@plusscommunities/pluss-newsletter-aws 2.0.6 → 2.1.1-beta.2

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.
@@ -1,6 +1,6 @@
1
1
  const _ = require("lodash");
2
2
  const moment = require("moment");
3
- const { Marshaller } = require("@aws/dynamodb-auto-marshaller");
3
+ const { unmarshall } = require("@aws-sdk/util-dynamodb");
4
4
  const initConfig = require("./initConfig");
5
5
  const { getRowId } = require("./common/helper");
6
6
  const deleteRef = require("./common/db/common/deleteRef");
@@ -13,7 +13,7 @@ const updateAttribute = require("./common/db/common/updateAttribute");
13
13
  const logAnalyticsActivity = require("@plusscommunities/pluss-core-aws/db/analytics/logAnalyticsActivity");
14
14
  const { values } = require("./values.config");
15
15
 
16
- const marshaller = new Marshaller();
16
+
17
17
 
18
18
  const createUserEntries = (data, toAdd, toRemove) => {
19
19
  initConfig();
@@ -128,7 +128,7 @@ module.exports.newsletterChanged = (event, context, callback) => {
128
128
  let site;
129
129
  if (record.eventName == "INSERT") {
130
130
  console.log("INSERT");
131
- const data = marshaller.unmarshallItem(record.dynamodb.NewImage);
131
+ const data = unmarshall(record.dynamodb.NewImage);
132
132
  console.log("Record: ", JSON.stringify(data));
133
133
 
134
134
  if (!_.isEmpty(data.Tagged)) {
@@ -149,8 +149,8 @@ module.exports.newsletterChanged = (event, context, callback) => {
149
149
  logAnalytics(data);
150
150
  } else if (record.eventName == "MODIFY") {
151
151
  console.log("MODIFY");
152
- const data = marshaller.unmarshallItem(record.dynamodb.NewImage);
153
- const previousData = marshaller.unmarshallItem(record.dynamodb.OldImage);
152
+ const data = unmarshall(record.dynamodb.NewImage);
153
+ const previousData = unmarshall(record.dynamodb.OldImage);
154
154
  console.log("New record: ", JSON.stringify(data));
155
155
  console.log("Old record: ", JSON.stringify(previousData));
156
156
 
@@ -175,7 +175,7 @@ module.exports.newsletterChanged = (event, context, callback) => {
175
175
  site = data.Site;
176
176
  } else if (record.eventName == "REMOVE") {
177
177
  console.log("REMOVE");
178
- const previousData = marshaller.unmarshallItem(record.dynamodb.OldImage);
178
+ const previousData = unmarshall(record.dynamodb.OldImage);
179
179
  console.log("Old record: ", JSON.stringify(previousData));
180
180
 
181
181
  const oldTags = _.isEmpty(previousData.Tagged)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plusscommunities/pluss-newsletter-aws",
3
- "version": "2.0.6",
3
+ "version": "2.1.1-beta.2",
4
4
  "description": "Extension package to enable newsletter on Pluss Communities Platform",
5
5
  "scripts": {
6
6
  "gc": "node ../../tools/gc ./",
@@ -23,11 +23,13 @@
23
23
  "author": "Thorbjorn Kappel Davis",
24
24
  "license": "ISC",
25
25
  "dependencies": {
26
- "@aws/dynamodb-auto-marshaller": "^0.7.1",
27
- "@plusscommunities/pluss-core-aws": "2.0.10",
26
+ "@aws-sdk/client-cognito-identity-provider": "^3.859.0",
27
+ "@aws-sdk/client-dynamodb": "^3.855.0",
28
+ "@aws-sdk/lib-dynamodb": "^3.855.0",
29
+ "@aws-sdk/util-dynamodb": "^3.0.0",
30
+ "@plusscommunities/pluss-core-aws": "2.1.1-beta.5",
28
31
  "amazon-cognito-identity-js": "^2.0.19",
29
32
  "axios": "^1.6.8",
30
- "aws-sdk": "^2.1591.0",
31
33
  "expo-server-sdk": "^3.0.1",
32
34
  "https": "^1.0.0",
33
35
  "lodash": "^4.17.10",
@@ -42,8 +44,7 @@
42
44
  "@types/jest": "^26.0.23",
43
45
  "eslint-config-rallycoding": "^3.2.0",
44
46
  "jest": "^29.0.0",
45
- "jest-aws-sdk-mock": "^1.0.2",
46
- "serverless-domain-manager": "^3.3.1",
47
+ "serverless-domain-manager": "^8.0.0",
47
48
  "serverless-prune-plugin": "^1.4.1"
48
49
  },
49
50
  "files": [