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
package/models/SocialGroup.js
DELETED
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
const mongoose = require("mongoose");
|
|
2
|
-
const { Schema } = mongoose;
|
|
3
|
-
|
|
4
|
-
const SocialGroupSchema = new mongoose.Schema(
|
|
5
|
-
{
|
|
6
|
-
name: { type: String, default: "" },
|
|
7
|
-
products: [
|
|
8
|
-
{
|
|
9
|
-
productId: {
|
|
10
|
-
type: Schema.Types.ObjectId,
|
|
11
|
-
ref: "Product",
|
|
12
|
-
},
|
|
13
|
-
orderNo: {
|
|
14
|
-
type: String,
|
|
15
|
-
default: "",
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
],
|
|
19
|
-
deletedArr: [],
|
|
20
|
-
productCount: { type: String, default: "" },
|
|
21
|
-
workspaceId: {
|
|
22
|
-
type: Schema.Types.ObjectId,
|
|
23
|
-
ref: "Workspace",
|
|
24
|
-
default: null,
|
|
25
|
-
},
|
|
26
|
-
isDeleted: { type: Boolean, default: false },
|
|
27
|
-
createdBy: { type: Schema.Types.ObjectId, ref: "User", default: null },
|
|
28
|
-
updatedBy: { type: Schema.Types.ObjectId, ref: "User", default: null },
|
|
29
|
-
},
|
|
30
|
-
{ timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
|
|
31
|
-
);
|
|
32
|
-
|
|
33
|
-
const SocialGroup = mongoose.model("SocialGroup", SocialGroupSchema);
|
|
34
|
-
|
|
35
|
-
const createNewSocialGroup = async (socialGroupData) => {
|
|
36
|
-
try {
|
|
37
|
-
return await SocialGroup.create(socialGroupData);
|
|
38
|
-
} catch (error) {
|
|
39
|
-
console.log(error);
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const findSocialGroupById = async (socialGroupId) => {
|
|
45
|
-
try {
|
|
46
|
-
return await SocialGroup.findById(socialGroupId);
|
|
47
|
-
} catch (error) {
|
|
48
|
-
console.log(error);
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const updateSocialGroupById = async (criteria, updateData, options = {}) => {
|
|
54
|
-
try {
|
|
55
|
-
return await SocialGroup.findByIdAndUpdate(criteria, updateData, options);
|
|
56
|
-
} catch (error) {
|
|
57
|
-
console.log(error);
|
|
58
|
-
return null;
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const deleteSocialGroupById = async (socialGroupId) => {
|
|
63
|
-
try {
|
|
64
|
-
return await SocialGroup.findByIdAndDelete(socialGroupId);
|
|
65
|
-
} catch (error) {
|
|
66
|
-
console.log(error);
|
|
67
|
-
return null;
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
const findSocialGroup = async (criteria, selectFields, populateOptions) => {
|
|
72
|
-
try {
|
|
73
|
-
let query = SocialGroup.findOne(criteria);
|
|
74
|
-
|
|
75
|
-
if (selectFields) {
|
|
76
|
-
query = query.select(selectFields);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if (populateOptions) {
|
|
80
|
-
query = query.populate(populateOptions);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
return await query.exec();
|
|
84
|
-
} catch (error) {
|
|
85
|
-
console.error(error);
|
|
86
|
-
return null;
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
const findSocialGroups = async (criteria) => {
|
|
91
|
-
try {
|
|
92
|
-
return await SocialGroup.find(criteria);
|
|
93
|
-
} catch (error) {
|
|
94
|
-
console.log(error);
|
|
95
|
-
return null;
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
const socialGroupByAggregation = async (pipeline) => {
|
|
100
|
-
try {
|
|
101
|
-
return await SocialGroup.aggregate(pipeline);
|
|
102
|
-
} catch (error) {
|
|
103
|
-
console.log(error);
|
|
104
|
-
return null;
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
const socialGroupUpdateMany = async (criteria, updateData, options = {}) => {
|
|
109
|
-
try {
|
|
110
|
-
return await SocialGroup.updateMany(criteria, updateData, options);
|
|
111
|
-
} catch (error) {
|
|
112
|
-
console.log(error);
|
|
113
|
-
return null;
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
module.exports = {
|
|
118
|
-
SocialGroup,
|
|
119
|
-
createNewSocialGroup,
|
|
120
|
-
findSocialGroupById,
|
|
121
|
-
updateSocialGroupById,
|
|
122
|
-
deleteSocialGroupById,
|
|
123
|
-
findSocialGroup,
|
|
124
|
-
findSocialGroups,
|
|
125
|
-
socialGroupByAggregation,
|
|
126
|
-
socialGroupUpdateMany,
|
|
127
|
-
};
|
package/models/SocialPost.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
const mongoose = require("mongoose");
|
|
2
|
-
const { Schema } = mongoose;
|
|
3
|
-
|
|
4
|
-
const SocialPostSchema = new Schema(
|
|
5
|
-
{
|
|
6
|
-
type: { type: String, default: "single" },
|
|
7
|
-
postType: { type: String, default: "post" },
|
|
8
|
-
platformType: { type: String, default: "facebook" },
|
|
9
|
-
isScheduledPost: { type: Boolean, default: false },
|
|
10
|
-
workspaceId: {
|
|
11
|
-
type: Schema.Types.ObjectId,
|
|
12
|
-
ref: "Workspace",
|
|
13
|
-
default: null,
|
|
14
|
-
},
|
|
15
|
-
pageId: { type: String, default: "" },
|
|
16
|
-
pageName: { type: String, default: "" },
|
|
17
|
-
pageLogo: { type: String, default: "" },
|
|
18
|
-
pageToken: { type: String, default: "" },
|
|
19
|
-
caption: { type: String, default: "" },
|
|
20
|
-
permanentLink: { type: String, default: "" },
|
|
21
|
-
attachments: [{
|
|
22
|
-
link: { type: String, default: ""},
|
|
23
|
-
src: { type: String, default: "" },
|
|
24
|
-
caption: { type: String, default: "" },
|
|
25
|
-
mediaType: { type: String, default: "" }
|
|
26
|
-
}],
|
|
27
|
-
socialProfile: { type: Schema.Types.ObjectId, ref: "Integration", default: null },
|
|
28
|
-
status: { type: String, default: "scheduled" },
|
|
29
|
-
scheduleDate: {type: Date, default: null },
|
|
30
|
-
queued: { type: Boolean, default: false },
|
|
31
|
-
isDeleted: { type: Boolean, default: false },
|
|
32
|
-
publishedAt: { type: String, default: "" },
|
|
33
|
-
publishedBy: { type: Schema.Types.ObjectId, ref: "User", default: null },
|
|
34
|
-
},
|
|
35
|
-
{ timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
const SocialPost = mongoose.model("SocialPost", SocialPostSchema);
|
|
39
|
-
module.exports = SocialPost;
|
|
40
|
-
|
package/models/SocialProfile.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
const mongoose = require("mongoose");
|
|
2
|
-
const { Schema } = mongoose;
|
|
3
|
-
|
|
4
|
-
const socialProfileSchema = new mongoose.Schema(
|
|
5
|
-
{
|
|
6
|
-
pageName: { type: String, default: "" },
|
|
7
|
-
pageToken: { type: String, default: "" },
|
|
8
|
-
platformType: { type: String, default: "" },
|
|
9
|
-
pageId: { type: String, default: "" },
|
|
10
|
-
pageIcon: { type: String, default: "" },
|
|
11
|
-
pageCoverUrl: { type: String, default: "" },
|
|
12
|
-
username: { type: String, default: "" },
|
|
13
|
-
workspaceId: {
|
|
14
|
-
type: Schema.Types.ObjectId,
|
|
15
|
-
ref: "Workspace",
|
|
16
|
-
default: null,
|
|
17
|
-
},
|
|
18
|
-
isDeleted: { type: Boolean, default: false },
|
|
19
|
-
userId: { type: Schema.Types.ObjectId, ref: "User", default: null },
|
|
20
|
-
options: {
|
|
21
|
-
type: Object,
|
|
22
|
-
default: null,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
{ timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
const SocialProfile = mongoose.model("socialProfile", socialProfileSchema);
|
|
29
|
-
|
|
30
|
-
const getSocialProfile = async (profileId) => {
|
|
31
|
-
try {
|
|
32
|
-
return await SocialProfile.findOne({
|
|
33
|
-
_id: mongoose.Types.ObjectId(profileId),
|
|
34
|
-
});
|
|
35
|
-
} catch (error) {
|
|
36
|
-
throw error;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
const findByPageId = async (pageId) => {
|
|
40
|
-
try {
|
|
41
|
-
let obj = { pageId: pageId, isDeleted: false };
|
|
42
|
-
const fetchingSocialProfile = await SocialProfile.findOne(obj);
|
|
43
|
-
if (fetchingSocialProfile) {
|
|
44
|
-
return fetchingSocialProfile;
|
|
45
|
-
}
|
|
46
|
-
return null;
|
|
47
|
-
} catch (err) {
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
module.exports = {
|
|
53
|
-
getSocialProfile,
|
|
54
|
-
findByPageId,
|
|
55
|
-
SocialProfile,
|
|
56
|
-
};
|
package/models/Story.js
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
const mongoose = require("mongoose");
|
|
2
|
-
|
|
3
|
-
const StorySchema = new mongoose.Schema(
|
|
4
|
-
{
|
|
5
|
-
option: { type: String, default: "" },
|
|
6
|
-
images: [String],
|
|
7
|
-
shareAt: { type: String, default: "" },
|
|
8
|
-
userId: { type: String, default: "" },
|
|
9
|
-
delay: { type: String, default: "" },
|
|
10
|
-
status: { type: String, default: "pending" },
|
|
11
|
-
workspaceId: { type: String, default: "" },
|
|
12
|
-
timeZone: { type: String, default: "" },
|
|
13
|
-
pageId: { type: String, default: "" },
|
|
14
|
-
pageName: { type: String, default: "" },
|
|
15
|
-
pageLogo: { type: String, default: "" },
|
|
16
|
-
accessToken: { type: String, default: "" },
|
|
17
|
-
type: { type: String, default: "" },
|
|
18
|
-
productIds: [{ productId: { type: String, default: "" } }],
|
|
19
|
-
isDeleted: { type: Boolean, default: false },
|
|
20
|
-
isNotified: { type: Boolean, default: false },
|
|
21
|
-
},
|
|
22
|
-
{ timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
const Story = mongoose.model("Story", StorySchema);
|
|
26
|
-
|
|
27
|
-
const storiesByAggregation = async (pipeline) => {
|
|
28
|
-
try {
|
|
29
|
-
return await Story.aggregate(pipeline);
|
|
30
|
-
} catch (err) {
|
|
31
|
-
return [];
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
const findStory = async (obj) => {
|
|
35
|
-
try {
|
|
36
|
-
return await Story.find(obj);
|
|
37
|
-
} catch (err) {
|
|
38
|
-
return err;
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
const findSingleStory = async (obj) => {
|
|
42
|
-
try {
|
|
43
|
-
return await Story.findOne(obj);
|
|
44
|
-
} catch (err) {
|
|
45
|
-
return err;
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
const deleteSingleStory = async (obj) => {
|
|
49
|
-
try {
|
|
50
|
-
return await Story.deleteOne(obj);
|
|
51
|
-
} catch (err) {
|
|
52
|
-
return err;
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
const saveStory = async (obj) => {
|
|
56
|
-
try {
|
|
57
|
-
let story = new Story(obj);
|
|
58
|
-
return await story.save();
|
|
59
|
-
} catch (err) {
|
|
60
|
-
return err;
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
const saveScheduledStory = async (obj) => {
|
|
64
|
-
try {
|
|
65
|
-
return await Story.insertMany(obj);
|
|
66
|
-
} catch (err) {
|
|
67
|
-
return [];
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
const findPendingStories = async (obj) => {
|
|
71
|
-
try {
|
|
72
|
-
return await Story.find(obj).exec();
|
|
73
|
-
} catch (err) {
|
|
74
|
-
return [];
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
module.exports = {
|
|
78
|
-
storiesByAggregation,
|
|
79
|
-
findStory,
|
|
80
|
-
findSingleStory,
|
|
81
|
-
deleteSingleStory,
|
|
82
|
-
saveStory,
|
|
83
|
-
saveScheduledStory,
|
|
84
|
-
findPendingStories,
|
|
85
|
-
Story,
|
|
86
|
-
};
|
package/models/Tag.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
const mongoose = require("mongoose");
|
|
2
|
-
const { Schema } = mongoose;
|
|
3
|
-
const TagSchema = new Schema(
|
|
4
|
-
{
|
|
5
|
-
name: { type: String, default: "" },
|
|
6
|
-
workspaceId: {
|
|
7
|
-
type: Schema.Types.ObjectId,
|
|
8
|
-
ref: "Workspace",
|
|
9
|
-
default: null,
|
|
10
|
-
},
|
|
11
|
-
oldId: { type: String, default: "" },
|
|
12
|
-
webTagId: { type: Number, default: "" },
|
|
13
|
-
createdBy: { type: Schema.Types.ObjectId, ref: "User", default: null },
|
|
14
|
-
updatedBy: { type: Schema.Types.ObjectId, ref: "User", default: null },
|
|
15
|
-
isDeleted: { type: Boolean, default: false },
|
|
16
|
-
},
|
|
17
|
-
{ timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
const Tag = mongoose.model("Tag", TagSchema);
|
|
21
|
-
|
|
22
|
-
const tagsByAggregation = async (aggregate) => {
|
|
23
|
-
try {
|
|
24
|
-
return await Tag.aggregate(aggregate);
|
|
25
|
-
} catch (err) {
|
|
26
|
-
return [];
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const findTags = async (obj) => {
|
|
31
|
-
try {
|
|
32
|
-
return await Tag.find(obj);
|
|
33
|
-
} catch (err) {
|
|
34
|
-
return [];
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const findSingleTag = async (obj) => {
|
|
39
|
-
try {
|
|
40
|
-
return await Tag.findOne(obj);
|
|
41
|
-
} catch (err) {
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
const createTag = async (obj) => {
|
|
47
|
-
try {
|
|
48
|
-
const tag = new Tag(obj);
|
|
49
|
-
return await tag.save();
|
|
50
|
-
} catch (err) {
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
const softDeleteTags = async (workspaceId, convertingIds, type) => {
|
|
55
|
-
try {
|
|
56
|
-
const filter = {
|
|
57
|
-
workspaceId: workspaceId,
|
|
58
|
-
isDeleted: false,
|
|
59
|
-
};
|
|
60
|
-
filter[type] = { $in: convertingIds };
|
|
61
|
-
const update = { $set: { isDeleted: true } };
|
|
62
|
-
const result = await Tag.updateMany(filter, update);
|
|
63
|
-
return result;
|
|
64
|
-
} catch (err) {
|
|
65
|
-
return [];
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
module.exports = {
|
|
70
|
-
Tag,
|
|
71
|
-
tagsByAggregation,
|
|
72
|
-
findTags,
|
|
73
|
-
findSingleTag,
|
|
74
|
-
createTag,
|
|
75
|
-
softDeleteTags,
|
|
76
|
-
Tag,
|
|
77
|
-
};
|
package/models/Template.js
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
const mongoose = require("mongoose");
|
|
2
|
-
const { Schema } = mongoose;
|
|
3
|
-
|
|
4
|
-
const templateSchema = new mongoose.Schema({
|
|
5
|
-
text: [
|
|
6
|
-
{
|
|
7
|
-
id: String,
|
|
8
|
-
textId: String,
|
|
9
|
-
text: String,
|
|
10
|
-
fontSize: String,
|
|
11
|
-
color: String,
|
|
12
|
-
fontFamily: String,
|
|
13
|
-
fontWeight: String,
|
|
14
|
-
textDecoration: String,
|
|
15
|
-
fontStyle: String,
|
|
16
|
-
x: Number,
|
|
17
|
-
y: Number,
|
|
18
|
-
width: Number,
|
|
19
|
-
rotation: { type: Number, default: 0 },
|
|
20
|
-
},
|
|
21
|
-
],
|
|
22
|
-
image: [
|
|
23
|
-
{
|
|
24
|
-
id: String,
|
|
25
|
-
src: String,
|
|
26
|
-
url: String,
|
|
27
|
-
x: Number,
|
|
28
|
-
y: Number,
|
|
29
|
-
height: Number,
|
|
30
|
-
width: Number,
|
|
31
|
-
type: { type: String, default: "logo" },
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
height: String,
|
|
35
|
-
width: String,
|
|
36
|
-
back: [
|
|
37
|
-
{
|
|
38
|
-
src: String,
|
|
39
|
-
id: String,
|
|
40
|
-
x: Number,
|
|
41
|
-
y: Number,
|
|
42
|
-
height: Number,
|
|
43
|
-
width: Number,
|
|
44
|
-
},
|
|
45
|
-
],
|
|
46
|
-
display: [
|
|
47
|
-
{
|
|
48
|
-
id: String,
|
|
49
|
-
src: String,
|
|
50
|
-
x: Number,
|
|
51
|
-
y: Number,
|
|
52
|
-
height: Number,
|
|
53
|
-
width: Number,
|
|
54
|
-
rotation: { type: Number, default: 0 },
|
|
55
|
-
},
|
|
56
|
-
],
|
|
57
|
-
preview: {
|
|
58
|
-
id: String,
|
|
59
|
-
src: String,
|
|
60
|
-
x: Number,
|
|
61
|
-
y: Number,
|
|
62
|
-
height: Number,
|
|
63
|
-
width: Number,
|
|
64
|
-
rotation: { type: Number, default: 0 },
|
|
65
|
-
},
|
|
66
|
-
frameId: {
|
|
67
|
-
type: Schema.Types.ObjectId,
|
|
68
|
-
ref: "TemplateFrame",
|
|
69
|
-
},
|
|
70
|
-
name: { type: String, default: "" },
|
|
71
|
-
canColor: String,
|
|
72
|
-
userId: String,
|
|
73
|
-
workspaceId: { type: String, default: "" },
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
module.exports = mongoose.model("Template", templateSchema);
|
package/models/TemplateFrame.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
const mongoose = require("mongoose");
|
|
2
|
-
const { Schema } = mongoose;
|
|
3
|
-
|
|
4
|
-
const templateFrameSchema = new mongoose.Schema(
|
|
5
|
-
{
|
|
6
|
-
fullImageUrl: { type: String, default: "" },
|
|
7
|
-
frameUrl: { type: String, default: "" },
|
|
8
|
-
name: { type: String, default: "" },
|
|
9
|
-
height: { type: Number },
|
|
10
|
-
width: { type: Number },
|
|
11
|
-
displayImageHeight: { type: Number },
|
|
12
|
-
displayImageWidth: { type: Number },
|
|
13
|
-
type: { type: String, default: "" },
|
|
14
|
-
categoryId: { type: Schema.Types.ObjectId, ref: "Catalogue" },
|
|
15
|
-
subCategoryId: { type: String, default: "" },
|
|
16
|
-
workspaceId: { type: String, default: "" },
|
|
17
|
-
colorIds: [
|
|
18
|
-
{
|
|
19
|
-
colorId: {
|
|
20
|
-
type: Schema.Types.ObjectId,
|
|
21
|
-
ref: "Color",
|
|
22
|
-
},
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
tagIds: [
|
|
26
|
-
{
|
|
27
|
-
tagId: {
|
|
28
|
-
type: Schema.Types.ObjectId,
|
|
29
|
-
ref: "Tag",
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
},
|
|
34
|
-
{ timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
templateFrameSchema.virtual("templateTag", {
|
|
38
|
-
ref: "TemplateTag",
|
|
39
|
-
localField: "_id",
|
|
40
|
-
foreignField: "frameId",
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
templateFrameSchema.virtual("templateColors", {
|
|
44
|
-
ref: "TemplateColor",
|
|
45
|
-
localField: "_id",
|
|
46
|
-
foreignField: "frameId",
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
templateFrameSchema.virtual("templateCategories", {
|
|
50
|
-
ref: "TemplateCategory",
|
|
51
|
-
localField: "_id",
|
|
52
|
-
foreignField: "frameId",
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
module.exports = mongoose.model("TemplateFrame", templateFrameSchema);
|
package/models/TemplateTag.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
const mongoose = require("mongoose");
|
|
2
|
-
|
|
3
|
-
const tagSchema = new mongoose.Schema(
|
|
4
|
-
{
|
|
5
|
-
name: { type: String, default: "" },
|
|
6
|
-
},
|
|
7
|
-
{ timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
|
|
8
|
-
);
|
|
9
|
-
|
|
10
|
-
module.exports = mongoose.model("TemplateTag", tagSchema);
|
package/models/UserGuide.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const mongoose = require("mongoose");
|
|
2
|
-
const { Schema } = mongoose;
|
|
3
|
-
const UserGuideSchema = new Schema(
|
|
4
|
-
{
|
|
5
|
-
category: {
|
|
6
|
-
type: String,
|
|
7
|
-
required: true,
|
|
8
|
-
},
|
|
9
|
-
subcategory: {
|
|
10
|
-
type: String,
|
|
11
|
-
required: true,
|
|
12
|
-
},
|
|
13
|
-
pdfUrl: {
|
|
14
|
-
type: String,
|
|
15
|
-
required: true,
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
{ timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
|
|
19
|
-
);
|
|
20
|
-
const UserGuide = mongoose.model("UserGuide", UserGuideSchema);
|
|
21
|
-
module.exports = UserGuide;
|
package/models/UserSession.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
const mongoose = require("mongoose");
|
|
2
|
-
|
|
3
|
-
const userSessionSchema = new mongoose.Schema(
|
|
4
|
-
{
|
|
5
|
-
userId: {
|
|
6
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
7
|
-
ref: "User",
|
|
8
|
-
default: null,
|
|
9
|
-
},
|
|
10
|
-
browserId: {
|
|
11
|
-
type: String,
|
|
12
|
-
default: "",
|
|
13
|
-
},
|
|
14
|
-
ipAddress: {
|
|
15
|
-
type: String,
|
|
16
|
-
default: "",
|
|
17
|
-
},
|
|
18
|
-
userAgent: {
|
|
19
|
-
type: String,
|
|
20
|
-
default: "",
|
|
21
|
-
},
|
|
22
|
-
createdTime: {
|
|
23
|
-
type: String,
|
|
24
|
-
default: "",
|
|
25
|
-
},
|
|
26
|
-
lastActivity: {
|
|
27
|
-
type: String,
|
|
28
|
-
default: "",
|
|
29
|
-
},
|
|
30
|
-
valid: {
|
|
31
|
-
type: Boolean,
|
|
32
|
-
default: true,
|
|
33
|
-
},
|
|
34
|
-
uuid: {
|
|
35
|
-
type: String,
|
|
36
|
-
default: "",
|
|
37
|
-
},
|
|
38
|
-
type: {
|
|
39
|
-
type: String,
|
|
40
|
-
default: "web",
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
{ timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
const UserSession = mongoose.model("UserSession", userSessionSchema);
|
|
47
|
-
module.exports = UserSession;
|