@plusscommunities/pluss-core-aws 1.6.2 → 1.6.4

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,30 @@
1
+ const uuid = require("uuid");
2
+ const moment = require("moment");
3
+ const updateRef = require("../common/updateRef");
4
+ const { getMultiRowId, getRowId } = require("../../helper");
5
+
6
+ module.exports = (actionType, entityType, site, user, entityId, data) => {
7
+ return new Promise((resolve, reject) => {
8
+ const activity = {
9
+ Id: uuid.v1(),
10
+ Type: actionType,
11
+ Timestamp: moment.utc().valueOf(),
12
+ EntityType: entityType,
13
+ SubjectId: entityId,
14
+ UserId: user.id,
15
+ User: user,
16
+ Site: site,
17
+ EntityId: getRowId(entityId, entityType),
18
+ ActivityId: getMultiRowId([entityId, entityType, actionType]),
19
+ Data: data,
20
+ };
21
+
22
+ updateRef(`analytics`, activity)
23
+ .then(() => {
24
+ resolve();
25
+ })
26
+ .catch((error) => {
27
+ reject(error);
28
+ });
29
+ });
30
+ };
@@ -0,0 +1,6 @@
1
+ const { getRowId } = require("../../helper");
2
+ const getRef = require("../common/getRef");
3
+
4
+ module.exports = async (site, id) => {
5
+ return await getRef("roles", "RowId", getRowId(site, id));
6
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plusscommunities/pluss-core-aws",
3
- "version": "1.6.2",
3
+ "version": "1.6.4",
4
4
  "description": "Core extension package for Pluss Communities platform",
5
5
  "scripts": {
6
6
  "betapatch": "npm version prepatch --preid=beta",