Skip to content

Commit

Permalink
Merge pull request #1 from elastic/refactor
Browse files Browse the repository at this point in the history
Refactor
  • Loading branch information
delvedor authored Mar 2, 2021
2 parents 72bb227 + eb909c3 commit ef4277e
Show file tree
Hide file tree
Showing 62 changed files with 6,484 additions and 10,809 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:

strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 15.x]
node-version: [12.x, 14.x, 15.x]
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
Expand All @@ -36,17 +36,13 @@ jobs:
run: |
npm run test:acceptance
- name: Type Definitions
run: |
npm run test:types
code-coverage:
name: Code coverage
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [12.x]
node-version: [14.x]

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -80,7 +76,7 @@ jobs:

strategy:
matrix:
node-version: [12.x]
node-version: [14.x]

steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,5 @@ dist
.DS_Store

package-lock.json

lib
2 changes: 2 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,5 @@ certs
.github
CODE_OF_CONDUCT.md
CONTRIBUTING.md

src
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ npm install @elastic/transport

### Node.js support

NOTE: The minimum supported version of Node.js is `v10`.
NOTE: The minimum supported version of Node.js is `v12`.

The client versioning follows the Elastc Stack versioning, this means that
major, minor, and patch releases are done following a precise schedule that
Expand Down
79 changes: 38 additions & 41 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,55 +17,52 @@
* under the License.
*/

import Transport, {
ApiError,
ApiResponse,
RequestEvent,
TransportRequestParams,
TransportRequestOptions,
nodeFilterFn,
nodeSelectorFn,
generateRequestIdFn,
TransportRequestCallback,
TransportRequestPromise,
RequestBody,
RequestNDBody,
Context
} from './lib/Transport';
import Connection from './lib/Connection'
import { ClusterConnectionPool, CloudConnectionPool, BaseConnectionPool } from './lib/pool'
import Diagnostic from './lib/Diagnostic'
import Transport from './lib/Transport'
import {
BaseConnection,
HttpConnection,
UndiciConnection
} from './lib/connection'
import {
WeightedConnectionPool,
ClusterConnectionPool,
CloudConnectionPool,
BaseConnectionPool
} from './lib/pool'
import Serializer from './lib/Serializer'
import * as errors from './lib/errors'

declare const events: {
SERIALIZATION: string
REQUEST: string
DESERIALIZATION: string
RESPONSE: string
SNIFF: string
RESURRECT: string
}
export type {
Connection,
ConnectionOptions,
ConnectionRequestOptions,
ConnectionRequestResponse
} from './lib/connection'

export type {
ConnectionPoolOptions,
GetConnectionOptions
} from './lib/pool'

export type {
TransportRequestParams,
TransportRequestOptions,
SniffOptions
} from './lib/Transport'

export type { Result } from './lib/types'

export {
Diagnostic,
Transport,
WeightedConnectionPool,
ClusterConnectionPool,
BaseConnectionPool,
CloudConnectionPool,
Connection,
BaseConnection,
HttpConnection,
UndiciConnection,
Serializer,
events,
errors,
ApiError,
ApiResponse,
RequestEvent,
TransportRequestParams,
TransportRequestOptions,
nodeFilterFn,
nodeSelectorFn,
generateRequestIdFn,
TransportRequestCallback,
TransportRequestPromise,
RequestBody,
RequestNDBody,
Context
errors
}
30 changes: 15 additions & 15 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,32 @@

'use strict'

const Transport = require('./lib/Transport')
const Connection = require('./lib/Connection')
const Diagnostic = require('./lib/Diagnostic').default
const Transport = require('./lib/Transport').default
const {
BaseConnection,
HttpConnection,
UndiciConnection
} = require('./lib/connection')
const {
BaseConnectionPool,
ClusterConnectionPool,
CloudConnectionPool,
WeightedConnectionPool
} = require('./lib/pool')
const Serializer = require('./lib/Serializer')
const Serializer = require('./lib/Serializer').default
const errors = require('./lib/errors')

const events = {
RESPONSE: 'response',
REQUEST: 'request',
SNIFF: 'sniff',
RESURRECT: 'resurrect',
SERIALIZATION: 'serialization',
DESERIALIZATION: 'deserialization'
}

module.exports = {
Diagnostic,
Transport,
Connection,
BaseConnection,
HttpConnection,
UndiciConnection,
BaseConnectionPool,
ClusterConnectionPool,
CloudConnectionPool,
WeightedConnectionPool,
Serializer,
errors,
events
errors
}
98 changes: 0 additions & 98 deletions lib/Connection.d.ts

This file was deleted.

Loading

0 comments on commit ef4277e

Please sign in to comment.