Node SDK

Module lib/types

Legend

  • Namespace
  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Type alias with type parameter
  • Interface
  • Interface with type parameter
  • Enumeration
  • Class

Index

References

Re-exports BaseWriteOptions
Re-exports BatchOptions
Re-exports BufferOptions
Re-exports Callback
Re-exports CheckpointData
Re-exports CommandWrapFunction
Re-exports CommandWrapOptions
Re-exports CreateCorrelationOptions
Re-exports EnrichBatchOptions
Re-exports EnrichOptions
Re-exports FromCsvOptions
Re-exports JoinExternalFetcher
Re-exports OffloadBatchOptions
Re-exports OffloadOptions
Re-exports ProcessCallback
Re-exports ProcessCallbackOptions
Re-exports ProcessFunction
Re-exports ProcessFunctionAsync
Re-exports ProcessFunctionAsyncReturn
Re-exports ProcessFunctionAsyncReturnOptions
Re-exports ProcessFunctionContext
Re-exports ProcessFunctionOptions
Re-exports ReadOptions
Re-exports StatsStream
Re-exports StreamUtil
Re-exports ThroughEvent
Re-exports ToCheckpointOptions
Re-exports ToCsvOptions
Re-exports WriteOptions
Re-exports batch
Re-exports buffer
Re-exports bufferBackoff
Re-exports commandWrap
Re-exports counter
Re-exports devnull
Re-exports eventIdFromTimestamp
Re-exports eventIdToTimestamp
Re-exports eventstream
Re-exports fromCSV
Re-exports fromS3
Re-exports joinExternal
Re-exports log
Re-exports parse
Re-exports passthrough
Re-exports pipe
Re-exports pipeAsync
Re-exports pipeline
Re-exports process
Re-exports stringify
Re-exports through
Re-exports toCSV
Re-exports toS3
Re-exports writeWrapped

Type aliases

BotInvocationEventTyped<T>: T & BotInvocationEvent

The RStreams bus will create this event and pass it to your bot when it is invoked. It tells you the ID of the bot your code is running as, so you don't have to hard-code it or so you can do complex things with fanout. It also sends you detail on the bot itself, including checkpoints and so on. Finally, the event will include your own custom-defined config you registered that you wanted passed into your bot when invoked.

Type parameters

  • T: any = {}

    Your registered config data that will be mixed in with the event when sent to you

DataCallback<T, E>: (err?: E | null, data?: T) => void

Type parameters

  • T = any

    The type of the data to be returned from the operation, if any

  • E = Error

    The type of the Error object if the operation fails

Type declaration

    • (err?: E | null, data?: T): void
    • A standard callback function supporting operation success with optional data returned and fail with Error.

      // Operation failed, returns an error from the callback
      callback(new Error())

      // Operation succeeded, return data from this operation
      callback(null, data)

      // Operation succeeded but don't want to forward any data from this operation
      callback()

      Parameters

      • Optional err: E | null

        If present, the operation failed and this is the error

      • Optional data: T

        If present, this is the data to return from the operation

      Returns void

DuplexStream<T, U>: TransformStream<T, U>
deprecated

Don't use. Will be removed.

Type parameters

  • T

  • U

ErrorCallback: (error: Error | null | undefined) => void

Type declaration

    • (error: Error | null | undefined): void
    • A standard callback indicating the operation failed if error is present

      Parameters

      • error: Error | null | undefined

        If present, an error occurred and this is it

      Returns void

FlushCallback<T, E>: (this: stream.Transform, flushCallback: DataCallback<T, E>) => any

Type parameters

  • T = any

  • E = Error

    The type of an error, if there is one

Type declaration

    • (this: stream.Transform, flushCallback: DataCallback<T, E>): any
    • This is a flush event callback function. When a stream is closed, the pipe is flushed meaning all events flow out of the pipe until it's empty. Once it's empty, the FlushCallabck will be called, allowing the developer to do cleanup like close open database connections or whatever.

      Parameters

      • this: stream.Transform

        Node will consume this argument and use it to set the context of the function to be the TransformStream itself so you can call methods on this in the function which will be the TransformStream instance

      • flushCallback: DataCallback<T, E>

        The function to call when the flush is complete

      Returns any

RStreamsTransformFunction<T, U, E>: (this: TransformStream<T, U>, obj: T, callback: DataCallback<U, E>) => void

Type parameters

  • T

    The type of data to be sent into the pipe step

  • U

    The type of data that will be produced by this pipe step and sent to the next pipe step

  • E = Error

    The type of error produced if something goes wrong

Type declaration

    • Creates a TransformStream pipe step. The doc on TransformStream is very helpful.

      Parameters

      • this: TransformStream<T, U>

        Node will consume this argument and use it to set the context of the function to be the TransformStream itself so you can call methods on this in the function which will be the TransformStream instance

      • obj: T
      • callback: DataCallback<U, E>

        A standard callback to return an error or data to send to the next pipe step

      Returns void

TransformFunction<T, E>: (this: stream.Transform, chunk: T, encoding: BufferEncoding, callback: DataCallback<T, E>) => void

Type parameters

  • T = any

  • E = Error

Type declaration

    • (this: stream.Transform, chunk: T, encoding: BufferEncoding, callback: DataCallback<T, E>): void
    • internal

      Don't use.

      Parameters

      • this: stream.Transform
      • chunk: T
      • encoding: BufferEncoding
      • callback: DataCallback<T, E>

      Returns void

Functions

  • This creates an async/await-friendly pipeline step that will take data in, possibly transform the data or do computation, and then sends the result on to the next step in the pipeline.

    see

    through

    Type parameters

    • T

      The type of the data sent in to be passed through this step.

    • U

      The type of data to be sent on to the next step in the pipeline.

    Parameters

    • Optional transform: (this: TransformStream<T, U>, obj: T) => U | Promise<U>

      A function that does the work of taking the data in, doing something with it and then rejecting or resolving the promise with the result object type U. If you resolve with no result data, the event is skipped and not sent to the next pipeline step. The first arg is stripped off by Javascript since it recognizes that the this arg is just to set the this context so that the this keyword will work inside the function and itself be the instance of the transform stream which can be useful. For example, say you want to push to an event in here to a queue. You could do that by calling this.push to push the event to a queue while still sending the queue on the next step in the pipeline afterwards.

      So, the first real argument your function will receive is obj which is the data event being sent in to be processed/transformed and sent on to the next pipeline step.

    • Optional flush: (this: TransformStream<T, U>) => U | Promise<U>

      A function to be called when the entire pipeline has been flushed to allow for cleanup, perhaps closing a DB connection.

    Returns TransformStream<T, U>

    The pipeline step that is ready to be used in a pipeline

Generated using TypeDoc