@kl1/contracts 1.3.56 → 1.3.58
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/chat/index.d.ts +96 -0
- package/dist/api-contracts/src/chat/index.d.ts.map +1 -1
- package/dist/api-contracts/src/chat/validation.d.ts +20 -0
- package/dist/api-contracts/src/chat/validation.d.ts.map +1 -1
- package/dist/api-contracts/src/contract.d.ts +118 -14
- package/dist/api-contracts/src/contract.d.ts.map +1 -1
- package/dist/api-contracts/src/dashboard/index.d.ts +14 -14
- package/dist/api-contracts/src/dashboard/schema.d.ts +4 -4
- package/dist/api-contracts/src/index.d.ts +1 -0
- package/dist/api-contracts/src/index.d.ts.map +1 -1
- package/dist/api-contracts/src/invoice/index.d.ts +106 -0
- package/dist/api-contracts/src/invoice/index.d.ts.map +1 -0
- package/dist/api-contracts/src/invoice/schema.d.ts +48 -0
- package/dist/api-contracts/src/invoice/schema.d.ts.map +1 -0
- package/dist/api-contracts/src/mail/mail-contract.d.ts +6 -6
- package/dist/api-contracts/src/mail/mail-server-contract.d.ts +6 -6
- package/dist/api-contracts/src/mail/schemas/account.schema.d.ts +2 -2
- package/dist/index.js +697 -627
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +696 -627
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1618,6 +1618,14 @@ var LineStickerSchema = z26.object({
|
|
|
1618
1618
|
packageId: z26.number(),
|
|
1619
1619
|
stickerId: z26.number()
|
|
1620
1620
|
});
|
|
1621
|
+
var AllOpenCloseRoomCountSchema = z26.object({
|
|
1622
|
+
allOpenedRoomCount: z26.number(),
|
|
1623
|
+
allClosedRoomCount: z26.number()
|
|
1624
|
+
});
|
|
1625
|
+
var AllHoldAndQueueRoomCountSchema = z26.object({
|
|
1626
|
+
holdRoomCount: z26.record(z26.string(), z26.number()),
|
|
1627
|
+
queueRoomCount: z26.record(z26.string(), z26.number())
|
|
1628
|
+
});
|
|
1621
1629
|
|
|
1622
1630
|
// src/sms/index.ts
|
|
1623
1631
|
var smsContract = initContract().router({
|
|
@@ -1700,7 +1708,7 @@ var smsSettingContract = initContract().router({
|
|
|
1700
1708
|
});
|
|
1701
1709
|
|
|
1702
1710
|
// src/contract.ts
|
|
1703
|
-
import { initContract as
|
|
1711
|
+
import { initContract as initContract44 } from "@ts-rest/core";
|
|
1704
1712
|
|
|
1705
1713
|
// src/activity-log/index.ts
|
|
1706
1714
|
import { initContract as initContract2 } from "@ts-rest/core";
|
|
@@ -2982,6 +2990,26 @@ var mainChatRoomContract = initContract8().router(
|
|
|
2982
2990
|
},
|
|
2983
2991
|
query: SearchRoomsSchema,
|
|
2984
2992
|
summary: "Search Rooms"
|
|
2993
|
+
},
|
|
2994
|
+
getAllRoomCount: {
|
|
2995
|
+
method: "GET",
|
|
2996
|
+
path: "/all-rooms-count",
|
|
2997
|
+
responses: {
|
|
2998
|
+
200: DefaultSuccessResponseSchema.extend({
|
|
2999
|
+
data: AllOpenCloseRoomCountSchema
|
|
3000
|
+
})
|
|
3001
|
+
},
|
|
3002
|
+
summary: "Get all opened and closed room count"
|
|
3003
|
+
},
|
|
3004
|
+
getAllQueueAndHoldCount: {
|
|
3005
|
+
method: "GET",
|
|
3006
|
+
path: "/all-queue-and-hold-count",
|
|
3007
|
+
responses: {
|
|
3008
|
+
200: DefaultSuccessResponseSchema.extend({
|
|
3009
|
+
data: AllHoldAndQueueRoomCountSchema
|
|
3010
|
+
})
|
|
3011
|
+
},
|
|
3012
|
+
summary: "Get all queue and hold rooms count"
|
|
2985
3013
|
}
|
|
2986
3014
|
},
|
|
2987
3015
|
{
|
|
@@ -8998,8 +9026,47 @@ var whatsappContract = initContract42().router({
|
|
|
8998
9026
|
}
|
|
8999
9027
|
});
|
|
9000
9028
|
|
|
9029
|
+
// src/invoice/index.ts
|
|
9030
|
+
import { initContract as initContract43 } from "@ts-rest/core";
|
|
9031
|
+
import { z as z116 } from "zod";
|
|
9032
|
+
|
|
9033
|
+
// src/invoice/schema.ts
|
|
9034
|
+
import z115 from "zod";
|
|
9035
|
+
var InvoiceSchema = DefaultEntitySchema.extend({
|
|
9036
|
+
invoiceId: z115.string(),
|
|
9037
|
+
amountPaid: z115.number(),
|
|
9038
|
+
billingReason: z115.string(),
|
|
9039
|
+
collectionMethod: z115.string(),
|
|
9040
|
+
created: z115.number(),
|
|
9041
|
+
currency: z115.string(),
|
|
9042
|
+
hostedInvoiceUrl: z115.string(),
|
|
9043
|
+
invoicePdf: z115.string(),
|
|
9044
|
+
number: z115.string(),
|
|
9045
|
+
paid: z115.boolean()
|
|
9046
|
+
});
|
|
9047
|
+
|
|
9048
|
+
// src/invoice/index.ts
|
|
9049
|
+
var invoiceContract = initContract43().router(
|
|
9050
|
+
{
|
|
9051
|
+
getInvoices: {
|
|
9052
|
+
method: "GET",
|
|
9053
|
+
path: "/",
|
|
9054
|
+
query: null,
|
|
9055
|
+
responses: {
|
|
9056
|
+
200: DefaultSuccessResponseSchema.extend({
|
|
9057
|
+
invoices: z116.array(InvoiceSchema)
|
|
9058
|
+
}),
|
|
9059
|
+
500: DefaultErrorResponseSchema
|
|
9060
|
+
}
|
|
9061
|
+
}
|
|
9062
|
+
},
|
|
9063
|
+
{
|
|
9064
|
+
pathPrefix: "ms/invoices"
|
|
9065
|
+
}
|
|
9066
|
+
);
|
|
9067
|
+
|
|
9001
9068
|
// src/contract.ts
|
|
9002
|
-
var apiContract =
|
|
9069
|
+
var apiContract = initContract44().router({
|
|
9003
9070
|
auth: authContract,
|
|
9004
9071
|
cxLog: cxLogContract,
|
|
9005
9072
|
dashboard: dashboardContract,
|
|
@@ -9021,7 +9088,8 @@ var apiContract = initContract43().router({
|
|
|
9021
9088
|
upload: uploadContract,
|
|
9022
9089
|
snippet: snippetContract,
|
|
9023
9090
|
bot: botContract,
|
|
9024
|
-
|
|
9091
|
+
invoice: invoiceContract,
|
|
9092
|
+
...initContract44().router(
|
|
9025
9093
|
{
|
|
9026
9094
|
channel: channelContract
|
|
9027
9095
|
},
|
|
@@ -9030,62 +9098,62 @@ var apiContract = initContract43().router({
|
|
|
9030
9098
|
}
|
|
9031
9099
|
)
|
|
9032
9100
|
});
|
|
9033
|
-
var contactContract2 =
|
|
9101
|
+
var contactContract2 = initContract44().router({
|
|
9034
9102
|
contact: contactContract
|
|
9035
9103
|
});
|
|
9036
|
-
var ticketContract2 =
|
|
9104
|
+
var ticketContract2 = initContract44().router({
|
|
9037
9105
|
ticket: ticketContract
|
|
9038
9106
|
});
|
|
9039
|
-
var extensionContract2 =
|
|
9107
|
+
var extensionContract2 = initContract44().router({
|
|
9040
9108
|
extension: extensionContract
|
|
9041
9109
|
});
|
|
9042
|
-
var commentActivityContract =
|
|
9110
|
+
var commentActivityContract = initContract44().router({
|
|
9043
9111
|
comment: commentContract,
|
|
9044
9112
|
activityLog: activityLogContract
|
|
9045
9113
|
});
|
|
9046
|
-
var platformContract =
|
|
9114
|
+
var platformContract = initContract44().router({
|
|
9047
9115
|
viber: viberContract
|
|
9048
9116
|
});
|
|
9049
|
-
var platformLineContract =
|
|
9117
|
+
var platformLineContract = initContract44().router({
|
|
9050
9118
|
line: lineContract
|
|
9051
9119
|
});
|
|
9052
|
-
var platformTelegramContract =
|
|
9120
|
+
var platformTelegramContract = initContract44().router({
|
|
9053
9121
|
telegram: telegramContract
|
|
9054
9122
|
});
|
|
9055
|
-
var platformMessengerContract =
|
|
9123
|
+
var platformMessengerContract = initContract44().router({
|
|
9056
9124
|
messenger: messengerContract
|
|
9057
9125
|
});
|
|
9058
|
-
var platformInstagramContract =
|
|
9126
|
+
var platformInstagramContract = initContract44().router({
|
|
9059
9127
|
instagram: instagramContract
|
|
9060
9128
|
});
|
|
9061
|
-
var platformBotpressContract =
|
|
9129
|
+
var platformBotpressContract = initContract44().router({
|
|
9062
9130
|
botpress: botpressContract
|
|
9063
9131
|
});
|
|
9064
|
-
var platformSMSContract =
|
|
9132
|
+
var platformSMSContract = initContract44().router({
|
|
9065
9133
|
sms: smsContract
|
|
9066
9134
|
});
|
|
9067
|
-
var platformWhatsappContract =
|
|
9135
|
+
var platformWhatsappContract = initContract44().router({
|
|
9068
9136
|
whatsapp: whatsappContract
|
|
9069
9137
|
});
|
|
9070
|
-
var facebookFeedContract2 =
|
|
9138
|
+
var facebookFeedContract2 = initContract44().router({
|
|
9071
9139
|
facebookFeed: facebookFeedContract
|
|
9072
9140
|
});
|
|
9073
|
-
var feedPostContract =
|
|
9141
|
+
var feedPostContract = initContract44().router({
|
|
9074
9142
|
main: mainFeedContract
|
|
9075
9143
|
});
|
|
9076
|
-
var telephonyContract =
|
|
9144
|
+
var telephonyContract = initContract44().router({
|
|
9077
9145
|
telephonyCdr: telephonyCdrContract
|
|
9078
9146
|
});
|
|
9079
|
-
var notificationContract =
|
|
9147
|
+
var notificationContract = initContract44().router({
|
|
9080
9148
|
notification: userNotificationContract
|
|
9081
9149
|
});
|
|
9082
|
-
var publicApiContract2 =
|
|
9150
|
+
var publicApiContract2 = initContract44().router({
|
|
9083
9151
|
publicApi: publicApiContract
|
|
9084
9152
|
});
|
|
9085
|
-
var businessCalendarContract2 =
|
|
9153
|
+
var businessCalendarContract2 = initContract44().router({
|
|
9086
9154
|
businessCalendar: businessCalendarContract
|
|
9087
9155
|
});
|
|
9088
|
-
var workflowContract =
|
|
9156
|
+
var workflowContract = initContract44().router(
|
|
9089
9157
|
{
|
|
9090
9158
|
chat: chatContract
|
|
9091
9159
|
},
|
|
@@ -9094,7 +9162,7 @@ var workflowContract = initContract43().router(
|
|
|
9094
9162
|
}
|
|
9095
9163
|
);
|
|
9096
9164
|
var settingsPathPrefix = "ms/settings/";
|
|
9097
|
-
var ticketSettingContract =
|
|
9165
|
+
var ticketSettingContract = initContract44().router(
|
|
9098
9166
|
{
|
|
9099
9167
|
ticketSetting: attributeContract
|
|
9100
9168
|
},
|
|
@@ -9102,7 +9170,7 @@ var ticketSettingContract = initContract43().router(
|
|
|
9102
9170
|
pathPrefix: `${settingsPathPrefix}ticket/`
|
|
9103
9171
|
}
|
|
9104
9172
|
);
|
|
9105
|
-
var contactSettingContract =
|
|
9173
|
+
var contactSettingContract = initContract44().router(
|
|
9106
9174
|
{
|
|
9107
9175
|
contactSetting: attributeContract
|
|
9108
9176
|
},
|
|
@@ -9110,7 +9178,7 @@ var contactSettingContract = initContract43().router(
|
|
|
9110
9178
|
pathPrefix: `${settingsPathPrefix}contact/`
|
|
9111
9179
|
}
|
|
9112
9180
|
);
|
|
9113
|
-
var companySettingContract =
|
|
9181
|
+
var companySettingContract = initContract44().router(
|
|
9114
9182
|
{
|
|
9115
9183
|
companySetting: attributeContract
|
|
9116
9184
|
},
|
|
@@ -9118,7 +9186,7 @@ var companySettingContract = initContract43().router(
|
|
|
9118
9186
|
pathPrefix: `${settingsPathPrefix}company/`
|
|
9119
9187
|
}
|
|
9120
9188
|
);
|
|
9121
|
-
var caseLogSettingContract =
|
|
9189
|
+
var caseLogSettingContract = initContract44().router(
|
|
9122
9190
|
{
|
|
9123
9191
|
caseLogSetting: attributeContract
|
|
9124
9192
|
},
|
|
@@ -9126,7 +9194,7 @@ var caseLogSettingContract = initContract43().router(
|
|
|
9126
9194
|
pathPrefix: `${settingsPathPrefix}case_log/`
|
|
9127
9195
|
}
|
|
9128
9196
|
);
|
|
9129
|
-
var generalTagSettingContract =
|
|
9197
|
+
var generalTagSettingContract = initContract44().router(
|
|
9130
9198
|
{
|
|
9131
9199
|
generalTag: tagContract
|
|
9132
9200
|
},
|
|
@@ -9134,7 +9202,7 @@ var generalTagSettingContract = initContract43().router(
|
|
|
9134
9202
|
pathPrefix: `${settingsPathPrefix}general_tag/`
|
|
9135
9203
|
}
|
|
9136
9204
|
);
|
|
9137
|
-
var contactLabelSettingContract =
|
|
9205
|
+
var contactLabelSettingContract = initContract44().router(
|
|
9138
9206
|
{
|
|
9139
9207
|
contactLabel: tagContract
|
|
9140
9208
|
},
|
|
@@ -9142,7 +9210,7 @@ var contactLabelSettingContract = initContract43().router(
|
|
|
9142
9210
|
pathPrefix: `${settingsPathPrefix}contact_label/`
|
|
9143
9211
|
}
|
|
9144
9212
|
);
|
|
9145
|
-
var categorySettingContract =
|
|
9213
|
+
var categorySettingContract = initContract44().router(
|
|
9146
9214
|
{
|
|
9147
9215
|
category: categoryContract
|
|
9148
9216
|
},
|
|
@@ -9150,7 +9218,7 @@ var categorySettingContract = initContract43().router(
|
|
|
9150
9218
|
pathPrefix: settingsPathPrefix
|
|
9151
9219
|
}
|
|
9152
9220
|
);
|
|
9153
|
-
var snippetSettingContract =
|
|
9221
|
+
var snippetSettingContract = initContract44().router(
|
|
9154
9222
|
{
|
|
9155
9223
|
snippet: snippetContract
|
|
9156
9224
|
},
|
|
@@ -9158,7 +9226,7 @@ var snippetSettingContract = initContract43().router(
|
|
|
9158
9226
|
pathPrefix: settingsPathPrefix
|
|
9159
9227
|
}
|
|
9160
9228
|
);
|
|
9161
|
-
var businessCalendarSettingContract =
|
|
9229
|
+
var businessCalendarSettingContract = initContract44().router(
|
|
9162
9230
|
{
|
|
9163
9231
|
businessCalendar: businessCalendarContract
|
|
9164
9232
|
},
|
|
@@ -9166,7 +9234,7 @@ var businessCalendarSettingContract = initContract43().router(
|
|
|
9166
9234
|
pathPrefix: settingsPathPrefix
|
|
9167
9235
|
}
|
|
9168
9236
|
);
|
|
9169
|
-
var channelSettingContract =
|
|
9237
|
+
var channelSettingContract = initContract44().router(
|
|
9170
9238
|
{
|
|
9171
9239
|
channel: channelContract
|
|
9172
9240
|
},
|
|
@@ -9174,50 +9242,50 @@ var channelSettingContract = initContract43().router(
|
|
|
9174
9242
|
pathPrefix: settingsPathPrefix
|
|
9175
9243
|
}
|
|
9176
9244
|
);
|
|
9177
|
-
var widgetSettingContract =
|
|
9245
|
+
var widgetSettingContract = initContract44().router(
|
|
9178
9246
|
{ widget: widgetContract },
|
|
9179
9247
|
{ pathPrefix: settingsPathPrefix }
|
|
9180
9248
|
);
|
|
9181
|
-
var roleSettingContract =
|
|
9249
|
+
var roleSettingContract = initContract44().router(
|
|
9182
9250
|
{ role: roleContract },
|
|
9183
9251
|
{ pathPrefix: settingsPathPrefix }
|
|
9184
9252
|
);
|
|
9185
|
-
var permissionSettingContract =
|
|
9253
|
+
var permissionSettingContract = initContract44().router(
|
|
9186
9254
|
{ permission: permissionContract },
|
|
9187
9255
|
{ pathPrefix: settingsPathPrefix }
|
|
9188
9256
|
);
|
|
9189
|
-
var memberSettingContract =
|
|
9257
|
+
var memberSettingContract = initContract44().router(
|
|
9190
9258
|
{ member: userContract },
|
|
9191
9259
|
{ pathPrefix: settingsPathPrefix }
|
|
9192
9260
|
);
|
|
9193
|
-
var presenceStatusContract2 =
|
|
9261
|
+
var presenceStatusContract2 = initContract44().router({
|
|
9194
9262
|
presenceStatus: presenceStatusContract
|
|
9195
9263
|
});
|
|
9196
9264
|
|
|
9197
9265
|
// src/general-setting/index.ts
|
|
9198
|
-
import { initContract as
|
|
9199
|
-
import
|
|
9200
|
-
var generalSettingContract =
|
|
9266
|
+
import { initContract as initContract45 } from "@ts-rest/core";
|
|
9267
|
+
import z117 from "zod";
|
|
9268
|
+
var generalSettingContract = initContract45().router(
|
|
9201
9269
|
{
|
|
9202
9270
|
autoOpenedContactWidgetId: {
|
|
9203
9271
|
getAutoOpenedContactWidgetId: {
|
|
9204
9272
|
method: "GET",
|
|
9205
9273
|
path: "/auto-opened-contact-widget-id",
|
|
9206
9274
|
responses: {
|
|
9207
|
-
200:
|
|
9208
|
-
autoOpenedContactWidgetId:
|
|
9275
|
+
200: z117.object({
|
|
9276
|
+
autoOpenedContactWidgetId: z117.string().nullable()
|
|
9209
9277
|
})
|
|
9210
9278
|
}
|
|
9211
9279
|
},
|
|
9212
9280
|
updateAutoOpenedContactWidgetId: {
|
|
9213
9281
|
method: "PATCH",
|
|
9214
9282
|
path: "/auto-opened-contact-widget-id",
|
|
9215
|
-
body:
|
|
9216
|
-
autoOpenedContactWidgetId:
|
|
9283
|
+
body: z117.object({
|
|
9284
|
+
autoOpenedContactWidgetId: z117.string().nullable()
|
|
9217
9285
|
}),
|
|
9218
9286
|
responses: {
|
|
9219
|
-
200:
|
|
9220
|
-
autoOpenedContactWidgetId:
|
|
9287
|
+
200: z117.object({
|
|
9288
|
+
autoOpenedContactWidgetId: z117.string().nullable()
|
|
9221
9289
|
})
|
|
9222
9290
|
}
|
|
9223
9291
|
}
|
|
@@ -9229,54 +9297,54 @@ var generalSettingContract = initContract44().router(
|
|
|
9229
9297
|
);
|
|
9230
9298
|
|
|
9231
9299
|
// src/automation-queue/index.ts
|
|
9232
|
-
import { initContract as
|
|
9233
|
-
import { z as
|
|
9300
|
+
import { initContract as initContract46 } from "@ts-rest/core";
|
|
9301
|
+
import { z as z120 } from "zod";
|
|
9234
9302
|
|
|
9235
9303
|
// src/automation-queue/validation.ts
|
|
9236
|
-
import { z as
|
|
9237
|
-
var QueueDistributionStrategySchema =
|
|
9238
|
-
|
|
9239
|
-
|
|
9240
|
-
|
|
9241
|
-
|
|
9304
|
+
import { z as z118 } from "zod";
|
|
9305
|
+
var QueueDistributionStrategySchema = z118.union([
|
|
9306
|
+
z118.literal("round-robin"),
|
|
9307
|
+
z118.literal("fewest-assignments"),
|
|
9308
|
+
z118.literal("random"),
|
|
9309
|
+
z118.literal("notify-all")
|
|
9242
9310
|
]);
|
|
9243
|
-
var CreateAutomationQueueSchema =
|
|
9244
|
-
emoji:
|
|
9245
|
-
name:
|
|
9246
|
-
description:
|
|
9247
|
-
managerIds:
|
|
9248
|
-
agentIds:
|
|
9311
|
+
var CreateAutomationQueueSchema = z118.object({
|
|
9312
|
+
emoji: z118.string().emoji(),
|
|
9313
|
+
name: z118.string(),
|
|
9314
|
+
description: z118.string().nullable(),
|
|
9315
|
+
managerIds: z118.array(z118.string().uuid()).min(1),
|
|
9316
|
+
agentIds: z118.array(z118.string().uuid()).min(1),
|
|
9249
9317
|
distributionStrategy: QueueDistributionStrategySchema,
|
|
9250
|
-
maximumAssignPerAgent:
|
|
9318
|
+
maximumAssignPerAgent: z118.number().positive()
|
|
9251
9319
|
// ringTimeOut: z.number().positive(),
|
|
9252
9320
|
// retryInterval: z.number().positive(),
|
|
9253
9321
|
// queueTimeOut: z.number().positive(),
|
|
9254
9322
|
// isAssignmentDeniable: z.coerce.boolean(),
|
|
9255
9323
|
});
|
|
9256
9324
|
var UpdateAutomationQueueSchema = CreateAutomationQueueSchema;
|
|
9257
|
-
var CheckHasAssignedRoomSchema =
|
|
9258
|
-
userId:
|
|
9259
|
-
queueId:
|
|
9325
|
+
var CheckHasAssignedRoomSchema = z118.object({
|
|
9326
|
+
userId: z118.string().uuid().optional(),
|
|
9327
|
+
queueId: z118.string().uuid().optional()
|
|
9260
9328
|
});
|
|
9261
9329
|
|
|
9262
9330
|
// src/automation-queue/schema.ts
|
|
9263
|
-
import { z as
|
|
9331
|
+
import { z as z119 } from "zod";
|
|
9264
9332
|
var AutomationQueueSchema = DefaultEntitySchema.extend({
|
|
9265
|
-
emoji:
|
|
9266
|
-
name:
|
|
9267
|
-
description:
|
|
9333
|
+
emoji: z119.string(),
|
|
9334
|
+
name: z119.string(),
|
|
9335
|
+
description: z119.string().nullable(),
|
|
9268
9336
|
distributionStrategy: QueueDistributionStrategySchema,
|
|
9269
|
-
maximumAssignPerAgent:
|
|
9337
|
+
maximumAssignPerAgent: z119.number().positive(),
|
|
9270
9338
|
// ringTimeOut: z.number(),
|
|
9271
9339
|
// retryInterval: z.number(),
|
|
9272
9340
|
// queueTimeOut: z.number(),
|
|
9273
9341
|
// isAssignmentDeniable: z.boolean(),
|
|
9274
|
-
managers:
|
|
9275
|
-
agents:
|
|
9342
|
+
managers: z119.array(UserSchema),
|
|
9343
|
+
agents: z119.array(UserSchema)
|
|
9276
9344
|
});
|
|
9277
9345
|
|
|
9278
9346
|
// src/automation-queue/index.ts
|
|
9279
|
-
var automationQueueContract =
|
|
9347
|
+
var automationQueueContract = initContract46().router(
|
|
9280
9348
|
{
|
|
9281
9349
|
createAutomationQueue: {
|
|
9282
9350
|
method: "POST",
|
|
@@ -9291,8 +9359,8 @@ var automationQueueContract = initContract45().router(
|
|
|
9291
9359
|
duplicateAutomationQueue: {
|
|
9292
9360
|
method: "POST",
|
|
9293
9361
|
path: "/:id/duplicate",
|
|
9294
|
-
pathParams:
|
|
9295
|
-
id:
|
|
9362
|
+
pathParams: z120.object({
|
|
9363
|
+
id: z120.string().uuid()
|
|
9296
9364
|
}),
|
|
9297
9365
|
body: null,
|
|
9298
9366
|
responses: {
|
|
@@ -9304,21 +9372,21 @@ var automationQueueContract = initContract45().router(
|
|
|
9304
9372
|
getAutomationQueues: {
|
|
9305
9373
|
method: "GET",
|
|
9306
9374
|
path: "",
|
|
9307
|
-
query:
|
|
9308
|
-
userId:
|
|
9309
|
-
withRelations:
|
|
9375
|
+
query: z120.object({
|
|
9376
|
+
userId: z120.string().uuid().optional(),
|
|
9377
|
+
withRelations: z120.coerce.boolean().default(true).optional()
|
|
9310
9378
|
}).optional(),
|
|
9311
9379
|
responses: {
|
|
9312
9380
|
200: DefaultSuccessResponseSchema.extend({
|
|
9313
|
-
data:
|
|
9381
|
+
data: z120.array(AutomationQueueSchema)
|
|
9314
9382
|
})
|
|
9315
9383
|
}
|
|
9316
9384
|
},
|
|
9317
9385
|
getAutomationQueueById: {
|
|
9318
9386
|
method: "GET",
|
|
9319
9387
|
path: "/:id",
|
|
9320
|
-
pathParams:
|
|
9321
|
-
id:
|
|
9388
|
+
pathParams: z120.object({
|
|
9389
|
+
id: z120.string().uuid()
|
|
9322
9390
|
}),
|
|
9323
9391
|
responses: {
|
|
9324
9392
|
200: DefaultSuccessResponseSchema.extend({
|
|
@@ -9329,8 +9397,8 @@ var automationQueueContract = initContract45().router(
|
|
|
9329
9397
|
updateAutomationQueue: {
|
|
9330
9398
|
method: "PATCH",
|
|
9331
9399
|
path: "/:id",
|
|
9332
|
-
pathParams:
|
|
9333
|
-
id:
|
|
9400
|
+
pathParams: z120.object({
|
|
9401
|
+
id: z120.string().uuid()
|
|
9334
9402
|
}),
|
|
9335
9403
|
body: UpdateAutomationQueueSchema,
|
|
9336
9404
|
responses: {
|
|
@@ -9342,13 +9410,13 @@ var automationQueueContract = initContract45().router(
|
|
|
9342
9410
|
deleteAutomationQueue: {
|
|
9343
9411
|
method: "DELETE",
|
|
9344
9412
|
path: "/:id",
|
|
9345
|
-
pathParams:
|
|
9346
|
-
id:
|
|
9413
|
+
pathParams: z120.object({
|
|
9414
|
+
id: z120.string().uuid()
|
|
9347
9415
|
}),
|
|
9348
9416
|
body: null,
|
|
9349
9417
|
responses: {
|
|
9350
9418
|
200: DefaultSuccessResponseSchema.extend({
|
|
9351
|
-
message:
|
|
9419
|
+
message: z120.string()
|
|
9352
9420
|
})
|
|
9353
9421
|
}
|
|
9354
9422
|
},
|
|
@@ -9358,8 +9426,8 @@ var automationQueueContract = initContract45().router(
|
|
|
9358
9426
|
body: CheckHasAssignedRoomSchema,
|
|
9359
9427
|
responses: {
|
|
9360
9428
|
200: DefaultSuccessResponseSchema.extend({
|
|
9361
|
-
data:
|
|
9362
|
-
hasAssignedRoom:
|
|
9429
|
+
data: z120.object({
|
|
9430
|
+
hasAssignedRoom: z120.boolean()
|
|
9363
9431
|
})
|
|
9364
9432
|
})
|
|
9365
9433
|
}
|
|
@@ -9372,300 +9440,300 @@ var automationQueueContract = initContract45().router(
|
|
|
9372
9440
|
);
|
|
9373
9441
|
|
|
9374
9442
|
// src/mail/mail-contract.ts
|
|
9375
|
-
import { initContract as
|
|
9443
|
+
import { initContract as initContract51 } from "@ts-rest/core";
|
|
9376
9444
|
|
|
9377
9445
|
// src/mail/room-contract.ts
|
|
9378
|
-
import { initContract as
|
|
9379
|
-
import
|
|
9446
|
+
import { initContract as initContract47 } from "@ts-rest/core";
|
|
9447
|
+
import z125 from "zod";
|
|
9380
9448
|
|
|
9381
9449
|
// src/mail/schemas/room.schema.ts
|
|
9382
|
-
import
|
|
9450
|
+
import z123 from "zod";
|
|
9383
9451
|
|
|
9384
9452
|
// src/mail/schemas/account.schema.ts
|
|
9385
|
-
import
|
|
9386
|
-
var MailServerSchema =
|
|
9387
|
-
id:
|
|
9388
|
-
createdAt: z119.date(),
|
|
9389
|
-
updatedAt: z119.date(),
|
|
9390
|
-
deletedAt: z119.date().nullable(),
|
|
9391
|
-
name: z119.string(),
|
|
9392
|
-
smtpHost: z119.string(),
|
|
9393
|
-
smtpPort: z119.number(),
|
|
9394
|
-
smtpTlsPort: z119.number(),
|
|
9395
|
-
useTlsForSmtp: z119.boolean(),
|
|
9396
|
-
imapHost: z119.string(),
|
|
9397
|
-
imapPort: z119.number(),
|
|
9398
|
-
imapTlsPort: z119.number(),
|
|
9399
|
-
useTlsForImap: z119.boolean()
|
|
9400
|
-
});
|
|
9401
|
-
var MailAccountSchema = z119.object({
|
|
9402
|
-
id: z119.string(),
|
|
9403
|
-
createdAt: z119.date(),
|
|
9404
|
-
updatedAt: z119.date(),
|
|
9405
|
-
deletedAt: z119.date().nullable(),
|
|
9406
|
-
name: z119.string(),
|
|
9407
|
-
address: z119.string(),
|
|
9408
|
-
accountId: z119.string(),
|
|
9409
|
-
mailServerId: z119.string(),
|
|
9410
|
-
mailServer: MailServerSchema,
|
|
9411
|
-
state: z119.union([
|
|
9412
|
-
z119.literal("init"),
|
|
9413
|
-
z119.literal("syncing"),
|
|
9414
|
-
z119.literal("connecting"),
|
|
9415
|
-
z119.literal("connected"),
|
|
9416
|
-
z119.literal("disconnected"),
|
|
9417
|
-
z119.literal("authenticationError"),
|
|
9418
|
-
z119.literal("connectError"),
|
|
9419
|
-
z119.literal("unset")
|
|
9420
|
-
])
|
|
9421
|
-
});
|
|
9422
|
-
var OAuth2AppSchema = z119.object({
|
|
9423
|
-
id: z119.string(),
|
|
9424
|
-
name: z119.string(),
|
|
9425
|
-
description: z119.string(),
|
|
9426
|
-
title: z119.string(),
|
|
9427
|
-
provider: z119.string(),
|
|
9428
|
-
enabled: z119.boolean(),
|
|
9429
|
-
legacy: z119.boolean(),
|
|
9430
|
-
created: z119.string(),
|
|
9431
|
-
updated: z119.string(),
|
|
9432
|
-
includeInListing: z119.boolean(),
|
|
9433
|
-
clientId: z119.string(),
|
|
9434
|
-
clientSecret: z119.string(),
|
|
9435
|
-
authority: z119.string(),
|
|
9436
|
-
redirectUrl: z119.string(),
|
|
9437
|
-
serviceClient: z119.string(),
|
|
9438
|
-
googleProjectId: z119.string(),
|
|
9439
|
-
serviceClientEmail: z119.string(),
|
|
9440
|
-
serviceKey: z119.string()
|
|
9441
|
-
});
|
|
9442
|
-
|
|
9443
|
-
// src/mail/schemas/message.schema.ts
|
|
9444
|
-
import z120 from "zod";
|
|
9445
|
-
var AttachmentSchema = z120.object({
|
|
9446
|
-
id: z120.string(),
|
|
9447
|
-
createdAt: z120.date(),
|
|
9448
|
-
updatedAt: z120.date(),
|
|
9449
|
-
deletedAt: z120.nullable(z120.date()),
|
|
9450
|
-
roomId: z120.string(),
|
|
9451
|
-
messageId: z120.string(),
|
|
9452
|
-
fileName: z120.string(),
|
|
9453
|
-
fileType: z120.string(),
|
|
9454
|
-
emailEngineAttachmentId: z120.string(),
|
|
9455
|
-
uploadId: z120.string(),
|
|
9456
|
-
upload: z120.object({
|
|
9457
|
-
id: z120.string(),
|
|
9458
|
-
createdAt: z120.date(),
|
|
9459
|
-
updatedAt: z120.date(),
|
|
9460
|
-
deletedAt: z120.nullable(z120.date()),
|
|
9461
|
-
bucketName: z120.string(),
|
|
9462
|
-
fileName: z120.string(),
|
|
9463
|
-
fileKey: z120.string(),
|
|
9464
|
-
fileSize: z120.number(),
|
|
9465
|
-
fileUrl: z120.string(),
|
|
9466
|
-
extensionName: z120.string()
|
|
9467
|
-
})
|
|
9468
|
-
});
|
|
9469
|
-
var MessageSchema2 = z120.object({
|
|
9470
|
-
id: z120.string(),
|
|
9471
|
-
createdAt: z120.date(),
|
|
9472
|
-
updatedAt: z120.date(),
|
|
9473
|
-
deletedAt: z120.nullable(z120.date()),
|
|
9474
|
-
roomId: z120.string(),
|
|
9475
|
-
subject: z120.string(),
|
|
9476
|
-
textPlain: z120.string(),
|
|
9477
|
-
textHtml: z120.string(),
|
|
9478
|
-
textId: z120.string(),
|
|
9479
|
-
emailEngineEmailId: z120.string(),
|
|
9480
|
-
emailEngineMessageId: z120.string(),
|
|
9481
|
-
emailEngineReplyTo: z120.nullable(z120.string()),
|
|
9482
|
-
direction: z120.string(),
|
|
9483
|
-
date: z120.date(),
|
|
9484
|
-
action: z120.string(),
|
|
9485
|
-
unseen: z120.boolean(),
|
|
9486
|
-
sendAt: z120.date(),
|
|
9487
|
-
starred: z120.boolean(),
|
|
9488
|
-
seemsLikeNew: z120.boolean(),
|
|
9489
|
-
from: z120.array(MailParticipant),
|
|
9490
|
-
to: z120.array(MailParticipant),
|
|
9491
|
-
cc: z120.array(MailParticipant),
|
|
9492
|
-
bcc: z120.array(MailParticipant),
|
|
9493
|
-
attachments: z120.array(AttachmentSchema)
|
|
9494
|
-
});
|
|
9495
|
-
|
|
9496
|
-
// src/mail/schemas/room.schema.ts
|
|
9497
|
-
var ContactSchema3 = z121.object({
|
|
9498
|
-
id: z121.string().uuid(),
|
|
9453
|
+
import z121 from "zod";
|
|
9454
|
+
var MailServerSchema = z121.object({
|
|
9455
|
+
id: z121.string(),
|
|
9499
9456
|
createdAt: z121.date(),
|
|
9500
9457
|
updatedAt: z121.date(),
|
|
9501
9458
|
deletedAt: z121.date().nullable(),
|
|
9502
9459
|
name: z121.string(),
|
|
9503
|
-
|
|
9504
|
-
|
|
9505
|
-
|
|
9506
|
-
|
|
9507
|
-
|
|
9508
|
-
|
|
9509
|
-
|
|
9460
|
+
smtpHost: z121.string(),
|
|
9461
|
+
smtpPort: z121.number(),
|
|
9462
|
+
smtpTlsPort: z121.number(),
|
|
9463
|
+
useTlsForSmtp: z121.boolean(),
|
|
9464
|
+
imapHost: z121.string(),
|
|
9465
|
+
imapPort: z121.number(),
|
|
9466
|
+
imapTlsPort: z121.number(),
|
|
9467
|
+
useTlsForImap: z121.boolean()
|
|
9468
|
+
});
|
|
9469
|
+
var MailAccountSchema = z121.object({
|
|
9510
9470
|
id: z121.string(),
|
|
9511
9471
|
createdAt: z121.date(),
|
|
9512
9472
|
updatedAt: z121.date(),
|
|
9513
9473
|
deletedAt: z121.date().nullable(),
|
|
9514
9474
|
name: z121.string(),
|
|
9515
9475
|
address: z121.string(),
|
|
9516
|
-
|
|
9517
|
-
|
|
9518
|
-
|
|
9476
|
+
accountId: z121.string(),
|
|
9477
|
+
mailServerId: z121.string(),
|
|
9478
|
+
mailServer: MailServerSchema,
|
|
9479
|
+
state: z121.union([
|
|
9480
|
+
z121.literal("init"),
|
|
9481
|
+
z121.literal("syncing"),
|
|
9482
|
+
z121.literal("connecting"),
|
|
9483
|
+
z121.literal("connected"),
|
|
9484
|
+
z121.literal("disconnected"),
|
|
9485
|
+
z121.literal("authenticationError"),
|
|
9486
|
+
z121.literal("connectError"),
|
|
9487
|
+
z121.literal("unset")
|
|
9488
|
+
])
|
|
9519
9489
|
});
|
|
9520
|
-
var
|
|
9490
|
+
var OAuth2AppSchema = z121.object({
|
|
9521
9491
|
id: z121.string(),
|
|
9522
|
-
|
|
9523
|
-
|
|
9524
|
-
|
|
9525
|
-
|
|
9526
|
-
|
|
9527
|
-
|
|
9528
|
-
|
|
9492
|
+
name: z121.string(),
|
|
9493
|
+
description: z121.string(),
|
|
9494
|
+
title: z121.string(),
|
|
9495
|
+
provider: z121.string(),
|
|
9496
|
+
enabled: z121.boolean(),
|
|
9497
|
+
legacy: z121.boolean(),
|
|
9498
|
+
created: z121.string(),
|
|
9499
|
+
updated: z121.string(),
|
|
9500
|
+
includeInListing: z121.boolean(),
|
|
9501
|
+
clientId: z121.string(),
|
|
9502
|
+
clientSecret: z121.string(),
|
|
9503
|
+
authority: z121.string(),
|
|
9504
|
+
redirectUrl: z121.string(),
|
|
9505
|
+
serviceClient: z121.string(),
|
|
9506
|
+
googleProjectId: z121.string(),
|
|
9507
|
+
serviceClientEmail: z121.string(),
|
|
9508
|
+
serviceKey: z121.string()
|
|
9529
9509
|
});
|
|
9530
|
-
|
|
9531
|
-
|
|
9532
|
-
|
|
9533
|
-
|
|
9534
|
-
|
|
9535
|
-
|
|
9536
|
-
|
|
9510
|
+
|
|
9511
|
+
// src/mail/schemas/message.schema.ts
|
|
9512
|
+
import z122 from "zod";
|
|
9513
|
+
var AttachmentSchema = z122.object({
|
|
9514
|
+
id: z122.string(),
|
|
9515
|
+
createdAt: z122.date(),
|
|
9516
|
+
updatedAt: z122.date(),
|
|
9517
|
+
deletedAt: z122.nullable(z122.date()),
|
|
9518
|
+
roomId: z122.string(),
|
|
9519
|
+
messageId: z122.string(),
|
|
9520
|
+
fileName: z122.string(),
|
|
9521
|
+
fileType: z122.string(),
|
|
9522
|
+
emailEngineAttachmentId: z122.string(),
|
|
9523
|
+
uploadId: z122.string(),
|
|
9524
|
+
upload: z122.object({
|
|
9525
|
+
id: z122.string(),
|
|
9526
|
+
createdAt: z122.date(),
|
|
9527
|
+
updatedAt: z122.date(),
|
|
9528
|
+
deletedAt: z122.nullable(z122.date()),
|
|
9529
|
+
bucketName: z122.string(),
|
|
9530
|
+
fileName: z122.string(),
|
|
9531
|
+
fileKey: z122.string(),
|
|
9532
|
+
fileSize: z122.number(),
|
|
9533
|
+
fileUrl: z122.string(),
|
|
9534
|
+
extensionName: z122.string()
|
|
9535
|
+
})
|
|
9537
9536
|
});
|
|
9538
|
-
var
|
|
9539
|
-
id:
|
|
9540
|
-
createdAt:
|
|
9541
|
-
updatedAt:
|
|
9542
|
-
deletedAt:
|
|
9543
|
-
|
|
9544
|
-
|
|
9545
|
-
|
|
9546
|
-
|
|
9547
|
-
|
|
9537
|
+
var MessageSchema2 = z122.object({
|
|
9538
|
+
id: z122.string(),
|
|
9539
|
+
createdAt: z122.date(),
|
|
9540
|
+
updatedAt: z122.date(),
|
|
9541
|
+
deletedAt: z122.nullable(z122.date()),
|
|
9542
|
+
roomId: z122.string(),
|
|
9543
|
+
subject: z122.string(),
|
|
9544
|
+
textPlain: z122.string(),
|
|
9545
|
+
textHtml: z122.string(),
|
|
9546
|
+
textId: z122.string(),
|
|
9547
|
+
emailEngineEmailId: z122.string(),
|
|
9548
|
+
emailEngineMessageId: z122.string(),
|
|
9549
|
+
emailEngineReplyTo: z122.nullable(z122.string()),
|
|
9550
|
+
direction: z122.string(),
|
|
9551
|
+
date: z122.date(),
|
|
9552
|
+
action: z122.string(),
|
|
9553
|
+
unseen: z122.boolean(),
|
|
9554
|
+
sendAt: z122.date(),
|
|
9555
|
+
starred: z122.boolean(),
|
|
9556
|
+
seemsLikeNew: z122.boolean(),
|
|
9557
|
+
from: z122.array(MailParticipant),
|
|
9558
|
+
to: z122.array(MailParticipant),
|
|
9559
|
+
cc: z122.array(MailParticipant),
|
|
9560
|
+
bcc: z122.array(MailParticipant),
|
|
9561
|
+
attachments: z122.array(AttachmentSchema)
|
|
9548
9562
|
});
|
|
9549
|
-
|
|
9550
|
-
|
|
9551
|
-
|
|
9552
|
-
|
|
9553
|
-
|
|
9554
|
-
|
|
9555
|
-
|
|
9556
|
-
|
|
9563
|
+
|
|
9564
|
+
// src/mail/schemas/room.schema.ts
|
|
9565
|
+
var ContactSchema3 = z123.object({
|
|
9566
|
+
id: z123.string().uuid(),
|
|
9567
|
+
createdAt: z123.date(),
|
|
9568
|
+
updatedAt: z123.date(),
|
|
9569
|
+
deletedAt: z123.date().nullable(),
|
|
9570
|
+
name: z123.string(),
|
|
9571
|
+
address: z123.string().nullable(),
|
|
9572
|
+
channel: z123.string().nullable(),
|
|
9573
|
+
notes: z123.string().nullable(),
|
|
9574
|
+
contactProfile: z123.string().nullable(),
|
|
9575
|
+
socialProfileUrl: z123.string().nullable()
|
|
9576
|
+
});
|
|
9577
|
+
var MailUserSchema = z123.object({
|
|
9578
|
+
id: z123.string(),
|
|
9579
|
+
createdAt: z123.date(),
|
|
9580
|
+
updatedAt: z123.date(),
|
|
9581
|
+
deletedAt: z123.date().nullable(),
|
|
9582
|
+
name: z123.string(),
|
|
9583
|
+
address: z123.string(),
|
|
9584
|
+
contactId: z123.string(),
|
|
9585
|
+
contact: ContactSchema3,
|
|
9586
|
+
isNewContact: z123.boolean()
|
|
9587
|
+
});
|
|
9588
|
+
var MailParticipant = z123.object({
|
|
9589
|
+
id: z123.string(),
|
|
9590
|
+
createdAt: z123.date(),
|
|
9591
|
+
updatedAt: z123.date(),
|
|
9592
|
+
deletedAt: z123.date().nullable(),
|
|
9593
|
+
roomId: z123.string(),
|
|
9594
|
+
messageId: z123.string(),
|
|
9595
|
+
mailUserId: z123.string(),
|
|
9596
|
+
mailUser: MailUserSchema
|
|
9597
|
+
});
|
|
9598
|
+
var TagSchema2 = z123.object({
|
|
9599
|
+
color: z123.string(),
|
|
9600
|
+
id: z123.string(),
|
|
9601
|
+
createdAt: z123.date(),
|
|
9602
|
+
updatedAt: z123.date(),
|
|
9603
|
+
deletedAt: z123.date().nullable(),
|
|
9604
|
+
name: z123.string()
|
|
9605
|
+
});
|
|
9606
|
+
var UserModel = z123.object({
|
|
9607
|
+
id: z123.string().uuid(),
|
|
9608
|
+
createdAt: z123.date(),
|
|
9609
|
+
updatedAt: z123.date(),
|
|
9610
|
+
deletedAt: z123.date().nullable(),
|
|
9611
|
+
name: z123.string(),
|
|
9612
|
+
email: z123.string(),
|
|
9613
|
+
address: z123.string().nullable(),
|
|
9614
|
+
phone: z123.string().nullable(),
|
|
9615
|
+
notificationCount: z123.number().nullable()
|
|
9616
|
+
});
|
|
9617
|
+
var ActivityLogModel = z123.object({
|
|
9618
|
+
id: z123.string(),
|
|
9619
|
+
createdAt: z123.date(),
|
|
9620
|
+
updatedAt: z123.date(),
|
|
9621
|
+
deletedAt: z123.nullable(z123.string()),
|
|
9622
|
+
description: z123.string(),
|
|
9623
|
+
actorId: z123.string(),
|
|
9624
|
+
roomId: z123.string(),
|
|
9557
9625
|
actor: UserModel
|
|
9558
9626
|
});
|
|
9559
|
-
var MessagesAndLogsSchema =
|
|
9560
|
-
|
|
9627
|
+
var MessagesAndLogsSchema = z123.array(
|
|
9628
|
+
z123.union([MessageSchema2, ActivityLogModel])
|
|
9561
9629
|
);
|
|
9562
|
-
var MailRoomSchema =
|
|
9563
|
-
id:
|
|
9564
|
-
createdAt:
|
|
9565
|
-
updatedAt:
|
|
9566
|
-
deletedAt:
|
|
9567
|
-
subject:
|
|
9568
|
-
resolved:
|
|
9569
|
-
assigneeId:
|
|
9570
|
-
note:
|
|
9571
|
-
mailId:
|
|
9572
|
-
direction:
|
|
9573
|
-
lastMessageId:
|
|
9574
|
-
firstMessageId:
|
|
9575
|
-
from:
|
|
9576
|
-
to:
|
|
9577
|
-
cc:
|
|
9578
|
-
bcc:
|
|
9630
|
+
var MailRoomSchema = z123.object({
|
|
9631
|
+
id: z123.string(),
|
|
9632
|
+
createdAt: z123.date(),
|
|
9633
|
+
updatedAt: z123.date(),
|
|
9634
|
+
deletedAt: z123.date().nullable(),
|
|
9635
|
+
subject: z123.string(),
|
|
9636
|
+
resolved: z123.boolean(),
|
|
9637
|
+
assigneeId: z123.string().nullable(),
|
|
9638
|
+
note: z123.string(),
|
|
9639
|
+
mailId: z123.string(),
|
|
9640
|
+
direction: z123.string(),
|
|
9641
|
+
lastMessageId: z123.string(),
|
|
9642
|
+
firstMessageId: z123.string(),
|
|
9643
|
+
from: z123.array(MailParticipant),
|
|
9644
|
+
to: z123.array(MailParticipant),
|
|
9645
|
+
cc: z123.array(MailParticipant),
|
|
9646
|
+
bcc: z123.array(MailParticipant),
|
|
9579
9647
|
firstMessage: MessageSchema2,
|
|
9580
9648
|
lastMessage: MessageSchema2,
|
|
9581
|
-
tags:
|
|
9649
|
+
tags: z123.array(TagSchema2),
|
|
9582
9650
|
assignee: UserModel,
|
|
9583
|
-
messages:
|
|
9651
|
+
messages: z123.array(MessageSchema2),
|
|
9584
9652
|
messagesAndLogs: MessagesAndLogsSchema,
|
|
9585
9653
|
mail: MailAccountSchema,
|
|
9586
|
-
unReadMessageCount:
|
|
9654
|
+
unReadMessageCount: z123.number(),
|
|
9587
9655
|
cxlog: CxLogSchema
|
|
9588
9656
|
});
|
|
9589
|
-
var AttachmentSchema2 =
|
|
9590
|
-
fileName:
|
|
9591
|
-
fileType:
|
|
9592
|
-
emailEngineAttachmentId:
|
|
9593
|
-
uploadId:
|
|
9594
|
-
messageId:
|
|
9595
|
-
roomId:
|
|
9657
|
+
var AttachmentSchema2 = z123.object({
|
|
9658
|
+
fileName: z123.string(),
|
|
9659
|
+
fileType: z123.string(),
|
|
9660
|
+
emailEngineAttachmentId: z123.string(),
|
|
9661
|
+
uploadId: z123.string(),
|
|
9662
|
+
messageId: z123.string(),
|
|
9663
|
+
roomId: z123.string(),
|
|
9596
9664
|
upload: UploadSchema
|
|
9597
9665
|
});
|
|
9598
9666
|
|
|
9599
9667
|
// src/mail/schemas/room-validation.schema.ts
|
|
9600
|
-
import
|
|
9668
|
+
import z124 from "zod";
|
|
9601
9669
|
var RoomContractsValidationSchema = {
|
|
9602
9670
|
getAll: {
|
|
9603
|
-
input:
|
|
9604
|
-
page:
|
|
9605
|
-
pageSize:
|
|
9606
|
-
keyword:
|
|
9607
|
-
value:
|
|
9608
|
-
category:
|
|
9671
|
+
input: z124.object({
|
|
9672
|
+
page: z124.coerce.number().default(1),
|
|
9673
|
+
pageSize: z124.coerce.number().default(10),
|
|
9674
|
+
keyword: z124.object({
|
|
9675
|
+
value: z124.string(),
|
|
9676
|
+
category: z124.union([z124.literal("contact"), z124.literal("message")])
|
|
9609
9677
|
}).optional(),
|
|
9610
|
-
contactLabels:
|
|
9611
|
-
channels:
|
|
9612
|
-
date:
|
|
9613
|
-
contacts:
|
|
9614
|
-
assignees:
|
|
9615
|
-
level1:
|
|
9616
|
-
|
|
9617
|
-
|
|
9618
|
-
|
|
9619
|
-
|
|
9620
|
-
|
|
9621
|
-
|
|
9678
|
+
contactLabels: z124.array(z124.string()).optional(),
|
|
9679
|
+
channels: z124.array(z124.string().email()).optional(),
|
|
9680
|
+
date: z124.string().optional(),
|
|
9681
|
+
contacts: z124.array(z124.string()).optional(),
|
|
9682
|
+
assignees: z124.array(z124.string()).optional(),
|
|
9683
|
+
level1: z124.union([
|
|
9684
|
+
z124.literal("open"),
|
|
9685
|
+
z124.literal("close"),
|
|
9686
|
+
z124.literal("inbox"),
|
|
9687
|
+
z124.literal("sent"),
|
|
9688
|
+
z124.literal("scheduled"),
|
|
9689
|
+
z124.literal("starred")
|
|
9622
9690
|
]).optional(),
|
|
9623
|
-
level2:
|
|
9624
|
-
|
|
9625
|
-
|
|
9626
|
-
|
|
9627
|
-
|
|
9691
|
+
level2: z124.union([
|
|
9692
|
+
z124.literal("all"),
|
|
9693
|
+
z124.literal("unassign"),
|
|
9694
|
+
z124.literal("mine"),
|
|
9695
|
+
z124.literal("other")
|
|
9628
9696
|
]).optional()
|
|
9629
9697
|
}),
|
|
9630
|
-
output:
|
|
9631
|
-
data:
|
|
9632
|
-
total:
|
|
9633
|
-
page:
|
|
9634
|
-
pageSize:
|
|
9698
|
+
output: z124.object({
|
|
9699
|
+
data: z124.array(MailRoomSchema),
|
|
9700
|
+
total: z124.number(),
|
|
9701
|
+
page: z124.number(),
|
|
9702
|
+
pageSize: z124.number()
|
|
9635
9703
|
})
|
|
9636
9704
|
},
|
|
9637
9705
|
update: {
|
|
9638
|
-
input:
|
|
9639
|
-
disposition:
|
|
9640
|
-
|
|
9641
|
-
|
|
9642
|
-
|
|
9643
|
-
|
|
9644
|
-
|
|
9645
|
-
|
|
9706
|
+
input: z124.object({
|
|
9707
|
+
disposition: z124.union([
|
|
9708
|
+
z124.literal("resolved"),
|
|
9709
|
+
z124.literal("follow up"),
|
|
9710
|
+
z124.literal("escalated"),
|
|
9711
|
+
z124.literal("dropped"),
|
|
9712
|
+
z124.literal("prank"),
|
|
9713
|
+
z124.literal("blank")
|
|
9646
9714
|
]).optional().nullable(),
|
|
9647
|
-
assigneeId:
|
|
9648
|
-
note:
|
|
9649
|
-
tags:
|
|
9650
|
-
handover:
|
|
9651
|
-
|
|
9715
|
+
assigneeId: z124.string().uuid().optional().nullable(),
|
|
9716
|
+
note: z124.string().optional(),
|
|
9717
|
+
tags: z124.array(z124.string().uuid()).optional(),
|
|
9718
|
+
handover: z124.boolean().or(
|
|
9719
|
+
z124.union([z124.literal("true"), z124.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
|
9652
9720
|
).optional().nullable(),
|
|
9653
|
-
selfAssign:
|
|
9654
|
-
|
|
9721
|
+
selfAssign: z124.boolean().or(
|
|
9722
|
+
z124.union([z124.literal("true"), z124.literal("false")]).transform((value) => value.toLowerCase() === "true")
|
|
9655
9723
|
).optional().nullable()
|
|
9656
9724
|
})
|
|
9657
9725
|
}
|
|
9658
9726
|
};
|
|
9659
9727
|
|
|
9660
9728
|
// src/mail/room-contract.ts
|
|
9661
|
-
var roomContract =
|
|
9729
|
+
var roomContract = initContract47().router(
|
|
9662
9730
|
{
|
|
9663
9731
|
create: {
|
|
9664
9732
|
method: "POST",
|
|
9665
9733
|
path: "/",
|
|
9666
9734
|
responses: {
|
|
9667
9735
|
200: DefaultSuccessResponseSchema.extend({
|
|
9668
|
-
message:
|
|
9736
|
+
message: z125.string()
|
|
9669
9737
|
}),
|
|
9670
9738
|
...DefaultResponses
|
|
9671
9739
|
},
|
|
@@ -9678,10 +9746,10 @@ var roomContract = initContract46().router(
|
|
|
9678
9746
|
query: RoomContractsValidationSchema.getAll.input,
|
|
9679
9747
|
responses: {
|
|
9680
9748
|
200: DefaultSuccessResponseSchema.extend({
|
|
9681
|
-
data:
|
|
9682
|
-
total:
|
|
9683
|
-
page:
|
|
9684
|
-
pageSize:
|
|
9749
|
+
data: z125.array(MailRoomSchema),
|
|
9750
|
+
total: z125.number(),
|
|
9751
|
+
page: z125.number(),
|
|
9752
|
+
pageSize: z125.number()
|
|
9685
9753
|
}),
|
|
9686
9754
|
...DefaultResponses
|
|
9687
9755
|
},
|
|
@@ -9693,24 +9761,24 @@ var roomContract = initContract46().router(
|
|
|
9693
9761
|
path: "/count_rooms/all",
|
|
9694
9762
|
responses: {
|
|
9695
9763
|
200: DefaultSuccessResponseSchema.extend({
|
|
9696
|
-
data:
|
|
9697
|
-
general:
|
|
9698
|
-
|
|
9699
|
-
name:
|
|
9700
|
-
count:
|
|
9701
|
-
unReadMessagesCount:
|
|
9764
|
+
data: z125.object({
|
|
9765
|
+
general: z125.array(
|
|
9766
|
+
z125.object({
|
|
9767
|
+
name: z125.string(),
|
|
9768
|
+
count: z125.number(),
|
|
9769
|
+
unReadMessagesCount: z125.number()
|
|
9702
9770
|
})
|
|
9703
9771
|
),
|
|
9704
|
-
channels:
|
|
9705
|
-
|
|
9772
|
+
channels: z125.array(
|
|
9773
|
+
z125.object({
|
|
9706
9774
|
channel: MailAccountSchema,
|
|
9707
|
-
count:
|
|
9775
|
+
count: z125.number()
|
|
9708
9776
|
})
|
|
9709
9777
|
),
|
|
9710
|
-
contactLabels:
|
|
9711
|
-
|
|
9778
|
+
contactLabels: z125.array(
|
|
9779
|
+
z125.object({
|
|
9712
9780
|
label: TagSchema,
|
|
9713
|
-
count:
|
|
9781
|
+
count: z125.number()
|
|
9714
9782
|
})
|
|
9715
9783
|
)
|
|
9716
9784
|
})
|
|
@@ -9722,12 +9790,12 @@ var roomContract = initContract46().router(
|
|
|
9722
9790
|
getAttachments: {
|
|
9723
9791
|
method: "GET",
|
|
9724
9792
|
path: "/:id/attachments",
|
|
9725
|
-
pathParams:
|
|
9726
|
-
id:
|
|
9793
|
+
pathParams: z125.object({
|
|
9794
|
+
id: z125.string().uuid()
|
|
9727
9795
|
}),
|
|
9728
9796
|
responses: {
|
|
9729
9797
|
200: DefaultSuccessResponseSchema.extend({
|
|
9730
|
-
data:
|
|
9798
|
+
data: z125.array(AttachmentSchema2)
|
|
9731
9799
|
}),
|
|
9732
9800
|
...DefaultResponses
|
|
9733
9801
|
},
|
|
@@ -9736,12 +9804,12 @@ var roomContract = initContract46().router(
|
|
|
9736
9804
|
getParticipants: {
|
|
9737
9805
|
method: "GET",
|
|
9738
9806
|
path: "/:id/participants",
|
|
9739
|
-
pathParams:
|
|
9740
|
-
id:
|
|
9807
|
+
pathParams: z125.object({
|
|
9808
|
+
id: z125.string().uuid()
|
|
9741
9809
|
}),
|
|
9742
9810
|
responses: {
|
|
9743
9811
|
200: DefaultSuccessResponseSchema.extend({
|
|
9744
|
-
data:
|
|
9812
|
+
data: z125.array(MailParticipant)
|
|
9745
9813
|
}),
|
|
9746
9814
|
...DefaultResponses
|
|
9747
9815
|
},
|
|
@@ -9752,22 +9820,22 @@ var roomContract = initContract46().router(
|
|
|
9752
9820
|
path: "/add_email_to_contact",
|
|
9753
9821
|
responses: {
|
|
9754
9822
|
200: DefaultSuccessResponseSchema.extend({
|
|
9755
|
-
data:
|
|
9823
|
+
data: z125.string()
|
|
9756
9824
|
}),
|
|
9757
9825
|
...DefaultResponses
|
|
9758
9826
|
},
|
|
9759
|
-
body:
|
|
9760
|
-
email:
|
|
9761
|
-
contactId:
|
|
9762
|
-
mailUserId:
|
|
9827
|
+
body: z125.object({
|
|
9828
|
+
email: z125.string(),
|
|
9829
|
+
contactId: z125.string(),
|
|
9830
|
+
mailUserId: z125.string()
|
|
9763
9831
|
}),
|
|
9764
9832
|
summary: "Add a new email of a mail room participant to an existing contact"
|
|
9765
9833
|
},
|
|
9766
9834
|
update: {
|
|
9767
9835
|
method: "PATCH",
|
|
9768
9836
|
path: "/:id",
|
|
9769
|
-
pathParams:
|
|
9770
|
-
id:
|
|
9837
|
+
pathParams: z125.object({
|
|
9838
|
+
id: z125.string()
|
|
9771
9839
|
}),
|
|
9772
9840
|
responses: {
|
|
9773
9841
|
200: DefaultSuccessResponseSchema.extend({
|
|
@@ -9781,12 +9849,12 @@ var roomContract = initContract46().router(
|
|
|
9781
9849
|
markAsRead: {
|
|
9782
9850
|
method: "POST",
|
|
9783
9851
|
path: "/mark_as_read",
|
|
9784
|
-
body:
|
|
9785
|
-
id:
|
|
9852
|
+
body: z125.object({
|
|
9853
|
+
id: z125.string()
|
|
9786
9854
|
}),
|
|
9787
9855
|
responses: {
|
|
9788
9856
|
200: DefaultSuccessResponseSchema.extend({
|
|
9789
|
-
message:
|
|
9857
|
+
message: z125.string()
|
|
9790
9858
|
}),
|
|
9791
9859
|
...DefaultResponses
|
|
9792
9860
|
},
|
|
@@ -9795,8 +9863,8 @@ var roomContract = initContract46().router(
|
|
|
9795
9863
|
getById: {
|
|
9796
9864
|
method: "GET",
|
|
9797
9865
|
path: "/:id",
|
|
9798
|
-
pathParams:
|
|
9799
|
-
id:
|
|
9866
|
+
pathParams: z125.object({
|
|
9867
|
+
id: z125.string().uuid()
|
|
9800
9868
|
}),
|
|
9801
9869
|
responses: {
|
|
9802
9870
|
200: DefaultSuccessResponseSchema.extend({
|
|
@@ -9813,78 +9881,78 @@ var roomContract = initContract46().router(
|
|
|
9813
9881
|
);
|
|
9814
9882
|
|
|
9815
9883
|
// src/mail/account-contract.ts
|
|
9816
|
-
import { initContract as
|
|
9817
|
-
import
|
|
9884
|
+
import { initContract as initContract48 } from "@ts-rest/core";
|
|
9885
|
+
import z127 from "zod";
|
|
9818
9886
|
|
|
9819
9887
|
// src/mail/schemas/account-validation.schema.ts
|
|
9820
|
-
import
|
|
9888
|
+
import z126 from "zod";
|
|
9821
9889
|
var AccountContractsValidationSchemas = {
|
|
9822
9890
|
create: {
|
|
9823
|
-
input:
|
|
9824
|
-
address:
|
|
9825
|
-
name:
|
|
9826
|
-
password:
|
|
9827
|
-
mailServerId:
|
|
9891
|
+
input: z126.object({
|
|
9892
|
+
address: z126.string().min(1, "Email address cannot be empty.").email("Invalid email address."),
|
|
9893
|
+
name: z126.string().min(1, "Account name cannot be empty."),
|
|
9894
|
+
password: z126.string().min(1, "Password cannot be empty."),
|
|
9895
|
+
mailServerId: z126.string().uuid("Invalid mail_server_id")
|
|
9828
9896
|
})
|
|
9829
9897
|
},
|
|
9830
9898
|
getById: {
|
|
9831
|
-
input:
|
|
9832
|
-
id:
|
|
9899
|
+
input: z126.object({
|
|
9900
|
+
id: z126.string().uuid()
|
|
9833
9901
|
}),
|
|
9834
9902
|
output: MailAccountSchema
|
|
9835
9903
|
},
|
|
9836
9904
|
getAll: {
|
|
9837
|
-
output:
|
|
9905
|
+
output: z126.array(MailAccountSchema)
|
|
9838
9906
|
},
|
|
9839
9907
|
update: {
|
|
9840
9908
|
input: MailAccountSchema,
|
|
9841
9909
|
output: MailAccountSchema
|
|
9842
9910
|
},
|
|
9843
9911
|
disconnect: {
|
|
9844
|
-
input:
|
|
9845
|
-
id:
|
|
9912
|
+
input: z126.object({
|
|
9913
|
+
id: z126.string().uuid()
|
|
9846
9914
|
}),
|
|
9847
9915
|
output: MailAccountSchema
|
|
9848
9916
|
},
|
|
9849
9917
|
reconnect: {
|
|
9850
|
-
input:
|
|
9851
|
-
id:
|
|
9918
|
+
input: z126.object({
|
|
9919
|
+
id: z126.string()
|
|
9852
9920
|
}),
|
|
9853
9921
|
output: MailAccountSchema
|
|
9854
9922
|
},
|
|
9855
9923
|
delete: {
|
|
9856
|
-
input:
|
|
9857
|
-
id:
|
|
9924
|
+
input: z126.object({
|
|
9925
|
+
id: z126.string()
|
|
9858
9926
|
}),
|
|
9859
|
-
output:
|
|
9927
|
+
output: z126.string()
|
|
9860
9928
|
},
|
|
9861
9929
|
deleteEmailEngineAcc: {
|
|
9862
|
-
input:
|
|
9863
|
-
account:
|
|
9930
|
+
input: z126.object({
|
|
9931
|
+
account: z126.string()
|
|
9864
9932
|
}),
|
|
9865
9933
|
output: MailAccountSchema
|
|
9866
9934
|
},
|
|
9867
9935
|
generateOAuth2AuthenticationLink: {
|
|
9868
|
-
body:
|
|
9869
|
-
oAuth2AppId:
|
|
9870
|
-
mailServerId:
|
|
9936
|
+
body: z126.object({
|
|
9937
|
+
oAuth2AppId: z126.string(),
|
|
9938
|
+
mailServerId: z126.string()
|
|
9871
9939
|
}),
|
|
9872
|
-
response:
|
|
9873
|
-
url:
|
|
9874
|
-
account:
|
|
9940
|
+
response: z126.object({
|
|
9941
|
+
url: z126.string(),
|
|
9942
|
+
account: z126.string()
|
|
9875
9943
|
})
|
|
9876
9944
|
},
|
|
9877
9945
|
createOAuth2Acc: {
|
|
9878
|
-
body:
|
|
9879
|
-
account:
|
|
9880
|
-
name:
|
|
9946
|
+
body: z126.object({
|
|
9947
|
+
account: z126.string(),
|
|
9948
|
+
name: z126.string()
|
|
9881
9949
|
}),
|
|
9882
9950
|
response: MailAccountSchema
|
|
9883
9951
|
}
|
|
9884
9952
|
};
|
|
9885
9953
|
|
|
9886
9954
|
// src/mail/account-contract.ts
|
|
9887
|
-
var accountContract =
|
|
9955
|
+
var accountContract = initContract48().router(
|
|
9888
9956
|
{
|
|
9889
9957
|
//#region ........register account
|
|
9890
9958
|
create: {
|
|
@@ -9895,14 +9963,14 @@ var accountContract = initContract47().router(
|
|
|
9895
9963
|
// data: AccountContractsValidationSchemas.create.output,
|
|
9896
9964
|
data: MailAccountSchema
|
|
9897
9965
|
}),
|
|
9898
|
-
400:
|
|
9899
|
-
message:
|
|
9966
|
+
400: z127.object({
|
|
9967
|
+
message: z127.string()
|
|
9900
9968
|
}),
|
|
9901
|
-
409:
|
|
9902
|
-
message:
|
|
9969
|
+
409: z127.object({
|
|
9970
|
+
message: z127.string()
|
|
9903
9971
|
}),
|
|
9904
|
-
500:
|
|
9905
|
-
message:
|
|
9972
|
+
500: z127.object({
|
|
9973
|
+
message: z127.string()
|
|
9906
9974
|
}),
|
|
9907
9975
|
...DefaultResponses
|
|
9908
9976
|
},
|
|
@@ -9918,14 +9986,14 @@ var accountContract = initContract47().router(
|
|
|
9918
9986
|
201: DefaultSuccessResponseSchema.extend({
|
|
9919
9987
|
data: AccountContractsValidationSchemas.generateOAuth2AuthenticationLink.response
|
|
9920
9988
|
}),
|
|
9921
|
-
400:
|
|
9922
|
-
message:
|
|
9989
|
+
400: z127.object({
|
|
9990
|
+
message: z127.string()
|
|
9923
9991
|
}),
|
|
9924
|
-
409:
|
|
9925
|
-
message:
|
|
9992
|
+
409: z127.object({
|
|
9993
|
+
message: z127.string()
|
|
9926
9994
|
}),
|
|
9927
|
-
500:
|
|
9928
|
-
message:
|
|
9995
|
+
500: z127.object({
|
|
9996
|
+
message: z127.string()
|
|
9929
9997
|
}),
|
|
9930
9998
|
...DefaultResponses
|
|
9931
9999
|
},
|
|
@@ -9939,7 +10007,7 @@ var accountContract = initContract47().router(
|
|
|
9939
10007
|
path: "/sync",
|
|
9940
10008
|
responses: {
|
|
9941
10009
|
200: DefaultSuccessResponseSchema.extend({
|
|
9942
|
-
message:
|
|
10010
|
+
message: z127.string()
|
|
9943
10011
|
}),
|
|
9944
10012
|
...DefaultResponses
|
|
9945
10013
|
},
|
|
@@ -9964,13 +10032,13 @@ var accountContract = initContract47().router(
|
|
|
9964
10032
|
getAll: {
|
|
9965
10033
|
method: "GET",
|
|
9966
10034
|
path: "",
|
|
9967
|
-
query:
|
|
9968
|
-
state:
|
|
9969
|
-
withDeleted:
|
|
10035
|
+
query: z127.object({
|
|
10036
|
+
state: z127.union([z127.literal("connected"), z127.literal("disconnected")]).optional(),
|
|
10037
|
+
withDeleted: z127.boolean().default(false)
|
|
9970
10038
|
}).optional(),
|
|
9971
10039
|
responses: {
|
|
9972
10040
|
200: DefaultSuccessResponseSchema.extend({
|
|
9973
|
-
data:
|
|
10041
|
+
data: z127.array(MailAccountSchema)
|
|
9974
10042
|
}),
|
|
9975
10043
|
...DefaultResponses
|
|
9976
10044
|
},
|
|
@@ -9981,8 +10049,8 @@ var accountContract = initContract47().router(
|
|
|
9981
10049
|
update: {
|
|
9982
10050
|
method: "PATCH",
|
|
9983
10051
|
path: "/:id",
|
|
9984
|
-
pathParams:
|
|
9985
|
-
id:
|
|
10052
|
+
pathParams: z127.object({
|
|
10053
|
+
id: z127.string().uuid()
|
|
9986
10054
|
}),
|
|
9987
10055
|
responses: {
|
|
9988
10056
|
201: DefaultSuccessResponseSchema.extend({
|
|
@@ -10031,7 +10099,7 @@ var accountContract = initContract47().router(
|
|
|
10031
10099
|
pathParams: AccountContractsValidationSchemas.delete.input,
|
|
10032
10100
|
responses: {
|
|
10033
10101
|
200: DefaultSuccessResponseSchema.extend({
|
|
10034
|
-
message:
|
|
10102
|
+
message: z127.string()
|
|
10035
10103
|
}),
|
|
10036
10104
|
...DefaultResponses
|
|
10037
10105
|
},
|
|
@@ -10046,7 +10114,7 @@ var accountContract = initContract47().router(
|
|
|
10046
10114
|
pathParams: AccountContractsValidationSchemas.deleteEmailEngineAcc.input,
|
|
10047
10115
|
responses: {
|
|
10048
10116
|
200: DefaultSuccessResponseSchema.extend({
|
|
10049
|
-
message:
|
|
10117
|
+
message: z127.string()
|
|
10050
10118
|
}),
|
|
10051
10119
|
...DefaultResponses
|
|
10052
10120
|
},
|
|
@@ -10074,25 +10142,25 @@ var accountContract = initContract47().router(
|
|
|
10074
10142
|
);
|
|
10075
10143
|
|
|
10076
10144
|
// src/mail/mail-server-contract.ts
|
|
10077
|
-
import { initContract as
|
|
10078
|
-
import
|
|
10145
|
+
import { initContract as initContract49 } from "@ts-rest/core";
|
|
10146
|
+
import z129 from "zod";
|
|
10079
10147
|
|
|
10080
10148
|
// src/mail/schemas/servers-validation.schema.ts
|
|
10081
|
-
import
|
|
10082
|
-
var CreateMailServerSchema =
|
|
10083
|
-
name:
|
|
10084
|
-
smtpHost:
|
|
10085
|
-
smtpPort:
|
|
10086
|
-
smtpTlsPort:
|
|
10087
|
-
useTlsForSmtp:
|
|
10088
|
-
imapHost:
|
|
10089
|
-
imapPort:
|
|
10090
|
-
imapTlsPort:
|
|
10091
|
-
useTlsForImap:
|
|
10149
|
+
import z128 from "zod";
|
|
10150
|
+
var CreateMailServerSchema = z128.object({
|
|
10151
|
+
name: z128.string(),
|
|
10152
|
+
smtpHost: z128.string(),
|
|
10153
|
+
smtpPort: z128.number(),
|
|
10154
|
+
smtpTlsPort: z128.number(),
|
|
10155
|
+
useTlsForSmtp: z128.boolean(),
|
|
10156
|
+
imapHost: z128.string(),
|
|
10157
|
+
imapPort: z128.number(),
|
|
10158
|
+
imapTlsPort: z128.number(),
|
|
10159
|
+
useTlsForImap: z128.boolean()
|
|
10092
10160
|
});
|
|
10093
10161
|
|
|
10094
10162
|
// src/mail/mail-server-contract.ts
|
|
10095
|
-
var serverContract =
|
|
10163
|
+
var serverContract = initContract49().router(
|
|
10096
10164
|
{
|
|
10097
10165
|
create: {
|
|
10098
10166
|
method: "POST",
|
|
@@ -10111,11 +10179,11 @@ var serverContract = initContract48().router(
|
|
|
10111
10179
|
path: "/oauth2/apps",
|
|
10112
10180
|
responses: {
|
|
10113
10181
|
200: DefaultSuccessResponseSchema.extend({
|
|
10114
|
-
data:
|
|
10115
|
-
total:
|
|
10116
|
-
pages:
|
|
10117
|
-
page:
|
|
10118
|
-
apps:
|
|
10182
|
+
data: z129.object({
|
|
10183
|
+
total: z129.number(),
|
|
10184
|
+
pages: z129.number(),
|
|
10185
|
+
page: z129.number(),
|
|
10186
|
+
apps: z129.array(OAuth2AppSchema)
|
|
10119
10187
|
})
|
|
10120
10188
|
}),
|
|
10121
10189
|
...DefaultResponses
|
|
@@ -10125,8 +10193,8 @@ var serverContract = initContract48().router(
|
|
|
10125
10193
|
getById: {
|
|
10126
10194
|
method: "GET",
|
|
10127
10195
|
path: "/:id",
|
|
10128
|
-
pathParams:
|
|
10129
|
-
id:
|
|
10196
|
+
pathParams: z129.object({
|
|
10197
|
+
id: z129.string().uuid()
|
|
10130
10198
|
}),
|
|
10131
10199
|
responses: {
|
|
10132
10200
|
200: DefaultSuccessResponseSchema.extend({
|
|
@@ -10141,7 +10209,7 @@ var serverContract = initContract48().router(
|
|
|
10141
10209
|
path: "/",
|
|
10142
10210
|
responses: {
|
|
10143
10211
|
200: DefaultSuccessResponseSchema.extend({
|
|
10144
|
-
data:
|
|
10212
|
+
data: z129.array(MailServerSchema)
|
|
10145
10213
|
}),
|
|
10146
10214
|
...DefaultResponses
|
|
10147
10215
|
},
|
|
@@ -10150,8 +10218,8 @@ var serverContract = initContract48().router(
|
|
|
10150
10218
|
update: {
|
|
10151
10219
|
method: "PATCH",
|
|
10152
10220
|
path: "/:id",
|
|
10153
|
-
pathParams:
|
|
10154
|
-
id:
|
|
10221
|
+
pathParams: z129.object({
|
|
10222
|
+
id: z129.string().uuid()
|
|
10155
10223
|
}),
|
|
10156
10224
|
responses: {
|
|
10157
10225
|
200: DefaultSuccessResponseSchema.extend({
|
|
@@ -10165,8 +10233,8 @@ var serverContract = initContract48().router(
|
|
|
10165
10233
|
delete: {
|
|
10166
10234
|
method: "DELETE",
|
|
10167
10235
|
path: "/:id",
|
|
10168
|
-
pathParams:
|
|
10169
|
-
id:
|
|
10236
|
+
pathParams: z129.object({
|
|
10237
|
+
id: z129.string().uuid()
|
|
10170
10238
|
}),
|
|
10171
10239
|
responses: {
|
|
10172
10240
|
200: DefaultSuccessResponseSchema.extend({
|
|
@@ -10184,52 +10252,52 @@ var serverContract = initContract48().router(
|
|
|
10184
10252
|
);
|
|
10185
10253
|
|
|
10186
10254
|
// src/mail/message-contract.ts
|
|
10187
|
-
import { initContract as
|
|
10188
|
-
import
|
|
10255
|
+
import { initContract as initContract50 } from "@ts-rest/core";
|
|
10256
|
+
import z131 from "zod";
|
|
10189
10257
|
|
|
10190
10258
|
// src/mail/schemas/message-validation.schema.ts
|
|
10191
|
-
import
|
|
10192
|
-
var MailParticipant2 =
|
|
10193
|
-
name:
|
|
10194
|
-
address:
|
|
10259
|
+
import z130 from "zod";
|
|
10260
|
+
var MailParticipant2 = z130.object({
|
|
10261
|
+
name: z130.string().optional(),
|
|
10262
|
+
address: z130.string().email()
|
|
10195
10263
|
});
|
|
10196
10264
|
var MessageContractsValidationsSchema = {
|
|
10197
10265
|
submit: {
|
|
10198
|
-
input:
|
|
10199
|
-
subject:
|
|
10200
|
-
text:
|
|
10201
|
-
html:
|
|
10266
|
+
input: z130.object({
|
|
10267
|
+
subject: z130.string(),
|
|
10268
|
+
text: z130.string(),
|
|
10269
|
+
html: z130.string(),
|
|
10202
10270
|
from: MailParticipant2,
|
|
10203
10271
|
to: MailParticipant2,
|
|
10204
|
-
cc:
|
|
10205
|
-
bcc:
|
|
10206
|
-
sendAt:
|
|
10207
|
-
reference:
|
|
10208
|
-
messageId:
|
|
10209
|
-
action:
|
|
10272
|
+
cc: z130.array(MailParticipant2).optional(),
|
|
10273
|
+
bcc: z130.array(MailParticipant2).optional(),
|
|
10274
|
+
sendAt: z130.string().optional(),
|
|
10275
|
+
reference: z130.object({
|
|
10276
|
+
messageId: z130.string(),
|
|
10277
|
+
action: z130.union([z130.literal("reply"), z130.literal("forward")])
|
|
10210
10278
|
}).optional(),
|
|
10211
|
-
attachments:
|
|
10212
|
-
|
|
10213
|
-
fileType:
|
|
10214
|
-
fileName:
|
|
10215
|
-
fileKey:
|
|
10216
|
-
fileSize:
|
|
10217
|
-
bucketName:
|
|
10218
|
-
presignedUrl:
|
|
10279
|
+
attachments: z130.array(
|
|
10280
|
+
z130.object({
|
|
10281
|
+
fileType: z130.string(),
|
|
10282
|
+
fileName: z130.string(),
|
|
10283
|
+
fileKey: z130.string(),
|
|
10284
|
+
fileSize: z130.number(),
|
|
10285
|
+
bucketName: z130.string(),
|
|
10286
|
+
presignedUrl: z130.string()
|
|
10219
10287
|
})
|
|
10220
10288
|
).optional()
|
|
10221
10289
|
}),
|
|
10222
|
-
output:
|
|
10223
|
-
response:
|
|
10224
|
-
messageId:
|
|
10225
|
-
sendAt:
|
|
10226
|
-
queueId:
|
|
10290
|
+
output: z130.object({
|
|
10291
|
+
response: z130.string(),
|
|
10292
|
+
messageId: z130.string(),
|
|
10293
|
+
sendAt: z130.string(),
|
|
10294
|
+
queueId: z130.string()
|
|
10227
10295
|
})
|
|
10228
10296
|
}
|
|
10229
10297
|
};
|
|
10230
10298
|
|
|
10231
10299
|
// src/mail/message-contract.ts
|
|
10232
|
-
var messageContract =
|
|
10300
|
+
var messageContract = initContract50().router(
|
|
10233
10301
|
{
|
|
10234
10302
|
submit: {
|
|
10235
10303
|
method: "POST",
|
|
@@ -10252,8 +10320,8 @@ var messageContract = initContract49().router(
|
|
|
10252
10320
|
path: "/new_message_count",
|
|
10253
10321
|
responses: {
|
|
10254
10322
|
200: DefaultSuccessResponseSchema.extend({
|
|
10255
|
-
data:
|
|
10256
|
-
count:
|
|
10323
|
+
data: z131.object({
|
|
10324
|
+
count: z131.number()
|
|
10257
10325
|
})
|
|
10258
10326
|
}),
|
|
10259
10327
|
...DefaultResponses
|
|
@@ -10265,8 +10333,8 @@ var messageContract = initContract49().router(
|
|
|
10265
10333
|
getById: {
|
|
10266
10334
|
method: "GET",
|
|
10267
10335
|
path: "/:id",
|
|
10268
|
-
pathParams:
|
|
10269
|
-
id:
|
|
10336
|
+
pathParams: z131.object({
|
|
10337
|
+
id: z131.string()
|
|
10270
10338
|
}),
|
|
10271
10339
|
responses: {
|
|
10272
10340
|
200: DefaultSuccessResponseSchema.extend({
|
|
@@ -10281,8 +10349,8 @@ var messageContract = initContract49().router(
|
|
|
10281
10349
|
update: {
|
|
10282
10350
|
method: "PATCH",
|
|
10283
10351
|
path: "/:id",
|
|
10284
|
-
pathParams:
|
|
10285
|
-
id:
|
|
10352
|
+
pathParams: z131.object({
|
|
10353
|
+
id: z131.string()
|
|
10286
10354
|
}),
|
|
10287
10355
|
responses: {
|
|
10288
10356
|
200: DefaultSuccessResponseSchema.extend({
|
|
@@ -10298,8 +10366,8 @@ var messageContract = initContract49().router(
|
|
|
10298
10366
|
delete: {
|
|
10299
10367
|
method: "DELETE",
|
|
10300
10368
|
path: "/:id",
|
|
10301
|
-
pathParams:
|
|
10302
|
-
id:
|
|
10369
|
+
pathParams: z131.object({
|
|
10370
|
+
id: z131.string()
|
|
10303
10371
|
}),
|
|
10304
10372
|
responses: {
|
|
10305
10373
|
200: DefaultSuccessResponseSchema.extend({
|
|
@@ -10315,13 +10383,13 @@ var messageContract = initContract49().router(
|
|
|
10315
10383
|
cancelScheduledMessage: {
|
|
10316
10384
|
method: "DELETE",
|
|
10317
10385
|
path: "/scheduled_message/:id",
|
|
10318
|
-
pathParams:
|
|
10319
|
-
id:
|
|
10386
|
+
pathParams: z131.object({
|
|
10387
|
+
id: z131.string()
|
|
10320
10388
|
}),
|
|
10321
10389
|
responses: {
|
|
10322
10390
|
200: DefaultSuccessResponseSchema.extend({
|
|
10323
|
-
data:
|
|
10324
|
-
totalMessagesCount:
|
|
10391
|
+
data: z131.object({
|
|
10392
|
+
totalMessagesCount: z131.number()
|
|
10325
10393
|
})
|
|
10326
10394
|
}),
|
|
10327
10395
|
...DefaultResponses
|
|
@@ -10337,7 +10405,7 @@ var messageContract = initContract49().router(
|
|
|
10337
10405
|
);
|
|
10338
10406
|
|
|
10339
10407
|
// src/mail/mail-contract.ts
|
|
10340
|
-
var mailContract =
|
|
10408
|
+
var mailContract = initContract51().router({
|
|
10341
10409
|
room: roomContract,
|
|
10342
10410
|
message: messageContract,
|
|
10343
10411
|
account: accountContract,
|
|
@@ -10345,45 +10413,45 @@ var mailContract = initContract50().router({
|
|
|
10345
10413
|
});
|
|
10346
10414
|
|
|
10347
10415
|
// src/webchat/index.ts
|
|
10348
|
-
import { initContract as
|
|
10349
|
-
import
|
|
10416
|
+
import { initContract as initContract52 } from "@ts-rest/core";
|
|
10417
|
+
import z134 from "zod";
|
|
10350
10418
|
|
|
10351
10419
|
// src/webchat/schema.ts
|
|
10352
|
-
import
|
|
10420
|
+
import z133 from "zod";
|
|
10353
10421
|
|
|
10354
10422
|
// src/webchat/validation.ts
|
|
10355
|
-
import
|
|
10423
|
+
import z132 from "zod";
|
|
10356
10424
|
var ChatwootChannelType2 = /* @__PURE__ */ ((ChatwootChannelType3) => {
|
|
10357
10425
|
ChatwootChannelType3["WEB_WIDGET"] = "web_widget";
|
|
10358
10426
|
return ChatwootChannelType3;
|
|
10359
10427
|
})(ChatwootChannelType2 || {});
|
|
10360
|
-
var WebChatChannelSchema =
|
|
10361
|
-
avatar:
|
|
10362
|
-
name:
|
|
10363
|
-
type:
|
|
10364
|
-
websiteName:
|
|
10365
|
-
welcomeTitle:
|
|
10366
|
-
websiteUrl:
|
|
10367
|
-
welcomeTagline:
|
|
10368
|
-
agentAwayMessage:
|
|
10369
|
-
widgetColor:
|
|
10428
|
+
var WebChatChannelSchema = z132.object({
|
|
10429
|
+
avatar: z132.string().optional(),
|
|
10430
|
+
name: z132.string(),
|
|
10431
|
+
type: z132.nativeEnum(ChatwootChannelType2),
|
|
10432
|
+
websiteName: z132.string(),
|
|
10433
|
+
welcomeTitle: z132.string(),
|
|
10434
|
+
websiteUrl: z132.string().url(),
|
|
10435
|
+
welcomeTagline: z132.string().optional(),
|
|
10436
|
+
agentAwayMessage: z132.string().optional(),
|
|
10437
|
+
widgetColor: z132.string().optional()
|
|
10370
10438
|
});
|
|
10371
10439
|
|
|
10372
10440
|
// src/webchat/schema.ts
|
|
10373
|
-
var ConnectWebChatChannelSchema =
|
|
10374
|
-
name:
|
|
10375
|
-
actor:
|
|
10376
|
-
id:
|
|
10377
|
-
name:
|
|
10378
|
-
email:
|
|
10379
|
-
address:
|
|
10380
|
-
phone:
|
|
10441
|
+
var ConnectWebChatChannelSchema = z133.object({
|
|
10442
|
+
name: z133.string(),
|
|
10443
|
+
actor: z133.object({
|
|
10444
|
+
id: z133.string().uuid(),
|
|
10445
|
+
name: z133.string(),
|
|
10446
|
+
email: z133.string().email(),
|
|
10447
|
+
address: z133.string().nullable(),
|
|
10448
|
+
phone: z133.string().nullable()
|
|
10381
10449
|
}),
|
|
10382
10450
|
channel: WebChatChannelSchema
|
|
10383
10451
|
});
|
|
10384
10452
|
|
|
10385
10453
|
// src/webchat/index.ts
|
|
10386
|
-
var platformWebchatContract =
|
|
10454
|
+
var platformWebchatContract = initContract52().router(
|
|
10387
10455
|
{
|
|
10388
10456
|
sendMessage: {
|
|
10389
10457
|
method: "POST",
|
|
@@ -10411,8 +10479,8 @@ var platformWebchatContract = initContract51().router(
|
|
|
10411
10479
|
disconnectToService: {
|
|
10412
10480
|
method: "POST",
|
|
10413
10481
|
path: "/disconnect",
|
|
10414
|
-
body:
|
|
10415
|
-
id:
|
|
10482
|
+
body: z134.object({
|
|
10483
|
+
id: z134.string().uuid()
|
|
10416
10484
|
}),
|
|
10417
10485
|
responses: {
|
|
10418
10486
|
200: ChannelServiceResponseSchema,
|
|
@@ -10423,8 +10491,8 @@ var platformWebchatContract = initContract51().router(
|
|
|
10423
10491
|
reconnect: {
|
|
10424
10492
|
method: "POST",
|
|
10425
10493
|
path: "/reconnect/:channelId",
|
|
10426
|
-
pathParams:
|
|
10427
|
-
channelId:
|
|
10494
|
+
pathParams: z134.object({
|
|
10495
|
+
channelId: z134.string().uuid()
|
|
10428
10496
|
}),
|
|
10429
10497
|
body: null,
|
|
10430
10498
|
responses: {
|
|
@@ -10436,8 +10504,8 @@ var platformWebchatContract = initContract51().router(
|
|
|
10436
10504
|
delete: {
|
|
10437
10505
|
method: "DELETE",
|
|
10438
10506
|
path: "/delete/:channelId",
|
|
10439
|
-
pathParams:
|
|
10440
|
-
channelId:
|
|
10507
|
+
pathParams: z134.object({
|
|
10508
|
+
channelId: z134.string().uuid()
|
|
10441
10509
|
}),
|
|
10442
10510
|
body: null,
|
|
10443
10511
|
responses: {
|
|
@@ -10453,28 +10521,28 @@ var platformWebchatContract = initContract51().router(
|
|
|
10453
10521
|
);
|
|
10454
10522
|
|
|
10455
10523
|
// src/hold-label/index.ts
|
|
10456
|
-
import { initContract as
|
|
10457
|
-
import
|
|
10524
|
+
import { initContract as initContract53 } from "@ts-rest/core";
|
|
10525
|
+
import z136 from "zod";
|
|
10458
10526
|
|
|
10459
10527
|
// src/hold-label/validation.ts
|
|
10460
|
-
import
|
|
10461
|
-
var UpdatePositionSchema2 =
|
|
10462
|
-
holdLabels:
|
|
10463
|
-
|
|
10528
|
+
import z135 from "zod";
|
|
10529
|
+
var UpdatePositionSchema2 = z135.object({
|
|
10530
|
+
holdLabels: z135.array(
|
|
10531
|
+
z135.object({ id: z135.string().uuid(), position: z135.number() })
|
|
10464
10532
|
)
|
|
10465
10533
|
});
|
|
10466
|
-
var HoldRoomSchema =
|
|
10467
|
-
roomId:
|
|
10468
|
-
holdLabelId:
|
|
10534
|
+
var HoldRoomSchema = z135.object({
|
|
10535
|
+
roomId: z135.string().uuid(),
|
|
10536
|
+
holdLabelId: z135.string().uuid()
|
|
10469
10537
|
});
|
|
10470
10538
|
|
|
10471
10539
|
// src/hold-label/index.ts
|
|
10472
|
-
var holdLabelContract =
|
|
10540
|
+
var holdLabelContract = initContract53().router(
|
|
10473
10541
|
{
|
|
10474
10542
|
createHoldLabel: {
|
|
10475
10543
|
method: "POST",
|
|
10476
10544
|
path: "/",
|
|
10477
|
-
body:
|
|
10545
|
+
body: z136.object({ name: z136.string() }),
|
|
10478
10546
|
responses: {
|
|
10479
10547
|
201: DefaultSuccessResponseSchema.extend({
|
|
10480
10548
|
holdLabel: HoldLabelSchema
|
|
@@ -10486,7 +10554,7 @@ var holdLabelContract = initContract52().router(
|
|
|
10486
10554
|
path: "/",
|
|
10487
10555
|
responses: {
|
|
10488
10556
|
200: DefaultSuccessResponseSchema.extend({
|
|
10489
|
-
holdLabels:
|
|
10557
|
+
holdLabels: z136.array(HoldLabelSchema)
|
|
10490
10558
|
})
|
|
10491
10559
|
}
|
|
10492
10560
|
},
|
|
@@ -10504,8 +10572,8 @@ var holdLabelContract = initContract52().router(
|
|
|
10504
10572
|
updateHoldLabel: {
|
|
10505
10573
|
method: "PATCH",
|
|
10506
10574
|
path: "/:id",
|
|
10507
|
-
pathParams:
|
|
10508
|
-
body:
|
|
10575
|
+
pathParams: z136.object({ id: z136.string().uuid() }),
|
|
10576
|
+
body: z136.object({ name: z136.string() }),
|
|
10509
10577
|
responses: {
|
|
10510
10578
|
200: DefaultSuccessResponseSchema.extend({
|
|
10511
10579
|
holdLabel: HoldLabelSchema
|
|
@@ -10515,7 +10583,7 @@ var holdLabelContract = initContract52().router(
|
|
|
10515
10583
|
deleteHoldLabel: {
|
|
10516
10584
|
method: "DELETE",
|
|
10517
10585
|
path: "/:id",
|
|
10518
|
-
pathParams:
|
|
10586
|
+
pathParams: z136.object({ id: z136.string().uuid() }),
|
|
10519
10587
|
body: null,
|
|
10520
10588
|
responses: {
|
|
10521
10589
|
200: DefaultSuccessResponseSchema
|
|
@@ -10526,10 +10594,10 @@ var holdLabelContract = initContract52().router(
|
|
|
10526
10594
|
path: "/auto-unhold",
|
|
10527
10595
|
responses: {
|
|
10528
10596
|
200: DefaultSuccessResponseSchema.extend({
|
|
10529
|
-
autoUnhold:
|
|
10530
|
-
resumeLabel:
|
|
10531
|
-
show:
|
|
10532
|
-
name:
|
|
10597
|
+
autoUnhold: z136.boolean(),
|
|
10598
|
+
resumeLabel: z136.object({
|
|
10599
|
+
show: z136.boolean(),
|
|
10600
|
+
name: z136.string()
|
|
10533
10601
|
})
|
|
10534
10602
|
})
|
|
10535
10603
|
}
|
|
@@ -10537,19 +10605,19 @@ var holdLabelContract = initContract52().router(
|
|
|
10537
10605
|
updateAutoUnhold: {
|
|
10538
10606
|
method: "POST",
|
|
10539
10607
|
path: "/auto-unhold",
|
|
10540
|
-
body:
|
|
10541
|
-
autoUnhold:
|
|
10542
|
-
resumeLabel:
|
|
10543
|
-
show:
|
|
10544
|
-
name:
|
|
10608
|
+
body: z136.object({
|
|
10609
|
+
autoUnhold: z136.boolean().optional(),
|
|
10610
|
+
resumeLabel: z136.object({
|
|
10611
|
+
show: z136.boolean().optional(),
|
|
10612
|
+
name: z136.string().optional()
|
|
10545
10613
|
}).optional()
|
|
10546
10614
|
}),
|
|
10547
10615
|
responses: {
|
|
10548
10616
|
200: DefaultSuccessResponseSchema.extend({
|
|
10549
|
-
autoUnhold:
|
|
10550
|
-
resumeLabel:
|
|
10551
|
-
show:
|
|
10552
|
-
name:
|
|
10617
|
+
autoUnhold: z136.boolean(),
|
|
10618
|
+
resumeLabel: z136.object({
|
|
10619
|
+
show: z136.boolean(),
|
|
10620
|
+
name: z136.string()
|
|
10553
10621
|
})
|
|
10554
10622
|
})
|
|
10555
10623
|
}
|
|
@@ -10557,10 +10625,10 @@ var holdLabelContract = initContract52().router(
|
|
|
10557
10625
|
getHoldLogs: {
|
|
10558
10626
|
method: "GET",
|
|
10559
10627
|
path: "/hold-logs",
|
|
10560
|
-
query:
|
|
10628
|
+
query: z136.object({ cxLogId: z136.string().uuid() }),
|
|
10561
10629
|
responses: {
|
|
10562
|
-
200:
|
|
10563
|
-
holdLogs:
|
|
10630
|
+
200: z136.object({
|
|
10631
|
+
holdLogs: z136.array(FormattedHoldLogSchema)
|
|
10564
10632
|
})
|
|
10565
10633
|
}
|
|
10566
10634
|
},
|
|
@@ -10577,7 +10645,7 @@ var holdLabelContract = initContract52().router(
|
|
|
10577
10645
|
unholdRoom: {
|
|
10578
10646
|
method: "POST",
|
|
10579
10647
|
path: "/unhold-room",
|
|
10580
|
-
body:
|
|
10648
|
+
body: z136.object({ roomId: z136.string().uuid() }),
|
|
10581
10649
|
responses: {
|
|
10582
10650
|
200: DefaultSuccessResponseSchema.extend({
|
|
10583
10651
|
holdLog: HoldLogSchema.optional()
|
|
@@ -10589,94 +10657,94 @@ var holdLabelContract = initContract52().router(
|
|
|
10589
10657
|
);
|
|
10590
10658
|
|
|
10591
10659
|
// src/subscription/index.ts
|
|
10592
|
-
import { initContract as
|
|
10593
|
-
import { z as
|
|
10660
|
+
import { initContract as initContract54 } from "@ts-rest/core";
|
|
10661
|
+
import { z as z139 } from "zod";
|
|
10594
10662
|
|
|
10595
10663
|
// src/subscription/schema.ts
|
|
10596
|
-
import
|
|
10664
|
+
import z137 from "zod";
|
|
10597
10665
|
var ProductPriceSchema = DefaultEntitySchema.extend({
|
|
10598
|
-
priceId:
|
|
10599
|
-
name:
|
|
10600
|
-
perUnit:
|
|
10601
|
-
price:
|
|
10602
|
-
currency:
|
|
10666
|
+
priceId: z137.string(),
|
|
10667
|
+
name: z137.string().nullable(),
|
|
10668
|
+
perUnit: z137.number(),
|
|
10669
|
+
price: z137.number(),
|
|
10670
|
+
currency: z137.string().nullable()
|
|
10603
10671
|
});
|
|
10604
10672
|
var ProductWithoutRelatedSchema = DefaultEntitySchema.extend({
|
|
10605
|
-
provider:
|
|
10606
|
-
productId:
|
|
10607
|
-
name:
|
|
10608
|
-
type:
|
|
10609
|
-
omnichannel:
|
|
10610
|
-
usageType:
|
|
10673
|
+
provider: z137.string(),
|
|
10674
|
+
productId: z137.string(),
|
|
10675
|
+
name: z137.string(),
|
|
10676
|
+
type: z137.string(),
|
|
10677
|
+
omnichannel: z137.string(),
|
|
10678
|
+
usageType: z137.string().nullable(),
|
|
10611
10679
|
productPrice: ProductPriceSchema
|
|
10612
10680
|
});
|
|
10613
10681
|
var RelatedProductSchema = DefaultEntitySchema.extend({
|
|
10614
|
-
includedQuantity:
|
|
10682
|
+
includedQuantity: z137.number(),
|
|
10615
10683
|
product: ProductWithoutRelatedSchema
|
|
10616
10684
|
});
|
|
10617
10685
|
var ProductSchema = DefaultEntitySchema.extend({
|
|
10618
|
-
provider:
|
|
10619
|
-
productId:
|
|
10620
|
-
name:
|
|
10621
|
-
type:
|
|
10622
|
-
omnichannel:
|
|
10623
|
-
usageType:
|
|
10686
|
+
provider: z137.string(),
|
|
10687
|
+
productId: z137.string(),
|
|
10688
|
+
name: z137.string(),
|
|
10689
|
+
type: z137.string(),
|
|
10690
|
+
omnichannel: z137.string(),
|
|
10691
|
+
usageType: z137.string().nullable(),
|
|
10624
10692
|
productPrice: ProductPriceSchema,
|
|
10625
|
-
relatedProducts:
|
|
10693
|
+
relatedProducts: z137.array(RelatedProductSchema)
|
|
10626
10694
|
});
|
|
10627
10695
|
var CustomerSchema = DefaultEntitySchema.extend({
|
|
10628
|
-
provider:
|
|
10629
|
-
customerId:
|
|
10630
|
-
email:
|
|
10631
|
-
name:
|
|
10632
|
-
balance:
|
|
10696
|
+
provider: z137.string(),
|
|
10697
|
+
customerId: z137.string(),
|
|
10698
|
+
email: z137.string(),
|
|
10699
|
+
name: z137.string(),
|
|
10700
|
+
balance: z137.number()
|
|
10633
10701
|
});
|
|
10634
10702
|
var SubscriptionProuctSchema = DefaultEntitySchema.extend({
|
|
10635
|
-
limit:
|
|
10636
|
-
subscriptionItemId:
|
|
10637
|
-
usage:
|
|
10703
|
+
limit: z137.number(),
|
|
10704
|
+
subscriptionItemId: z137.string(),
|
|
10705
|
+
usage: z137.number().nullable(),
|
|
10638
10706
|
product: ProductSchema
|
|
10639
10707
|
});
|
|
10640
10708
|
var SubscriptionSchema = DefaultEntitySchema.extend({
|
|
10641
|
-
provider:
|
|
10642
|
-
type:
|
|
10643
|
-
subscriptionId:
|
|
10644
|
-
interval:
|
|
10645
|
-
quantity:
|
|
10646
|
-
amount:
|
|
10647
|
-
startAt:
|
|
10648
|
-
expireAt:
|
|
10649
|
-
status:
|
|
10650
|
-
name:
|
|
10651
|
-
subscriptionProducts:
|
|
10709
|
+
provider: z137.string(),
|
|
10710
|
+
type: z137.string(),
|
|
10711
|
+
subscriptionId: z137.string(),
|
|
10712
|
+
interval: z137.string(),
|
|
10713
|
+
quantity: z137.number(),
|
|
10714
|
+
amount: z137.number(),
|
|
10715
|
+
startAt: z137.date().nullable(),
|
|
10716
|
+
expireAt: z137.date(),
|
|
10717
|
+
status: z137.string(),
|
|
10718
|
+
name: z137.string().nullable(),
|
|
10719
|
+
subscriptionProducts: z137.array(SubscriptionProuctSchema),
|
|
10652
10720
|
productPrice: ProductPriceSchema,
|
|
10653
10721
|
product: ProductSchema
|
|
10654
10722
|
});
|
|
10655
10723
|
|
|
10656
10724
|
// src/subscription/validation.ts
|
|
10657
|
-
import { z as
|
|
10658
|
-
var GetAvailablePlanSchema =
|
|
10659
|
-
type:
|
|
10660
|
-
currency:
|
|
10661
|
-
});
|
|
10662
|
-
var UpdateSubscriptionSchema =
|
|
10663
|
-
planProductId:
|
|
10664
|
-
planProductPriceId:
|
|
10665
|
-
subscriptionId:
|
|
10666
|
-
subscriptionProducts:
|
|
10667
|
-
|
|
10668
|
-
productId:
|
|
10669
|
-
productPriceId:
|
|
10670
|
-
quantity:
|
|
10725
|
+
import { z as z138 } from "zod";
|
|
10726
|
+
var GetAvailablePlanSchema = z138.object({
|
|
10727
|
+
type: z138.string(),
|
|
10728
|
+
currency: z138.string()
|
|
10729
|
+
});
|
|
10730
|
+
var UpdateSubscriptionSchema = z138.object({
|
|
10731
|
+
planProductId: z138.string(),
|
|
10732
|
+
planProductPriceId: z138.string(),
|
|
10733
|
+
subscriptionId: z138.string(),
|
|
10734
|
+
subscriptionProducts: z138.array(
|
|
10735
|
+
z138.object({
|
|
10736
|
+
productId: z138.string(),
|
|
10737
|
+
productPriceId: z138.string(),
|
|
10738
|
+
quantity: z138.number()
|
|
10671
10739
|
})
|
|
10672
10740
|
)
|
|
10673
10741
|
});
|
|
10674
|
-
var TopUpBalanceSchema =
|
|
10675
|
-
quantity:
|
|
10742
|
+
var TopUpBalanceSchema = z138.object({
|
|
10743
|
+
quantity: z138.number()
|
|
10676
10744
|
});
|
|
10677
10745
|
|
|
10678
10746
|
// src/subscription/index.ts
|
|
10679
|
-
var subscriptionContract =
|
|
10747
|
+
var subscriptionContract = initContract54().router(
|
|
10680
10748
|
{
|
|
10681
10749
|
getSubscription: {
|
|
10682
10750
|
method: "GET",
|
|
@@ -10696,9 +10764,9 @@ var subscriptionContract = initContract53().router(
|
|
|
10696
10764
|
body: UpdateSubscriptionSchema,
|
|
10697
10765
|
responses: {
|
|
10698
10766
|
200: DefaultSuccessResponseSchema.extend({
|
|
10699
|
-
message:
|
|
10700
|
-
requireCheckout:
|
|
10701
|
-
checkoutUrl:
|
|
10767
|
+
message: z139.string(),
|
|
10768
|
+
requireCheckout: z139.boolean(),
|
|
10769
|
+
checkoutUrl: z139.string().nullable()
|
|
10702
10770
|
}),
|
|
10703
10771
|
402: DefaultErrorResponseSchema,
|
|
10704
10772
|
500: DefaultErrorResponseSchema
|
|
@@ -10710,7 +10778,7 @@ var subscriptionContract = initContract53().router(
|
|
|
10710
10778
|
body: TopUpBalanceSchema,
|
|
10711
10779
|
responses: {
|
|
10712
10780
|
200: DefaultSuccessResponseSchema.extend({
|
|
10713
|
-
checkoutUrl:
|
|
10781
|
+
checkoutUrl: z139.string()
|
|
10714
10782
|
}),
|
|
10715
10783
|
500: DefaultErrorResponseSchema
|
|
10716
10784
|
}
|
|
@@ -10721,7 +10789,7 @@ var subscriptionContract = initContract53().router(
|
|
|
10721
10789
|
query: GetAvailablePlanSchema,
|
|
10722
10790
|
responses: {
|
|
10723
10791
|
200: DefaultSuccessResponseSchema.extend({
|
|
10724
|
-
data:
|
|
10792
|
+
data: z139.array(ProductSchema)
|
|
10725
10793
|
}),
|
|
10726
10794
|
500: DefaultErrorResponseSchema
|
|
10727
10795
|
}
|
|
@@ -10743,20 +10811,20 @@ var subscriptionContract = initContract53().router(
|
|
|
10743
10811
|
);
|
|
10744
10812
|
|
|
10745
10813
|
// src/cx-intelligence/index.ts
|
|
10746
|
-
import { initContract as
|
|
10747
|
-
import
|
|
10748
|
-
var cxIntelligenceContract =
|
|
10814
|
+
import { initContract as initContract55 } from "@ts-rest/core";
|
|
10815
|
+
import z140 from "zod";
|
|
10816
|
+
var cxIntelligenceContract = initContract55().router(
|
|
10749
10817
|
{
|
|
10750
10818
|
toggle: {
|
|
10751
10819
|
method: "POST",
|
|
10752
10820
|
path: "/toggle",
|
|
10753
10821
|
headers: DefaultHeaderSchema,
|
|
10754
|
-
body:
|
|
10755
|
-
enabled:
|
|
10822
|
+
body: z140.object({
|
|
10823
|
+
enabled: z140.union([z140.literal(true), z140.literal(false)])
|
|
10756
10824
|
}),
|
|
10757
10825
|
responses: {
|
|
10758
10826
|
200: DefaultSuccessResponseSchema.extend({
|
|
10759
|
-
message:
|
|
10827
|
+
message: z140.string()
|
|
10760
10828
|
}),
|
|
10761
10829
|
500: DefaultErrorResponseSchema
|
|
10762
10830
|
},
|
|
@@ -10766,15 +10834,15 @@ var cxIntelligenceContract = initContract54().router(
|
|
|
10766
10834
|
method: "POST",
|
|
10767
10835
|
path: "/cx-logs/:id/transcribe",
|
|
10768
10836
|
headers: DefaultHeaderSchema,
|
|
10769
|
-
pathParams:
|
|
10770
|
-
id:
|
|
10837
|
+
pathParams: z140.object({
|
|
10838
|
+
id: z140.string().uuid()
|
|
10771
10839
|
}),
|
|
10772
|
-
body:
|
|
10773
|
-
fileUrl:
|
|
10840
|
+
body: z140.object({
|
|
10841
|
+
fileUrl: z140.string()
|
|
10774
10842
|
}),
|
|
10775
10843
|
responses: {
|
|
10776
10844
|
200: DefaultSuccessResponseSchema.extend({
|
|
10777
|
-
message:
|
|
10845
|
+
message: z140.string()
|
|
10778
10846
|
}),
|
|
10779
10847
|
403: DefaultErrorResponseSchema,
|
|
10780
10848
|
404: DefaultErrorResponseSchema,
|
|
@@ -10786,7 +10854,7 @@ var cxIntelligenceContract = initContract54().router(
|
|
|
10786
10854
|
},
|
|
10787
10855
|
{ pathPrefix: "cx-intelligence" }
|
|
10788
10856
|
);
|
|
10789
|
-
var settingCxIntelligenceContract =
|
|
10857
|
+
var settingCxIntelligenceContract = initContract55().router(
|
|
10790
10858
|
{
|
|
10791
10859
|
checkStatus: {
|
|
10792
10860
|
method: "GET",
|
|
@@ -10794,13 +10862,13 @@ var settingCxIntelligenceContract = initContract54().router(
|
|
|
10794
10862
|
headers: DefaultHeaderSchema,
|
|
10795
10863
|
responses: {
|
|
10796
10864
|
200: DefaultSuccessResponseSchema.extend({
|
|
10797
|
-
message:
|
|
10798
|
-
status:
|
|
10865
|
+
message: z140.string(),
|
|
10866
|
+
status: z140.boolean()
|
|
10799
10867
|
}),
|
|
10800
|
-
422:
|
|
10801
|
-
requestId:
|
|
10802
|
-
message:
|
|
10803
|
-
status:
|
|
10868
|
+
422: z140.object({
|
|
10869
|
+
requestId: z140.string(),
|
|
10870
|
+
message: z140.string(),
|
|
10871
|
+
status: z140.boolean()
|
|
10804
10872
|
}),
|
|
10805
10873
|
500: DefaultErrorResponseSchema
|
|
10806
10874
|
},
|
|
@@ -10811,21 +10879,21 @@ var settingCxIntelligenceContract = initContract54().router(
|
|
|
10811
10879
|
);
|
|
10812
10880
|
|
|
10813
10881
|
// src/export/index.ts
|
|
10814
|
-
import { initContract as
|
|
10815
|
-
import
|
|
10816
|
-
var exportContract =
|
|
10882
|
+
import { initContract as initContract56 } from "@ts-rest/core";
|
|
10883
|
+
import z141 from "zod";
|
|
10884
|
+
var exportContract = initContract56().router(
|
|
10817
10885
|
{
|
|
10818
10886
|
notifyExport: {
|
|
10819
10887
|
method: "POST",
|
|
10820
10888
|
path: "notify",
|
|
10821
|
-
body:
|
|
10822
|
-
userId:
|
|
10823
|
-
module:
|
|
10824
|
-
fileUrl:
|
|
10889
|
+
body: z141.object({
|
|
10890
|
+
userId: z141.string().uuid(),
|
|
10891
|
+
module: z141.string(),
|
|
10892
|
+
fileUrl: z141.string()
|
|
10825
10893
|
}),
|
|
10826
10894
|
responses: {
|
|
10827
10895
|
200: DefaultSuccessResponseSchema.extend({
|
|
10828
|
-
success:
|
|
10896
|
+
success: z141.boolean()
|
|
10829
10897
|
}),
|
|
10830
10898
|
500: DefaultErrorResponseSchema
|
|
10831
10899
|
}
|
|
@@ -10871,6 +10939,7 @@ export {
|
|
|
10871
10939
|
generalTagSettingContract,
|
|
10872
10940
|
holdLabelContract,
|
|
10873
10941
|
initiateMessageContract,
|
|
10942
|
+
invoiceContract,
|
|
10874
10943
|
mailContract,
|
|
10875
10944
|
mainChatContract,
|
|
10876
10945
|
mainChatMessageContract,
|