shuttlepro-shared 1.1.31 → 1.1.33
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.
|
@@ -7,7 +7,6 @@ exports.checkPermission = async (req, res, next, values) => {
|
|
|
7
7
|
req.headers && req.headers.authorization
|
|
8
8
|
? req.headers.authorization
|
|
9
9
|
: null;
|
|
10
|
-
console.log(req?.headers, "headers");
|
|
11
10
|
if (req?.headers["x-api-key"] === process.env.API_KEY) {
|
|
12
11
|
return next();
|
|
13
12
|
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
const mongoose = require("mongoose");
|
|
2
|
+
const { Schema } = mongoose;
|
|
3
|
+
const User = require("./User");
|
|
4
|
+
const allPostSchema = new Schema(
|
|
5
|
+
{
|
|
6
|
+
platform: { type: String, default: "" },
|
|
7
|
+
type: { type: String, default: "" },
|
|
8
|
+
batchId: {
|
|
9
|
+
type: Schema.Types.ObjectId,
|
|
10
|
+
ref: "AllPostBatch",
|
|
11
|
+
default: null,
|
|
12
|
+
},
|
|
13
|
+
workspaceId: {
|
|
14
|
+
type: Schema.Types.ObjectId,
|
|
15
|
+
ref: "Workspace",
|
|
16
|
+
default: null,
|
|
17
|
+
},
|
|
18
|
+
pageId: { type: String, default: "" },
|
|
19
|
+
pageName: { type: String, default: "" },
|
|
20
|
+
pageLogo: { type: String, default: "" },
|
|
21
|
+
accessToken: { type: String, default: "" },
|
|
22
|
+
caption: { type: String, default: "" },
|
|
23
|
+
date: { type: String, default: "" },
|
|
24
|
+
postId: { type: String, default: "" },
|
|
25
|
+
permalink: { type: String, default: "" },
|
|
26
|
+
image: { type: String, default: "" },
|
|
27
|
+
link: { type: String, default: "" },
|
|
28
|
+
video: { type: String, default: "" },
|
|
29
|
+
carousel: [],
|
|
30
|
+
status: { type: String, default: "unpublished" },
|
|
31
|
+
organization: { type: String, default: "" },
|
|
32
|
+
compressed: { type: Boolean, default: false },
|
|
33
|
+
approvedAt: { type: String, default: "" },
|
|
34
|
+
publishedAt: { type: String, default: "" },
|
|
35
|
+
approvedBy: { type: Schema.Types.ObjectId, ref: "User", default: null },
|
|
36
|
+
publishedBy: { type: Schema.Types.ObjectId, ref: "User", default: null },
|
|
37
|
+
approved: { type: Boolean, default: false },
|
|
38
|
+
postStatus: { type: String, default: "pending" },
|
|
39
|
+
isDeleted: { type: Boolean, default: false },
|
|
40
|
+
reason: { type: Object, default: null },
|
|
41
|
+
productIds: [{ productId: { type: String, default: "" } }],
|
|
42
|
+
isNotified: { type: Boolean, default: false },
|
|
43
|
+
refreshToken: { type: String, default: "" },
|
|
44
|
+
expiresIn: { type: String, default: "" },
|
|
45
|
+
refreshExpiresIn: { type: String, default: "" },
|
|
46
|
+
scope: { type: String, default: "" },
|
|
47
|
+
socialProfileId: { type: String, default: "" },
|
|
48
|
+
logId: { type: String, default: "" },
|
|
49
|
+
sequenceId: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: "",
|
|
52
|
+
},
|
|
53
|
+
isLocallyBooked: { type: Boolean, default: true },
|
|
54
|
+
instaPublishId: { type: String, default: "" },
|
|
55
|
+
isScheduledPost: { type: Boolean, default: false },
|
|
56
|
+
},
|
|
57
|
+
{ timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
|
|
58
|
+
);
|
|
59
|
+
module.exports = allPostSchema;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const mongoose = require("mongoose");
|
|
2
|
+
const { Schema } = mongoose;
|
|
3
|
+
|
|
4
|
+
const allPostBatchSchema = new Schema(
|
|
5
|
+
{
|
|
6
|
+
type: { type: String, default: "" },
|
|
7
|
+
status: { type: String, default: "pending" },
|
|
8
|
+
workspaceId: { type: String, default: "" },
|
|
9
|
+
caption: { type: String, default: "" },
|
|
10
|
+
image: { type: String, default: "" },
|
|
11
|
+
link: { type: String, default: "" },
|
|
12
|
+
video: { type: String, default: "" },
|
|
13
|
+
carousel: [],
|
|
14
|
+
date: { type: String, default: "" },
|
|
15
|
+
socialProfiles: [],
|
|
16
|
+
scheduleId: {
|
|
17
|
+
type: Schema.Types.ObjectId,
|
|
18
|
+
ref: "AllPostSchedule",
|
|
19
|
+
default: null,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
{ timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
// const AllPostBatch = mongoose.model("allPostBatch", allPostBatchSchema);
|
|
26
|
+
module.exports = allPostBatchSchema;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const mongoose = require("mongoose");
|
|
2
|
+
const { Schema } = mongoose;
|
|
3
|
+
|
|
4
|
+
const AllPostScheduleSchema = new Schema(
|
|
5
|
+
{
|
|
6
|
+
type: { type: String },
|
|
7
|
+
status: { type: String, default: "queue" },
|
|
8
|
+
date: { type: String },
|
|
9
|
+
workspaceId: { type: String, default: "" },
|
|
10
|
+
approved: { type: Boolean, default: false },
|
|
11
|
+
},
|
|
12
|
+
{ timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
// const AllPostSchedule = mongoose.model(
|
|
16
|
+
// "AllPostSchedule",
|
|
17
|
+
// AllPostScheduleSchema
|
|
18
|
+
// );
|
|
19
|
+
|
|
20
|
+
module.exports = AllPostScheduleSchema;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const mongoose = require("mongoose");
|
|
2
|
+
const { Schema } = mongoose;
|
|
3
|
+
|
|
4
|
+
const AutoSchedulerSchema = new Schema(
|
|
5
|
+
{
|
|
6
|
+
pageId: { type: String, default: "" },
|
|
7
|
+
workspaceId: { type: String, default: "" },
|
|
8
|
+
type: { type: String, default: "single" },
|
|
9
|
+
criteria: { type: Object, default: null },
|
|
10
|
+
noOfPosts: { type: Object, default: null },
|
|
11
|
+
desTemplateId: { type: Object, default: null },
|
|
12
|
+
startDate: { type: String, default: "" },
|
|
13
|
+
endDate: { type: String, default: "" },
|
|
14
|
+
products: Array,
|
|
15
|
+
},
|
|
16
|
+
{ timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
// const AutoScheduler = mongoose.model("AutoScheduler", AutoSchedulerSchema);
|
|
20
|
+
|
|
21
|
+
module.exports = AutoSchedulerSchema;
|