@plusscommunities/pluss-core-aws 1.3.7-beta.0 → 1.3.8-beta.0

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,13 +7,12 @@ module.exports = async (accessKey, secretKey) => {
7
7
  sender: null,
8
8
  };
9
9
  const service = await getEmailService(accessKey, secretKey);
10
- if (service) {
11
- console.log("Amazon SES status", service);
12
- result.enabled = service.SendingEnabled && service.ProductionAccessEnabled;
13
-
10
+ console.log("Amazon SES status", service);
11
+ if (service && service.SendingEnabled && service.ProductionAccessEnabled) {
12
+ result.enabled = true;
14
13
  const sender = await getDefaultEmailAddress(accessKey, secretKey);
14
+ console.log("Amazon SES sender", sender);
15
15
  if (sender) {
16
- console.log("Amazon SES sender", sender);
17
16
  result.sender = sender.IdentityName;
18
17
  }
19
18
  }
@@ -0,0 +1,5 @@
1
+ const deleteRef = require("../common/deleteRef");
2
+
3
+ module.exports = (id) => {
4
+ return deleteRef("actionqueue", "RowId", id);
5
+ };
@@ -0,0 +1,13 @@
1
+ const getRef = require("../common/getRef");
2
+
3
+ module.exports = (rowId) => {
4
+ return new Promise((resolve, reject) => {
5
+ getRef("actionqueue", "RowId", rowId)
6
+ .then((ev) => {
7
+ resolve(ev);
8
+ })
9
+ .catch((error) => {
10
+ reject(error);
11
+ });
12
+ });
13
+ };
@@ -0,0 +1,31 @@
1
+ const uuid = require("uuid");
2
+ const moment = require("moment");
3
+ const editRef = require("../common/editRef");
4
+
5
+ module.exports = (rowId, update) => {
6
+ return new Promise(async (resolve, reject) => {
7
+ try {
8
+ const now = moment().valueOf();
9
+ const { Created, Updated, TriggerAt, Status, Recipients } = update;
10
+ if (!rowId) {
11
+ rowId = uuid.v1();
12
+ if (!Created) update.Created = now;
13
+ if (!Status) update.Status = "READY";
14
+ } else {
15
+ if (!Updated) update.Updated = now;
16
+ }
17
+ if (TriggerAt) update.TriggerAt = moment(TriggerAt).valueOf();
18
+ if (Recipients)
19
+ update.Recipients =
20
+ typeof Recipients === "string" || Recipients instanceof String
21
+ ? Recipients.split(",").map((r) => r.trim())
22
+ : Recipients;
23
+
24
+ const updated = await editRef("actionqueue", "RowId", rowId, update);
25
+
26
+ resolve(updated);
27
+ } catch (error) {
28
+ reject(error);
29
+ }
30
+ });
31
+ };
@@ -114,6 +114,10 @@ module.exports = (noti) => {
114
114
  thisNoti.Text = `There is a new document: ${noti.Data.Name}`;
115
115
  thisNoti.Icon = "file-o";
116
116
  break;
117
+ case "ScheduledAction":
118
+ thisNoti.Text = noti.Data.message;
119
+ thisNoti.Icon = "bell-o";
120
+ break;
117
121
  default:
118
122
  thisNoti.Text = "You have received a notification";
119
123
  thisNoti.Icon = "bell-o";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plusscommunities/pluss-core-aws",
3
- "version": "1.3.7-beta.0",
3
+ "version": "1.3.8-beta.0",
4
4
  "description": "Core extension package for Pluss Communities platform",
5
5
  "scripts": {
6
6
  "betapatch": "npm version prepatch --preid=beta",