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