aws-v3-sdk 1.0.22 → 1.0.23

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.
@@ -34,17 +34,27 @@ const getClient = async () => {
34
34
  exports.sendGetRequest = async (index, query, from, size, sort, _source) => {
35
35
  const client = await getClient()
36
36
  return new Promise((resolve, reject) => {
37
- let body = { query }
37
+ const body = {}
38
+ if (query) {
39
+ body.query = query
40
+ }
38
41
  if (sort) {
39
- body = { query, sort }
42
+ body.sort = sort
40
43
  }
41
- client.search({
44
+ const options = {
42
45
  index,
43
- from,
44
- size,
45
- _source,
46
46
  body
47
- }).then(response => {
47
+ }
48
+ if (from) {
49
+ options.from = from
50
+ }
51
+ if (size) {
52
+ options.size = size
53
+ }
54
+ if (_source) {
55
+ options._source = size
56
+ }
57
+ client.search(options).then(response => {
48
58
  logger.debug(response, { response })
49
59
  const data = response.body.hits.hits
50
60
  const totalCount = response.body.hits.total
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aws-v3-sdk",
3
- "version": "1.0.22",
3
+ "version": "1.0.23",
4
4
  "description": "AWS v3 SDK Utils",
5
5
  "main": "index.js",
6
6
  "scripts": {