@certik/skynet 0.16.4 → 0.16.5

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.
package/CHANGELOG.md CHANGED
@@ -1,20 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.16.5
4
+
5
+ - Updated: dynamodb translate config
6
+
3
7
  ## 0.16.4
4
8
 
5
9
  - Updated: nomad job spec
6
10
 
7
11
  ## 0.16.3
8
12
 
9
- - Removed log-shipper job
13
+ - Removed: log-shipper job
10
14
 
11
15
  ## 0.16.2
12
16
 
13
- - Doubled log-shipper cpu and memory
17
+ - Updated: Doubled log-shipper cpu and memory
14
18
 
15
19
  ## 0.16.1
16
20
 
17
- - Removed verbose log from exponentialRetry (@certik/skynet/availablity)
21
+ - Removed: verbose log from exponentialRetry (@certik/skynet/availablity)
18
22
 
19
23
  ## 0.16.0
20
24
 
package/dynamodb.js CHANGED
@@ -24,8 +24,25 @@ function getDynamoDB(forceNew = false) {
24
24
  }
25
25
 
26
26
  function getDocClient(forceNew = false) {
27
+ const marshallOptions = {
28
+ // Whether to automatically convert empty strings, blobs, and sets to `null`.
29
+ convertEmptyValues: true,
30
+ // Whether to remove undefined values while marshalling.
31
+ removeUndefinedValues: true,
32
+ // Whether to convert typeof object to map attribute.
33
+ convertClassInstanceToMap: true,
34
+ };
35
+
36
+ const unmarshallOptions = {
37
+ // Whether to return numbers as a string instead of converting them to native JavaScript numbers.
38
+ wrapNumbers: false, // false, by default.
39
+ };
40
+
27
41
  if (!_docClient || forceNew) {
28
- _docClient = DynamoDBDocumentClient.from(getDynamoDB());
42
+ _docClient = DynamoDBDocumentClient.from(getDynamoDB(), {
43
+ marshallOptions,
44
+ unmarshallOptions,
45
+ });
29
46
  }
30
47
  return _docClient;
31
48
  }
@@ -161,10 +178,12 @@ async function readRecord(tableName, key, verbose = false) {
161
178
 
162
179
  const docClient = getDocClient();
163
180
 
164
- const record = await docClient.send(new GetCommand({
165
- TableName: tableName,
166
- Key: key,
167
- }));
181
+ const record = await docClient.send(
182
+ new GetCommand({
183
+ TableName: tableName,
184
+ Key: key,
185
+ }),
186
+ );
168
187
 
169
188
  return record.Item;
170
189
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@certik/skynet",
3
- "version": "0.16.4",
3
+ "version": "0.16.5",
4
4
  "description": "Skynet Shared JS library",
5
5
  "type": "module",
6
6
  "main": "index.js",