- AvroValidationError()
A AvroValidationError is thrown when avsc fails to encode/decode data.
- ClientConstructorOptions :
Object
- AwsClientOptions :
Object
- WriteOptions :
Object
- WriteResponse :
Object
Kind: global class
- Client
- new Client(options)
- .write(streamName, data, options) ⇒
Promise.<WriteReponse>
- .kinesisClient() ⇒
Promise.<AWS.Kinesis>
- .dataApiClient() ⇒
Promise.<NyplClient>
- .encodeData(schemaName, data) ⇒
Promise
- .decodeData(schemaName, data) ⇒
Promise
- .decodeAvroBufferString(bufferString, avroObject, encodeType) ⇒
- .getAvroType() ⇒
Promise.<avsc.Type>
- ._defaultSchema()
Param | Type | Description |
---|---|---|
options | ClientConstructorOptions |
A hash of options |
Write data to named stream.
Kind: instance method of Client
Returns: Promise.<WriteReponse>
- A promise that resolves a WriteReponse obj
Note, the data
arg can be an object or array of objects.
Param | Type | Description |
---|---|---|
streamName | string |
Name of stream to write to. |
data | Object | Array |
Object (or array of objects) to write. |
options | WriteOptions |
Kind: instance method of Client
Returns: Promise.<AWS.Kinesis>
- A Promise that resolves an instance of
AWS.Kinesis
Kind: instance method of Client
Returns: Promise.<NyplClient>
- A Promise that resolves an instance of
the NYPL Data API Client
( https://www.npmjs.com/package/@nypl/nypl-data-api-client )
Returns Promise that resolves the given data encoded against the named schema
Kind: instance method of Client
Param | Type |
---|---|
schemaName | String |
data | Object | String |
Returns a Promise that resolves the given data decoded against the given schema.
Kind: instance method of Client
Param | Type |
---|---|
schemaName | String |
data | Object | String |
Returns a decoded Avro Object from a given encoded Buffer
Kind: instance method of Client
Returns: Returns a deserialized buffer
Param | Type | Default | Description |
---|---|---|---|
bufferString | String |
||
avroObject | Object |
||
encodeType | String |
base64 |
default encode type base64. |
Returns an avro type instance by schema name
Kind: instance method of Client
Returns: Promise.<avsc.Type>
- A Promise that resolves an avsc.Type instance
Given a stream name (e.g. MyEventStream-qa) returns the conventional schema name (MyEventStream)
Kind: instance method of Client
A AvroValidationError is thrown when avsc fails to encode/decode data.
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
nyplDataApiClientBase | string |
Base URL for API (e.g. 'https://[FQDN]/api/v0.1/'). If missing, client will check process.env.NYPL_API_BASE_URL |
writeBatchSize | number |
How many records to write to a stream at once. Default 500. http://docs.aws.amazon.com/streams/latest/dev/service-sizes-and-limits.html |
recordsPerSecond | number |
How many records to write to a stream in a single 1s period. Default 500. AWS max is 1000/s. See: http://docs.aws.amazon.com/streams/latest/dev/service-sizes-and-limits.html |
waitBetweenDescribeCallsInSeconds | number |
How many seconds to pause between describe calls (i.e. when waiting for active stream). Default 4 |
maxDescribeCallRetries | number |
Maximum describe calls to make before giving up (i.e. when waiting for active stream). Default 10. |
logLevel | string |
Set log level (i.e. info, error, warn, debug). Default env.LOG_LEVEL or 'error' |
awsClientOptions | AwsClientOptions |
AWS client options |
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
region | string |
AWS region to use. Default us-east-1 |
profile | string |
Named profile to use for from local credentials file. |
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
avroEncode | boolean |
Whether or not to Name of avro schema to use to encode. |
avroSchemaName | string |
Name of avro schema to use to encode. Defaults to streamName (with -qa/-production suffix removed). |
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
Records | Array |
Array of records written |
FailedRecordCount | number |
Number of records that failed |
unmergedResponses | Array |
Raw AWS responses (for debugging mult. batch jobs) |