shuttlepro-shared 1.3.39 → 1.3.40
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/common/repositories/customerProfile.repository.js +14 -83
- package/common/repositories/userRole.repository.js +2 -5
- package/config/redis.js +73 -72
- package/middlewares/checkPermission/index.js +23 -36
- package/models/ActivityLogs.js +0 -1
- package/models/AgentActivity.js +4 -5
- package/models/Card.js +1 -50
- package/models/Chatbot.js +1 -1
- package/models/Column.js +0 -6
- package/models/Conversation.js +0 -40
- package/models/Customer.js +1 -2
- package/models/Integration.js +0 -6
- package/models/Order.js +0 -11
- package/models/Profile.js +1 -3
- package/models/Workspace.js +4 -78
- package/models.js +49 -168
- package/package.json +1 -1
- package/models/Activity.js +0 -28
- package/models/Attribute.js +0 -130
- package/models/Automation.js +0 -242
- package/models/BusinessRule.js +0 -16
- package/models/BusinessRuleHelper.js +0 -13
- package/models/Catalogue.js +0 -22
- package/models/Category.js +0 -129
- package/models/ChatMemberSession.js +0 -21
- package/models/ChatMessage.js +0 -43
- package/models/Color.js +0 -10
- package/models/CustomerCheckpoint.js +0 -21
- package/models/DeviceInfo.js +0 -13
- package/models/Email.js +0 -21
- package/models/EmailMessage.js +0 -30
- package/models/EmailNotification.js +0 -17
- package/models/EscalationConfiguration.js +0 -123
- package/models/EscalationManager.js +0 -50
- package/models/Faq.js +0 -29
- package/models/FeedbackResponse.js +0 -72
- package/models/FormTemplate.js +0 -27
- package/models/InternalComments.js +0 -27
- package/models/InternalThreads.js +0 -20
- package/models/JobDesign.js +0 -32
- package/models/JobQueue.js +0 -17
- package/models/LabelsPdf.js +0 -12
- package/models/Layout.js +0 -12
- package/models/LoadSheet.js +0 -31
- package/models/Location.js +0 -147
- package/models/Logo.js +0 -11
- package/models/MailGroup.js +0 -21
- package/models/Notification.js +0 -32
- package/models/OrderPdf.js +0 -29
- package/models/PostsAutomation.js +0 -66
- package/models/Product.js +0 -336
- package/models/ProductAttachment.js +0 -158
- package/models/ProductAttribute.js +0 -140
- package/models/ProductCategory.js +0 -128
- package/models/ProductLabels.js +0 -11
- package/models/ProductShopify.js +0 -13
- package/models/ProductTag.js +0 -124
- package/models/ProductVariant.js +0 -156
- package/models/ServiceUsage.js +0 -26
- package/models/ShipperSetting.js +0 -24
- package/models/SocialGroup.js +0 -127
- package/models/SocialPost.js +0 -40
- package/models/SocialProfile.js +0 -56
- package/models/Story.js +0 -86
- package/models/Tag.js +0 -77
- package/models/Template.js +0 -76
- package/models/TemplateFrame.js +0 -55
- package/models/TemplateTag.js +0 -10
- package/models/UserGuide.js +0 -21
- package/models/UserSession.js +0 -47
- package/models/VariantLocation.js +0 -145
- package/models/WhatsappFlow.js +0 -29
- package/models/Workflow.js +0 -34
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
const mongoose = require("mongoose");
|
|
2
|
-
const { Schema } = mongoose;
|
|
3
|
-
const VariantLocationSchema = new Schema(
|
|
4
|
-
{
|
|
5
|
-
variantId: {
|
|
6
|
-
type: Schema.Types.ObjectId,
|
|
7
|
-
ref: "ProductVariant",
|
|
8
|
-
default: null,
|
|
9
|
-
},
|
|
10
|
-
quantity: { type: Number, default: 0 },
|
|
11
|
-
workspaceId: {
|
|
12
|
-
type: Schema.Types.ObjectId,
|
|
13
|
-
ref: "Workspace",
|
|
14
|
-
default: null,
|
|
15
|
-
},
|
|
16
|
-
productId: { type: Schema.Types.ObjectId, ref: "Product", default: null },
|
|
17
|
-
locationId: { type: Schema.Types.ObjectId, ref: "Location", default: null },
|
|
18
|
-
webVariantLocationId: { type: Number, default: null },
|
|
19
|
-
rackNo: { type: String, default: "" },
|
|
20
|
-
boxNo: { type: String, default: "" },
|
|
21
|
-
shelfNo: { type: String, default: "" },
|
|
22
|
-
uuid: { type: String, default: "" },
|
|
23
|
-
createdBy: { type: Schema.Types.ObjectId, ref: "User", default: null },
|
|
24
|
-
updatedBy: { type: Schema.Types.ObjectId, ref: "User", default: null },
|
|
25
|
-
isDeleted: { type: Boolean, default: false },
|
|
26
|
-
},
|
|
27
|
-
{ timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
const VariantLocation = mongoose.model(
|
|
31
|
-
"VariantLocation",
|
|
32
|
-
VariantLocationSchema
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
const createNewVariantLocation = async (variantLocationData) => {
|
|
36
|
-
try {
|
|
37
|
-
return await VariantLocation.create(variantLocationData);
|
|
38
|
-
} catch (error) {
|
|
39
|
-
console.log(error);
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const insertVariantLocations = async (data) => {
|
|
45
|
-
try {
|
|
46
|
-
return await VariantLocation.insertMany(data);
|
|
47
|
-
} catch (error) {
|
|
48
|
-
console.log(error);
|
|
49
|
-
return [null];
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const updateManyVariantsLocations = async (
|
|
54
|
-
criteria,
|
|
55
|
-
updateData,
|
|
56
|
-
options = {}
|
|
57
|
-
) => {
|
|
58
|
-
try {
|
|
59
|
-
return await VariantLocation.updateMany(criteria, updateData, options);
|
|
60
|
-
} catch (error) {
|
|
61
|
-
console.log(error);
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const findVariantLocationById = async (variantLocationId) => {
|
|
67
|
-
try {
|
|
68
|
-
return await VariantLocation.findById(variantLocationId);
|
|
69
|
-
} catch (error) {
|
|
70
|
-
console.log(error);
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
const updateVariantLocationById = async (criteria, updateData, options) => {
|
|
76
|
-
try {
|
|
77
|
-
return await VariantLocation.findByIdAndUpdate(
|
|
78
|
-
criteria,
|
|
79
|
-
updateData,
|
|
80
|
-
options
|
|
81
|
-
);
|
|
82
|
-
} catch (error) {
|
|
83
|
-
console.log(error);
|
|
84
|
-
return null;
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
const deleteVariantLocationById = async (variantLocationId) => {
|
|
89
|
-
try {
|
|
90
|
-
return await VariantLocation.findByIdAndDelete(variantLocationId);
|
|
91
|
-
} catch (error) {
|
|
92
|
-
console.log(error);
|
|
93
|
-
return null;
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
const findVariantLocation = async (criteria) => {
|
|
98
|
-
try {
|
|
99
|
-
return await VariantLocation.findOne(criteria);
|
|
100
|
-
} catch (error) {
|
|
101
|
-
console.log(error);
|
|
102
|
-
return null;
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
const findVariantLocations = async (criteria) => {
|
|
107
|
-
try {
|
|
108
|
-
return await VariantLocation.find(criteria);
|
|
109
|
-
} catch (error) {
|
|
110
|
-
console.log(error);
|
|
111
|
-
return [];
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
const findSingleVariantLocation = async (obj) => {
|
|
116
|
-
try {
|
|
117
|
-
let variantLocation = await VariantLocation.findOne(obj);
|
|
118
|
-
return variantLocation;
|
|
119
|
-
} catch (err) {
|
|
120
|
-
return null;
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
const findVariantLocationsByPopulate = async (criteria, populate) => {
|
|
125
|
-
try {
|
|
126
|
-
return await VariantLocation.find(criteria).populate(populate);
|
|
127
|
-
} catch (error) {
|
|
128
|
-
console.log(error);
|
|
129
|
-
return [];
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
module.exports = {
|
|
134
|
-
insertVariantLocations,
|
|
135
|
-
createNewVariantLocation,
|
|
136
|
-
updateManyVariantsLocations,
|
|
137
|
-
findVariantLocationById,
|
|
138
|
-
updateVariantLocationById,
|
|
139
|
-
findVariantLocationsByPopulate,
|
|
140
|
-
deleteVariantLocationById,
|
|
141
|
-
findVariantLocation,
|
|
142
|
-
findVariantLocations,
|
|
143
|
-
findSingleVariantLocation,
|
|
144
|
-
VariantLocation,
|
|
145
|
-
};
|
package/models/WhatsappFlow.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
const mongoose = require("mongoose");
|
|
2
|
-
|
|
3
|
-
const whatsappFlowSchema = new mongoose.Schema(
|
|
4
|
-
{
|
|
5
|
-
referenceId: {
|
|
6
|
-
type: String,
|
|
7
|
-
default: "",
|
|
8
|
-
},
|
|
9
|
-
flowName: {
|
|
10
|
-
type: String,
|
|
11
|
-
default: "",
|
|
12
|
-
},
|
|
13
|
-
workspaceId: {
|
|
14
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
15
|
-
ref: "Workspace",
|
|
16
|
-
},
|
|
17
|
-
response: {
|
|
18
|
-
type: Object,
|
|
19
|
-
default: {},
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
timestamps: true,
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
const WhatsappFlow = mongoose.model("WhatsappFlow", whatsappFlowSchema);
|
|
28
|
-
|
|
29
|
-
module.exports = WhatsappFlow;
|
package/models/Workflow.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
const mongoose = require("mongoose");
|
|
2
|
-
|
|
3
|
-
const WorkflowSchema = new mongoose.Schema(
|
|
4
|
-
{
|
|
5
|
-
workspaceId: {
|
|
6
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
7
|
-
ref: "Workspace",
|
|
8
|
-
required: true,
|
|
9
|
-
},
|
|
10
|
-
orders: {
|
|
11
|
-
enabled: { type: Boolean, default: false },
|
|
12
|
-
maxOrders: { type: Number, default: 100 },
|
|
13
|
-
currentCount: { type: Number, default: 0 },
|
|
14
|
-
},
|
|
15
|
-
chatbot: { type: Boolean, default: true },
|
|
16
|
-
nlpBot: {
|
|
17
|
-
enabled: { type: Boolean, default: true },
|
|
18
|
-
shared: {
|
|
19
|
-
maxRequests: { type: Number, default: 5000 },
|
|
20
|
-
maxTokens: { type: Number, default: 80000 },
|
|
21
|
-
requestsCount: { type: Number, default: 0 },
|
|
22
|
-
tokensCount: { type: Number, default: 0 },
|
|
23
|
-
},
|
|
24
|
-
custom: {
|
|
25
|
-
requestsCount: { type: Number, default: 0 },
|
|
26
|
-
tokensCount: { type: Number, default: 0 },
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
{ timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
const Workflow = mongoose.model("Workflow", WorkflowSchema);
|
|
34
|
-
module.exports = Workflow;
|