@plusscommunities/pluss-core-aws 2.0.16-beta.0 → 2.0.17
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.
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const indexQuery = require("../common/indexQuery");
|
|
2
|
+
|
|
3
|
+
module.exports = (userID) => {
|
|
4
|
+
return new Promise((resolve, reject) => {
|
|
5
|
+
const query = {
|
|
6
|
+
IndexName: "LinkedByLinkedUserIdIndex",
|
|
7
|
+
KeyConditionExpression: "LinkedUserId = :userID",
|
|
8
|
+
ExpressionAttributeValues: {
|
|
9
|
+
":userID": userID,
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
console.log("running linkedUserId query");
|
|
14
|
+
console.log(query);
|
|
15
|
+
indexQuery("linkedusers", query)
|
|
16
|
+
.then((data) => {
|
|
17
|
+
console.log("successful query");
|
|
18
|
+
resolve(data);
|
|
19
|
+
})
|
|
20
|
+
.catch((error) => {
|
|
21
|
+
console.log("query failed");
|
|
22
|
+
console.log(error);
|
|
23
|
+
reject();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const moment = require("moment-timezone");
|
|
2
|
+
|
|
3
|
+
module.exports = (dateString, timeOfDay, timezone, resultFormat = "value") => {
|
|
4
|
+
// Parse the date string into a moment object in the given timezone
|
|
5
|
+
const dateMoment = moment.tz(dateString, "DD-MM-YYYY", timezone);
|
|
6
|
+
|
|
7
|
+
// Calculate the hours and minutes from the timeOfDay in minutes
|
|
8
|
+
const hours = Math.floor(timeOfDay / 60);
|
|
9
|
+
const minutes = timeOfDay % 60;
|
|
10
|
+
|
|
11
|
+
// Set the hours and minutes to the dateMoment
|
|
12
|
+
dateMoment.hours(hours).minutes(minutes).seconds(0).milliseconds(0);
|
|
13
|
+
|
|
14
|
+
switch (resultFormat) {
|
|
15
|
+
case "string":
|
|
16
|
+
// return the timestamp in string format
|
|
17
|
+
return dateMoment.format();
|
|
18
|
+
case "value":
|
|
19
|
+
// Return the timestamp in milliseconds
|
|
20
|
+
return dateMoment.valueOf();
|
|
21
|
+
default:
|
|
22
|
+
// return the timestamp in a formatted string
|
|
23
|
+
return dateMoment.format(resultFormat);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const _ = require("lodash");
|
|
2
|
+
const { getRowId } = require("../");
|
|
3
|
+
const getRef = require("../../db/common/getRef");
|
|
4
|
+
|
|
5
|
+
module.exports = async (site) => {
|
|
6
|
+
if (site) {
|
|
7
|
+
const timezone = await getRef(
|
|
8
|
+
"strings",
|
|
9
|
+
"RowId",
|
|
10
|
+
getRowId(site, "timezone")
|
|
11
|
+
);
|
|
12
|
+
if (timezone && !_.isEmpty(timezone.Value)) {
|
|
13
|
+
return timezone.Value;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return "Australia/Brisbane";
|
|
17
|
+
};
|
|
@@ -119,6 +119,13 @@ module.exports = (noti) => {
|
|
|
119
119
|
} else if (type.startsWith("ScheduledAction")) {
|
|
120
120
|
thisNoti.Text = noti.Data.message;
|
|
121
121
|
thisNoti.Icon = "bell-o";
|
|
122
|
+
} else if (type.startsWith("FeedPostApproved")) {
|
|
123
|
+
thisNoti.Text = `You have a new post for ${noti.Data.user.displayName}`;
|
|
124
|
+
thisNoti.Subtext = noti.Data.title;
|
|
125
|
+
thisNoti.Icon = "bars";
|
|
126
|
+
} else if (type.startsWith("FeedPostToday")) {
|
|
127
|
+
thisNoti.Text = `Review today's posts for ${noti.Data.displayName}`;
|
|
128
|
+
thisNoti.Icon = "bars";
|
|
122
129
|
} else {
|
|
123
130
|
thisNoti.Text = "You have received a notification";
|
|
124
131
|
thisNoti.Icon = "bell-o";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plusscommunities/pluss-core-aws",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.17",
|
|
4
4
|
"description": "Core extension package for Pluss Communities platform",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"betapatch": "npm version prepatch --preid=beta",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"https": "^1.0.0",
|
|
23
23
|
"lodash": "^4.17.10",
|
|
24
24
|
"moment": "^2.30.1",
|
|
25
|
+
"moment-timezone": "^0.5.41",
|
|
25
26
|
"node-fetch": "^2.2.0",
|
|
26
27
|
"node-jose": "^1.0.0",
|
|
27
28
|
"nodemailer": "^6.9.12",
|