@plusscommunities/pluss-core-aws 1.6.6 → 1.6.8

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,17 @@
1
+ const _ = require("lodash");
2
+ const { getMultiRowId } = require("../../helper");
3
+ const indexQuery = require("../common/indexQuery");
4
+
5
+ module.exports = async (entityId, entityType, actionType) => {
6
+ const result = await indexQuery("analytics", {
7
+ IndexName: "AnalyticsActivityIndex",
8
+ KeyConditionExpression: "ActivityId = :activityId",
9
+ ExpressionAttributeValues: {
10
+ ":activityId": getMultiRowId([entityId, entityType, actionType]),
11
+ },
12
+ });
13
+ if (result && !_.isEmpty(result.Items)) {
14
+ return true;
15
+ }
16
+ return false;
17
+ };
@@ -3,12 +3,20 @@ const moment = require("moment");
3
3
  const updateRef = require("../common/updateRef");
4
4
  const { getMultiRowId, getRowId } = require("../../helper");
5
5
 
6
- module.exports = (actionType, entityType, site, user, entityId, data) => {
6
+ module.exports = (
7
+ actionType,
8
+ entityType,
9
+ site,
10
+ user,
11
+ entityId,
12
+ data,
13
+ timestamp
14
+ ) => {
7
15
  return new Promise((resolve, reject) => {
8
16
  const activity = {
9
17
  Id: uuid.v1(),
10
18
  Type: actionType,
11
- Timestamp: moment.utc().valueOf(),
19
+ Timestamp: timestamp || moment.utc().valueOf(),
12
20
  EntityType: entityType,
13
21
  SubjectId: entityId,
14
22
  UserId: user.id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plusscommunities/pluss-core-aws",
3
- "version": "1.6.6",
3
+ "version": "1.6.8",
4
4
  "description": "Core extension package for Pluss Communities platform",
5
5
  "scripts": {
6
6
  "betapatch": "npm version prepatch --preid=beta",