Skip to content

Commit

Permalink
Use node import specifier (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshMock authored Aug 22, 2024
1 parent 657e3a5 commit 7747157
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 29 deletions.
2 changes: 1 addition & 1 deletion src/Diagnostic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { EventEmitter } from 'events'
import { EventEmitter } from 'node:events'
import { ElasticsearchClientError, ConfigurationError } from './errors'
import { ConnectionRequestOptions } from './connection'
import { ResurrectEvent } from './pool'
Expand Down
2 changes: 1 addition & 1 deletion src/Serializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import { stringify } from 'querystring'
import { stringify } from 'node:querystring'
import Debug from 'debug'
import sjson from 'secure-json-parse'
import { SerializationError, DeserializationError } from './errors'
Expand Down
13 changes: 7 additions & 6 deletions src/Transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@
*/

import Debug from 'debug'
import os from 'os'
import * as http from 'http'
import zlib from 'zlib'
import buffer from 'buffer'
import { promisify } from 'util'
import os from 'node:os'
import * as http from 'node:http'
import zlib from 'node:zlib'
import buffer from 'node:buffer'
import { promisify } from 'node:util'
import process from 'node:process'
import ms from 'ms'
import {
ConnectionError,
Expand All @@ -37,7 +38,7 @@ import {
import { Connection, ConnectionRequestParams } from './connection'
import Diagnostic from './Diagnostic'
import Serializer from './Serializer'
import { Readable as ReadableStream } from 'stream'
import { Readable as ReadableStream } from 'node:stream'
import { BaseConnectionPool } from './pool'
import {
nodeFilterFn,
Expand Down
10 changes: 5 additions & 5 deletions src/connection/BaseConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
* under the License.
*/

import { inspect } from 'util'
import * as http from 'http'
import { URL } from 'url'
import { ConnectionOptions as TlsConnectionOptions, TLSSocket, DetailedPeerCertificate } from 'tls'
import { Readable as ReadableStream } from 'stream'
import { inspect } from 'node:util'
import * as http from 'node:http'
import { URL } from 'node:url'
import { ConnectionOptions as TlsConnectionOptions, TLSSocket, DetailedPeerCertificate } from 'node:tls'
import { Readable as ReadableStream } from 'node:stream'
import Diagnostic from '../Diagnostic'
import {
ApiKeyAuth,
Expand Down
12 changes: 6 additions & 6 deletions src/connection/HttpConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
/* eslint-disable @typescript-eslint/restrict-template-expressions */

import hpagent from 'hpagent'
import http from 'http'
import https from 'https'
import http from 'node:http'
import https from 'node:https'
import Debug from 'debug'
import buffer from 'buffer'
import { TLSSocket } from 'tls'
import buffer from 'node:buffer'
import { TLSSocket } from 'node:tls'
import BaseConnection, {
ConnectionOptions,
ConnectionRequestParams,
Expand All @@ -36,14 +36,14 @@ import BaseConnection, {
isCaFingerprintMatch
} from './BaseConnection'
import { kCaFingerprint } from '../symbols'
import { Readable as ReadableStream, pipeline } from 'stream'
import { Readable as ReadableStream, pipeline } from 'node:stream'
import {
ConfigurationError,
ConnectionError,
RequestAbortedError,
TimeoutError
} from '../errors'
import { setTimeout as setTimeoutPromise } from 'timers/promises'
import { setTimeout as setTimeoutPromise } from 'node:timers/promises'
import { HttpAgentOptions } from '../types'

const debug = Debug('elasticsearch')
Expand Down
6 changes: 3 additions & 3 deletions src/connection/UndiciConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
/* eslint-disable @typescript-eslint/restrict-template-expressions */

import Debug from 'debug'
import buffer from 'buffer'
import { TLSSocket } from 'tls'
import { Socket } from 'net'
import buffer from 'node:buffer'
import { TLSSocket } from 'node:tls'
import { Socket } from 'node:net'
import BaseConnection, {
ConnectionOptions,
ConnectionRequestParams,
Expand Down
2 changes: 1 addition & 1 deletion src/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* under the License.
*/

import * as http from 'http'
import * as http from 'node:http'
import { DiagnosticResult } from './types'
import { RedactionOptions } from './Transport'
import { redactDiagnostic } from './security'
Expand Down
4 changes: 2 additions & 2 deletions src/pool/BaseConnectionPool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
* under the License.
*/

import { URL } from 'url'
import { ConnectionOptions as TlsConnectionOptions } from 'tls'
import { URL } from 'node:url'
import { ConnectionOptions as TlsConnectionOptions } from 'node:tls'
import Debug from 'debug'
import Diagnostic from '../Diagnostic'
import { kCaFingerprint } from '../symbols'
Expand Down
2 changes: 1 addition & 1 deletion src/pool/ClusterConnectionPool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import BaseConnectionPool, {
ConnectionPoolOptions,
GetConnectionOptions
} from './BaseConnectionPool'
import assert from 'assert'
import assert from 'node:assert'
import Debug from 'debug'
import { Connection, BaseConnection, ConnectionOptions } from '../connection'

Expand Down
6 changes: 3 additions & 3 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
* under the License.
*/

import { Readable as ReadableStream } from 'stream'
import { URL } from 'url'
import * as http from 'http'
import { Readable as ReadableStream } from 'node:stream'
import { URL } from 'node:url'
import * as http from 'node:http'
import { Connection, ConnectionOptions, ConnectionRequestParams } from './connection'
import { TransportRequestParams, TransportRequestOptions } from './Transport'

Expand Down

0 comments on commit 7747157

Please sign in to comment.