influxdb-client-js

InfluxDB 2.0 JavaScript client

View the Project on GitHub influxdata/influxdb-client-js

Home > @influxdata/influxdb-client

influxdb-client package

Classes

Class Description
AbortError AbortError indicates that the communication with the server was aborted
HttpError A general HTTP error.
IllegalArgumentError IllegalArgumentError is thrown when illegal argument is supplied.
InfluxDB InfluxDB entry point that configures communication with InfluxDB server and provide APIs to write and query data.
LineSplitter Optimized tokenizer of a single CSV line.
Point Point defines values of a single measurement.
RequestTimedOutError RequestTimedOutError indicates request timeout in the communication with the server

Functions

Function Description
canRetryHttpCall(error) Tests the error in order to know if an HTTP call can be retried.
chunksToLines(target, chunkCombiner) ChunksToLines is a transformation that accepts Uint8Array instances and emmits strings representing CSV lines.
chunksToLinesIterable(source, chunkCombiner) ChunksToLinesIterable is a transformation that accepts an iterable of Uint8Array instances and returns iterable of lines.
convertTimeToNanos(value) convertTimeToNanos converts Point’s timestamp to a string.
createFluxTableColumn(object) Creates a flux table column from a partial FluxTableColumn.
createFluxTableMetaData(columns) Created FluxTableMetaData from the columns supplied.
createTextDecoderCombiner() Creates a chunk combiner instance that uses UTF-8 TextDecoder to decode Uint8Arrays into strings.
flux(strings, values) Flux is a tagged template that sanitizes supplied parameters to avoid injection attacks in flux.
fluxBool(value) Creates flux boolean literal.
fluxDateTime(value) Creates flux date-time literal.
fluxDuration(value) Creates flux date-time literal.
fluxExpression(value) Assumes that the supplied value is flux expression or literal that does not need sanitizing.
fluxFloat(value) Creates a flux float literal.
fluxInteger(value) Creates a flux integer literal.
fluxRegExp(value) Creates flux regexp literal out of a regular expression. See https://docs.influxdata.com/flux/latest/data-types/basic/regexp/#regular-expression-syntax for details.
fluxString(value) Creates a flux string literal.
getRetryDelay(error, retryJitter) Gets retry delay from the supplied error, possibly using random number up to retryJitter.
isStatusCodeRetriable(statusCode) isStatusCodeRetriable checks whether the supplied HTTP status code is retriable.
linesToRowsIterable(source) LinesToRowsIterable is a transformation that accepts an iterable of flux annotated CSV lines and returns an iterable of rows (row values and table metadata).
linesToTables(consumer) LinesToTables creates a transformation that accepts (flux) annotated CSV lines and emits rows together with table metadata.
newFluxTableColumn() Creates a new flux table column.
sanitizeFloat(value) Sanitizes float value to avoid injections.
sanitizeInteger(value) Sanitizes integer value to avoid injections.
serializeDateTimeAsDate() serializeDateTimeAsDate changes type serializers to return JavaScript Date instances for ‘dateTime:RFC3339’ query result data type. Empty value is converted to null.
serializeDateTimeAsNumber() serializeDateTimeAsNumber changes type serializers to return milliseconds since epoch for ‘dateTime:RFC3339’ query result data type. Empty value is converted to null.
serializeDateTimeAsString() serializeDateTimeAsString changes type serializers to return string values for dateTime:RFC3339 query result data type. Empty value is converted to null.
setLogger(logger) Sets custom logger.
stringToLines(source, target) StringToLines is a transformation that emmits strings for each CSV line in the supplied source string.
toFluxValue(value) Escapes content of the supplied parameter so that it can be safely embedded into flux query.
useProcessHrtime(use)  

Interfaces

Interface Description
AnnotatedCSVResponse AnnotatedCSVResponse provides various ways of how to process data from an annotated CSV response stream, which is returned as a result of a flux script execution.
Cancellable Allows to cancel a running execution.
ChunkCombiner ChunkCombiner is a simplified platform-neutral manipulation of Uint8arrays that allows to process text data on the fly. The implementation can be optimized for the target platform (node vs browser).
ClientOptions Options used by InfluxDB .
CommunicationObserver Observes communication with the server.
ConnectionOptions Option for the communication with InfluxDB server.
FluxParameterLike A flux parameter can print its (sanitized) flux value.
FluxResultObserver Observes results of a flux query.
FluxTableColumn FluxTableColumn describes flux table column.
FluxTableMetaData Represents metadata of a flux table.
Logger Logging interface.
Observable An observable that aligns with the TC39 observable proposal and can be consumed by other observable libraries like rx js or zen-observable.
Observer Observer mimics Observer from ECMAScript TC39 Observable proposal
ParameterizedQuery Represents a parameterized query.
PointSettings Settings that control the way of how a Point is serialized to a protocol line.
QueryApi Query InfluxDB. Provides methods that notify about result lines of the executed query. See https://docs.influxdata.com/influxdb/latest/api/#operation/PostQuery
QueryOptions QueryOptions contains QueryApi configuration options.
RetriableDecision Interface for errors to inform that an associated operation can be retried.
RetryDelayStrategy Strategy for calculating retry delays.
RetryDelayStrategyOptions Options that configure strategy for retrying failed requests.
Row Wraps values and associated metadata of a query result row
SendOptions Options for sending a request message.
Subscribable  
Subscription Subscription mimics Subscription from ECMAScript TC39 Observable proposal
Transport Simpified platform-neutral transport layer for communication with InfluxDB.
WriteApi Asynchronous API that writes time-series data into InfluxDB. This API always buffers points/lines to create batches under the hood to optimize data transfer to InfluxDB server, use flush to send the buffered data to InfluxDB immediately.
WriteOptions Options used by WriteApi .
WriteRetryOptions Options that configure strategy for retrying failed InfluxDB write operations.

Variables

Variable Description
consoleLogger Logger that logs to console.out
currentTime Exposes functions that creates strings that represent a timestamp that can be used in the line protocol. Micro and nano timestamps are emulated depending on the js platform in use.
dateToProtocolTimestamp dateToProtocolTimestamp provides converters for JavaScript Date to InfluxDB Write Protocol Timestamp. Keys are supported precisions.
DEFAULT_ConnectionOptions default connection options
DEFAULT_RetryDelayStrategyOptions default RetryDelayStrategyOptions
DEFAULT_WriteOptions default writeOptions
escape_2 Provides functions escape specific parts in InfluxDB line protocol.
FLUX_VALUE Property that offers a function that returns flux-sanitized value of an object.
Log  
symbolObservable Symbol.observable or a string “@@observable”. Used for interop
typeSerializers A dictionary of serializers of particular types returned by a flux query. See https://docs.influxdata.com/influxdb/latest/reference/syntax/annotated-csv/#data-types
UNKNOWN_COLUMN  

Type Aliases

Type Alias Description
APIExecutor APIExecutor executes the API and passes its response to the supplied consumer
ColumnType Type of query result column, see https://docs.influxdata.com/influxdb/latest/reference/syntax/annotated-csv/#data-types
HttpHeaders Type of HTTP headers.
IterableResultExecutor A factory that returns async iterables.
ObserverComplete Type of Observer.complete
ObserverError Type of Observer.error
ObserverNext Type of Observer.next
ResponseStartedFn Informs about a start of response processing.
WritePrecisionType Timestamp precision used in write operations. See https://docs.influxdata.com/influxdb/latest/api/#operation/PostWrite