aws-v3-sdk 1.0.28 → 1.0.29
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.
|
@@ -116,18 +116,6 @@ class DocumentClient {
|
|
|
116
116
|
})
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
transactWrite (params, callback) {
|
|
120
|
-
const docClient = DynamoDBDocument.from(new DynamoDB())
|
|
121
|
-
docClient.transactWrite(params, function (err, data) {
|
|
122
|
-
if (err) {
|
|
123
|
-
callback(err)
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
callback(null, data)
|
|
127
|
-
}
|
|
128
|
-
})
|
|
129
|
-
}
|
|
130
|
-
|
|
131
119
|
batchGet (params, callback) {
|
|
132
120
|
const docClient = DynamoDBDocument.from(ddb)
|
|
133
121
|
|
|
@@ -335,28 +323,4 @@ class DocumentClient {
|
|
|
335
323
|
}
|
|
336
324
|
}
|
|
337
325
|
|
|
338
|
-
transactWriteAsync (params, callback) {
|
|
339
|
-
const docClient = DynamoDBDocument.from(new DynamoDB())
|
|
340
|
-
return new Promise((resolve, reject) => {
|
|
341
|
-
docClient.transactWrite(params, (err, response) => {
|
|
342
|
-
if (err || !response) {
|
|
343
|
-
return reject(err)
|
|
344
|
-
}
|
|
345
|
-
if (response) {
|
|
346
|
-
return resolve(response)
|
|
347
|
-
}
|
|
348
|
-
})
|
|
349
|
-
}).then(result => {
|
|
350
|
-
if (callback && typeof callback === 'function') {
|
|
351
|
-
callback(null, result)
|
|
352
|
-
}
|
|
353
|
-
return result
|
|
354
|
-
}).catch(error => {
|
|
355
|
-
if (callback && typeof callback === 'function') {
|
|
356
|
-
callback(error, null)
|
|
357
|
-
}
|
|
358
|
-
return Promise.reject(error)
|
|
359
|
-
})
|
|
360
|
-
}
|
|
361
|
-
|
|
362
326
|
module.exports = DocumentClient
|