Skip to content

Commit

Permalink
Merge pull request #5 from mergermarket/1.1.0
Browse files Browse the repository at this point in the history
Release 1.1.0
  • Loading branch information
fewstera authored Mar 25, 2020
2 parents d86660e + cec3450 commit 37085bd
Show file tree
Hide file tree
Showing 6 changed files with 613 additions and 571 deletions.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@acuris/aws-es-connection",
"private": false,
"version": "1.0.1",
"version": "1.1.0",
"description": "AWS ElasticSearch connection for the @elastic/elasticsearch ES client",
"keywords": [
"aws",
Expand All @@ -21,7 +21,9 @@
},
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": ["dist/**/*"],
"files": [
"dist/**/*"
],
"scripts": {
"prepublishOnly": "npm run build",
"build": "tsc",
Expand Down
4 changes: 2 additions & 2 deletions src/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createAWSConnection, awsCredsifyAll, awsGetCredentials} from './index'
import AWS from 'aws-sdk'
import * as AWS from 'aws-sdk'
import { Client } from '@elastic/elasticsearch'

describe('aws-es-connection', () => {
Expand Down Expand Up @@ -104,7 +104,7 @@ describe('aws-es-connection', () => {
await esClient.index({ index: indexName, refresh: 'wait_for', body: doc3 })

const result = await esClient.search({ index: indexName, q: 'Hello' })
expect(result.body.hits.total).toBe(2)
expect(result.body.hits.total.value).toBe(2)
} finally {
// Clean up
await esClient.indices.delete({ index: indexName })
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import AWS from 'aws-sdk'
import http from 'http'
import * as AWS from 'aws-sdk'
import { request, ClientRequest, ClientRequestArgs } from 'http'
import { sign } from 'aws4'
import { Client, Connection } from '@elastic/elasticsearch'

Expand All @@ -13,8 +13,8 @@ class AWSConnection extends Connection {
this.makeRequest = this.signedRequest
}

private signedRequest(reqParams: http.ClientRequestArgs): http.ClientRequest {
return http.request(sign(reqParams, this.awsCredentials))
private signedRequest(reqParams: ClientRequestArgs): ClientRequest {
return request(sign(reqParams, this.awsCredentials))
}
}

Expand Down
14 changes: 14 additions & 0 deletions src/whitelisted-props.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
export default [
'async_search',
'async_search',
'asyncSearch',
'autoscaling',
'bulk',
'cat',
'ccr',
Expand All @@ -8,14 +12,18 @@ export default [
'count',
'create',
'data_frame',
'data_frame_transform_deprecated',
'dataFrame',
'dataFrameTransformDeprecated',
'delete',
'delete_by_query',
'deleteByQuery',
'delete_by_query_rethrottle',
'deleteByQueryRethrottle',
'delete_script',
'deleteScript',
'enrich',
'eql',
'exists',
'exists_source',
'existsSource',
Expand All @@ -25,6 +33,10 @@ export default [
'get',
'get_script',
'getScript',
'get_script_context',
'getScriptContext',
'get_script_languages',
'getScriptLanguages',
'get_source',
'getSource',
'graph',
Expand Down Expand Up @@ -53,6 +65,7 @@ export default [
'reindexRethrottle',
'render_search_template',
'renderSearchTemplate',
'rollup',
'scripts_painless_execute',
'scriptsPainlessExecute',
'scroll',
Expand All @@ -68,6 +81,7 @@ export default [
'ssl',
'tasks',
'termvectors',
'transform',
'update',
'update_by_query',
'updateByQuery',
Expand Down
4 changes: 1 addition & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"module": "commonjs",
"outDir": "./dist/",
"target": "es6",
"declaration": true
},
"include": ["src/**/*"],
"exclude": ["node_modules"]
"exclude": ["node_modules", "src/**/*.test.ts"]
}
Loading

0 comments on commit 37085bd

Please sign in to comment.