@kl1/contracts 1.2.22-uat → 1.2.24-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/api-contracts/src/activity-log/index.d.ts +4 -4
- package/dist/api-contracts/src/activity-log/schema.d.ts +4 -4
- package/dist/api-contracts/src/attribute/index.d.ts +4 -4
- package/dist/api-contracts/src/attribute/validation.d.ts +4 -4
- package/dist/api-contracts/src/auth/index.d.ts +4 -4
- package/dist/api-contracts/src/automation-queue/index.d.ts +80 -80
- package/dist/api-contracts/src/automation-queue/schema.d.ts +10 -10
- package/dist/api-contracts/src/botpress/index.d.ts +28 -28
- package/dist/api-contracts/src/botpress/schema.d.ts +6 -6
- package/dist/api-contracts/src/botpress/validation.d.ts +8 -8
- package/dist/api-contracts/src/business-calendar/index.d.ts +32 -32
- package/dist/api-contracts/src/business-calendar/schema.d.ts +8 -8
- package/dist/api-contracts/src/business-calendar/validation.d.ts +2 -2
- package/dist/api-contracts/src/category/index.d.ts +12 -12
- package/dist/api-contracts/src/category/schema.d.ts +2 -2
- package/dist/api-contracts/src/channel/index.d.ts +467 -467
- package/dist/api-contracts/src/channel/schema.d.ts +16 -16
- package/dist/api-contracts/src/channel/validation.d.ts +20 -20
- package/dist/api-contracts/src/chat/index.d.ts +3870 -3870
- package/dist/api-contracts/src/chat/schema.d.ts +844 -844
- package/dist/api-contracts/src/chat/validation.d.ts +717 -707
- package/dist/api-contracts/src/chat/validation.d.ts.map +1 -1
- package/dist/api-contracts/src/comment/index.d.ts +244 -244
- package/dist/api-contracts/src/comment/schema.d.ts +68 -68
- package/dist/api-contracts/src/company/index.d.ts +4 -4
- package/dist/api-contracts/src/company/validation.d.ts +4 -4
- package/dist/api-contracts/src/contact/index.d.ts +246 -246
- package/dist/api-contracts/src/contact/schema.d.ts +26 -26
- package/dist/api-contracts/src/contact/validation.d.ts +134 -134
- package/dist/api-contracts/src/contract.d.ts +9142 -10992
- package/dist/api-contracts/src/contract.d.ts.map +1 -1
- package/dist/api-contracts/src/cx-log/index.d.ts +248 -248
- package/dist/api-contracts/src/cx-log/schema.d.ts +198 -198
- package/dist/api-contracts/src/cx-log/validation.d.ts +2 -2
- package/dist/api-contracts/src/dashboard/index.d.ts +40 -40
- package/dist/api-contracts/src/dashboard/schema.d.ts +34 -34
- package/dist/api-contracts/src/extension/index.d.ts +4 -4
- package/dist/api-contracts/src/facebook-feed/index.d.ts +687 -682
- package/dist/api-contracts/src/facebook-feed/index.d.ts.map +1 -1
- package/dist/api-contracts/src/facebook-feed/schema.d.ts +64 -64
- package/dist/api-contracts/src/facebook-feed/validation.d.ts +66 -66
- package/dist/api-contracts/src/hold-label/index.d.ts +16 -16
- package/dist/api-contracts/src/hold-label/schema.d.ts +2 -2
- package/dist/api-contracts/src/index.d.ts +2 -1
- package/dist/api-contracts/src/index.d.ts.map +1 -1
- package/dist/api-contracts/src/instagram/index.d.ts +575 -570
- package/dist/api-contracts/src/instagram/index.d.ts.map +1 -1
- package/dist/api-contracts/src/instagram/validation.d.ts +10 -10
- package/dist/api-contracts/src/line/index.d.ts +587 -582
- package/dist/api-contracts/src/line/index.d.ts.map +1 -1
- package/dist/api-contracts/src/line/schema.d.ts +4 -4
- package/dist/api-contracts/src/line/validation.d.ts +50 -50
- package/dist/api-contracts/src/mail/account-contract.d.ts +72 -72
- package/dist/api-contracts/src/mail/mail-contract.d.ts +2254 -2254
- package/dist/api-contracts/src/mail/mail-server-contract.d.ts +26 -26
- package/dist/api-contracts/src/mail/message-contract.d.ts +272 -272
- package/dist/api-contracts/src/mail/room-contract.d.ts +1444 -1444
- package/dist/api-contracts/src/mail/schemas/account-validation.schema.d.ts +50 -50
- package/dist/api-contracts/src/mail/schemas/account.schema.d.ts +10 -10
- package/dist/api-contracts/src/mail/schemas/message.schema.d.ts +56 -56
- package/dist/api-contracts/src/mail/schemas/room-validation.schema.d.ts +468 -468
- package/dist/api-contracts/src/mail/schemas/room.schema.d.ts +458 -458
- package/dist/api-contracts/src/messenger/index.d.ts +578 -573
- package/dist/api-contracts/src/messenger/index.d.ts.map +1 -1
- package/dist/api-contracts/src/messenger/schema.d.ts +16 -16
- package/dist/api-contracts/src/messenger/validation.d.ts +62 -62
- package/dist/api-contracts/src/notification/index.d.ts +26 -26
- package/dist/api-contracts/src/notification/schema.d.ts +18 -18
- package/dist/api-contracts/src/notification/validation.d.ts +10 -10
- package/dist/api-contracts/src/public-api/index.d.ts +84 -84
- package/dist/api-contracts/src/public-api/schema.d.ts +10 -10
- package/dist/api-contracts/src/public-api/validation.d.ts +20 -20
- package/dist/api-contracts/src/sms/index.d.ts +91 -86
- package/dist/api-contracts/src/sms/index.d.ts.map +1 -1
- package/dist/api-contracts/src/sms/schema.d.ts +8 -8
- package/dist/api-contracts/src/sms/validation.d.ts +2 -2
- package/dist/api-contracts/src/snippet/index.d.ts +42 -42
- package/dist/api-contracts/src/snippet/schema.d.ts +10 -10
- package/dist/api-contracts/src/subscription/index.d.ts +218 -184
- package/dist/api-contracts/src/subscription/index.d.ts.map +1 -1
- package/dist/api-contracts/src/subscription/schema.d.ts +216 -216
- package/dist/api-contracts/src/tag/index.d.ts +12 -12
- package/dist/api-contracts/src/tag/schema.d.ts +2 -2
- package/dist/api-contracts/src/telegram/index.d.ts +535 -530
- package/dist/api-contracts/src/telegram/index.d.ts.map +1 -1
- package/dist/api-contracts/src/telegram/validation.d.ts +4 -4
- package/dist/api-contracts/src/telephony-agent-presence-status/index.d.ts +14 -14
- package/dist/api-contracts/src/telephony-agent-presence-status/schema.d.ts +4 -4
- package/dist/api-contracts/src/telephony-cdr/index.d.ts +186 -186
- package/dist/api-contracts/src/telephony-cdr/schema.d.ts +58 -58
- package/dist/api-contracts/src/tenant/schema.d.ts +2 -2
- package/dist/api-contracts/src/ticket/index.d.ts +328 -328
- package/dist/api-contracts/src/ticket/schema.d.ts +42 -42
- package/dist/api-contracts/src/user/index.d.ts +23 -23
- package/dist/api-contracts/src/user/schema.d.ts +2 -2
- package/dist/api-contracts/src/user/validation.d.ts +5 -5
- package/dist/api-contracts/src/user-presence-status-log/index.d.ts +4 -4
- package/dist/api-contracts/src/user-presence-status-log/schema.d.ts +4 -4
- package/dist/api-contracts/src/viber/index.d.ts +547 -542
- package/dist/api-contracts/src/viber/index.d.ts.map +1 -1
- package/dist/api-contracts/src/viber/validation.d.ts +4 -4
- package/dist/api-contracts/src/webchat/index.d.ts +493 -488
- package/dist/api-contracts/src/webchat/index.d.ts.map +1 -1
- package/dist/api-contracts/src/webchat/schema.d.ts +10 -10
- package/dist/api-contracts/src/webchat/validation.d.ts +2 -2
- package/dist/api-contracts/src/whatsapp/index.d.ts +541 -536
- package/dist/api-contracts/src/whatsapp/index.d.ts.map +1 -1
- package/dist/api-contracts/src/widget/index.d.ts +24 -24
- package/dist/api-contracts/src/widget/schema.d.ts +2 -2
- package/dist/api-contracts/src/widget/validation.d.ts +4 -4
- package/dist/api-contracts/src/workflow-rule/index.d.ts +212 -212
- package/dist/api-contracts/src/workflow-rule/schema.d.ts +2 -2
- package/dist/api-contracts/src/wrap-up-form/index.d.ts +26 -26
- package/dist/api-contracts/src/wrap-up-form/schema.d.ts +4 -4
- package/dist/api-contracts/utils.d.ts +1 -1
- package/dist/api-contracts/utils.d.ts.map +1 -1
- package/dist/index.js +1000 -990
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1000 -990
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -3
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";
|
|
@@ -1799,7 +1799,8 @@ var SendMessageToPlatformSchema = z33.object({
|
|
|
1799
1799
|
z33.literal("post_purchase_update"),
|
|
1800
1800
|
z33.literal("account_update"),
|
|
1801
1801
|
z33.literal("confirmed_event_update")
|
|
1802
|
-
]).optional()
|
|
1802
|
+
]).optional(),
|
|
1803
|
+
telegramBusinessConnectionId: z33.string().nullable()
|
|
1803
1804
|
}),
|
|
1804
1805
|
message: z33.object({
|
|
1805
1806
|
id: z33.string().optional(),
|
|
@@ -7259,211 +7260,82 @@ var snippetContract = initContract34().router(
|
|
|
7259
7260
|
}
|
|
7260
7261
|
);
|
|
7261
7262
|
|
|
7262
|
-
// src/subscription/index.ts
|
|
7263
|
-
import { initContract as initContract35 } from "@ts-rest/core";
|
|
7264
|
-
import { z as z101 } from "zod";
|
|
7265
|
-
|
|
7266
|
-
// src/subscription/schema.ts
|
|
7267
|
-
import z99 from "zod";
|
|
7268
|
-
var ProductPriceSchema = DefaultEntitySchema.extend({
|
|
7269
|
-
priceId: z99.string(),
|
|
7270
|
-
name: z99.string().nullable(),
|
|
7271
|
-
perUnit: z99.number(),
|
|
7272
|
-
price: z99.number(),
|
|
7273
|
-
currency: z99.string().nullable()
|
|
7274
|
-
});
|
|
7275
|
-
var ProductWithoutRelatedSchema = DefaultEntitySchema.extend({
|
|
7276
|
-
provider: z99.string(),
|
|
7277
|
-
productId: z99.string(),
|
|
7278
|
-
name: z99.string(),
|
|
7279
|
-
type: z99.string(),
|
|
7280
|
-
omnichannel: z99.string(),
|
|
7281
|
-
usageType: z99.string().nullable(),
|
|
7282
|
-
productPrice: ProductPriceSchema
|
|
7283
|
-
});
|
|
7284
|
-
var RelatedProductSchema = DefaultEntitySchema.extend({
|
|
7285
|
-
includedQuantity: z99.number(),
|
|
7286
|
-
product: ProductWithoutRelatedSchema
|
|
7287
|
-
});
|
|
7288
|
-
var ProductSchema = DefaultEntitySchema.extend({
|
|
7289
|
-
provider: z99.string(),
|
|
7290
|
-
productId: z99.string(),
|
|
7291
|
-
name: z99.string(),
|
|
7292
|
-
type: z99.string(),
|
|
7293
|
-
omnichannel: z99.string(),
|
|
7294
|
-
usageType: z99.string().nullable(),
|
|
7295
|
-
productPrice: ProductPriceSchema,
|
|
7296
|
-
relatedProducts: z99.array(RelatedProductSchema)
|
|
7297
|
-
});
|
|
7298
|
-
var SubscriptionProuctSchema = DefaultEntitySchema.extend({
|
|
7299
|
-
limit: z99.number(),
|
|
7300
|
-
subscriptionItemId: z99.string(),
|
|
7301
|
-
usage: z99.number().nullable(),
|
|
7302
|
-
product: ProductSchema
|
|
7303
|
-
});
|
|
7304
|
-
var SubscriptionSchema = DefaultEntitySchema.extend({
|
|
7305
|
-
provider: z99.string(),
|
|
7306
|
-
type: z99.string(),
|
|
7307
|
-
subscriptionId: z99.string(),
|
|
7308
|
-
interval: z99.string(),
|
|
7309
|
-
quantity: z99.number(),
|
|
7310
|
-
amount: z99.number(),
|
|
7311
|
-
startAt: z99.date().nullable(),
|
|
7312
|
-
expireAt: z99.date(),
|
|
7313
|
-
status: z99.string(),
|
|
7314
|
-
name: z99.string().nullable(),
|
|
7315
|
-
subscriptionProducts: z99.array(SubscriptionProuctSchema),
|
|
7316
|
-
productPrice: ProductPriceSchema,
|
|
7317
|
-
product: ProductSchema
|
|
7318
|
-
});
|
|
7319
|
-
|
|
7320
|
-
// src/subscription/validation.ts
|
|
7321
|
-
import { z as z100 } from "zod";
|
|
7322
|
-
var UpdateSubscriptionSchema = z100.object({
|
|
7323
|
-
planProductId: z100.string(),
|
|
7324
|
-
subscriptionId: z100.string(),
|
|
7325
|
-
subscriptionProducts: z100.array(
|
|
7326
|
-
z100.object({
|
|
7327
|
-
productId: z100.string(),
|
|
7328
|
-
quantity: z100.number()
|
|
7329
|
-
})
|
|
7330
|
-
)
|
|
7331
|
-
});
|
|
7332
|
-
var TopUpBalanceSchema = z100.object({
|
|
7333
|
-
quantity: z100.number()
|
|
7334
|
-
});
|
|
7335
|
-
|
|
7336
|
-
// src/subscription/index.ts
|
|
7337
|
-
var subscriptionContract = initContract35().router(
|
|
7338
|
-
{
|
|
7339
|
-
getSubscription: {
|
|
7340
|
-
method: "GET",
|
|
7341
|
-
path: "/",
|
|
7342
|
-
query: null,
|
|
7343
|
-
responses: {
|
|
7344
|
-
200: DefaultSuccessResponseSchema.extend({
|
|
7345
|
-
subscription: SubscriptionSchema
|
|
7346
|
-
}),
|
|
7347
|
-
500: DefaultErrorResponseSchema
|
|
7348
|
-
}
|
|
7349
|
-
},
|
|
7350
|
-
updateSubscription: {
|
|
7351
|
-
method: "PATCH",
|
|
7352
|
-
path: "/",
|
|
7353
|
-
body: UpdateSubscriptionSchema,
|
|
7354
|
-
responses: {
|
|
7355
|
-
200: DefaultSuccessResponseSchema.extend({
|
|
7356
|
-
message: z101.string(),
|
|
7357
|
-
requireCheckout: z101.boolean(),
|
|
7358
|
-
checkoutUrl: z101.string().nullable()
|
|
7359
|
-
}),
|
|
7360
|
-
500: DefaultErrorResponseSchema
|
|
7361
|
-
}
|
|
7362
|
-
},
|
|
7363
|
-
topUpBalance: {
|
|
7364
|
-
method: "POST",
|
|
7365
|
-
path: "/top-up",
|
|
7366
|
-
body: TopUpBalanceSchema,
|
|
7367
|
-
responses: {
|
|
7368
|
-
200: DefaultSuccessResponseSchema.extend({
|
|
7369
|
-
checkoutUrl: z101.string()
|
|
7370
|
-
}),
|
|
7371
|
-
500: DefaultErrorResponseSchema
|
|
7372
|
-
}
|
|
7373
|
-
},
|
|
7374
|
-
getAvailablePlan: {
|
|
7375
|
-
method: "GET",
|
|
7376
|
-
path: "/available-plan",
|
|
7377
|
-
query: null,
|
|
7378
|
-
responses: {
|
|
7379
|
-
200: DefaultSuccessResponseSchema.extend({
|
|
7380
|
-
data: z101.array(ProductSchema)
|
|
7381
|
-
}),
|
|
7382
|
-
500: DefaultErrorResponseSchema
|
|
7383
|
-
}
|
|
7384
|
-
}
|
|
7385
|
-
},
|
|
7386
|
-
{
|
|
7387
|
-
pathPrefix: "subscriptions"
|
|
7388
|
-
}
|
|
7389
|
-
);
|
|
7390
|
-
|
|
7391
7263
|
// src/business-calendar/index.ts
|
|
7392
|
-
import { initContract as
|
|
7264
|
+
import { initContract as initContract35 } from "@ts-rest/core";
|
|
7393
7265
|
|
|
7394
7266
|
// src/business-calendar/validation.ts
|
|
7395
|
-
import
|
|
7396
|
-
var TimeSlotDataSchema =
|
|
7397
|
-
var CreateBusinessHourSchema =
|
|
7398
|
-
day:
|
|
7399
|
-
isEnabled:
|
|
7267
|
+
import z99 from "zod";
|
|
7268
|
+
var TimeSlotDataSchema = z99.any();
|
|
7269
|
+
var CreateBusinessHourSchema = z99.object({
|
|
7270
|
+
day: z99.string(),
|
|
7271
|
+
isEnabled: z99.boolean(),
|
|
7400
7272
|
timeSlots: TimeSlotDataSchema
|
|
7401
7273
|
}).array();
|
|
7402
|
-
var UpdateBusinessHourSchema =
|
|
7403
|
-
id:
|
|
7404
|
-
day:
|
|
7405
|
-
isEnabled:
|
|
7274
|
+
var UpdateBusinessHourSchema = z99.object({
|
|
7275
|
+
id: z99.string(),
|
|
7276
|
+
day: z99.string(),
|
|
7277
|
+
isEnabled: z99.boolean(),
|
|
7406
7278
|
timeSlots: TimeSlotDataSchema
|
|
7407
7279
|
}).array();
|
|
7408
|
-
var CreateHolidaySchema =
|
|
7409
|
-
name:
|
|
7410
|
-
date:
|
|
7411
|
-
isEnabled:
|
|
7280
|
+
var CreateHolidaySchema = z99.object({
|
|
7281
|
+
name: z99.string(),
|
|
7282
|
+
date: z99.string(),
|
|
7283
|
+
isEnabled: z99.boolean()
|
|
7412
7284
|
}).array();
|
|
7413
|
-
var UpdateHolidaySchema =
|
|
7414
|
-
id:
|
|
7415
|
-
name:
|
|
7416
|
-
date:
|
|
7417
|
-
isEnabled:
|
|
7285
|
+
var UpdateHolidaySchema = z99.object({
|
|
7286
|
+
id: z99.string().optional(),
|
|
7287
|
+
name: z99.string(),
|
|
7288
|
+
date: z99.string(),
|
|
7289
|
+
isEnabled: z99.boolean()
|
|
7418
7290
|
}).array();
|
|
7419
|
-
var CreateBusinessCalendarSchema =
|
|
7420
|
-
name:
|
|
7421
|
-
description:
|
|
7422
|
-
timeZone:
|
|
7423
|
-
isEnabled:
|
|
7291
|
+
var CreateBusinessCalendarSchema = z99.object({
|
|
7292
|
+
name: z99.string(),
|
|
7293
|
+
description: z99.string().optional(),
|
|
7294
|
+
timeZone: z99.string(),
|
|
7295
|
+
isEnabled: z99.boolean(),
|
|
7424
7296
|
businessHours: CreateBusinessHourSchema,
|
|
7425
7297
|
holidays: CreateHolidaySchema
|
|
7426
7298
|
});
|
|
7427
|
-
var UpdateBusinessCalendarSchema =
|
|
7428
|
-
id:
|
|
7429
|
-
name:
|
|
7430
|
-
description:
|
|
7431
|
-
timeZone:
|
|
7432
|
-
isEnabled:
|
|
7299
|
+
var UpdateBusinessCalendarSchema = z99.object({
|
|
7300
|
+
id: z99.string(),
|
|
7301
|
+
name: z99.string(),
|
|
7302
|
+
description: z99.string().optional(),
|
|
7303
|
+
timeZone: z99.string(),
|
|
7304
|
+
isEnabled: z99.boolean(),
|
|
7433
7305
|
businessHours: UpdateBusinessHourSchema,
|
|
7434
7306
|
holidays: UpdateHolidaySchema
|
|
7435
7307
|
});
|
|
7436
|
-
var DeleteBusinessCalendarSchema =
|
|
7437
|
-
id:
|
|
7308
|
+
var DeleteBusinessCalendarSchema = z99.object({
|
|
7309
|
+
id: z99.string()
|
|
7438
7310
|
});
|
|
7439
7311
|
|
|
7440
7312
|
// src/business-calendar/schema.ts
|
|
7441
|
-
import
|
|
7442
|
-
var TimeSlotDataSchema2 =
|
|
7313
|
+
import z100 from "zod";
|
|
7314
|
+
var TimeSlotDataSchema2 = z100.any();
|
|
7443
7315
|
var BusinessHourSchema = DefaultEntitySchema.extend({
|
|
7444
|
-
day:
|
|
7445
|
-
isEnabled:
|
|
7316
|
+
day: z100.string(),
|
|
7317
|
+
isEnabled: z100.boolean(),
|
|
7446
7318
|
timeSlots: TimeSlotDataSchema2
|
|
7447
7319
|
});
|
|
7448
7320
|
var HolidaySchema = DefaultEntitySchema.extend({
|
|
7449
|
-
name:
|
|
7450
|
-
date:
|
|
7451
|
-
isEnabled:
|
|
7452
|
-
isDefault:
|
|
7321
|
+
name: z100.string(),
|
|
7322
|
+
date: z100.string(),
|
|
7323
|
+
isEnabled: z100.boolean(),
|
|
7324
|
+
isDefault: z100.boolean()
|
|
7453
7325
|
});
|
|
7454
7326
|
var BusinessCalendarSchema = DefaultEntitySchema.extend({
|
|
7455
|
-
name:
|
|
7456
|
-
description:
|
|
7457
|
-
timeZone:
|
|
7458
|
-
isEnabled:
|
|
7459
|
-
isDefault:
|
|
7327
|
+
name: z100.string(),
|
|
7328
|
+
description: z100.string().optional(),
|
|
7329
|
+
timeZone: z100.string(),
|
|
7330
|
+
isEnabled: z100.boolean(),
|
|
7331
|
+
isDefault: z100.boolean(),
|
|
7460
7332
|
businessHours: BusinessHourSchema.array(),
|
|
7461
7333
|
holidays: HolidaySchema.array()
|
|
7462
7334
|
});
|
|
7463
7335
|
|
|
7464
7336
|
// src/business-calendar/index.ts
|
|
7465
|
-
import
|
|
7466
|
-
var businessCalendarContract =
|
|
7337
|
+
import z101 from "zod";
|
|
7338
|
+
var businessCalendarContract = initContract35().router({
|
|
7467
7339
|
createBusinessCalendar: {
|
|
7468
7340
|
method: "POST",
|
|
7469
7341
|
path: "business-calendar",
|
|
@@ -7488,7 +7360,7 @@ var businessCalendarContract = initContract36().router({
|
|
|
7488
7360
|
updateBusinessCalendar: {
|
|
7489
7361
|
method: "POST",
|
|
7490
7362
|
path: "business-calendars/:id",
|
|
7491
|
-
pathParams:
|
|
7363
|
+
pathParams: z101.object({ id: z101.string() }),
|
|
7492
7364
|
body: UpdateBusinessCalendarSchema,
|
|
7493
7365
|
responses: {
|
|
7494
7366
|
201: DefaultSuccessResponseSchema.extend({
|
|
@@ -7500,7 +7372,7 @@ var businessCalendarContract = initContract36().router({
|
|
|
7500
7372
|
deleteBusinessCalendar: {
|
|
7501
7373
|
method: "DELETE",
|
|
7502
7374
|
path: "business-calendars/:id",
|
|
7503
|
-
pathParams:
|
|
7375
|
+
pathParams: z101.object({ id: z101.string() }),
|
|
7504
7376
|
body: null,
|
|
7505
7377
|
responses: {
|
|
7506
7378
|
200: DefaultSuccessResponseSchema,
|
|
@@ -7510,77 +7382,77 @@ var businessCalendarContract = initContract36().router({
|
|
|
7510
7382
|
});
|
|
7511
7383
|
|
|
7512
7384
|
// src/facebook-feed/index.ts
|
|
7513
|
-
import { initContract as
|
|
7385
|
+
import { initContract as initContract36 } from "@ts-rest/core";
|
|
7514
7386
|
|
|
7515
7387
|
// src/facebook-feed/validation.ts
|
|
7516
|
-
import
|
|
7517
|
-
var GetFacebookPagesSchema2 =
|
|
7518
|
-
data:
|
|
7519
|
-
|
|
7388
|
+
import z102 from "zod";
|
|
7389
|
+
var GetFacebookPagesSchema2 = z102.object({
|
|
7390
|
+
data: z102.array(
|
|
7391
|
+
z102.object({
|
|
7520
7392
|
// biome-ignore lint/style/useNamingConvention: <explanation>
|
|
7521
|
-
access_token:
|
|
7522
|
-
category:
|
|
7393
|
+
access_token: z102.string(),
|
|
7394
|
+
category: z102.string(),
|
|
7523
7395
|
// biome-ignore lint/style/useNamingConvention: <explanation>
|
|
7524
|
-
category_list:
|
|
7525
|
-
|
|
7526
|
-
id:
|
|
7527
|
-
name:
|
|
7396
|
+
category_list: z102.array(
|
|
7397
|
+
z102.object({
|
|
7398
|
+
id: z102.string(),
|
|
7399
|
+
name: z102.string()
|
|
7528
7400
|
})
|
|
7529
7401
|
),
|
|
7530
|
-
id:
|
|
7531
|
-
name:
|
|
7532
|
-
tasks:
|
|
7402
|
+
id: z102.string(),
|
|
7403
|
+
name: z102.string(),
|
|
7404
|
+
tasks: z102.string().array()
|
|
7533
7405
|
})
|
|
7534
7406
|
),
|
|
7535
|
-
paging:
|
|
7536
|
-
cursors:
|
|
7537
|
-
before:
|
|
7538
|
-
after:
|
|
7407
|
+
paging: z102.object({
|
|
7408
|
+
cursors: z102.object({
|
|
7409
|
+
before: z102.string().optional(),
|
|
7410
|
+
after: z102.string().optional()
|
|
7539
7411
|
})
|
|
7540
7412
|
}).optional()
|
|
7541
7413
|
});
|
|
7542
|
-
var GetFacebookPagesQuerySchema2 =
|
|
7543
|
-
accessToken:
|
|
7544
|
-
userId:
|
|
7414
|
+
var GetFacebookPagesQuerySchema2 = z102.object({
|
|
7415
|
+
accessToken: z102.string(),
|
|
7416
|
+
userId: z102.string()
|
|
7545
7417
|
});
|
|
7546
7418
|
var ReconnectFacebookFeedSchema = ChannelSchema.merge(
|
|
7547
|
-
|
|
7548
|
-
isReloginRequired:
|
|
7549
|
-
platformContacts:
|
|
7550
|
-
id:
|
|
7551
|
-
name:
|
|
7552
|
-
createdAt:
|
|
7553
|
-
updatedAt:
|
|
7554
|
-
deletedAt:
|
|
7419
|
+
z102.object({
|
|
7420
|
+
isReloginRequired: z102.boolean(),
|
|
7421
|
+
platformContacts: z102.array(PlatformContactSchema),
|
|
7422
|
+
id: z102.string().uuid(),
|
|
7423
|
+
name: z102.string(),
|
|
7424
|
+
createdAt: z102.date(),
|
|
7425
|
+
updatedAt: z102.date(),
|
|
7426
|
+
deletedAt: z102.date().nullable()
|
|
7555
7427
|
})
|
|
7556
7428
|
);
|
|
7557
|
-
var GetFeedPostResponseSchema =
|
|
7558
|
-
id:
|
|
7559
|
-
message:
|
|
7560
|
-
created_time:
|
|
7561
|
-
can_reply_privately:
|
|
7562
|
-
from:
|
|
7563
|
-
permalink_url:
|
|
7564
|
-
attachments:
|
|
7565
|
-
data:
|
|
7566
|
-
|
|
7567
|
-
media:
|
|
7568
|
-
image:
|
|
7569
|
-
height:
|
|
7570
|
-
src:
|
|
7571
|
-
width:
|
|
7429
|
+
var GetFeedPostResponseSchema = z102.object({
|
|
7430
|
+
id: z102.string(),
|
|
7431
|
+
message: z102.string(),
|
|
7432
|
+
created_time: z102.string(),
|
|
7433
|
+
can_reply_privately: z102.boolean(),
|
|
7434
|
+
from: z102.object({ name: z102.string(), id: z102.string() }),
|
|
7435
|
+
permalink_url: z102.string(),
|
|
7436
|
+
attachments: z102.object({
|
|
7437
|
+
data: z102.array(
|
|
7438
|
+
z102.object({
|
|
7439
|
+
media: z102.object({
|
|
7440
|
+
image: z102.object({
|
|
7441
|
+
height: z102.number(),
|
|
7442
|
+
src: z102.string(),
|
|
7443
|
+
width: z102.number()
|
|
7572
7444
|
})
|
|
7573
7445
|
}),
|
|
7574
|
-
media_type:
|
|
7575
|
-
url:
|
|
7446
|
+
media_type: z102.string(),
|
|
7447
|
+
url: z102.string()
|
|
7576
7448
|
})
|
|
7577
7449
|
)
|
|
7578
7450
|
})
|
|
7579
7451
|
});
|
|
7580
7452
|
|
|
7581
7453
|
// src/facebook-feed/index.ts
|
|
7582
|
-
import
|
|
7583
|
-
var facebookFeedContract =
|
|
7454
|
+
import z103 from "zod";
|
|
7455
|
+
var facebookFeedContract = initContract36().router({
|
|
7584
7456
|
connectToService: {
|
|
7585
7457
|
method: "POST",
|
|
7586
7458
|
path: "/connect",
|
|
@@ -7604,8 +7476,8 @@ var facebookFeedContract = initContract37().router({
|
|
|
7604
7476
|
reconnect: {
|
|
7605
7477
|
method: "POST",
|
|
7606
7478
|
path: "/reconnect/:channelId",
|
|
7607
|
-
pathParams:
|
|
7608
|
-
channelId:
|
|
7479
|
+
pathParams: z103.object({
|
|
7480
|
+
channelId: z103.string().uuid()
|
|
7609
7481
|
}),
|
|
7610
7482
|
body: null,
|
|
7611
7483
|
responses: {
|
|
@@ -7617,8 +7489,8 @@ var facebookFeedContract = initContract37().router({
|
|
|
7617
7489
|
delete: {
|
|
7618
7490
|
method: "DELETE",
|
|
7619
7491
|
path: "/delete/:channelId",
|
|
7620
|
-
pathParams:
|
|
7621
|
-
channelId:
|
|
7492
|
+
pathParams: z103.object({
|
|
7493
|
+
channelId: z103.string().uuid()
|
|
7622
7494
|
}),
|
|
7623
7495
|
body: null,
|
|
7624
7496
|
responses: {
|
|
@@ -7669,169 +7541,169 @@ var facebookFeedContract = initContract37().router({
|
|
|
7669
7541
|
});
|
|
7670
7542
|
|
|
7671
7543
|
// src/public-api/index.ts
|
|
7672
|
-
import { initContract as
|
|
7673
|
-
import
|
|
7544
|
+
import { initContract as initContract37 } from "@ts-rest/core";
|
|
7545
|
+
import z106 from "zod";
|
|
7674
7546
|
|
|
7675
7547
|
// src/public-api/validation.ts
|
|
7676
|
-
import
|
|
7548
|
+
import z105 from "zod";
|
|
7677
7549
|
|
|
7678
7550
|
// src/public-api/schema.ts
|
|
7679
|
-
import
|
|
7680
|
-
var ContactPhonesSchema2 =
|
|
7681
|
-
id:
|
|
7682
|
-
createdAt:
|
|
7683
|
-
updatedAt:
|
|
7684
|
-
deletedAt:
|
|
7685
|
-
phone:
|
|
7686
|
-
isPrimary:
|
|
7687
|
-
});
|
|
7688
|
-
var ContactEmailsSchema2 =
|
|
7689
|
-
id:
|
|
7690
|
-
createdAt:
|
|
7691
|
-
updatedAt:
|
|
7692
|
-
deletedAt:
|
|
7693
|
-
email:
|
|
7694
|
-
isPrimary:
|
|
7695
|
-
});
|
|
7696
|
-
var ContactCustomFieldSchema2 =
|
|
7697
|
-
id:
|
|
7698
|
-
createdAt:
|
|
7699
|
-
updatedAt:
|
|
7700
|
-
deletedAt:
|
|
7701
|
-
textValue:
|
|
7702
|
-
booleanValue:
|
|
7703
|
-
numberValue:
|
|
7704
|
-
dateValue:
|
|
7551
|
+
import z104 from "zod";
|
|
7552
|
+
var ContactPhonesSchema2 = z104.object({
|
|
7553
|
+
id: z104.string().uuid(),
|
|
7554
|
+
createdAt: z104.date(),
|
|
7555
|
+
updatedAt: z104.date(),
|
|
7556
|
+
deletedAt: z104.date().nullable(),
|
|
7557
|
+
phone: z104.string(),
|
|
7558
|
+
isPrimary: z104.boolean()
|
|
7559
|
+
});
|
|
7560
|
+
var ContactEmailsSchema2 = z104.object({
|
|
7561
|
+
id: z104.string().uuid(),
|
|
7562
|
+
createdAt: z104.date(),
|
|
7563
|
+
updatedAt: z104.date(),
|
|
7564
|
+
deletedAt: z104.date().nullable(),
|
|
7565
|
+
email: z104.string(),
|
|
7566
|
+
isPrimary: z104.boolean()
|
|
7567
|
+
});
|
|
7568
|
+
var ContactCustomFieldSchema2 = z104.object({
|
|
7569
|
+
id: z104.string().uuid(),
|
|
7570
|
+
createdAt: z104.date(),
|
|
7571
|
+
updatedAt: z104.date(),
|
|
7572
|
+
deletedAt: z104.date().nullable(),
|
|
7573
|
+
textValue: z104.string().nullable(),
|
|
7574
|
+
booleanValue: z104.boolean().nullable(),
|
|
7575
|
+
numberValue: z104.number().nullable(),
|
|
7576
|
+
dateValue: z104.date().nullable(),
|
|
7705
7577
|
attribute: AttributeSchema.omit({ options: true, group: true }),
|
|
7706
|
-
uploads:
|
|
7707
|
-
});
|
|
7708
|
-
var ContactEntityTypesSchema2 =
|
|
7709
|
-
id:
|
|
7710
|
-
createdAt:
|
|
7711
|
-
updatedAt:
|
|
7712
|
-
deletedAt:
|
|
7713
|
-
entity:
|
|
7714
|
-
description:
|
|
7715
|
-
});
|
|
7716
|
-
var ContactActivitySchema2 =
|
|
7717
|
-
id:
|
|
7718
|
-
createdAt:
|
|
7719
|
-
updatedAt:
|
|
7720
|
-
deletedAt:
|
|
7721
|
-
entityId:
|
|
7722
|
-
description:
|
|
7578
|
+
uploads: z104.array(UploadSchema)
|
|
7579
|
+
});
|
|
7580
|
+
var ContactEntityTypesSchema2 = z104.object({
|
|
7581
|
+
id: z104.string().uuid(),
|
|
7582
|
+
createdAt: z104.date(),
|
|
7583
|
+
updatedAt: z104.date(),
|
|
7584
|
+
deletedAt: z104.date().nullable(),
|
|
7585
|
+
entity: z104.string(),
|
|
7586
|
+
description: z104.string().nullable()
|
|
7587
|
+
});
|
|
7588
|
+
var ContactActivitySchema2 = z104.object({
|
|
7589
|
+
id: z104.string().uuid(),
|
|
7590
|
+
createdAt: z104.date(),
|
|
7591
|
+
updatedAt: z104.date(),
|
|
7592
|
+
deletedAt: z104.date().nullable(),
|
|
7593
|
+
entityId: z104.string(),
|
|
7594
|
+
description: z104.string(),
|
|
7723
7595
|
entityType: ContactEntityTypesSchema2
|
|
7724
7596
|
});
|
|
7725
|
-
var ContactSchema2 =
|
|
7726
|
-
id:
|
|
7727
|
-
createdAt:
|
|
7728
|
-
updatedAt:
|
|
7729
|
-
deletedAt:
|
|
7730
|
-
name:
|
|
7731
|
-
address:
|
|
7732
|
-
channel:
|
|
7733
|
-
notes:
|
|
7734
|
-
contactProfile:
|
|
7735
|
-
socialProfileUrl:
|
|
7736
|
-
tags:
|
|
7597
|
+
var ContactSchema2 = z104.object({
|
|
7598
|
+
id: z104.string().uuid(),
|
|
7599
|
+
createdAt: z104.date(),
|
|
7600
|
+
updatedAt: z104.date(),
|
|
7601
|
+
deletedAt: z104.date().nullable(),
|
|
7602
|
+
name: z104.string(),
|
|
7603
|
+
address: z104.string().nullable(),
|
|
7604
|
+
channel: z104.string().nullable(),
|
|
7605
|
+
notes: z104.string().nullable(),
|
|
7606
|
+
contactProfile: z104.string().nullable(),
|
|
7607
|
+
socialProfileUrl: z104.string().nullable(),
|
|
7608
|
+
tags: z104.array(TagSchema),
|
|
7737
7609
|
company: CompanySchema.omit({ customFields: true }).nullable(),
|
|
7738
|
-
customFields:
|
|
7739
|
-
contactEmails:
|
|
7740
|
-
contactPhones:
|
|
7741
|
-
activityLogs:
|
|
7610
|
+
customFields: z104.array(ContactCustomFieldSchema2),
|
|
7611
|
+
contactEmails: z104.array(ContactEmailsSchema2),
|
|
7612
|
+
contactPhones: z104.array(ContactPhonesSchema2),
|
|
7613
|
+
activityLogs: z104.array(ContactActivitySchema2).optional()
|
|
7742
7614
|
});
|
|
7743
7615
|
|
|
7744
7616
|
// src/public-api/validation.ts
|
|
7745
7617
|
var ContactContractValidationSchema2 = {
|
|
7746
7618
|
create: {
|
|
7747
|
-
request:
|
|
7748
|
-
name:
|
|
7749
|
-
email:
|
|
7750
|
-
|
|
7751
|
-
email:
|
|
7752
|
-
isPrimary:
|
|
7619
|
+
request: z105.object({
|
|
7620
|
+
name: z105.string(),
|
|
7621
|
+
email: z105.array(
|
|
7622
|
+
z105.object({
|
|
7623
|
+
email: z105.string().email(),
|
|
7624
|
+
isPrimary: z105.boolean()
|
|
7753
7625
|
})
|
|
7754
7626
|
).optional(),
|
|
7755
|
-
channel:
|
|
7756
|
-
address:
|
|
7757
|
-
phone:
|
|
7758
|
-
|
|
7759
|
-
phone:
|
|
7760
|
-
isPrimary:
|
|
7627
|
+
channel: z105.string().optional(),
|
|
7628
|
+
address: z105.string().optional(),
|
|
7629
|
+
phone: z105.array(
|
|
7630
|
+
z105.object({
|
|
7631
|
+
phone: z105.string(),
|
|
7632
|
+
isPrimary: z105.boolean()
|
|
7761
7633
|
})
|
|
7762
7634
|
).optional(),
|
|
7763
|
-
notes:
|
|
7764
|
-
tags:
|
|
7765
|
-
company:
|
|
7766
|
-
customFields:
|
|
7635
|
+
notes: z105.string().optional(),
|
|
7636
|
+
tags: z105.array(z105.string()).optional(),
|
|
7637
|
+
company: z105.string().optional(),
|
|
7638
|
+
customFields: z105.record(z105.string())
|
|
7767
7639
|
// Dynamic keys with string values
|
|
7768
7640
|
}),
|
|
7769
7641
|
response: ContactSchema2
|
|
7770
7642
|
},
|
|
7771
7643
|
getById: {
|
|
7772
|
-
request:
|
|
7773
|
-
id:
|
|
7644
|
+
request: z105.object({
|
|
7645
|
+
id: z105.string().uuid()
|
|
7774
7646
|
})
|
|
7775
7647
|
},
|
|
7776
7648
|
delete: {
|
|
7777
|
-
request:
|
|
7778
|
-
id:
|
|
7649
|
+
request: z105.object({
|
|
7650
|
+
id: z105.string().uuid()
|
|
7779
7651
|
})
|
|
7780
7652
|
},
|
|
7781
7653
|
getAll: {
|
|
7782
|
-
request:
|
|
7783
|
-
page:
|
|
7784
|
-
pageSize:
|
|
7785
|
-
keyword:
|
|
7786
|
-
company:
|
|
7787
|
-
name:
|
|
7788
|
-
address:
|
|
7789
|
-
channel:
|
|
7790
|
-
selectedDate:
|
|
7791
|
-
customFields:
|
|
7792
|
-
|
|
7793
|
-
attributeId:
|
|
7794
|
-
type:
|
|
7795
|
-
value:
|
|
7654
|
+
request: z105.object({
|
|
7655
|
+
page: z105.coerce.number().default(1),
|
|
7656
|
+
pageSize: z105.coerce.number().default(10),
|
|
7657
|
+
keyword: z105.string().optional(),
|
|
7658
|
+
company: z105.array(z105.string().uuid()),
|
|
7659
|
+
name: z105.string(),
|
|
7660
|
+
address: z105.string(),
|
|
7661
|
+
channel: z105.array(z105.string()),
|
|
7662
|
+
selectedDate: z105.string(),
|
|
7663
|
+
customFields: z105.array(
|
|
7664
|
+
z105.object({
|
|
7665
|
+
attributeId: z105.string().uuid(),
|
|
7666
|
+
type: z105.string(),
|
|
7667
|
+
value: z105.union([z105.string(), z105.array(z105.string())])
|
|
7796
7668
|
})
|
|
7797
7669
|
),
|
|
7798
|
-
tags:
|
|
7799
|
-
phone:
|
|
7800
|
-
email:
|
|
7801
|
-
notes:
|
|
7670
|
+
tags: z105.array(z105.string().uuid()),
|
|
7671
|
+
phone: z105.string(),
|
|
7672
|
+
email: z105.string(),
|
|
7673
|
+
notes: z105.string()
|
|
7802
7674
|
}).partial(),
|
|
7803
7675
|
response: {
|
|
7804
|
-
page:
|
|
7805
|
-
pageSize:
|
|
7806
|
-
total:
|
|
7807
|
-
lastPage:
|
|
7808
|
-
data:
|
|
7676
|
+
page: z105.number(),
|
|
7677
|
+
pageSize: z105.number(),
|
|
7678
|
+
total: z105.number(),
|
|
7679
|
+
lastPage: z105.number(),
|
|
7680
|
+
data: z105.array(ContactSchema2)
|
|
7809
7681
|
}
|
|
7810
7682
|
},
|
|
7811
7683
|
getContactFields: {
|
|
7812
|
-
request:
|
|
7813
|
-
page:
|
|
7814
|
-
pageSize:
|
|
7684
|
+
request: z105.object({
|
|
7685
|
+
page: z105.coerce.number().default(1),
|
|
7686
|
+
pageSize: z105.coerce.number().default(10)
|
|
7815
7687
|
}).partial(),
|
|
7816
7688
|
response: {
|
|
7817
|
-
page:
|
|
7818
|
-
pageSize:
|
|
7819
|
-
total:
|
|
7820
|
-
lastPage:
|
|
7821
|
-
data:
|
|
7689
|
+
page: z105.number(),
|
|
7690
|
+
pageSize: z105.number(),
|
|
7691
|
+
total: z105.number(),
|
|
7692
|
+
lastPage: z105.number(),
|
|
7693
|
+
data: z105.array(ContactCustomFieldSchema2)
|
|
7822
7694
|
}
|
|
7823
7695
|
},
|
|
7824
7696
|
addAttachments: {
|
|
7825
|
-
request:
|
|
7826
|
-
contactId:
|
|
7827
|
-
attributeId:
|
|
7828
|
-
contactAttachmentRecords:
|
|
7829
|
-
|
|
7830
|
-
bucketName:
|
|
7831
|
-
fileKey:
|
|
7832
|
-
fileName:
|
|
7833
|
-
fileSize:
|
|
7834
|
-
url:
|
|
7697
|
+
request: z105.object({
|
|
7698
|
+
contactId: z105.string(),
|
|
7699
|
+
attributeId: z105.string().uuid(),
|
|
7700
|
+
contactAttachmentRecords: z105.array(
|
|
7701
|
+
z105.object({
|
|
7702
|
+
bucketName: z105.string(),
|
|
7703
|
+
fileKey: z105.string(),
|
|
7704
|
+
fileName: z105.string(),
|
|
7705
|
+
fileSize: z105.coerce.number(),
|
|
7706
|
+
url: z105.string()
|
|
7835
7707
|
})
|
|
7836
7708
|
)
|
|
7837
7709
|
}),
|
|
@@ -7840,7 +7712,7 @@ var ContactContractValidationSchema2 = {
|
|
|
7840
7712
|
};
|
|
7841
7713
|
|
|
7842
7714
|
// src/public-api/index.ts
|
|
7843
|
-
var publicApiContract =
|
|
7715
|
+
var publicApiContract = initContract37().router(
|
|
7844
7716
|
{
|
|
7845
7717
|
createContact: {
|
|
7846
7718
|
method: "POST",
|
|
@@ -7850,11 +7722,11 @@ var publicApiContract = initContract38().router(
|
|
|
7850
7722
|
201: DefaultSuccessResponseSchema.extend({
|
|
7851
7723
|
data: ContactSchema2
|
|
7852
7724
|
}),
|
|
7853
|
-
400:
|
|
7854
|
-
message:
|
|
7725
|
+
400: z106.object({
|
|
7726
|
+
message: z106.string()
|
|
7855
7727
|
}),
|
|
7856
|
-
409:
|
|
7857
|
-
message:
|
|
7728
|
+
409: z106.object({
|
|
7729
|
+
message: z106.string()
|
|
7858
7730
|
}),
|
|
7859
7731
|
401: DefaultUnauthorizedSchema,
|
|
7860
7732
|
404: DefaultNotFoundSchema,
|
|
@@ -7869,13 +7741,13 @@ var publicApiContract = initContract38().router(
|
|
|
7869
7741
|
query: GetTagsSchema,
|
|
7870
7742
|
responses: {
|
|
7871
7743
|
200: DefaultSuccessResponseSchema.extend({
|
|
7872
|
-
tags:
|
|
7744
|
+
tags: z106.array(TagSchema)
|
|
7873
7745
|
}),
|
|
7874
|
-
400:
|
|
7875
|
-
message:
|
|
7746
|
+
400: z106.object({
|
|
7747
|
+
message: z106.string()
|
|
7876
7748
|
}),
|
|
7877
|
-
409:
|
|
7878
|
-
message:
|
|
7749
|
+
409: z106.object({
|
|
7750
|
+
message: z106.string()
|
|
7879
7751
|
}),
|
|
7880
7752
|
401: DefaultUnauthorizedSchema,
|
|
7881
7753
|
404: DefaultNotFoundSchema,
|
|
@@ -7891,11 +7763,11 @@ var publicApiContract = initContract38().router(
|
|
|
7891
7763
|
200: DefaultSuccessResponseSchema.extend(
|
|
7892
7764
|
ContactContractValidationSchema2.getAll.response
|
|
7893
7765
|
),
|
|
7894
|
-
400:
|
|
7895
|
-
message:
|
|
7766
|
+
400: z106.object({
|
|
7767
|
+
message: z106.string()
|
|
7896
7768
|
}),
|
|
7897
|
-
409:
|
|
7898
|
-
message:
|
|
7769
|
+
409: z106.object({
|
|
7770
|
+
message: z106.string()
|
|
7899
7771
|
}),
|
|
7900
7772
|
401: DefaultUnauthorizedSchema,
|
|
7901
7773
|
404: DefaultNotFoundSchema,
|
|
@@ -7912,11 +7784,11 @@ var publicApiContract = initContract38().router(
|
|
|
7912
7784
|
200: DefaultSuccessResponseSchema.extend(
|
|
7913
7785
|
ContactContractValidationSchema2.getContactFields.response
|
|
7914
7786
|
),
|
|
7915
|
-
400:
|
|
7916
|
-
message:
|
|
7787
|
+
400: z106.object({
|
|
7788
|
+
message: z106.string()
|
|
7917
7789
|
}),
|
|
7918
|
-
409:
|
|
7919
|
-
message:
|
|
7790
|
+
409: z106.object({
|
|
7791
|
+
message: z106.string()
|
|
7920
7792
|
}),
|
|
7921
7793
|
401: DefaultUnauthorizedSchema,
|
|
7922
7794
|
404: DefaultNotFoundSchema,
|
|
@@ -7930,17 +7802,17 @@ var publicApiContract = initContract38().router(
|
|
|
7930
7802
|
path: "/contacts/:id",
|
|
7931
7803
|
pathParams: ContactContractValidationSchema2.getById.request,
|
|
7932
7804
|
responses: {
|
|
7933
|
-
200:
|
|
7934
|
-
status:
|
|
7935
|
-
message:
|
|
7805
|
+
200: z106.object({
|
|
7806
|
+
status: z106.string(),
|
|
7807
|
+
message: z106.string(),
|
|
7936
7808
|
data: ContactSchema2,
|
|
7937
|
-
requestId:
|
|
7809
|
+
requestId: z106.string()
|
|
7938
7810
|
}),
|
|
7939
|
-
400:
|
|
7940
|
-
message:
|
|
7811
|
+
400: z106.object({
|
|
7812
|
+
message: z106.string()
|
|
7941
7813
|
}),
|
|
7942
|
-
409:
|
|
7943
|
-
message:
|
|
7814
|
+
409: z106.object({
|
|
7815
|
+
message: z106.string()
|
|
7944
7816
|
}),
|
|
7945
7817
|
401: DefaultUnauthorizedSchema,
|
|
7946
7818
|
404: DefaultNotFoundSchema,
|
|
@@ -7958,11 +7830,11 @@ var publicApiContract = initContract38().router(
|
|
|
7958
7830
|
201: DefaultSuccessResponseSchema.extend({
|
|
7959
7831
|
message: ContactCustomFieldSchema2
|
|
7960
7832
|
}),
|
|
7961
|
-
400:
|
|
7962
|
-
message:
|
|
7833
|
+
400: z106.object({
|
|
7834
|
+
message: z106.string()
|
|
7963
7835
|
}),
|
|
7964
|
-
409:
|
|
7965
|
-
message:
|
|
7836
|
+
409: z106.object({
|
|
7837
|
+
message: z106.string()
|
|
7966
7838
|
}),
|
|
7967
7839
|
401: DefaultUnauthorizedSchema,
|
|
7968
7840
|
404: DefaultNotFoundSchema,
|
|
@@ -7976,17 +7848,17 @@ var publicApiContract = initContract38().router(
|
|
|
7976
7848
|
path: "/contacts/:id",
|
|
7977
7849
|
pathParams: ContactContractValidationSchema2.getById.request,
|
|
7978
7850
|
responses: {
|
|
7979
|
-
200:
|
|
7980
|
-
status:
|
|
7981
|
-
message:
|
|
7851
|
+
200: z106.object({
|
|
7852
|
+
status: z106.string(),
|
|
7853
|
+
message: z106.string(),
|
|
7982
7854
|
data: ContactSchema2,
|
|
7983
|
-
requestId:
|
|
7855
|
+
requestId: z106.string()
|
|
7984
7856
|
}),
|
|
7985
|
-
400:
|
|
7986
|
-
message:
|
|
7857
|
+
400: z106.object({
|
|
7858
|
+
message: z106.string()
|
|
7987
7859
|
}),
|
|
7988
|
-
409:
|
|
7989
|
-
message:
|
|
7860
|
+
409: z106.object({
|
|
7861
|
+
message: z106.string()
|
|
7990
7862
|
}),
|
|
7991
7863
|
401: DefaultUnauthorizedSchema,
|
|
7992
7864
|
404: DefaultNotFoundSchema,
|
|
@@ -8000,17 +7872,17 @@ var publicApiContract = initContract38().router(
|
|
|
8000
7872
|
path: "/contacts/:id",
|
|
8001
7873
|
pathParams: ContactContractValidationSchema2.delete.request,
|
|
8002
7874
|
responses: {
|
|
8003
|
-
200:
|
|
8004
|
-
status:
|
|
8005
|
-
message:
|
|
7875
|
+
200: z106.object({
|
|
7876
|
+
status: z106.string(),
|
|
7877
|
+
message: z106.string(),
|
|
8006
7878
|
data: ContactSchema2,
|
|
8007
|
-
requestId:
|
|
7879
|
+
requestId: z106.string()
|
|
8008
7880
|
}),
|
|
8009
|
-
400:
|
|
8010
|
-
message:
|
|
7881
|
+
400: z106.object({
|
|
7882
|
+
message: z106.string()
|
|
8011
7883
|
}),
|
|
8012
|
-
409:
|
|
8013
|
-
message:
|
|
7884
|
+
409: z106.object({
|
|
7885
|
+
message: z106.string()
|
|
8014
7886
|
}),
|
|
8015
7887
|
401: DefaultUnauthorizedSchema,
|
|
8016
7888
|
404: DefaultNotFoundSchema,
|
|
@@ -8027,18 +7899,18 @@ var publicApiContract = initContract38().router(
|
|
|
8027
7899
|
);
|
|
8028
7900
|
|
|
8029
7901
|
// src/workflow-rule/index.ts
|
|
8030
|
-
import { initContract as
|
|
8031
|
-
import
|
|
8032
|
-
var chatContract =
|
|
7902
|
+
import { initContract as initContract38 } from "@ts-rest/core";
|
|
7903
|
+
import z107 from "zod";
|
|
7904
|
+
var chatContract = initContract38().router(
|
|
8033
7905
|
{
|
|
8034
7906
|
updateAssignee: {
|
|
8035
7907
|
method: "POST",
|
|
8036
7908
|
path: "/room/assignee",
|
|
8037
|
-
body:
|
|
8038
|
-
assigneeId:
|
|
8039
|
-
roomId:
|
|
8040
|
-
workflowId:
|
|
8041
|
-
queueId:
|
|
7909
|
+
body: z107.object({
|
|
7910
|
+
assigneeId: z107.string().uuid().optional(),
|
|
7911
|
+
roomId: z107.string().uuid(),
|
|
7912
|
+
workflowId: z107.string().uuid(),
|
|
7913
|
+
queueId: z107.string().uuid().optional()
|
|
8042
7914
|
}),
|
|
8043
7915
|
responses: {
|
|
8044
7916
|
200: DefaultSuccessResponseSchema.extend({
|
|
@@ -8052,15 +7924,15 @@ var chatContract = initContract39().router(
|
|
|
8052
7924
|
solveRoom: {
|
|
8053
7925
|
method: "POST",
|
|
8054
7926
|
path: "/room/solve",
|
|
8055
|
-
body:
|
|
8056
|
-
roomId:
|
|
8057
|
-
disposition:
|
|
8058
|
-
workflowId:
|
|
7927
|
+
body: z107.object({
|
|
7928
|
+
roomId: z107.string(),
|
|
7929
|
+
disposition: z107.string(),
|
|
7930
|
+
workflowId: z107.string().uuid()
|
|
8059
7931
|
}),
|
|
8060
7932
|
responses: {
|
|
8061
7933
|
200: DefaultSuccessResponseSchema.extend({
|
|
8062
7934
|
data: RoomSchema.extend({
|
|
8063
|
-
solveMessage:
|
|
7935
|
+
solveMessage: z107.string()
|
|
8064
7936
|
})
|
|
8065
7937
|
}),
|
|
8066
7938
|
409: DefaultErrorResponseSchema
|
|
@@ -8070,9 +7942,9 @@ var chatContract = initContract39().router(
|
|
|
8070
7942
|
emitMessage: {
|
|
8071
7943
|
method: "POST",
|
|
8072
7944
|
path: "/message/emit",
|
|
8073
|
-
body:
|
|
8074
|
-
messageId:
|
|
8075
|
-
queueId:
|
|
7945
|
+
body: z107.object({
|
|
7946
|
+
messageId: z107.string().uuid(),
|
|
7947
|
+
queueId: z107.string().uuid().optional().nullable()
|
|
8076
7948
|
}),
|
|
8077
7949
|
responses: {
|
|
8078
7950
|
200: DefaultSuccessResponseSchema,
|
|
@@ -8083,18 +7955,18 @@ var chatContract = initContract39().router(
|
|
|
8083
7955
|
}
|
|
8084
7956
|
},
|
|
8085
7957
|
{
|
|
8086
|
-
baseHeaders:
|
|
8087
|
-
"x-tenant":
|
|
8088
|
-
"x-code":
|
|
7958
|
+
baseHeaders: z107.object({
|
|
7959
|
+
"x-tenant": z107.string({ required_error: "Tenant id is required" }),
|
|
7960
|
+
"x-code": z107.string().uuid().optional()
|
|
8089
7961
|
}),
|
|
8090
7962
|
pathPrefix: "chat"
|
|
8091
7963
|
}
|
|
8092
7964
|
);
|
|
8093
7965
|
|
|
8094
7966
|
// src/botpress/index.ts
|
|
8095
|
-
import
|
|
8096
|
-
import { initContract as
|
|
8097
|
-
var botpressContract =
|
|
7967
|
+
import z108 from "zod";
|
|
7968
|
+
import { initContract as initContract39 } from "@ts-rest/core";
|
|
7969
|
+
var botpressContract = initContract39().router(
|
|
8098
7970
|
{
|
|
8099
7971
|
createBot: {
|
|
8100
7972
|
method: "POST",
|
|
@@ -8111,7 +7983,7 @@ var botpressContract = initContract40().router(
|
|
|
8111
7983
|
path: "/",
|
|
8112
7984
|
responses: {
|
|
8113
7985
|
200: DefaultSuccessResponseSchema.extend({
|
|
8114
|
-
data:
|
|
7986
|
+
data: z108.array(BotpressBotSchema)
|
|
8115
7987
|
}),
|
|
8116
7988
|
500: DefaultErrorResponseSchema
|
|
8117
7989
|
}
|
|
@@ -8128,7 +8000,7 @@ var botpressContract = initContract40().router(
|
|
|
8128
8000
|
},
|
|
8129
8001
|
{ pathPrefix: "/bots" }
|
|
8130
8002
|
);
|
|
8131
|
-
var botContract =
|
|
8003
|
+
var botContract = initContract39().router(
|
|
8132
8004
|
{
|
|
8133
8005
|
createBot: {
|
|
8134
8006
|
method: "POST",
|
|
@@ -8148,7 +8020,7 @@ var botContract = initContract40().router(
|
|
|
8148
8020
|
path: "/",
|
|
8149
8021
|
responses: {
|
|
8150
8022
|
200: DefaultSuccessResponseSchema.extend({
|
|
8151
|
-
data:
|
|
8023
|
+
data: z108.array(BotpressBotSchema)
|
|
8152
8024
|
}),
|
|
8153
8025
|
500: DefaultErrorResponseSchema
|
|
8154
8026
|
}
|
|
@@ -8160,32 +8032,32 @@ var botContract = initContract40().router(
|
|
|
8160
8032
|
);
|
|
8161
8033
|
|
|
8162
8034
|
// src/presence-status/index.ts
|
|
8163
|
-
import { initContract as
|
|
8164
|
-
import
|
|
8035
|
+
import { initContract as initContract40 } from "@ts-rest/core";
|
|
8036
|
+
import z110 from "zod";
|
|
8165
8037
|
|
|
8166
8038
|
// src/presence-status/validation.ts
|
|
8167
|
-
import { z as
|
|
8168
|
-
var CreatePresenceStatusSchema =
|
|
8169
|
-
status:
|
|
8039
|
+
import { z as z109 } from "zod";
|
|
8040
|
+
var CreatePresenceStatusSchema = z109.object({
|
|
8041
|
+
status: z109.string(),
|
|
8170
8042
|
description: PresenceStatusDesEnum,
|
|
8171
|
-
position:
|
|
8043
|
+
position: z109.number()
|
|
8172
8044
|
});
|
|
8173
8045
|
var UpdatePresenceStatusSchema = CreatePresenceStatusSchema;
|
|
8174
8046
|
|
|
8175
8047
|
// src/presence-status/index.ts
|
|
8176
|
-
var presenceStatusContract =
|
|
8048
|
+
var presenceStatusContract = initContract40().router(
|
|
8177
8049
|
{
|
|
8178
8050
|
getAllStatus: {
|
|
8179
8051
|
method: "GET",
|
|
8180
8052
|
path: "",
|
|
8181
8053
|
headers: DefaultHeaderSchema,
|
|
8182
8054
|
responses: {
|
|
8183
|
-
200:
|
|
8184
|
-
total:
|
|
8185
|
-
data:
|
|
8055
|
+
200: z110.object({
|
|
8056
|
+
total: z110.number(),
|
|
8057
|
+
data: z110.array(PresenceStatusSchema)
|
|
8186
8058
|
}),
|
|
8187
|
-
400:
|
|
8188
|
-
message:
|
|
8059
|
+
400: z110.object({
|
|
8060
|
+
message: z110.string()
|
|
8189
8061
|
}),
|
|
8190
8062
|
401: DefaultUnauthorizedSchema,
|
|
8191
8063
|
500: DefaultErrorResponseSchema
|
|
@@ -8201,8 +8073,8 @@ var presenceStatusContract = initContract41().router(
|
|
|
8201
8073
|
201: DefaultSuccessResponseSchema.extend({
|
|
8202
8074
|
presenceStatus: PresenceStatusSchema
|
|
8203
8075
|
}),
|
|
8204
|
-
400:
|
|
8205
|
-
message:
|
|
8076
|
+
400: z110.object({
|
|
8077
|
+
message: z110.string()
|
|
8206
8078
|
}),
|
|
8207
8079
|
401: DefaultUnauthorizedSchema,
|
|
8208
8080
|
404: DefaultNotFoundSchema,
|
|
@@ -8214,12 +8086,12 @@ var presenceStatusContract = initContract41().router(
|
|
|
8214
8086
|
getPresenceStatusById: {
|
|
8215
8087
|
method: "GET",
|
|
8216
8088
|
path: "/:id",
|
|
8217
|
-
pathParams:
|
|
8089
|
+
pathParams: z110.object({ id: z110.string() }),
|
|
8218
8090
|
headers: DefaultHeaderSchema,
|
|
8219
8091
|
responses: {
|
|
8220
8092
|
200: PresenceStatusSchema,
|
|
8221
|
-
400:
|
|
8222
|
-
message:
|
|
8093
|
+
400: z110.object({
|
|
8094
|
+
message: z110.string()
|
|
8223
8095
|
}),
|
|
8224
8096
|
401: DefaultUnauthorizedSchema,
|
|
8225
8097
|
404: DefaultNotFoundSchema,
|
|
@@ -8231,15 +8103,15 @@ var presenceStatusContract = initContract41().router(
|
|
|
8231
8103
|
updatePresenceStatus: {
|
|
8232
8104
|
method: "PATCH",
|
|
8233
8105
|
path: "/:id",
|
|
8234
|
-
pathParams:
|
|
8106
|
+
pathParams: z110.object({ id: z110.string() }),
|
|
8235
8107
|
headers: DefaultHeaderSchema,
|
|
8236
8108
|
body: UpdatePresenceStatusSchema,
|
|
8237
8109
|
responses: {
|
|
8238
8110
|
201: DefaultSuccessResponseSchema.extend({
|
|
8239
8111
|
presenceStatus: PresenceStatusSchema
|
|
8240
8112
|
}),
|
|
8241
|
-
400:
|
|
8242
|
-
message:
|
|
8113
|
+
400: z110.object({
|
|
8114
|
+
message: z110.string()
|
|
8243
8115
|
}),
|
|
8244
8116
|
401: DefaultUnauthorizedSchema,
|
|
8245
8117
|
404: DefaultNotFoundSchema,
|
|
@@ -8251,11 +8123,11 @@ var presenceStatusContract = initContract41().router(
|
|
|
8251
8123
|
deletePresenceStatus: {
|
|
8252
8124
|
method: "DELETE",
|
|
8253
8125
|
path: "/:id",
|
|
8254
|
-
pathParams:
|
|
8126
|
+
pathParams: z110.object({ id: z110.string() }),
|
|
8255
8127
|
headers: DefaultHeaderSchema,
|
|
8256
8128
|
body: null,
|
|
8257
8129
|
responses: {
|
|
8258
|
-
200: DefaultSuccessResponseSchema.extend({ message:
|
|
8130
|
+
200: DefaultSuccessResponseSchema.extend({ message: z110.string() }),
|
|
8259
8131
|
404: DefaultNotFoundSchema,
|
|
8260
8132
|
422: DefaultUnprocessibleSchema,
|
|
8261
8133
|
500: DefaultErrorResponseSchema
|
|
@@ -8267,38 +8139,38 @@ var presenceStatusContract = initContract41().router(
|
|
|
8267
8139
|
);
|
|
8268
8140
|
|
|
8269
8141
|
// src/sms/index.ts
|
|
8270
|
-
import { initContract as
|
|
8142
|
+
import { initContract as initContract41 } from "@ts-rest/core";
|
|
8271
8143
|
|
|
8272
8144
|
// src/sms/schema.ts
|
|
8273
|
-
import
|
|
8145
|
+
import z112 from "zod";
|
|
8274
8146
|
|
|
8275
8147
|
// src/sms/validation.ts
|
|
8276
|
-
import
|
|
8277
|
-
var ConnectSMSSchema2 =
|
|
8278
|
-
name:
|
|
8279
|
-
type:
|
|
8280
|
-
senderId:
|
|
8281
|
-
vonageCredentials:
|
|
8282
|
-
mobileNumber:
|
|
8283
|
-
apiKey:
|
|
8284
|
-
apiSecret:
|
|
8148
|
+
import z111 from "zod";
|
|
8149
|
+
var ConnectSMSSchema2 = z111.object({
|
|
8150
|
+
name: z111.string(),
|
|
8151
|
+
type: z111.enum(["sms_vonage" /* VONAGE_SMS */]),
|
|
8152
|
+
senderId: z111.string(),
|
|
8153
|
+
vonageCredentials: z111.object({
|
|
8154
|
+
mobileNumber: z111.string(),
|
|
8155
|
+
apiKey: z111.string(),
|
|
8156
|
+
apiSecret: z111.string()
|
|
8285
8157
|
})
|
|
8286
8158
|
});
|
|
8287
8159
|
|
|
8288
8160
|
// src/sms/schema.ts
|
|
8289
|
-
var ConnectSMSChannelSchema =
|
|
8290
|
-
actor:
|
|
8291
|
-
id:
|
|
8292
|
-
name:
|
|
8293
|
-
email:
|
|
8294
|
-
address:
|
|
8295
|
-
phone:
|
|
8161
|
+
var ConnectSMSChannelSchema = z112.object({
|
|
8162
|
+
actor: z112.object({
|
|
8163
|
+
id: z112.string().uuid(),
|
|
8164
|
+
name: z112.string(),
|
|
8165
|
+
email: z112.string().email(),
|
|
8166
|
+
address: z112.string().nullable(),
|
|
8167
|
+
phone: z112.string().nullable()
|
|
8296
8168
|
}),
|
|
8297
8169
|
channel: ConnectSMSSchema2
|
|
8298
8170
|
});
|
|
8299
8171
|
|
|
8300
8172
|
// src/sms/index.ts
|
|
8301
|
-
var smsContract =
|
|
8173
|
+
var smsContract = initContract41().router({
|
|
8302
8174
|
connect: {
|
|
8303
8175
|
method: "POST",
|
|
8304
8176
|
path: "/connect",
|
|
@@ -8324,9 +8196,9 @@ var smsContract = initContract42().router({
|
|
|
8324
8196
|
});
|
|
8325
8197
|
|
|
8326
8198
|
// src/whatsapp/index.ts
|
|
8327
|
-
import { initContract as
|
|
8328
|
-
import
|
|
8329
|
-
var whatsappContract =
|
|
8199
|
+
import { initContract as initContract42 } from "@ts-rest/core";
|
|
8200
|
+
import z113 from "zod";
|
|
8201
|
+
var whatsappContract = initContract42().router({
|
|
8330
8202
|
sendMessage: {
|
|
8331
8203
|
method: "POST",
|
|
8332
8204
|
path: "/message",
|
|
@@ -8360,8 +8232,8 @@ var whatsappContract = initContract43().router({
|
|
|
8360
8232
|
reconnect: {
|
|
8361
8233
|
method: "POST",
|
|
8362
8234
|
path: "/reconnect/:channelId",
|
|
8363
|
-
pathParams:
|
|
8364
|
-
channelId:
|
|
8235
|
+
pathParams: z113.object({
|
|
8236
|
+
channelId: z113.string().uuid()
|
|
8365
8237
|
}),
|
|
8366
8238
|
body: null,
|
|
8367
8239
|
responses: {
|
|
@@ -8373,8 +8245,8 @@ var whatsappContract = initContract43().router({
|
|
|
8373
8245
|
delete: {
|
|
8374
8246
|
method: "DELETE",
|
|
8375
8247
|
path: "/delete/:channelId",
|
|
8376
|
-
pathParams:
|
|
8377
|
-
channelId:
|
|
8248
|
+
pathParams: z113.object({
|
|
8249
|
+
channelId: z113.string().uuid()
|
|
8378
8250
|
}),
|
|
8379
8251
|
body: null,
|
|
8380
8252
|
responses: {
|
|
@@ -8396,7 +8268,7 @@ var whatsappContract = initContract43().router({
|
|
|
8396
8268
|
});
|
|
8397
8269
|
|
|
8398
8270
|
// src/contract.ts
|
|
8399
|
-
var apiContract =
|
|
8271
|
+
var apiContract = initContract43().router({
|
|
8400
8272
|
auth: authContract,
|
|
8401
8273
|
cxLog: cxLogContract,
|
|
8402
8274
|
dashboard: dashboardContract,
|
|
@@ -8418,63 +8290,62 @@ var apiContract = initContract44().router({
|
|
|
8418
8290
|
evaluateForm: evaluateFormContract,
|
|
8419
8291
|
upload: uploadContract,
|
|
8420
8292
|
snippet: snippetContract,
|
|
8421
|
-
bot: botContract
|
|
8422
|
-
subscription: subscriptionContract
|
|
8293
|
+
bot: botContract
|
|
8423
8294
|
});
|
|
8424
|
-
var contactContract2 =
|
|
8295
|
+
var contactContract2 = initContract43().router({
|
|
8425
8296
|
contact: contactContract
|
|
8426
8297
|
});
|
|
8427
|
-
var ticketContract2 =
|
|
8298
|
+
var ticketContract2 = initContract43().router({
|
|
8428
8299
|
ticket: ticketContract
|
|
8429
8300
|
});
|
|
8430
|
-
var extensionContract2 =
|
|
8301
|
+
var extensionContract2 = initContract43().router({
|
|
8431
8302
|
extension: extensionContract
|
|
8432
8303
|
});
|
|
8433
|
-
var commentActivityContract =
|
|
8304
|
+
var commentActivityContract = initContract43().router({
|
|
8434
8305
|
comment: commentContract,
|
|
8435
8306
|
activityLog: activityLogContract
|
|
8436
8307
|
});
|
|
8437
|
-
var platformContract =
|
|
8308
|
+
var platformContract = initContract43().router({
|
|
8438
8309
|
line: lineContract,
|
|
8439
8310
|
viber: viberContract
|
|
8440
8311
|
});
|
|
8441
|
-
var platformTelegramContract =
|
|
8312
|
+
var platformTelegramContract = initContract43().router({
|
|
8442
8313
|
telegram: telegramContract
|
|
8443
8314
|
});
|
|
8444
|
-
var platformMessengerContract =
|
|
8315
|
+
var platformMessengerContract = initContract43().router({
|
|
8445
8316
|
messenger: messengerContract
|
|
8446
8317
|
});
|
|
8447
|
-
var platformInstagramContract =
|
|
8318
|
+
var platformInstagramContract = initContract43().router({
|
|
8448
8319
|
instagram: instagramContract
|
|
8449
8320
|
});
|
|
8450
|
-
var platformBotpressContract =
|
|
8321
|
+
var platformBotpressContract = initContract43().router({
|
|
8451
8322
|
botpress: botpressContract
|
|
8452
8323
|
});
|
|
8453
|
-
var platformSMSContract =
|
|
8324
|
+
var platformSMSContract = initContract43().router({
|
|
8454
8325
|
sms: smsContract
|
|
8455
8326
|
});
|
|
8456
|
-
var platformWhatsappContract =
|
|
8327
|
+
var platformWhatsappContract = initContract43().router({
|
|
8457
8328
|
whatsapp: whatsappContract
|
|
8458
8329
|
});
|
|
8459
|
-
var facebookFeedContract2 =
|
|
8330
|
+
var facebookFeedContract2 = initContract43().router({
|
|
8460
8331
|
facebookFeed: facebookFeedContract
|
|
8461
8332
|
});
|
|
8462
|
-
var feedPostContract =
|
|
8333
|
+
var feedPostContract = initContract43().router({
|
|
8463
8334
|
main: mainFeedContract
|
|
8464
8335
|
});
|
|
8465
|
-
var telephonyContract =
|
|
8336
|
+
var telephonyContract = initContract43().router({
|
|
8466
8337
|
telephonyCdr: telephonyCdrContract
|
|
8467
8338
|
});
|
|
8468
|
-
var notificationContract =
|
|
8339
|
+
var notificationContract = initContract43().router({
|
|
8469
8340
|
notification: userNotificationContract
|
|
8470
8341
|
});
|
|
8471
|
-
var publicApiContract2 =
|
|
8342
|
+
var publicApiContract2 = initContract43().router({
|
|
8472
8343
|
publicApi: publicApiContract
|
|
8473
8344
|
});
|
|
8474
|
-
var businessCalendarContract2 =
|
|
8345
|
+
var businessCalendarContract2 = initContract43().router({
|
|
8475
8346
|
businessCalendar: businessCalendarContract
|
|
8476
8347
|
});
|
|
8477
|
-
var workflowContract =
|
|
8348
|
+
var workflowContract = initContract43().router(
|
|
8478
8349
|
{
|
|
8479
8350
|
chat: chatContract
|
|
8480
8351
|
},
|
|
@@ -8483,7 +8354,7 @@ var workflowContract = initContract44().router(
|
|
|
8483
8354
|
}
|
|
8484
8355
|
);
|
|
8485
8356
|
var settingsPathPrefix = "settings/";
|
|
8486
|
-
var ticketSettingContract =
|
|
8357
|
+
var ticketSettingContract = initContract43().router(
|
|
8487
8358
|
{
|
|
8488
8359
|
ticketSetting: attributeContract
|
|
8489
8360
|
},
|
|
@@ -8491,7 +8362,7 @@ var ticketSettingContract = initContract44().router(
|
|
|
8491
8362
|
pathPrefix: `${settingsPathPrefix}ticket/`
|
|
8492
8363
|
}
|
|
8493
8364
|
);
|
|
8494
|
-
var contactSettingContract =
|
|
8365
|
+
var contactSettingContract = initContract43().router(
|
|
8495
8366
|
{
|
|
8496
8367
|
contactSetting: attributeContract
|
|
8497
8368
|
},
|
|
@@ -8499,7 +8370,7 @@ var contactSettingContract = initContract44().router(
|
|
|
8499
8370
|
pathPrefix: `${settingsPathPrefix}contact/`
|
|
8500
8371
|
}
|
|
8501
8372
|
);
|
|
8502
|
-
var companySettingContract =
|
|
8373
|
+
var companySettingContract = initContract43().router(
|
|
8503
8374
|
{
|
|
8504
8375
|
companySetting: attributeContract
|
|
8505
8376
|
},
|
|
@@ -8507,7 +8378,7 @@ var companySettingContract = initContract44().router(
|
|
|
8507
8378
|
pathPrefix: `${settingsPathPrefix}company/`
|
|
8508
8379
|
}
|
|
8509
8380
|
);
|
|
8510
|
-
var caseLogSettingContract =
|
|
8381
|
+
var caseLogSettingContract = initContract43().router(
|
|
8511
8382
|
{
|
|
8512
8383
|
caseLogSetting: attributeContract
|
|
8513
8384
|
},
|
|
@@ -8515,7 +8386,7 @@ var caseLogSettingContract = initContract44().router(
|
|
|
8515
8386
|
pathPrefix: `${settingsPathPrefix}case_log/`
|
|
8516
8387
|
}
|
|
8517
8388
|
);
|
|
8518
|
-
var generalTagSettingContract =
|
|
8389
|
+
var generalTagSettingContract = initContract43().router(
|
|
8519
8390
|
{
|
|
8520
8391
|
generalTag: tagContract
|
|
8521
8392
|
},
|
|
@@ -8523,7 +8394,7 @@ var generalTagSettingContract = initContract44().router(
|
|
|
8523
8394
|
pathPrefix: `${settingsPathPrefix}general_tag/`
|
|
8524
8395
|
}
|
|
8525
8396
|
);
|
|
8526
|
-
var contactLabelSettingContract =
|
|
8397
|
+
var contactLabelSettingContract = initContract43().router(
|
|
8527
8398
|
{
|
|
8528
8399
|
contactLabel: tagContract
|
|
8529
8400
|
},
|
|
@@ -8531,7 +8402,7 @@ var contactLabelSettingContract = initContract44().router(
|
|
|
8531
8402
|
pathPrefix: `${settingsPathPrefix}contact_label/`
|
|
8532
8403
|
}
|
|
8533
8404
|
);
|
|
8534
|
-
var categorySettingContract =
|
|
8405
|
+
var categorySettingContract = initContract43().router(
|
|
8535
8406
|
{
|
|
8536
8407
|
category: categoryContract
|
|
8537
8408
|
},
|
|
@@ -8539,7 +8410,7 @@ var categorySettingContract = initContract44().router(
|
|
|
8539
8410
|
pathPrefix: settingsPathPrefix
|
|
8540
8411
|
}
|
|
8541
8412
|
);
|
|
8542
|
-
var snippetSettingContract =
|
|
8413
|
+
var snippetSettingContract = initContract43().router(
|
|
8543
8414
|
{
|
|
8544
8415
|
snippet: snippetContract
|
|
8545
8416
|
},
|
|
@@ -8547,7 +8418,7 @@ var snippetSettingContract = initContract44().router(
|
|
|
8547
8418
|
pathPrefix: settingsPathPrefix
|
|
8548
8419
|
}
|
|
8549
8420
|
);
|
|
8550
|
-
var businessCalendarSettingContract =
|
|
8421
|
+
var businessCalendarSettingContract = initContract43().router(
|
|
8551
8422
|
{
|
|
8552
8423
|
businessCalendar: businessCalendarContract
|
|
8553
8424
|
},
|
|
@@ -8555,7 +8426,7 @@ var businessCalendarSettingContract = initContract44().router(
|
|
|
8555
8426
|
pathPrefix: settingsPathPrefix
|
|
8556
8427
|
}
|
|
8557
8428
|
);
|
|
8558
|
-
var channelSettingContract =
|
|
8429
|
+
var channelSettingContract = initContract43().router(
|
|
8559
8430
|
{
|
|
8560
8431
|
channel: channelContract
|
|
8561
8432
|
},
|
|
@@ -8563,50 +8434,50 @@ var channelSettingContract = initContract44().router(
|
|
|
8563
8434
|
pathPrefix: settingsPathPrefix
|
|
8564
8435
|
}
|
|
8565
8436
|
);
|
|
8566
|
-
var widgetSettingContract =
|
|
8437
|
+
var widgetSettingContract = initContract43().router(
|
|
8567
8438
|
{ widget: widgetContract },
|
|
8568
8439
|
{ pathPrefix: settingsPathPrefix }
|
|
8569
8440
|
);
|
|
8570
|
-
var roleSettingContract =
|
|
8441
|
+
var roleSettingContract = initContract43().router(
|
|
8571
8442
|
{ role: roleContract },
|
|
8572
8443
|
{ pathPrefix: settingsPathPrefix }
|
|
8573
8444
|
);
|
|
8574
|
-
var permissionSettingContract =
|
|
8445
|
+
var permissionSettingContract = initContract43().router(
|
|
8575
8446
|
{ permission: permissionContract },
|
|
8576
8447
|
{ pathPrefix: settingsPathPrefix }
|
|
8577
8448
|
);
|
|
8578
|
-
var memberSettingContract =
|
|
8449
|
+
var memberSettingContract = initContract43().router(
|
|
8579
8450
|
{ member: userContract },
|
|
8580
8451
|
{ pathPrefix: settingsPathPrefix }
|
|
8581
8452
|
);
|
|
8582
|
-
var presenceStatusContract2 =
|
|
8453
|
+
var presenceStatusContract2 = initContract43().router({
|
|
8583
8454
|
presenceStatus: presenceStatusContract
|
|
8584
8455
|
});
|
|
8585
8456
|
|
|
8586
8457
|
// src/general-setting/index.ts
|
|
8587
|
-
import { initContract as
|
|
8588
|
-
import
|
|
8589
|
-
var generalSettingContract =
|
|
8458
|
+
import { initContract as initContract44 } from "@ts-rest/core";
|
|
8459
|
+
import z114 from "zod";
|
|
8460
|
+
var generalSettingContract = initContract44().router(
|
|
8590
8461
|
{
|
|
8591
8462
|
autoOpenedContactWidgetId: {
|
|
8592
8463
|
getAutoOpenedContactWidgetId: {
|
|
8593
8464
|
method: "GET",
|
|
8594
8465
|
path: "/auto-opened-contact-widget-id",
|
|
8595
8466
|
responses: {
|
|
8596
|
-
200:
|
|
8597
|
-
autoOpenedContactWidgetId:
|
|
8467
|
+
200: z114.object({
|
|
8468
|
+
autoOpenedContactWidgetId: z114.string().nullable()
|
|
8598
8469
|
})
|
|
8599
8470
|
}
|
|
8600
8471
|
},
|
|
8601
8472
|
updateAutoOpenedContactWidgetId: {
|
|
8602
8473
|
method: "PATCH",
|
|
8603
8474
|
path: "/auto-opened-contact-widget-id",
|
|
8604
|
-
body:
|
|
8605
|
-
autoOpenedContactWidgetId:
|
|
8475
|
+
body: z114.object({
|
|
8476
|
+
autoOpenedContactWidgetId: z114.string().nullable()
|
|
8606
8477
|
}),
|
|
8607
8478
|
responses: {
|
|
8608
|
-
200:
|
|
8609
|
-
autoOpenedContactWidgetId:
|
|
8479
|
+
200: z114.object({
|
|
8480
|
+
autoOpenedContactWidgetId: z114.string().nullable()
|
|
8610
8481
|
})
|
|
8611
8482
|
}
|
|
8612
8483
|
}
|
|
@@ -8618,54 +8489,54 @@ var generalSettingContract = initContract45().router(
|
|
|
8618
8489
|
);
|
|
8619
8490
|
|
|
8620
8491
|
// src/automation-queue/index.ts
|
|
8621
|
-
import { initContract as
|
|
8622
|
-
import { z as
|
|
8492
|
+
import { initContract as initContract45 } from "@ts-rest/core";
|
|
8493
|
+
import { z as z117 } from "zod";
|
|
8623
8494
|
|
|
8624
8495
|
// src/automation-queue/validation.ts
|
|
8625
|
-
import { z as
|
|
8626
|
-
var QueueDistributionStrategySchema =
|
|
8627
|
-
|
|
8628
|
-
|
|
8629
|
-
|
|
8630
|
-
|
|
8496
|
+
import { z as z115 } from "zod";
|
|
8497
|
+
var QueueDistributionStrategySchema = z115.union([
|
|
8498
|
+
z115.literal("round-robin"),
|
|
8499
|
+
z115.literal("fewest-assignments"),
|
|
8500
|
+
z115.literal("random"),
|
|
8501
|
+
z115.literal("notify-all")
|
|
8631
8502
|
]);
|
|
8632
|
-
var CreateAutomationQueueSchema =
|
|
8633
|
-
emoji:
|
|
8634
|
-
name:
|
|
8635
|
-
description:
|
|
8636
|
-
managerIds:
|
|
8637
|
-
agentIds:
|
|
8503
|
+
var CreateAutomationQueueSchema = z115.object({
|
|
8504
|
+
emoji: z115.string().emoji(),
|
|
8505
|
+
name: z115.string(),
|
|
8506
|
+
description: z115.string().nullable(),
|
|
8507
|
+
managerIds: z115.array(z115.string().uuid()).min(1),
|
|
8508
|
+
agentIds: z115.array(z115.string().uuid()).min(1),
|
|
8638
8509
|
distributionStrategy: QueueDistributionStrategySchema,
|
|
8639
|
-
maximumAssignPerAgent:
|
|
8510
|
+
maximumAssignPerAgent: z115.number().positive()
|
|
8640
8511
|
// ringTimeOut: z.number().positive(),
|
|
8641
8512
|
// retryInterval: z.number().positive(),
|
|
8642
8513
|
// queueTimeOut: z.number().positive(),
|
|
8643
8514
|
// isAssignmentDeniable: z.coerce.boolean(),
|
|
8644
8515
|
});
|
|
8645
8516
|
var UpdateAutomationQueueSchema = CreateAutomationQueueSchema;
|
|
8646
|
-
var CheckHasAssignedRoomSchema =
|
|
8647
|
-
userId:
|
|
8648
|
-
queueId:
|
|
8517
|
+
var CheckHasAssignedRoomSchema = z115.object({
|
|
8518
|
+
userId: z115.string().uuid().optional(),
|
|
8519
|
+
queueId: z115.string().uuid().optional()
|
|
8649
8520
|
});
|
|
8650
8521
|
|
|
8651
8522
|
// src/automation-queue/schema.ts
|
|
8652
|
-
import { z as
|
|
8523
|
+
import { z as z116 } from "zod";
|
|
8653
8524
|
var AutomationQueueSchema = DefaultEntitySchema.extend({
|
|
8654
|
-
emoji:
|
|
8655
|
-
name:
|
|
8656
|
-
description:
|
|
8525
|
+
emoji: z116.string(),
|
|
8526
|
+
name: z116.string(),
|
|
8527
|
+
description: z116.string().nullable(),
|
|
8657
8528
|
distributionStrategy: QueueDistributionStrategySchema,
|
|
8658
|
-
maximumAssignPerAgent:
|
|
8529
|
+
maximumAssignPerAgent: z116.number().positive(),
|
|
8659
8530
|
// ringTimeOut: z.number(),
|
|
8660
8531
|
// retryInterval: z.number(),
|
|
8661
8532
|
// queueTimeOut: z.number(),
|
|
8662
8533
|
// isAssignmentDeniable: z.boolean(),
|
|
8663
|
-
managers:
|
|
8664
|
-
agents:
|
|
8534
|
+
managers: z116.array(UserSchema),
|
|
8535
|
+
agents: z116.array(UserSchema)
|
|
8665
8536
|
});
|
|
8666
8537
|
|
|
8667
8538
|
// src/automation-queue/index.ts
|
|
8668
|
-
var automationQueueContract =
|
|
8539
|
+
var automationQueueContract = initContract45().router(
|
|
8669
8540
|
{
|
|
8670
8541
|
createAutomationQueue: {
|
|
8671
8542
|
method: "POST",
|
|
@@ -8680,8 +8551,8 @@ var automationQueueContract = initContract46().router(
|
|
|
8680
8551
|
duplicateAutomationQueue: {
|
|
8681
8552
|
method: "POST",
|
|
8682
8553
|
path: "/:id/duplicate",
|
|
8683
|
-
pathParams:
|
|
8684
|
-
id:
|
|
8554
|
+
pathParams: z117.object({
|
|
8555
|
+
id: z117.string().uuid()
|
|
8685
8556
|
}),
|
|
8686
8557
|
body: null,
|
|
8687
8558
|
responses: {
|
|
@@ -8693,20 +8564,20 @@ var automationQueueContract = initContract46().router(
|
|
|
8693
8564
|
getAutomationQueues: {
|
|
8694
8565
|
method: "GET",
|
|
8695
8566
|
path: "",
|
|
8696
|
-
query:
|
|
8697
|
-
userId:
|
|
8567
|
+
query: z117.object({
|
|
8568
|
+
userId: z117.string().uuid().optional()
|
|
8698
8569
|
}).optional(),
|
|
8699
8570
|
responses: {
|
|
8700
8571
|
200: DefaultSuccessResponseSchema.extend({
|
|
8701
|
-
data:
|
|
8572
|
+
data: z117.array(AutomationQueueSchema)
|
|
8702
8573
|
})
|
|
8703
8574
|
}
|
|
8704
8575
|
},
|
|
8705
8576
|
getAutomationQueueById: {
|
|
8706
8577
|
method: "GET",
|
|
8707
8578
|
path: "/:id",
|
|
8708
|
-
pathParams:
|
|
8709
|
-
id:
|
|
8579
|
+
pathParams: z117.object({
|
|
8580
|
+
id: z117.string().uuid()
|
|
8710
8581
|
}),
|
|
8711
8582
|
responses: {
|
|
8712
8583
|
200: DefaultSuccessResponseSchema.extend({
|
|
@@ -8717,8 +8588,8 @@ var automationQueueContract = initContract46().router(
|
|
|
8717
8588
|
updateAutomationQueue: {
|
|
8718
8589
|
method: "PATCH",
|
|
8719
8590
|
path: "/:id",
|
|
8720
|
-
pathParams:
|
|
8721
|
-
id:
|
|
8591
|
+
pathParams: z117.object({
|
|
8592
|
+
id: z117.string().uuid()
|
|
8722
8593
|
}),
|
|
8723
8594
|
body: UpdateAutomationQueueSchema,
|
|
8724
8595
|
responses: {
|
|
@@ -8730,13 +8601,13 @@ var automationQueueContract = initContract46().router(
|
|
|
8730
8601
|
deleteAutomationQueue: {
|
|
8731
8602
|
method: "DELETE",
|
|
8732
8603
|
path: "/:id",
|
|
8733
|
-
pathParams:
|
|
8734
|
-
id:
|
|
8604
|
+
pathParams: z117.object({
|
|
8605
|
+
id: z117.string().uuid()
|
|
8735
8606
|
}),
|
|
8736
8607
|
body: null,
|
|
8737
8608
|
responses: {
|
|
8738
8609
|
200: DefaultSuccessResponseSchema.extend({
|
|
8739
|
-
message:
|
|
8610
|
+
message: z117.string()
|
|
8740
8611
|
})
|
|
8741
8612
|
}
|
|
8742
8613
|
},
|
|
@@ -8746,8 +8617,8 @@ var automationQueueContract = initContract46().router(
|
|
|
8746
8617
|
body: CheckHasAssignedRoomSchema,
|
|
8747
8618
|
responses: {
|
|
8748
8619
|
200: DefaultSuccessResponseSchema.extend({
|
|
8749
|
-
data:
|
|
8750
|
-
hasAssignedRoom:
|
|
8620
|
+
data: z117.object({
|
|
8621
|
+
hasAssignedRoom: z117.boolean()
|
|
8751
8622
|
})
|
|
8752
8623
|
})
|
|
8753
8624
|
}
|
|
@@ -8757,300 +8628,300 @@ var automationQueueContract = initContract46().router(
|
|
|
8757
8628
|
);
|
|
8758
8629
|
|
|
8759
8630
|
// src/mail/mail-contract.ts
|
|
8760
|
-
import { initContract as
|
|
8631
|
+
import { initContract as initContract50 } from "@ts-rest/core";
|
|
8761
8632
|
|
|
8762
8633
|
// src/mail/room-contract.ts
|
|
8763
|
-
import { initContract as
|
|
8764
|
-
import
|
|
8634
|
+
import { initContract as initContract46 } from "@ts-rest/core";
|
|
8635
|
+
import z122 from "zod";
|
|
8765
8636
|
|
|
8766
8637
|
// src/mail/schemas/room.schema.ts
|
|
8767
|
-
import
|
|
8638
|
+
import z120 from "zod";
|
|
8768
8639
|
|
|
8769
8640
|
// src/mail/schemas/account.schema.ts
|
|
8770
|
-
import
|
|
8771
|
-
var MailServerSchema =
|
|
8772
|
-
id:
|
|
8773
|
-
createdAt:
|
|
8774
|
-
updatedAt:
|
|
8775
|
-
deletedAt:
|
|
8776
|
-
name:
|
|
8777
|
-
smtpHost:
|
|
8778
|
-
smtpPort:
|
|
8779
|
-
smtpTlsPort:
|
|
8780
|
-
useTlsForSmtp:
|
|
8781
|
-
imapHost:
|
|
8782
|
-
imapPort:
|
|
8783
|
-
imapTlsPort:
|
|
8784
|
-
useTlsForImap:
|
|
8785
|
-
});
|
|
8786
|
-
var MailAccountSchema =
|
|
8787
|
-
id:
|
|
8788
|
-
createdAt:
|
|
8789
|
-
updatedAt:
|
|
8790
|
-
deletedAt:
|
|
8791
|
-
name:
|
|
8792
|
-
address:
|
|
8793
|
-
accountId:
|
|
8794
|
-
mailServerId:
|
|
8641
|
+
import z118 from "zod";
|
|
8642
|
+
var MailServerSchema = z118.object({
|
|
8643
|
+
id: z118.string(),
|
|
8644
|
+
createdAt: z118.date(),
|
|
8645
|
+
updatedAt: z118.date(),
|
|
8646
|
+
deletedAt: z118.date().nullable(),
|
|
8647
|
+
name: z118.string(),
|
|
8648
|
+
smtpHost: z118.string(),
|
|
8649
|
+
smtpPort: z118.number(),
|
|
8650
|
+
smtpTlsPort: z118.number(),
|
|
8651
|
+
useTlsForSmtp: z118.boolean(),
|
|
8652
|
+
imapHost: z118.string(),
|
|
8653
|
+
imapPort: z118.number(),
|
|
8654
|
+
imapTlsPort: z118.number(),
|
|
8655
|
+
useTlsForImap: z118.boolean()
|
|
8656
|
+
});
|
|
8657
|
+
var MailAccountSchema = z118.object({
|
|
8658
|
+
id: z118.string(),
|
|
8659
|
+
createdAt: z118.date(),
|
|
8660
|
+
updatedAt: z118.date(),
|
|
8661
|
+
deletedAt: z118.date().nullable(),
|
|
8662
|
+
name: z118.string(),
|
|
8663
|
+
address: z118.string(),
|
|
8664
|
+
accountId: z118.string(),
|
|
8665
|
+
mailServerId: z118.string(),
|
|
8795
8666
|
mailServer: MailServerSchema,
|
|
8796
|
-
state:
|
|
8797
|
-
|
|
8798
|
-
|
|
8799
|
-
|
|
8800
|
-
|
|
8801
|
-
|
|
8802
|
-
|
|
8803
|
-
|
|
8804
|
-
|
|
8667
|
+
state: z118.union([
|
|
8668
|
+
z118.literal("init"),
|
|
8669
|
+
z118.literal("syncing"),
|
|
8670
|
+
z118.literal("connecting"),
|
|
8671
|
+
z118.literal("connected"),
|
|
8672
|
+
z118.literal("disconnected"),
|
|
8673
|
+
z118.literal("authenticationError"),
|
|
8674
|
+
z118.literal("connectError"),
|
|
8675
|
+
z118.literal("unset")
|
|
8805
8676
|
])
|
|
8806
8677
|
});
|
|
8807
|
-
var OAuth2AppSchema =
|
|
8808
|
-
id:
|
|
8809
|
-
name:
|
|
8810
|
-
description:
|
|
8811
|
-
title:
|
|
8812
|
-
provider:
|
|
8813
|
-
enabled:
|
|
8814
|
-
legacy:
|
|
8815
|
-
created:
|
|
8816
|
-
updated:
|
|
8817
|
-
includeInListing:
|
|
8818
|
-
clientId:
|
|
8819
|
-
clientSecret:
|
|
8820
|
-
authority:
|
|
8821
|
-
redirectUrl:
|
|
8822
|
-
serviceClient:
|
|
8823
|
-
googleProjectId:
|
|
8824
|
-
serviceClientEmail:
|
|
8825
|
-
serviceKey:
|
|
8678
|
+
var OAuth2AppSchema = z118.object({
|
|
8679
|
+
id: z118.string(),
|
|
8680
|
+
name: z118.string(),
|
|
8681
|
+
description: z118.string(),
|
|
8682
|
+
title: z118.string(),
|
|
8683
|
+
provider: z118.string(),
|
|
8684
|
+
enabled: z118.boolean(),
|
|
8685
|
+
legacy: z118.boolean(),
|
|
8686
|
+
created: z118.string(),
|
|
8687
|
+
updated: z118.string(),
|
|
8688
|
+
includeInListing: z118.boolean(),
|
|
8689
|
+
clientId: z118.string(),
|
|
8690
|
+
clientSecret: z118.string(),
|
|
8691
|
+
authority: z118.string(),
|
|
8692
|
+
redirectUrl: z118.string(),
|
|
8693
|
+
serviceClient: z118.string(),
|
|
8694
|
+
googleProjectId: z118.string(),
|
|
8695
|
+
serviceClientEmail: z118.string(),
|
|
8696
|
+
serviceKey: z118.string()
|
|
8826
8697
|
});
|
|
8827
8698
|
|
|
8828
8699
|
// src/mail/schemas/message.schema.ts
|
|
8829
|
-
import
|
|
8830
|
-
var AttachmentSchema =
|
|
8831
|
-
id:
|
|
8832
|
-
createdAt:
|
|
8833
|
-
updatedAt:
|
|
8834
|
-
deletedAt:
|
|
8835
|
-
roomId:
|
|
8836
|
-
messageId:
|
|
8837
|
-
fileName:
|
|
8838
|
-
fileType:
|
|
8839
|
-
emailEngineAttachmentId:
|
|
8840
|
-
uploadId:
|
|
8841
|
-
upload:
|
|
8842
|
-
id:
|
|
8843
|
-
createdAt:
|
|
8844
|
-
updatedAt:
|
|
8845
|
-
deletedAt:
|
|
8846
|
-
bucketName:
|
|
8847
|
-
fileName:
|
|
8848
|
-
fileKey:
|
|
8849
|
-
fileSize:
|
|
8850
|
-
fileUrl:
|
|
8851
|
-
extensionName:
|
|
8700
|
+
import z119 from "zod";
|
|
8701
|
+
var AttachmentSchema = z119.object({
|
|
8702
|
+
id: z119.string(),
|
|
8703
|
+
createdAt: z119.date(),
|
|
8704
|
+
updatedAt: z119.date(),
|
|
8705
|
+
deletedAt: z119.nullable(z119.date()),
|
|
8706
|
+
roomId: z119.string(),
|
|
8707
|
+
messageId: z119.string(),
|
|
8708
|
+
fileName: z119.string(),
|
|
8709
|
+
fileType: z119.string(),
|
|
8710
|
+
emailEngineAttachmentId: z119.string(),
|
|
8711
|
+
uploadId: z119.string(),
|
|
8712
|
+
upload: z119.object({
|
|
8713
|
+
id: z119.string(),
|
|
8714
|
+
createdAt: z119.date(),
|
|
8715
|
+
updatedAt: z119.date(),
|
|
8716
|
+
deletedAt: z119.nullable(z119.date()),
|
|
8717
|
+
bucketName: z119.string(),
|
|
8718
|
+
fileName: z119.string(),
|
|
8719
|
+
fileKey: z119.string(),
|
|
8720
|
+
fileSize: z119.number(),
|
|
8721
|
+
fileUrl: z119.string(),
|
|
8722
|
+
extensionName: z119.string()
|
|
8852
8723
|
})
|
|
8853
8724
|
});
|
|
8854
|
-
var MessageSchema2 =
|
|
8855
|
-
id:
|
|
8856
|
-
createdAt:
|
|
8857
|
-
updatedAt:
|
|
8858
|
-
deletedAt:
|
|
8859
|
-
roomId:
|
|
8860
|
-
subject:
|
|
8861
|
-
textPlain:
|
|
8862
|
-
textHtml:
|
|
8863
|
-
textId:
|
|
8864
|
-
emailEngineEmailId:
|
|
8865
|
-
emailEngineMessageId:
|
|
8866
|
-
emailEngineReplyTo:
|
|
8867
|
-
direction:
|
|
8868
|
-
date:
|
|
8869
|
-
action:
|
|
8870
|
-
unseen:
|
|
8871
|
-
sendAt:
|
|
8872
|
-
starred:
|
|
8873
|
-
seemsLikeNew:
|
|
8874
|
-
from:
|
|
8875
|
-
to:
|
|
8876
|
-
cc:
|
|
8877
|
-
bcc:
|
|
8878
|
-
attachments:
|
|
8725
|
+
var MessageSchema2 = z119.object({
|
|
8726
|
+
id: z119.string(),
|
|
8727
|
+
createdAt: z119.date(),
|
|
8728
|
+
updatedAt: z119.date(),
|
|
8729
|
+
deletedAt: z119.nullable(z119.date()),
|
|
8730
|
+
roomId: z119.string(),
|
|
8731
|
+
subject: z119.string(),
|
|
8732
|
+
textPlain: z119.string(),
|
|
8733
|
+
textHtml: z119.string(),
|
|
8734
|
+
textId: z119.string(),
|
|
8735
|
+
emailEngineEmailId: z119.string(),
|
|
8736
|
+
emailEngineMessageId: z119.string(),
|
|
8737
|
+
emailEngineReplyTo: z119.nullable(z119.string()),
|
|
8738
|
+
direction: z119.string(),
|
|
8739
|
+
date: z119.date(),
|
|
8740
|
+
action: z119.string(),
|
|
8741
|
+
unseen: z119.boolean(),
|
|
8742
|
+
sendAt: z119.date(),
|
|
8743
|
+
starred: z119.boolean(),
|
|
8744
|
+
seemsLikeNew: z119.boolean(),
|
|
8745
|
+
from: z119.array(MailParticipant),
|
|
8746
|
+
to: z119.array(MailParticipant),
|
|
8747
|
+
cc: z119.array(MailParticipant),
|
|
8748
|
+
bcc: z119.array(MailParticipant),
|
|
8749
|
+
attachments: z119.array(AttachmentSchema)
|
|
8879
8750
|
});
|
|
8880
8751
|
|
|
8881
8752
|
// src/mail/schemas/room.schema.ts
|
|
8882
|
-
var ContactSchema3 =
|
|
8883
|
-
id:
|
|
8884
|
-
createdAt:
|
|
8885
|
-
updatedAt:
|
|
8886
|
-
deletedAt:
|
|
8887
|
-
name:
|
|
8888
|
-
address:
|
|
8889
|
-
channel:
|
|
8890
|
-
notes:
|
|
8891
|
-
contactProfile:
|
|
8892
|
-
socialProfileUrl:
|
|
8893
|
-
});
|
|
8894
|
-
var MailUserSchema =
|
|
8895
|
-
id:
|
|
8896
|
-
createdAt:
|
|
8897
|
-
updatedAt:
|
|
8898
|
-
deletedAt:
|
|
8899
|
-
name:
|
|
8900
|
-
address:
|
|
8901
|
-
contactId:
|
|
8753
|
+
var ContactSchema3 = z120.object({
|
|
8754
|
+
id: z120.string().uuid(),
|
|
8755
|
+
createdAt: z120.date(),
|
|
8756
|
+
updatedAt: z120.date(),
|
|
8757
|
+
deletedAt: z120.date().nullable(),
|
|
8758
|
+
name: z120.string(),
|
|
8759
|
+
address: z120.string().nullable(),
|
|
8760
|
+
channel: z120.string().nullable(),
|
|
8761
|
+
notes: z120.string().nullable(),
|
|
8762
|
+
contactProfile: z120.string().nullable(),
|
|
8763
|
+
socialProfileUrl: z120.string().nullable()
|
|
8764
|
+
});
|
|
8765
|
+
var MailUserSchema = z120.object({
|
|
8766
|
+
id: z120.string(),
|
|
8767
|
+
createdAt: z120.date(),
|
|
8768
|
+
updatedAt: z120.date(),
|
|
8769
|
+
deletedAt: z120.date().nullable(),
|
|
8770
|
+
name: z120.string(),
|
|
8771
|
+
address: z120.string(),
|
|
8772
|
+
contactId: z120.string(),
|
|
8902
8773
|
contact: ContactSchema3,
|
|
8903
|
-
isNewContact:
|
|
8904
|
-
});
|
|
8905
|
-
var MailParticipant =
|
|
8906
|
-
id:
|
|
8907
|
-
createdAt:
|
|
8908
|
-
updatedAt:
|
|
8909
|
-
deletedAt:
|
|
8910
|
-
roomId:
|
|
8911
|
-
messageId:
|
|
8912
|
-
mailUserId:
|
|
8774
|
+
isNewContact: z120.boolean()
|
|
8775
|
+
});
|
|
8776
|
+
var MailParticipant = z120.object({
|
|
8777
|
+
id: z120.string(),
|
|
8778
|
+
createdAt: z120.date(),
|
|
8779
|
+
updatedAt: z120.date(),
|
|
8780
|
+
deletedAt: z120.date().nullable(),
|
|
8781
|
+
roomId: z120.string(),
|
|
8782
|
+
messageId: z120.string(),
|
|
8783
|
+
mailUserId: z120.string(),
|
|
8913
8784
|
mailUser: MailUserSchema
|
|
8914
8785
|
});
|
|
8915
|
-
var TagSchema2 =
|
|
8916
|
-
color:
|
|
8917
|
-
id:
|
|
8918
|
-
createdAt:
|
|
8919
|
-
updatedAt:
|
|
8920
|
-
deletedAt:
|
|
8921
|
-
name:
|
|
8922
|
-
});
|
|
8923
|
-
var UserModel =
|
|
8924
|
-
id:
|
|
8925
|
-
createdAt:
|
|
8926
|
-
updatedAt:
|
|
8927
|
-
deletedAt:
|
|
8928
|
-
name:
|
|
8929
|
-
email:
|
|
8930
|
-
address:
|
|
8931
|
-
phone:
|
|
8932
|
-
notificationCount:
|
|
8933
|
-
});
|
|
8934
|
-
var ActivityLogModel =
|
|
8935
|
-
id:
|
|
8936
|
-
createdAt:
|
|
8937
|
-
updatedAt:
|
|
8938
|
-
deletedAt:
|
|
8939
|
-
description:
|
|
8940
|
-
actorId:
|
|
8941
|
-
roomId:
|
|
8786
|
+
var TagSchema2 = z120.object({
|
|
8787
|
+
color: z120.string(),
|
|
8788
|
+
id: z120.string(),
|
|
8789
|
+
createdAt: z120.date(),
|
|
8790
|
+
updatedAt: z120.date(),
|
|
8791
|
+
deletedAt: z120.date().nullable(),
|
|
8792
|
+
name: z120.string()
|
|
8793
|
+
});
|
|
8794
|
+
var UserModel = z120.object({
|
|
8795
|
+
id: z120.string().uuid(),
|
|
8796
|
+
createdAt: z120.date(),
|
|
8797
|
+
updatedAt: z120.date(),
|
|
8798
|
+
deletedAt: z120.date().nullable(),
|
|
8799
|
+
name: z120.string(),
|
|
8800
|
+
email: z120.string(),
|
|
8801
|
+
address: z120.string().nullable(),
|
|
8802
|
+
phone: z120.string().nullable(),
|
|
8803
|
+
notificationCount: z120.number().nullable()
|
|
8804
|
+
});
|
|
8805
|
+
var ActivityLogModel = z120.object({
|
|
8806
|
+
id: z120.string(),
|
|
8807
|
+
createdAt: z120.date(),
|
|
8808
|
+
updatedAt: z120.date(),
|
|
8809
|
+
deletedAt: z120.nullable(z120.string()),
|
|
8810
|
+
description: z120.string(),
|
|
8811
|
+
actorId: z120.string(),
|
|
8812
|
+
roomId: z120.string(),
|
|
8942
8813
|
actor: UserModel
|
|
8943
8814
|
});
|
|
8944
|
-
var MessagesAndLogsSchema =
|
|
8945
|
-
|
|
8815
|
+
var MessagesAndLogsSchema = z120.array(
|
|
8816
|
+
z120.union([MessageSchema2, ActivityLogModel])
|
|
8946
8817
|
);
|
|
8947
|
-
var MailRoomSchema =
|
|
8948
|
-
id:
|
|
8949
|
-
createdAt:
|
|
8950
|
-
updatedAt:
|
|
8951
|
-
deletedAt:
|
|
8952
|
-
subject:
|
|
8953
|
-
resolved:
|
|
8954
|
-
assigneeId:
|
|
8955
|
-
note:
|
|
8956
|
-
mailId:
|
|
8957
|
-
direction:
|
|
8958
|
-
lastMessageId:
|
|
8959
|
-
firstMessageId:
|
|
8960
|
-
from:
|
|
8961
|
-
to:
|
|
8962
|
-
cc:
|
|
8963
|
-
bcc:
|
|
8818
|
+
var MailRoomSchema = z120.object({
|
|
8819
|
+
id: z120.string(),
|
|
8820
|
+
createdAt: z120.date(),
|
|
8821
|
+
updatedAt: z120.date(),
|
|
8822
|
+
deletedAt: z120.date().nullable(),
|
|
8823
|
+
subject: z120.string(),
|
|
8824
|
+
resolved: z120.boolean(),
|
|
8825
|
+
assigneeId: z120.string().nullable(),
|
|
8826
|
+
note: z120.string(),
|
|
8827
|
+
mailId: z120.string(),
|
|
8828
|
+
direction: z120.string(),
|
|
8829
|
+
lastMessageId: z120.string(),
|
|
8830
|
+
firstMessageId: z120.string(),
|
|
8831
|
+
from: z120.array(MailParticipant),
|
|
8832
|
+
to: z120.array(MailParticipant),
|
|
8833
|
+
cc: z120.array(MailParticipant),
|
|
8834
|
+
bcc: z120.array(MailParticipant),
|
|
8964
8835
|
firstMessage: MessageSchema2,
|
|
8965
8836
|
lastMessage: MessageSchema2,
|
|
8966
|
-
tags:
|
|
8837
|
+
tags: z120.array(TagSchema2),
|
|
8967
8838
|
assignee: UserModel,
|
|
8968
|
-
messages:
|
|
8839
|
+
messages: z120.array(MessageSchema2),
|
|
8969
8840
|
messagesAndLogs: MessagesAndLogsSchema,
|
|
8970
8841
|
mail: MailAccountSchema,
|
|
8971
|
-
unReadMessageCount:
|
|
8842
|
+
unReadMessageCount: z120.number(),
|
|
8972
8843
|
cxlog: CxLogSchema
|
|
8973
8844
|
});
|
|
8974
|
-
var AttachmentSchema2 =
|
|
8975
|
-
fileName:
|
|
8976
|
-
fileType:
|
|
8977
|
-
emailEngineAttachmentId:
|
|
8978
|
-
uploadId:
|
|
8979
|
-
messageId:
|
|
8980
|
-
roomId:
|
|
8845
|
+
var AttachmentSchema2 = z120.object({
|
|
8846
|
+
fileName: z120.string(),
|
|
8847
|
+
fileType: z120.string(),
|
|
8848
|
+
emailEngineAttachmentId: z120.string(),
|
|
8849
|
+
uploadId: z120.string(),
|
|
8850
|
+
messageId: z120.string(),
|
|
8851
|
+
roomId: z120.string(),
|
|
8981
8852
|
upload: UploadSchema
|
|
8982
8853
|
});
|
|
8983
8854
|
|
|
8984
8855
|
// src/mail/schemas/room-validation.schema.ts
|
|
8985
|
-
import
|
|
8856
|
+
import z121 from "zod";
|
|
8986
8857
|
var RoomContractsValidationSchema = {
|
|
8987
8858
|
getAll: {
|
|
8988
|
-
input:
|
|
8989
|
-
page:
|
|
8990
|
-
pageSize:
|
|
8991
|
-
keyword:
|
|
8992
|
-
value:
|
|
8993
|
-
category:
|
|
8859
|
+
input: z121.object({
|
|
8860
|
+
page: z121.coerce.number().default(1),
|
|
8861
|
+
pageSize: z121.coerce.number().default(10),
|
|
8862
|
+
keyword: z121.object({
|
|
8863
|
+
value: z121.string(),
|
|
8864
|
+
category: z121.union([z121.literal("contact"), z121.literal("message")])
|
|
8994
8865
|
}).optional(),
|
|
8995
|
-
contactLabels:
|
|
8996
|
-
channels:
|
|
8997
|
-
date:
|
|
8998
|
-
contacts:
|
|
8999
|
-
assignees:
|
|
9000
|
-
level1:
|
|
9001
|
-
|
|
9002
|
-
|
|
9003
|
-
|
|
9004
|
-
|
|
9005
|
-
|
|
9006
|
-
|
|
8866
|
+
contactLabels: z121.array(z121.string()).optional(),
|
|
8867
|
+
channels: z121.array(z121.string().email()).optional(),
|
|
8868
|
+
date: z121.string().optional(),
|
|
8869
|
+
contacts: z121.array(z121.string()).optional(),
|
|
8870
|
+
assignees: z121.array(z121.string()).optional(),
|
|
8871
|
+
level1: z121.union([
|
|
8872
|
+
z121.literal("open"),
|
|
8873
|
+
z121.literal("close"),
|
|
8874
|
+
z121.literal("inbox"),
|
|
8875
|
+
z121.literal("sent"),
|
|
8876
|
+
z121.literal("scheduled"),
|
|
8877
|
+
z121.literal("starred")
|
|
9007
8878
|
]).optional(),
|
|
9008
|
-
level2:
|
|
9009
|
-
|
|
9010
|
-
|
|
9011
|
-
|
|
9012
|
-
|
|
8879
|
+
level2: z121.union([
|
|
8880
|
+
z121.literal("all"),
|
|
8881
|
+
z121.literal("unassign"),
|
|
8882
|
+
z121.literal("mine"),
|
|
8883
|
+
z121.literal("other")
|
|
9013
8884
|
]).optional()
|
|
9014
8885
|
}),
|
|
9015
|
-
output:
|
|
9016
|
-
data:
|
|
9017
|
-
total:
|
|
9018
|
-
page:
|
|
9019
|
-
pageSize:
|
|
8886
|
+
output: z121.object({
|
|
8887
|
+
data: z121.array(MailRoomSchema),
|
|
8888
|
+
total: z121.number(),
|
|
8889
|
+
page: z121.number(),
|
|
8890
|
+
pageSize: z121.number()
|
|
9020
8891
|
})
|
|
9021
8892
|
},
|
|
9022
8893
|
update: {
|
|
9023
|
-
input:
|
|
9024
|
-
disposition:
|
|
9025
|
-
|
|
9026
|
-
|
|
9027
|
-
|
|
9028
|
-
|
|
9029
|
-
|
|
9030
|
-
|
|
8894
|
+
input: z121.object({
|
|
8895
|
+
disposition: z121.union([
|
|
8896
|
+
z121.literal("resolved"),
|
|
8897
|
+
z121.literal("follow up"),
|
|
8898
|
+
z121.literal("escalated"),
|
|
8899
|
+
z121.literal("dropped"),
|
|
8900
|
+
z121.literal("prank"),
|
|
8901
|
+
z121.literal("blank")
|
|
9031
8902
|
]).optional().nullable(),
|
|
9032
|
-
assigneeId:
|
|
9033
|
-
note:
|
|
9034
|
-
tags:
|
|
9035
|
-
handover:
|
|
9036
|
-
|
|
8903
|
+
assigneeId: z121.string().uuid().optional().nullable(),
|
|
8904
|
+
note: z121.string().optional(),
|
|
8905
|
+
tags: z121.array(z121.string().uuid()).optional(),
|
|
8906
|
+
handover: z121.boolean().or(
|
|
8907
|
+
z121.union([z121.literal("true"), z121.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
|
9037
8908
|
).optional().nullable(),
|
|
9038
|
-
selfAssign:
|
|
9039
|
-
|
|
8909
|
+
selfAssign: z121.boolean().or(
|
|
8910
|
+
z121.union([z121.literal("true"), z121.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
|
9040
8911
|
).optional().nullable()
|
|
9041
8912
|
})
|
|
9042
8913
|
}
|
|
9043
8914
|
};
|
|
9044
8915
|
|
|
9045
8916
|
// src/mail/room-contract.ts
|
|
9046
|
-
var roomContract =
|
|
8917
|
+
var roomContract = initContract46().router(
|
|
9047
8918
|
{
|
|
9048
8919
|
create: {
|
|
9049
8920
|
method: "POST",
|
|
9050
8921
|
path: "/",
|
|
9051
8922
|
responses: {
|
|
9052
8923
|
200: DefaultSuccessResponseSchema.extend({
|
|
9053
|
-
message:
|
|
8924
|
+
message: z122.string()
|
|
9054
8925
|
}),
|
|
9055
8926
|
...DefaultResponses
|
|
9056
8927
|
},
|
|
@@ -9063,10 +8934,10 @@ var roomContract = initContract47().router(
|
|
|
9063
8934
|
query: RoomContractsValidationSchema.getAll.input,
|
|
9064
8935
|
responses: {
|
|
9065
8936
|
200: DefaultSuccessResponseSchema.extend({
|
|
9066
|
-
data:
|
|
9067
|
-
total:
|
|
9068
|
-
page:
|
|
9069
|
-
pageSize:
|
|
8937
|
+
data: z122.array(MailRoomSchema),
|
|
8938
|
+
total: z122.number(),
|
|
8939
|
+
page: z122.number(),
|
|
8940
|
+
pageSize: z122.number()
|
|
9070
8941
|
}),
|
|
9071
8942
|
...DefaultResponses
|
|
9072
8943
|
},
|
|
@@ -9078,24 +8949,24 @@ var roomContract = initContract47().router(
|
|
|
9078
8949
|
path: "/count_rooms/all",
|
|
9079
8950
|
responses: {
|
|
9080
8951
|
200: DefaultSuccessResponseSchema.extend({
|
|
9081
|
-
data:
|
|
9082
|
-
general:
|
|
9083
|
-
|
|
9084
|
-
name:
|
|
9085
|
-
count:
|
|
9086
|
-
unReadMessagesCount:
|
|
8952
|
+
data: z122.object({
|
|
8953
|
+
general: z122.array(
|
|
8954
|
+
z122.object({
|
|
8955
|
+
name: z122.string(),
|
|
8956
|
+
count: z122.number(),
|
|
8957
|
+
unReadMessagesCount: z122.number()
|
|
9087
8958
|
})
|
|
9088
8959
|
),
|
|
9089
|
-
channels:
|
|
9090
|
-
|
|
8960
|
+
channels: z122.array(
|
|
8961
|
+
z122.object({
|
|
9091
8962
|
channel: MailAccountSchema,
|
|
9092
|
-
count:
|
|
8963
|
+
count: z122.number()
|
|
9093
8964
|
})
|
|
9094
8965
|
),
|
|
9095
|
-
contactLabels:
|
|
9096
|
-
|
|
8966
|
+
contactLabels: z122.array(
|
|
8967
|
+
z122.object({
|
|
9097
8968
|
label: TagSchema,
|
|
9098
|
-
count:
|
|
8969
|
+
count: z122.number()
|
|
9099
8970
|
})
|
|
9100
8971
|
)
|
|
9101
8972
|
})
|
|
@@ -9107,12 +8978,12 @@ var roomContract = initContract47().router(
|
|
|
9107
8978
|
getAttachments: {
|
|
9108
8979
|
method: "GET",
|
|
9109
8980
|
path: "/:id/attachments",
|
|
9110
|
-
pathParams:
|
|
9111
|
-
id:
|
|
8981
|
+
pathParams: z122.object({
|
|
8982
|
+
id: z122.string().uuid()
|
|
9112
8983
|
}),
|
|
9113
8984
|
responses: {
|
|
9114
8985
|
200: DefaultSuccessResponseSchema.extend({
|
|
9115
|
-
data:
|
|
8986
|
+
data: z122.array(AttachmentSchema2)
|
|
9116
8987
|
}),
|
|
9117
8988
|
...DefaultResponses
|
|
9118
8989
|
},
|
|
@@ -9121,12 +8992,12 @@ var roomContract = initContract47().router(
|
|
|
9121
8992
|
getParticipants: {
|
|
9122
8993
|
method: "GET",
|
|
9123
8994
|
path: "/:id/participants",
|
|
9124
|
-
pathParams:
|
|
9125
|
-
id:
|
|
8995
|
+
pathParams: z122.object({
|
|
8996
|
+
id: z122.string().uuid()
|
|
9126
8997
|
}),
|
|
9127
8998
|
responses: {
|
|
9128
8999
|
200: DefaultSuccessResponseSchema.extend({
|
|
9129
|
-
data:
|
|
9000
|
+
data: z122.array(MailParticipant)
|
|
9130
9001
|
}),
|
|
9131
9002
|
...DefaultResponses
|
|
9132
9003
|
},
|
|
@@ -9137,22 +9008,22 @@ var roomContract = initContract47().router(
|
|
|
9137
9008
|
path: "/add_email_to_contact",
|
|
9138
9009
|
responses: {
|
|
9139
9010
|
200: DefaultSuccessResponseSchema.extend({
|
|
9140
|
-
data:
|
|
9011
|
+
data: z122.string()
|
|
9141
9012
|
}),
|
|
9142
9013
|
...DefaultResponses
|
|
9143
9014
|
},
|
|
9144
|
-
body:
|
|
9145
|
-
email:
|
|
9146
|
-
contactId:
|
|
9147
|
-
mailUserId:
|
|
9015
|
+
body: z122.object({
|
|
9016
|
+
email: z122.string(),
|
|
9017
|
+
contactId: z122.string(),
|
|
9018
|
+
mailUserId: z122.string()
|
|
9148
9019
|
}),
|
|
9149
9020
|
summary: "Add a new email of a mail room participant to an existing contact"
|
|
9150
9021
|
},
|
|
9151
9022
|
update: {
|
|
9152
9023
|
method: "PATCH",
|
|
9153
9024
|
path: "/:id",
|
|
9154
|
-
pathParams:
|
|
9155
|
-
id:
|
|
9025
|
+
pathParams: z122.object({
|
|
9026
|
+
id: z122.string()
|
|
9156
9027
|
}),
|
|
9157
9028
|
responses: {
|
|
9158
9029
|
200: DefaultSuccessResponseSchema.extend({
|
|
@@ -9166,12 +9037,12 @@ var roomContract = initContract47().router(
|
|
|
9166
9037
|
markAsRead: {
|
|
9167
9038
|
method: "POST",
|
|
9168
9039
|
path: "/mark_as_read",
|
|
9169
|
-
body:
|
|
9170
|
-
id:
|
|
9040
|
+
body: z122.object({
|
|
9041
|
+
id: z122.string()
|
|
9171
9042
|
}),
|
|
9172
9043
|
responses: {
|
|
9173
9044
|
200: DefaultSuccessResponseSchema.extend({
|
|
9174
|
-
message:
|
|
9045
|
+
message: z122.string()
|
|
9175
9046
|
}),
|
|
9176
9047
|
...DefaultResponses
|
|
9177
9048
|
},
|
|
@@ -9180,8 +9051,8 @@ var roomContract = initContract47().router(
|
|
|
9180
9051
|
getById: {
|
|
9181
9052
|
method: "GET",
|
|
9182
9053
|
path: "/:id",
|
|
9183
|
-
pathParams:
|
|
9184
|
-
id:
|
|
9054
|
+
pathParams: z122.object({
|
|
9055
|
+
id: z122.string().uuid()
|
|
9185
9056
|
}),
|
|
9186
9057
|
responses: {
|
|
9187
9058
|
200: DefaultSuccessResponseSchema.extend({
|
|
@@ -9198,78 +9069,78 @@ var roomContract = initContract47().router(
|
|
|
9198
9069
|
);
|
|
9199
9070
|
|
|
9200
9071
|
// src/mail/account-contract.ts
|
|
9201
|
-
import { initContract as
|
|
9202
|
-
import
|
|
9072
|
+
import { initContract as initContract47 } from "@ts-rest/core";
|
|
9073
|
+
import z124 from "zod";
|
|
9203
9074
|
|
|
9204
9075
|
// src/mail/schemas/account-validation.schema.ts
|
|
9205
|
-
import
|
|
9076
|
+
import z123 from "zod";
|
|
9206
9077
|
var AccountContractsValidationSchemas = {
|
|
9207
9078
|
create: {
|
|
9208
|
-
input:
|
|
9209
|
-
address:
|
|
9210
|
-
name:
|
|
9211
|
-
password:
|
|
9212
|
-
mailServerId:
|
|
9079
|
+
input: z123.object({
|
|
9080
|
+
address: z123.string().min(1, "Email address cannot be empty.").email("Invalid email address."),
|
|
9081
|
+
name: z123.string().min(1, "Account name cannot be empty."),
|
|
9082
|
+
password: z123.string().min(1, "Password cannot be empty."),
|
|
9083
|
+
mailServerId: z123.string().uuid("Invalid mail_server_id")
|
|
9213
9084
|
})
|
|
9214
9085
|
},
|
|
9215
9086
|
getById: {
|
|
9216
|
-
input:
|
|
9217
|
-
id:
|
|
9087
|
+
input: z123.object({
|
|
9088
|
+
id: z123.string().uuid()
|
|
9218
9089
|
}),
|
|
9219
9090
|
output: MailAccountSchema
|
|
9220
9091
|
},
|
|
9221
9092
|
getAll: {
|
|
9222
|
-
output:
|
|
9093
|
+
output: z123.array(MailAccountSchema)
|
|
9223
9094
|
},
|
|
9224
9095
|
update: {
|
|
9225
9096
|
input: MailAccountSchema,
|
|
9226
9097
|
output: MailAccountSchema
|
|
9227
9098
|
},
|
|
9228
9099
|
disconnect: {
|
|
9229
|
-
input:
|
|
9230
|
-
id:
|
|
9100
|
+
input: z123.object({
|
|
9101
|
+
id: z123.string().uuid()
|
|
9231
9102
|
}),
|
|
9232
9103
|
output: MailAccountSchema
|
|
9233
9104
|
},
|
|
9234
9105
|
reconnect: {
|
|
9235
|
-
input:
|
|
9236
|
-
id:
|
|
9106
|
+
input: z123.object({
|
|
9107
|
+
id: z123.string()
|
|
9237
9108
|
}),
|
|
9238
9109
|
output: MailAccountSchema
|
|
9239
9110
|
},
|
|
9240
9111
|
delete: {
|
|
9241
|
-
input:
|
|
9242
|
-
id:
|
|
9112
|
+
input: z123.object({
|
|
9113
|
+
id: z123.string()
|
|
9243
9114
|
}),
|
|
9244
|
-
output:
|
|
9115
|
+
output: z123.string()
|
|
9245
9116
|
},
|
|
9246
9117
|
deleteEmailEngineAcc: {
|
|
9247
|
-
input:
|
|
9248
|
-
account:
|
|
9118
|
+
input: z123.object({
|
|
9119
|
+
account: z123.string()
|
|
9249
9120
|
}),
|
|
9250
9121
|
output: MailAccountSchema
|
|
9251
9122
|
},
|
|
9252
9123
|
generateOAuth2AuthenticationLink: {
|
|
9253
|
-
body:
|
|
9254
|
-
oAuth2AppId:
|
|
9255
|
-
mailServerId:
|
|
9124
|
+
body: z123.object({
|
|
9125
|
+
oAuth2AppId: z123.string(),
|
|
9126
|
+
mailServerId: z123.string()
|
|
9256
9127
|
}),
|
|
9257
|
-
response:
|
|
9258
|
-
url:
|
|
9259
|
-
account:
|
|
9128
|
+
response: z123.object({
|
|
9129
|
+
url: z123.string(),
|
|
9130
|
+
account: z123.string()
|
|
9260
9131
|
})
|
|
9261
9132
|
},
|
|
9262
9133
|
createOAuth2Acc: {
|
|
9263
|
-
body:
|
|
9264
|
-
account:
|
|
9265
|
-
name:
|
|
9134
|
+
body: z123.object({
|
|
9135
|
+
account: z123.string(),
|
|
9136
|
+
name: z123.string()
|
|
9266
9137
|
}),
|
|
9267
9138
|
response: MailAccountSchema
|
|
9268
9139
|
}
|
|
9269
9140
|
};
|
|
9270
9141
|
|
|
9271
9142
|
// src/mail/account-contract.ts
|
|
9272
|
-
var accountContract =
|
|
9143
|
+
var accountContract = initContract47().router(
|
|
9273
9144
|
{
|
|
9274
9145
|
//#region ........register account
|
|
9275
9146
|
create: {
|
|
@@ -9280,14 +9151,14 @@ var accountContract = initContract48().router(
|
|
|
9280
9151
|
// data: AccountContractsValidationSchemas.create.output,
|
|
9281
9152
|
data: MailAccountSchema
|
|
9282
9153
|
}),
|
|
9283
|
-
400:
|
|
9284
|
-
message:
|
|
9154
|
+
400: z124.object({
|
|
9155
|
+
message: z124.string()
|
|
9285
9156
|
}),
|
|
9286
|
-
409:
|
|
9287
|
-
message:
|
|
9157
|
+
409: z124.object({
|
|
9158
|
+
message: z124.string()
|
|
9288
9159
|
}),
|
|
9289
|
-
500:
|
|
9290
|
-
message:
|
|
9160
|
+
500: z124.object({
|
|
9161
|
+
message: z124.string()
|
|
9291
9162
|
}),
|
|
9292
9163
|
...DefaultResponses
|
|
9293
9164
|
},
|
|
@@ -9303,14 +9174,14 @@ var accountContract = initContract48().router(
|
|
|
9303
9174
|
201: DefaultSuccessResponseSchema.extend({
|
|
9304
9175
|
data: AccountContractsValidationSchemas.generateOAuth2AuthenticationLink.response
|
|
9305
9176
|
}),
|
|
9306
|
-
400:
|
|
9307
|
-
message:
|
|
9177
|
+
400: z124.object({
|
|
9178
|
+
message: z124.string()
|
|
9308
9179
|
}),
|
|
9309
|
-
409:
|
|
9310
|
-
message:
|
|
9180
|
+
409: z124.object({
|
|
9181
|
+
message: z124.string()
|
|
9311
9182
|
}),
|
|
9312
|
-
500:
|
|
9313
|
-
message:
|
|
9183
|
+
500: z124.object({
|
|
9184
|
+
message: z124.string()
|
|
9314
9185
|
}),
|
|
9315
9186
|
...DefaultResponses
|
|
9316
9187
|
},
|
|
@@ -9324,7 +9195,7 @@ var accountContract = initContract48().router(
|
|
|
9324
9195
|
path: "/sync",
|
|
9325
9196
|
responses: {
|
|
9326
9197
|
200: DefaultSuccessResponseSchema.extend({
|
|
9327
|
-
message:
|
|
9198
|
+
message: z124.string()
|
|
9328
9199
|
}),
|
|
9329
9200
|
...DefaultResponses
|
|
9330
9201
|
},
|
|
@@ -9349,13 +9220,13 @@ var accountContract = initContract48().router(
|
|
|
9349
9220
|
getAll: {
|
|
9350
9221
|
method: "GET",
|
|
9351
9222
|
path: "",
|
|
9352
|
-
query:
|
|
9353
|
-
state:
|
|
9354
|
-
withDeleted:
|
|
9223
|
+
query: z124.object({
|
|
9224
|
+
state: z124.union([z124.literal("connected"), z124.literal("disconnected")]).optional(),
|
|
9225
|
+
withDeleted: z124.boolean().default(false)
|
|
9355
9226
|
}).optional(),
|
|
9356
9227
|
responses: {
|
|
9357
9228
|
200: DefaultSuccessResponseSchema.extend({
|
|
9358
|
-
data:
|
|
9229
|
+
data: z124.array(MailAccountSchema)
|
|
9359
9230
|
}),
|
|
9360
9231
|
...DefaultResponses
|
|
9361
9232
|
},
|
|
@@ -9366,8 +9237,8 @@ var accountContract = initContract48().router(
|
|
|
9366
9237
|
update: {
|
|
9367
9238
|
method: "PATCH",
|
|
9368
9239
|
path: "/:id",
|
|
9369
|
-
pathParams:
|
|
9370
|
-
id:
|
|
9240
|
+
pathParams: z124.object({
|
|
9241
|
+
id: z124.string().uuid()
|
|
9371
9242
|
}),
|
|
9372
9243
|
responses: {
|
|
9373
9244
|
201: DefaultSuccessResponseSchema.extend({
|
|
@@ -9416,7 +9287,7 @@ var accountContract = initContract48().router(
|
|
|
9416
9287
|
pathParams: AccountContractsValidationSchemas.delete.input,
|
|
9417
9288
|
responses: {
|
|
9418
9289
|
200: DefaultSuccessResponseSchema.extend({
|
|
9419
|
-
message:
|
|
9290
|
+
message: z124.string()
|
|
9420
9291
|
}),
|
|
9421
9292
|
...DefaultResponses
|
|
9422
9293
|
},
|
|
@@ -9431,7 +9302,7 @@ var accountContract = initContract48().router(
|
|
|
9431
9302
|
pathParams: AccountContractsValidationSchemas.deleteEmailEngineAcc.input,
|
|
9432
9303
|
responses: {
|
|
9433
9304
|
200: DefaultSuccessResponseSchema.extend({
|
|
9434
|
-
message:
|
|
9305
|
+
message: z124.string()
|
|
9435
9306
|
}),
|
|
9436
9307
|
...DefaultResponses
|
|
9437
9308
|
},
|
|
@@ -9459,25 +9330,25 @@ var accountContract = initContract48().router(
|
|
|
9459
9330
|
);
|
|
9460
9331
|
|
|
9461
9332
|
// src/mail/mail-server-contract.ts
|
|
9462
|
-
import { initContract as
|
|
9463
|
-
import
|
|
9333
|
+
import { initContract as initContract48 } from "@ts-rest/core";
|
|
9334
|
+
import z126 from "zod";
|
|
9464
9335
|
|
|
9465
9336
|
// src/mail/schemas/servers-validation.schema.ts
|
|
9466
|
-
import
|
|
9467
|
-
var CreateMailServerSchema =
|
|
9468
|
-
name:
|
|
9469
|
-
smtpHost:
|
|
9470
|
-
smtpPort:
|
|
9471
|
-
smtpTlsPort:
|
|
9472
|
-
useTlsForSmtp:
|
|
9473
|
-
imapHost:
|
|
9474
|
-
imapPort:
|
|
9475
|
-
imapTlsPort:
|
|
9476
|
-
useTlsForImap:
|
|
9337
|
+
import z125 from "zod";
|
|
9338
|
+
var CreateMailServerSchema = z125.object({
|
|
9339
|
+
name: z125.string(),
|
|
9340
|
+
smtpHost: z125.string(),
|
|
9341
|
+
smtpPort: z125.number(),
|
|
9342
|
+
smtpTlsPort: z125.number(),
|
|
9343
|
+
useTlsForSmtp: z125.boolean(),
|
|
9344
|
+
imapHost: z125.string(),
|
|
9345
|
+
imapPort: z125.number(),
|
|
9346
|
+
imapTlsPort: z125.number(),
|
|
9347
|
+
useTlsForImap: z125.boolean()
|
|
9477
9348
|
});
|
|
9478
9349
|
|
|
9479
9350
|
// src/mail/mail-server-contract.ts
|
|
9480
|
-
var serverContract =
|
|
9351
|
+
var serverContract = initContract48().router(
|
|
9481
9352
|
{
|
|
9482
9353
|
create: {
|
|
9483
9354
|
method: "POST",
|
|
@@ -9496,11 +9367,11 @@ var serverContract = initContract49().router(
|
|
|
9496
9367
|
path: "/oauth2/apps",
|
|
9497
9368
|
responses: {
|
|
9498
9369
|
200: DefaultSuccessResponseSchema.extend({
|
|
9499
|
-
data:
|
|
9500
|
-
total:
|
|
9501
|
-
pages:
|
|
9502
|
-
page:
|
|
9503
|
-
apps:
|
|
9370
|
+
data: z126.object({
|
|
9371
|
+
total: z126.number(),
|
|
9372
|
+
pages: z126.number(),
|
|
9373
|
+
page: z126.number(),
|
|
9374
|
+
apps: z126.array(OAuth2AppSchema)
|
|
9504
9375
|
})
|
|
9505
9376
|
}),
|
|
9506
9377
|
...DefaultResponses
|
|
@@ -9510,8 +9381,8 @@ var serverContract = initContract49().router(
|
|
|
9510
9381
|
getById: {
|
|
9511
9382
|
method: "GET",
|
|
9512
9383
|
path: "/:id",
|
|
9513
|
-
pathParams:
|
|
9514
|
-
id:
|
|
9384
|
+
pathParams: z126.object({
|
|
9385
|
+
id: z126.string().uuid()
|
|
9515
9386
|
}),
|
|
9516
9387
|
responses: {
|
|
9517
9388
|
200: DefaultSuccessResponseSchema.extend({
|
|
@@ -9526,7 +9397,7 @@ var serverContract = initContract49().router(
|
|
|
9526
9397
|
path: "/",
|
|
9527
9398
|
responses: {
|
|
9528
9399
|
200: DefaultSuccessResponseSchema.extend({
|
|
9529
|
-
data:
|
|
9400
|
+
data: z126.array(MailServerSchema)
|
|
9530
9401
|
}),
|
|
9531
9402
|
...DefaultResponses
|
|
9532
9403
|
},
|
|
@@ -9535,8 +9406,8 @@ var serverContract = initContract49().router(
|
|
|
9535
9406
|
update: {
|
|
9536
9407
|
method: "PATCH",
|
|
9537
9408
|
path: "/:id",
|
|
9538
|
-
pathParams:
|
|
9539
|
-
id:
|
|
9409
|
+
pathParams: z126.object({
|
|
9410
|
+
id: z126.string().uuid()
|
|
9540
9411
|
}),
|
|
9541
9412
|
responses: {
|
|
9542
9413
|
200: DefaultSuccessResponseSchema.extend({
|
|
@@ -9550,8 +9421,8 @@ var serverContract = initContract49().router(
|
|
|
9550
9421
|
delete: {
|
|
9551
9422
|
method: "DELETE",
|
|
9552
9423
|
path: "/:id",
|
|
9553
|
-
pathParams:
|
|
9554
|
-
id:
|
|
9424
|
+
pathParams: z126.object({
|
|
9425
|
+
id: z126.string().uuid()
|
|
9555
9426
|
}),
|
|
9556
9427
|
responses: {
|
|
9557
9428
|
200: DefaultSuccessResponseSchema.extend({
|
|
@@ -9569,52 +9440,52 @@ var serverContract = initContract49().router(
|
|
|
9569
9440
|
);
|
|
9570
9441
|
|
|
9571
9442
|
// src/mail/message-contract.ts
|
|
9572
|
-
import { initContract as
|
|
9573
|
-
import
|
|
9443
|
+
import { initContract as initContract49 } from "@ts-rest/core";
|
|
9444
|
+
import z128 from "zod";
|
|
9574
9445
|
|
|
9575
9446
|
// src/mail/schemas/message-validation.schema.ts
|
|
9576
|
-
import
|
|
9577
|
-
var MailParticipant2 =
|
|
9578
|
-
name:
|
|
9579
|
-
address:
|
|
9447
|
+
import z127 from "zod";
|
|
9448
|
+
var MailParticipant2 = z127.object({
|
|
9449
|
+
name: z127.string().optional(),
|
|
9450
|
+
address: z127.string().email()
|
|
9580
9451
|
});
|
|
9581
9452
|
var MessageContractsValidationsSchema = {
|
|
9582
9453
|
submit: {
|
|
9583
|
-
input:
|
|
9584
|
-
subject:
|
|
9585
|
-
text:
|
|
9586
|
-
html:
|
|
9454
|
+
input: z127.object({
|
|
9455
|
+
subject: z127.string(),
|
|
9456
|
+
text: z127.string(),
|
|
9457
|
+
html: z127.string(),
|
|
9587
9458
|
from: MailParticipant2,
|
|
9588
9459
|
to: MailParticipant2,
|
|
9589
|
-
cc:
|
|
9590
|
-
bcc:
|
|
9591
|
-
sendAt:
|
|
9592
|
-
reference:
|
|
9593
|
-
messageId:
|
|
9594
|
-
action:
|
|
9460
|
+
cc: z127.array(MailParticipant2).optional(),
|
|
9461
|
+
bcc: z127.array(MailParticipant2).optional(),
|
|
9462
|
+
sendAt: z127.string().optional(),
|
|
9463
|
+
reference: z127.object({
|
|
9464
|
+
messageId: z127.string(),
|
|
9465
|
+
action: z127.union([z127.literal("reply"), z127.literal("forward")])
|
|
9595
9466
|
}).optional(),
|
|
9596
|
-
attachments:
|
|
9597
|
-
|
|
9598
|
-
fileType:
|
|
9599
|
-
fileName:
|
|
9600
|
-
fileKey:
|
|
9601
|
-
fileSize:
|
|
9602
|
-
bucketName:
|
|
9603
|
-
presignedUrl:
|
|
9467
|
+
attachments: z127.array(
|
|
9468
|
+
z127.object({
|
|
9469
|
+
fileType: z127.string(),
|
|
9470
|
+
fileName: z127.string(),
|
|
9471
|
+
fileKey: z127.string(),
|
|
9472
|
+
fileSize: z127.number(),
|
|
9473
|
+
bucketName: z127.string(),
|
|
9474
|
+
presignedUrl: z127.string()
|
|
9604
9475
|
})
|
|
9605
9476
|
).optional()
|
|
9606
9477
|
}),
|
|
9607
|
-
output:
|
|
9608
|
-
response:
|
|
9609
|
-
messageId:
|
|
9610
|
-
sendAt:
|
|
9611
|
-
queueId:
|
|
9478
|
+
output: z127.object({
|
|
9479
|
+
response: z127.string(),
|
|
9480
|
+
messageId: z127.string(),
|
|
9481
|
+
sendAt: z127.string(),
|
|
9482
|
+
queueId: z127.string()
|
|
9612
9483
|
})
|
|
9613
9484
|
}
|
|
9614
9485
|
};
|
|
9615
9486
|
|
|
9616
9487
|
// src/mail/message-contract.ts
|
|
9617
|
-
var messageContract =
|
|
9488
|
+
var messageContract = initContract49().router(
|
|
9618
9489
|
{
|
|
9619
9490
|
submit: {
|
|
9620
9491
|
method: "POST",
|
|
@@ -9637,8 +9508,8 @@ var messageContract = initContract50().router(
|
|
|
9637
9508
|
path: "/new_message_count",
|
|
9638
9509
|
responses: {
|
|
9639
9510
|
200: DefaultSuccessResponseSchema.extend({
|
|
9640
|
-
data:
|
|
9641
|
-
count:
|
|
9511
|
+
data: z128.object({
|
|
9512
|
+
count: z128.number()
|
|
9642
9513
|
})
|
|
9643
9514
|
}),
|
|
9644
9515
|
...DefaultResponses
|
|
@@ -9650,8 +9521,8 @@ var messageContract = initContract50().router(
|
|
|
9650
9521
|
getById: {
|
|
9651
9522
|
method: "GET",
|
|
9652
9523
|
path: "/:id",
|
|
9653
|
-
pathParams:
|
|
9654
|
-
id:
|
|
9524
|
+
pathParams: z128.object({
|
|
9525
|
+
id: z128.string()
|
|
9655
9526
|
}),
|
|
9656
9527
|
responses: {
|
|
9657
9528
|
200: DefaultSuccessResponseSchema.extend({
|
|
@@ -9666,8 +9537,8 @@ var messageContract = initContract50().router(
|
|
|
9666
9537
|
update: {
|
|
9667
9538
|
method: "PATCH",
|
|
9668
9539
|
path: "/:id",
|
|
9669
|
-
pathParams:
|
|
9670
|
-
id:
|
|
9540
|
+
pathParams: z128.object({
|
|
9541
|
+
id: z128.string()
|
|
9671
9542
|
}),
|
|
9672
9543
|
responses: {
|
|
9673
9544
|
200: DefaultSuccessResponseSchema.extend({
|
|
@@ -9683,8 +9554,8 @@ var messageContract = initContract50().router(
|
|
|
9683
9554
|
delete: {
|
|
9684
9555
|
method: "DELETE",
|
|
9685
9556
|
path: "/:id",
|
|
9686
|
-
pathParams:
|
|
9687
|
-
id:
|
|
9557
|
+
pathParams: z128.object({
|
|
9558
|
+
id: z128.string()
|
|
9688
9559
|
}),
|
|
9689
9560
|
responses: {
|
|
9690
9561
|
200: DefaultSuccessResponseSchema.extend({
|
|
@@ -9700,13 +9571,13 @@ var messageContract = initContract50().router(
|
|
|
9700
9571
|
cancelScheduledMessage: {
|
|
9701
9572
|
method: "DELETE",
|
|
9702
9573
|
path: "/scheduled_message/:id",
|
|
9703
|
-
pathParams:
|
|
9704
|
-
id:
|
|
9574
|
+
pathParams: z128.object({
|
|
9575
|
+
id: z128.string()
|
|
9705
9576
|
}),
|
|
9706
9577
|
responses: {
|
|
9707
9578
|
200: DefaultSuccessResponseSchema.extend({
|
|
9708
|
-
data:
|
|
9709
|
-
totalMessagesCount:
|
|
9579
|
+
data: z128.object({
|
|
9580
|
+
totalMessagesCount: z128.number()
|
|
9710
9581
|
})
|
|
9711
9582
|
}),
|
|
9712
9583
|
...DefaultResponses
|
|
@@ -9722,7 +9593,7 @@ var messageContract = initContract50().router(
|
|
|
9722
9593
|
);
|
|
9723
9594
|
|
|
9724
9595
|
// src/mail/mail-contract.ts
|
|
9725
|
-
var mailContract =
|
|
9596
|
+
var mailContract = initContract50().router({
|
|
9726
9597
|
room: roomContract,
|
|
9727
9598
|
message: messageContract,
|
|
9728
9599
|
account: accountContract,
|
|
@@ -9730,44 +9601,44 @@ var mailContract = initContract51().router({
|
|
|
9730
9601
|
});
|
|
9731
9602
|
|
|
9732
9603
|
// src/webchat/index.ts
|
|
9733
|
-
import { initContract as
|
|
9604
|
+
import { initContract as initContract51 } from "@ts-rest/core";
|
|
9734
9605
|
|
|
9735
9606
|
// src/webchat/schema.ts
|
|
9736
|
-
import
|
|
9607
|
+
import z130 from "zod";
|
|
9737
9608
|
|
|
9738
9609
|
// src/webchat/validation.ts
|
|
9739
|
-
import
|
|
9610
|
+
import z129 from "zod";
|
|
9740
9611
|
var ChatwootChannelType2 = /* @__PURE__ */ ((ChatwootChannelType3) => {
|
|
9741
9612
|
ChatwootChannelType3["WEB_WIDGET"] = "web_widget";
|
|
9742
9613
|
return ChatwootChannelType3;
|
|
9743
9614
|
})(ChatwootChannelType2 || {});
|
|
9744
|
-
var WebChatChannelSchema =
|
|
9745
|
-
avatar:
|
|
9746
|
-
name:
|
|
9747
|
-
type:
|
|
9748
|
-
websiteName:
|
|
9749
|
-
welcomeTitle:
|
|
9750
|
-
websiteUrl:
|
|
9751
|
-
welcomeTagline:
|
|
9752
|
-
agentAwayMessage:
|
|
9753
|
-
widgetColor:
|
|
9615
|
+
var WebChatChannelSchema = z129.object({
|
|
9616
|
+
avatar: z129.string().optional(),
|
|
9617
|
+
name: z129.string(),
|
|
9618
|
+
type: z129.nativeEnum(ChatwootChannelType2),
|
|
9619
|
+
websiteName: z129.string(),
|
|
9620
|
+
welcomeTitle: z129.string(),
|
|
9621
|
+
websiteUrl: z129.string().url(),
|
|
9622
|
+
welcomeTagline: z129.string().optional(),
|
|
9623
|
+
agentAwayMessage: z129.string().optional(),
|
|
9624
|
+
widgetColor: z129.string().optional()
|
|
9754
9625
|
});
|
|
9755
9626
|
|
|
9756
9627
|
// src/webchat/schema.ts
|
|
9757
|
-
var ConnectWebChatChannelSchema =
|
|
9758
|
-
name:
|
|
9759
|
-
actor:
|
|
9760
|
-
id:
|
|
9761
|
-
name:
|
|
9762
|
-
email:
|
|
9763
|
-
address:
|
|
9764
|
-
phone:
|
|
9628
|
+
var ConnectWebChatChannelSchema = z130.object({
|
|
9629
|
+
name: z130.string(),
|
|
9630
|
+
actor: z130.object({
|
|
9631
|
+
id: z130.string().uuid(),
|
|
9632
|
+
name: z130.string(),
|
|
9633
|
+
email: z130.string().email(),
|
|
9634
|
+
address: z130.string().nullable(),
|
|
9635
|
+
phone: z130.string().nullable()
|
|
9765
9636
|
}),
|
|
9766
9637
|
channel: WebChatChannelSchema
|
|
9767
9638
|
});
|
|
9768
9639
|
|
|
9769
9640
|
// src/webchat/index.ts
|
|
9770
|
-
var platformWebchatContract =
|
|
9641
|
+
var platformWebchatContract = initContract51().router({
|
|
9771
9642
|
sendMessage: {
|
|
9772
9643
|
method: "POST",
|
|
9773
9644
|
path: "/message",
|
|
@@ -9794,33 +9665,33 @@ var platformWebchatContract = initContract52().router({
|
|
|
9794
9665
|
});
|
|
9795
9666
|
|
|
9796
9667
|
// src/hold-label/index.ts
|
|
9797
|
-
import { initContract as
|
|
9668
|
+
import { initContract as initContract52 } from "@ts-rest/core";
|
|
9798
9669
|
|
|
9799
9670
|
// src/hold-label/schema.ts
|
|
9800
|
-
import
|
|
9671
|
+
import z131 from "zod";
|
|
9801
9672
|
var HoldLabelSchema = DefaultEntitySchema.extend({
|
|
9802
|
-
name:
|
|
9803
|
-
position:
|
|
9673
|
+
name: z131.string(),
|
|
9674
|
+
position: z131.number()
|
|
9804
9675
|
});
|
|
9805
9676
|
|
|
9806
9677
|
// src/hold-label/index.ts
|
|
9807
|
-
import
|
|
9678
|
+
import z133 from "zod";
|
|
9808
9679
|
|
|
9809
9680
|
// src/hold-label/validation.ts
|
|
9810
|
-
import
|
|
9811
|
-
var UpdatePositionSchema2 =
|
|
9812
|
-
holdLabels:
|
|
9813
|
-
|
|
9681
|
+
import z132 from "zod";
|
|
9682
|
+
var UpdatePositionSchema2 = z132.object({
|
|
9683
|
+
holdLabels: z132.array(
|
|
9684
|
+
z132.object({ id: z132.string().uuid(), position: z132.number() })
|
|
9814
9685
|
)
|
|
9815
9686
|
});
|
|
9816
9687
|
|
|
9817
9688
|
// src/hold-label/index.ts
|
|
9818
|
-
var holdLabelContract =
|
|
9689
|
+
var holdLabelContract = initContract52().router(
|
|
9819
9690
|
{
|
|
9820
9691
|
createHoldLabel: {
|
|
9821
9692
|
method: "POST",
|
|
9822
9693
|
path: "/",
|
|
9823
|
-
body:
|
|
9694
|
+
body: z133.object({ name: z133.string() }),
|
|
9824
9695
|
responses: {
|
|
9825
9696
|
201: DefaultSuccessResponseSchema.extend({
|
|
9826
9697
|
holdLabel: HoldLabelSchema
|
|
@@ -9832,7 +9703,7 @@ var holdLabelContract = initContract53().router(
|
|
|
9832
9703
|
path: "/",
|
|
9833
9704
|
responses: {
|
|
9834
9705
|
200: DefaultSuccessResponseSchema.extend({
|
|
9835
|
-
holdLabels:
|
|
9706
|
+
holdLabels: z133.array(HoldLabelSchema)
|
|
9836
9707
|
})
|
|
9837
9708
|
}
|
|
9838
9709
|
},
|
|
@@ -9850,8 +9721,8 @@ var holdLabelContract = initContract53().router(
|
|
|
9850
9721
|
updateHoldLabel: {
|
|
9851
9722
|
method: "PATCH",
|
|
9852
9723
|
path: "/:id",
|
|
9853
|
-
pathParams:
|
|
9854
|
-
body:
|
|
9724
|
+
pathParams: z133.object({ id: z133.string().uuid() }),
|
|
9725
|
+
body: z133.object({ name: z133.string() }),
|
|
9855
9726
|
responses: {
|
|
9856
9727
|
200: DefaultSuccessResponseSchema.extend({
|
|
9857
9728
|
holdLabel: HoldLabelSchema
|
|
@@ -9861,7 +9732,7 @@ var holdLabelContract = initContract53().router(
|
|
|
9861
9732
|
deleteHoldLabel: {
|
|
9862
9733
|
method: "DELETE",
|
|
9863
9734
|
path: "/:id",
|
|
9864
|
-
pathParams:
|
|
9735
|
+
pathParams: z133.object({ id: z133.string().uuid() }),
|
|
9865
9736
|
body: null,
|
|
9866
9737
|
responses: {
|
|
9867
9738
|
200: DefaultSuccessResponseSchema
|
|
@@ -9872,23 +9743,162 @@ var holdLabelContract = initContract53().router(
|
|
|
9872
9743
|
path: "/auto-unhold",
|
|
9873
9744
|
responses: {
|
|
9874
9745
|
200: DefaultSuccessResponseSchema.extend({
|
|
9875
|
-
autoUnhold:
|
|
9746
|
+
autoUnhold: z133.boolean()
|
|
9876
9747
|
})
|
|
9877
9748
|
}
|
|
9878
9749
|
},
|
|
9879
9750
|
updateAutoUnhold: {
|
|
9880
9751
|
method: "POST",
|
|
9881
9752
|
path: "/auto-unhold",
|
|
9882
|
-
body:
|
|
9753
|
+
body: z133.object({ autoUnhold: z133.boolean() }),
|
|
9883
9754
|
responses: {
|
|
9884
9755
|
200: DefaultSuccessResponseSchema.extend({
|
|
9885
|
-
autoUnhold:
|
|
9756
|
+
autoUnhold: z133.boolean()
|
|
9886
9757
|
})
|
|
9887
9758
|
}
|
|
9888
9759
|
}
|
|
9889
9760
|
},
|
|
9890
9761
|
{ pathPrefix: "hold-label" }
|
|
9891
9762
|
);
|
|
9763
|
+
|
|
9764
|
+
// src/subscription/index.ts
|
|
9765
|
+
import { initContract as initContract53 } from "@ts-rest/core";
|
|
9766
|
+
import { z as z136 } from "zod";
|
|
9767
|
+
|
|
9768
|
+
// src/subscription/schema.ts
|
|
9769
|
+
import z134 from "zod";
|
|
9770
|
+
var ProductPriceSchema = DefaultEntitySchema.extend({
|
|
9771
|
+
priceId: z134.string(),
|
|
9772
|
+
name: z134.string().nullable(),
|
|
9773
|
+
perUnit: z134.number(),
|
|
9774
|
+
price: z134.number(),
|
|
9775
|
+
currency: z134.string().nullable()
|
|
9776
|
+
});
|
|
9777
|
+
var ProductWithoutRelatedSchema = DefaultEntitySchema.extend({
|
|
9778
|
+
provider: z134.string(),
|
|
9779
|
+
productId: z134.string(),
|
|
9780
|
+
name: z134.string(),
|
|
9781
|
+
type: z134.string(),
|
|
9782
|
+
omnichannel: z134.string(),
|
|
9783
|
+
usageType: z134.string().nullable(),
|
|
9784
|
+
productPrice: ProductPriceSchema
|
|
9785
|
+
});
|
|
9786
|
+
var RelatedProductSchema = DefaultEntitySchema.extend({
|
|
9787
|
+
includedQuantity: z134.number(),
|
|
9788
|
+
product: ProductWithoutRelatedSchema
|
|
9789
|
+
});
|
|
9790
|
+
var ProductSchema = DefaultEntitySchema.extend({
|
|
9791
|
+
provider: z134.string(),
|
|
9792
|
+
productId: z134.string(),
|
|
9793
|
+
name: z134.string(),
|
|
9794
|
+
type: z134.string(),
|
|
9795
|
+
omnichannel: z134.string(),
|
|
9796
|
+
usageType: z134.string().nullable(),
|
|
9797
|
+
productPrice: ProductPriceSchema,
|
|
9798
|
+
relatedProducts: z134.array(RelatedProductSchema)
|
|
9799
|
+
});
|
|
9800
|
+
var SubscriptionProuctSchema = DefaultEntitySchema.extend({
|
|
9801
|
+
limit: z134.number(),
|
|
9802
|
+
subscriptionItemId: z134.string(),
|
|
9803
|
+
usage: z134.number().nullable(),
|
|
9804
|
+
product: ProductSchema
|
|
9805
|
+
});
|
|
9806
|
+
var SubscriptionSchema = DefaultEntitySchema.extend({
|
|
9807
|
+
provider: z134.string(),
|
|
9808
|
+
type: z134.string(),
|
|
9809
|
+
subscriptionId: z134.string(),
|
|
9810
|
+
interval: z134.string(),
|
|
9811
|
+
quantity: z134.number(),
|
|
9812
|
+
amount: z134.number(),
|
|
9813
|
+
startAt: z134.date().nullable(),
|
|
9814
|
+
expireAt: z134.date(),
|
|
9815
|
+
status: z134.string(),
|
|
9816
|
+
name: z134.string().nullable(),
|
|
9817
|
+
subscriptionProducts: z134.array(SubscriptionProuctSchema),
|
|
9818
|
+
productPrice: ProductPriceSchema,
|
|
9819
|
+
product: ProductSchema
|
|
9820
|
+
});
|
|
9821
|
+
|
|
9822
|
+
// src/subscription/validation.ts
|
|
9823
|
+
import { z as z135 } from "zod";
|
|
9824
|
+
var UpdateSubscriptionSchema = z135.object({
|
|
9825
|
+
planProductId: z135.string(),
|
|
9826
|
+
subscriptionId: z135.string(),
|
|
9827
|
+
subscriptionProducts: z135.array(
|
|
9828
|
+
z135.object({
|
|
9829
|
+
productId: z135.string(),
|
|
9830
|
+
quantity: z135.number()
|
|
9831
|
+
})
|
|
9832
|
+
)
|
|
9833
|
+
});
|
|
9834
|
+
var TopUpBalanceSchema = z135.object({
|
|
9835
|
+
quantity: z135.number()
|
|
9836
|
+
});
|
|
9837
|
+
|
|
9838
|
+
// src/subscription/index.ts
|
|
9839
|
+
var subscriptionContract = initContract53().router(
|
|
9840
|
+
{
|
|
9841
|
+
getSubscription: {
|
|
9842
|
+
method: "GET",
|
|
9843
|
+
path: "/",
|
|
9844
|
+
query: null,
|
|
9845
|
+
responses: {
|
|
9846
|
+
200: DefaultSuccessResponseSchema.extend({
|
|
9847
|
+
subscription: SubscriptionSchema
|
|
9848
|
+
}),
|
|
9849
|
+
500: DefaultErrorResponseSchema
|
|
9850
|
+
}
|
|
9851
|
+
},
|
|
9852
|
+
updateSubscription: {
|
|
9853
|
+
method: "PATCH",
|
|
9854
|
+
path: "/",
|
|
9855
|
+
body: UpdateSubscriptionSchema,
|
|
9856
|
+
responses: {
|
|
9857
|
+
200: DefaultSuccessResponseSchema.extend({
|
|
9858
|
+
message: z136.string(),
|
|
9859
|
+
requireCheckout: z136.boolean(),
|
|
9860
|
+
checkoutUrl: z136.string().nullable()
|
|
9861
|
+
}),
|
|
9862
|
+
500: DefaultErrorResponseSchema
|
|
9863
|
+
}
|
|
9864
|
+
},
|
|
9865
|
+
topUpBalance: {
|
|
9866
|
+
method: "POST",
|
|
9867
|
+
path: "/top-up",
|
|
9868
|
+
body: TopUpBalanceSchema,
|
|
9869
|
+
responses: {
|
|
9870
|
+
200: DefaultSuccessResponseSchema.extend({
|
|
9871
|
+
checkoutUrl: z136.string()
|
|
9872
|
+
}),
|
|
9873
|
+
500: DefaultErrorResponseSchema
|
|
9874
|
+
}
|
|
9875
|
+
},
|
|
9876
|
+
getAvailablePlan: {
|
|
9877
|
+
method: "GET",
|
|
9878
|
+
path: "/available-plan",
|
|
9879
|
+
query: null,
|
|
9880
|
+
responses: {
|
|
9881
|
+
200: DefaultSuccessResponseSchema.extend({
|
|
9882
|
+
data: z136.array(ProductSchema)
|
|
9883
|
+
}),
|
|
9884
|
+
500: DefaultErrorResponseSchema
|
|
9885
|
+
}
|
|
9886
|
+
},
|
|
9887
|
+
checkPlan: {
|
|
9888
|
+
method: "POST",
|
|
9889
|
+
path: "/check-plan",
|
|
9890
|
+
body: null,
|
|
9891
|
+
responses: {
|
|
9892
|
+
200: DefaultSuccessResponseSchema,
|
|
9893
|
+
403: DefaultUnauthorizedSchema,
|
|
9894
|
+
500: DefaultErrorResponseSchema
|
|
9895
|
+
}
|
|
9896
|
+
}
|
|
9897
|
+
},
|
|
9898
|
+
{
|
|
9899
|
+
pathPrefix: "subscriptions"
|
|
9900
|
+
}
|
|
9901
|
+
);
|
|
9892
9902
|
export {
|
|
9893
9903
|
activityLogContract,
|
|
9894
9904
|
apiContract,
|