shuttlepro-shared 1.3.66 → 1.3.68

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/config/redis.js CHANGED
@@ -41,6 +41,15 @@ const connectRedis = async () => {
41
41
  }
42
42
  };
43
43
 
44
+ // ✅ Ensure Redis is connected once during app startup
45
+ const connectRedisClient = async () => {
46
+ try {
47
+ if (!client.isOpen) await client.connect();
48
+ } catch (err) {
49
+ console.error("❌ Failed to connect to Redis:", err);
50
+ }
51
+ };
52
+
44
53
  // ✅ Publish Data to a Channel
45
54
  const publishToChannel = async (channel, message) => {
46
55
  try {
@@ -70,6 +79,7 @@ const setRedisData = async (
70
79
  expiryInSeconds = 3600
71
80
  ) => {
72
81
  try {
82
+ await connectRedisClient();
73
83
  const stringifiedValue = JSON.stringify(value);
74
84
  let result;
75
85
 
@@ -93,6 +103,7 @@ const setRedisData = async (
93
103
  // ✅ Get Data from Redis (Supports String & Hash)
94
104
  const getRedisData = async (key, field = null) => {
95
105
  try {
106
+ await connectRedisClient();
96
107
  const result = field
97
108
  ? await client.hGet(key, field)
98
109
  : await client.get(key);
@@ -8,8 +8,13 @@ const ActivitySchema = new Schema(
8
8
  name: { type: String, default: "" },
9
9
  type: { type: String, default: "" },
10
10
  orderId: { type: String, default: "" },
11
- emailId: { type: Schema.Types.ObjectId, ref: "Email" },
12
- mailGroupId: { type: Schema.Types.ObjectId, ref: "MailGroup" },
11
+ integrationId: {
12
+ type: Schema.Types.ObjectId,
13
+ ref: "Integration",
14
+ default: null,
15
+ },
16
+ emailId: { type: Schema.Types.ObjectId, ref: "EmailContact" },
17
+ mailGroupId: { type: Schema.Types.ObjectId, ref: "EmailContactGroup" },
13
18
  templateId: { type: Schema.Types.ObjectId, ref: "DescriptionTemplate" },
14
19
  message: { type: String, default: "" },
15
20
  status: { type: String, default: "" },
@@ -32,6 +32,7 @@ const conversationSchema = new mongoose.Schema(
32
32
  "outlook",
33
33
  "webChat",
34
34
  "smtp_gmail",
35
+ "shuttle_smtp",
35
36
  ],
36
37
  required: true,
37
38
  },
@@ -22,6 +22,7 @@ const IntegrationSchema = new mongoose.Schema(
22
22
  "business_central",
23
23
  "ivr",
24
24
  "sms",
25
+ "shuttle_smtp",
25
26
  ],
26
27
  },
27
28
  chatbot: { type: Boolean, default: false },
@@ -76,7 +76,6 @@ const ReasonSchema = new mongoose.Schema({
76
76
  reason: { type: String, required: true },
77
77
  color: { type: String, default: "#000000" },
78
78
  categoryTitle: { type: String, required: true },
79
- isDefault: { type: Boolean, default: false },
80
79
  });
81
80
  const ResolutionReasonCategorySchema = new mongoose.Schema({
82
81
  _id: {
@@ -240,7 +239,6 @@ const workspaceSchema = new mongoose.Schema(
240
239
  color: { type: String, default: "" },
241
240
  },
242
241
  ],
243
- sendReadReceipts: { type: Boolean, default: true },
244
242
  chatGptApiKey: String,
245
243
  skuSeparator: { type: String, default: "-" },
246
244
  uniqueNo: { type: Number, default: 0 },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shuttlepro-shared",
3
- "version": "1.3.66",
3
+ "version": "1.3.68",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {