shuttlepro-shared 1.1.41 → 1.1.43

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.
@@ -16,7 +16,7 @@ exports.checkPermission = async (req, res, next, values) => {
16
16
  req.params?.workspaceId ||
17
17
  req.body?.workspaceId ||
18
18
  "";
19
- if (user && user.role === "super") {
19
+ if (req?.user && req?.user?.role === "super") {
20
20
  next();
21
21
  }
22
22
  if (!workspaceId) {
@@ -0,0 +1,17 @@
1
+ const mongoose = require("mongoose");
2
+
3
+ const OrderQueueSchema = new mongoose.Schema(
4
+ {
5
+ type: { type: String, default: "" }, // "publish-order"
6
+ status: { type: String, default: "pending" }, // ["pending", "processing", "completed", "incomplete"]
7
+ retry: { type: Number, default: 3 },
8
+ userId: { type: String, default: "" },
9
+ workspaceId: { type: String, default: "" },
10
+ body: {},
11
+ failedOrders: [],
12
+ },
13
+ { timestamps: true, toJSON: { virtuals: true }, toObject: { virtuals: true } }
14
+ );
15
+ const OrderQueue = mongoose.model("OrderQueue", OrderQueueSchema);
16
+
17
+ module.exports = OrderQueue;
package/models.js CHANGED
@@ -11,6 +11,7 @@ const AllPostScheduleSchema = require("./models/AllPostSchedule");
11
11
  const AutoSchedulerSchema = require("./models/AutoScheduler");
12
12
  const ActivityLogs = require("./models/ActivityLogs");
13
13
  const UserRole = require("./models/UserRole");
14
+ const OrderQueue = require("./models/OrderQueue");
14
15
 
15
16
  module.exports = {
16
17
  Website,
@@ -26,4 +27,5 @@ module.exports = {
26
27
  AutoSchedulerSchema,
27
28
  ActivityLogs,
28
29
  UserRole,
30
+ OrderQueue,
29
31
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shuttlepro-shared",
3
- "version": "1.1.41",
3
+ "version": "1.1.43",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {