Socket
Socket
Sign inDemoInstall

aws-crt

Package Overview
Dependencies
Maintainers
4
Versions
123
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-crt - npm Package Compare versions

Comparing version 1.10.1 to 1.10.2

dist.browser/browser/auth.d.ts

4

dist.browser/browser.d.ts
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
* @packageDocumentation
* @module crt
*/

@@ -5,0 +5,0 @@ import * as platform from './common/platform';

"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -27,2 +27,6 @@ * SPDX-License-Identifier: Apache-2.0.

exports.CrtError = exports.resource_safety = exports.platform = exports.iot = exports.crypto = exports.http = exports.mqtt = exports.io = void 0;
/**
* @packageDocumentation
* @module crt
*/
// This is the entry point for the browser AWS CRT shim library

@@ -29,0 +33,0 @@ /* common libs */

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
* Module for AWS IoT configuration and connection establishment
*
* @packageDocumentation
* @module aws-iot
* @preferred
*/

@@ -11,3 +14,2 @@ import { SocketOptions } from "./io";

*
* @module aws-crt
* @category IoT

@@ -20,2 +22,4 @@ */

* For API compatibility with the native version. Does not set up mTLS.
*
* @returns a new websocket connection builder object with default TLS configuration
*/

@@ -25,2 +29,4 @@ static new_mtls_builder(...args: any[]): AwsIotMqttConnectionConfigBuilder;

* For API compatibility with the native version. Alias for {@link new_builder_for_websocket}.
*
* @returns a new websocket connection builder object with default TLS configuration
*/

@@ -30,2 +36,4 @@ static new_with_websockets(...args: any[]): AwsIotMqttConnectionConfigBuilder;

* Creates a new builder using MQTT over websockets (the only option in browser)
*
* @returns a new websocket connection builder object with default TLS configuration
*/

@@ -36,12 +44,25 @@ static new_builder_for_websocket(): AwsIotMqttConnectionConfigBuilder;

* @param endpoint The IoT endpoint to connect to
*
* @returns this builder object
*/
with_endpoint(endpoint: string): this;
/**
* The client id to use for this connection
* @param client_id The client id to use for this connection
*
* @returns this builder object
*/
with_client_id(client_id: string): this;
/**
* The port to connect to on the IoT endpoint
* @param port The port to connect to on the IoT endpoint. Usually 8883 for MQTT, or 443 for websockets
*
* @returns this builder object
*/
with_client_id(client_id: string): this;
with_port(port: number): this;
/**
* Determines whether or not the service should try to resume prior subscriptions, if it has any
* @param clean_session true if the session should drop prior subscriptions when this client connects, false to resume the session
*
* @returns this builder object
*/

@@ -51,2 +72,4 @@ with_clean_session(clean_session: boolean): this;

* Configures the connection to use MQTT over websockets. No-op in the browser.
*
* @returns this builder object
*/

@@ -57,2 +80,4 @@ with_use_websockets(): this;

* @param keep_alive How often in seconds to send an MQTT PING message to the service to keep the connection alive
*
* @returns this builder object
*/

@@ -63,3 +88,5 @@ with_keep_alive_seconds(keep_alive: number): this;

* @param timeout_ms TCP socket timeout
* @deprecated
* @deprecated in favor of socket options
*
* @returns this builder object
*/

@@ -70,2 +97,4 @@ with_timeout_ms(timeout_ms: number): this;

* @param ping_timeout PINGREQ response timeout
*
* @returns this builder object
*/

@@ -76,2 +105,4 @@ with_ping_timeout_ms(ping_timeout: number): this;

* @param will The will topic, qos, and message
*
* @returns this builder object
*/

@@ -82,2 +113,4 @@ with_will(will: MqttWill): this;

* @param socket_options The socket settings
*
* @returns this builder object
*/

@@ -88,2 +121,4 @@ with_socket_options(socket_options: SocketOptions): this;

* @param headers Additional headers to send during websocket connect
*
* @returns this builder object
*/

@@ -98,3 +133,5 @@ with_websocket_headers(headers: {

* @param aws_secret_key IAM Secret Key
* @param aws_sts_token STS token from Cognito (optional)
* @param aws_sts_token session credentials token (optional)
*
* @returns this builder object
*/

@@ -101,0 +138,0 @@ with_credentials(aws_region: string, aws_access_id: string, aws_secret_key: string, aws_sts_token?: string): this;

"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -27,2 +27,9 @@ * SPDX-License-Identifier: Apache-2.0.

exports.AwsIotMqttConnectionConfigBuilder = void 0;
/**
* Module for AWS IoT configuration and connection establishment
*
* @packageDocumentation
* @module aws-iot
* @preferred
*/
var io_1 = require("./io");

@@ -34,3 +41,2 @@ var platform = __importStar(require("../common/platform"));

*
* @module aws-crt
* @category IoT

@@ -55,2 +61,4 @@ */

* For API compatibility with the native version. Does not set up mTLS.
*
* @returns a new websocket connection builder object with default TLS configuration
*/

@@ -66,2 +74,4 @@ AwsIotMqttConnectionConfigBuilder.new_mtls_builder = function () {

* For API compatibility with the native version. Alias for {@link new_builder_for_websocket}.
*
* @returns a new websocket connection builder object with default TLS configuration
*/

@@ -77,2 +87,4 @@ AwsIotMqttConnectionConfigBuilder.new_with_websockets = function () {

* Creates a new builder using MQTT over websockets (the only option in browser)
*
* @returns a new websocket connection builder object with default TLS configuration
*/

@@ -86,2 +98,4 @@ AwsIotMqttConnectionConfigBuilder.new_builder_for_websocket = function () {

* @param endpoint The IoT endpoint to connect to
*
* @returns this builder object
*/

@@ -93,4 +107,6 @@ AwsIotMqttConnectionConfigBuilder.prototype.with_endpoint = function (endpoint) {

/**
* The port to connect to on the IoT endpoint
* @param port The port to connect to on the IoT endpoint. Usually 8883 for MQTT, or 443 for websockets
* The client id to use for this connection
* @param client_id The client id to use for this connection
*
* @returns this builder object
*/

@@ -102,4 +118,16 @@ AwsIotMqttConnectionConfigBuilder.prototype.with_client_id = function (client_id) {

/**
* The port to connect to on the IoT endpoint
* @param port The port to connect to on the IoT endpoint. Usually 8883 for MQTT, or 443 for websockets
*
* @returns this builder object
*/
AwsIotMqttConnectionConfigBuilder.prototype.with_port = function (port) {
this.params.port = port;
return this;
};
/**
* Determines whether or not the service should try to resume prior subscriptions, if it has any
* @param clean_session true if the session should drop prior subscriptions when this client connects, false to resume the session
*
* @returns this builder object
*/

@@ -112,2 +140,4 @@ AwsIotMqttConnectionConfigBuilder.prototype.with_clean_session = function (clean_session) {

* Configures the connection to use MQTT over websockets. No-op in the browser.
*
* @returns this builder object
*/

@@ -121,2 +151,4 @@ AwsIotMqttConnectionConfigBuilder.prototype.with_use_websockets = function () {

* @param keep_alive How often in seconds to send an MQTT PING message to the service to keep the connection alive
*
* @returns this builder object
*/

@@ -130,3 +162,5 @@ AwsIotMqttConnectionConfigBuilder.prototype.with_keep_alive_seconds = function (keep_alive) {

* @param timeout_ms TCP socket timeout
* @deprecated
* @deprecated in favor of socket options
*
* @returns this builder object
*/

@@ -140,2 +174,4 @@ AwsIotMqttConnectionConfigBuilder.prototype.with_timeout_ms = function (timeout_ms) {

* @param ping_timeout PINGREQ response timeout
*
* @returns this builder object
*/

@@ -149,2 +185,4 @@ AwsIotMqttConnectionConfigBuilder.prototype.with_ping_timeout_ms = function (ping_timeout) {

* @param will The will topic, qos, and message
*
* @returns this builder object
*/

@@ -158,2 +196,4 @@ AwsIotMqttConnectionConfigBuilder.prototype.with_will = function (will) {

* @param socket_options The socket settings
*
* @returns this builder object
*/

@@ -167,2 +207,4 @@ AwsIotMqttConnectionConfigBuilder.prototype.with_socket_options = function (socket_options) {

* @param headers Additional headers to send during websocket connect
*
* @returns this builder object
*/

@@ -180,3 +222,5 @@ AwsIotMqttConnectionConfigBuilder.prototype.with_websocket_headers = function (headers) {

* @param aws_secret_key IAM Secret Key
* @param aws_sts_token STS token from Cognito (optional)
* @param aws_sts_token session credentials token (optional)
*
* @returns this builder object
*/

@@ -183,0 +227,0 @@ AwsIotMqttConnectionConfigBuilder.prototype.with_credentials = function (aws_region, aws_access_id, aws_secret_key, aws_sts_token) {

@@ -1,5 +0,1 @@

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
import { Hashable } from "../common/crypto";

@@ -9,3 +5,2 @@ /**

*
* @module aws-crt
* @category Crypto

@@ -16,10 +11,12 @@ */

/**
* Digests additional data
* @param data Additional data to digest
* Hashes additional data
* @param data Additional data to hash
*/
update(data: Hashable): void;
/**
* Completes the hash computation and returns the final digest.
* Completes the hash computation and returns the final hash digest.
*
* @param truncate_to The maximum number of bytes to receive. Leave as undefined or 0 to receive the entire digest.
*
* @returns the final hash digest
*/

@@ -35,3 +32,4 @@ finalize(truncate_to?: number): DataView;

*
* @module aws-crt
* @returns the data's hash digest
*
* @category Crypto

@@ -43,3 +41,2 @@ */

*
* @module aws-crt
* @category Crypto

@@ -50,11 +47,13 @@ */

/**
* Digests additional data
* @param data Additional data to digest
* Hashes additional data
* @param data Additional data to hash
*/
update(data: Hashable): void;
/**
* Completes the hash computation and returns the final digest.
*
* @param truncate_to The maximum number of bytes to receive. Leave as undefined or 0 to receive the entire digest.
*/
* Completes the hash computation and returns the final hash digest.
*
* @param truncate_to The maximum number of bytes to receive. Leave as undefined or 0 to receive the entire digest.
*
* @returns the final hash digest
*/
finalize(truncate_to?: number): DataView;

@@ -69,3 +68,4 @@ }

*
* @module aws-crt
* @returns the data's hash digest
*
* @category Crypto

@@ -77,3 +77,2 @@ */

*
* @module aws-crt
* @category Crypto

@@ -84,11 +83,13 @@ */

/**
* Digests additional data
* @param data Additional data to digest
* Hashes additional data
* @param data Additional data to hash
*/
update(data: Hashable): void;
/**
* Completes the hash computation and returns the final digest.
*
* @param truncate_to The maximum number of bytes to receive. Leave as undefined or 0 to receive the entire digest.
*/
* Completes the hash computation and returns the final hash digest.
*
* @param truncate_to The maximum number of bytes to receive. Leave as undefined or 0 to receive the entire digest.
*
* @returns the final hash digest
*/
finalize(truncate_to?: number): DataView;

@@ -103,3 +104,4 @@ }

*
* @module aws-crt
* @returns the data's hash digest
*
* @category Crypto

@@ -111,3 +113,2 @@ */

*
* @module aws-crt
* @category Crypto

@@ -117,13 +118,19 @@ */

private hmac;
/**
* Constructor for the Sha256Hmac class type
* @param secret secret key to seed the hmac process with
*/
constructor(secret: Hashable);
/**
* Digests additional data
* @param data Additional data to digest
* Hashes additional data
* @param data Additional data to hash
*/
update(data: Hashable): void;
/**
* Completes the hash computation and returns the final digest.
*
* @param truncate_to The maximum number of bytes to receive. Leave as undefined or 0 to receive the entire digest.
*/
* Completes the hash computation and returns the final hmac digest.
*
* @param truncate_to The maximum number of bytes to receive. Leave as undefined or 0 to receive the entire digest.
*
* @returns the final hmac digest
*/
finalize(truncate_to?: number): DataView;

@@ -139,5 +146,6 @@ }

*
* @module aws-crt
* @returns the data's hmac digest
*
* @category Crypto
*/
export declare function hmac_sha256(secret: Hashable, data: Hashable, truncate_to?: number): DataView;
"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -27,2 +27,7 @@ * SPDX-License-Identifier: Apache-2.0.

exports.hmac_sha256 = exports.Sha256Hmac = exports.hash_sha1 = exports.Sha1Hash = exports.hash_sha256 = exports.Sha256Hash = exports.hash_md5 = exports.Md5Hash = void 0;
/**
*
* @packageDocumentation
* @module crypto
*/
var Crypto = __importStar(require("crypto-js"));

@@ -33,3 +38,2 @@ var polyfills_1 = require("./polyfills");

*
* @module aws-crt
* @category Crypto

@@ -41,4 +45,4 @@ */

/**
* Digests additional data
* @param data Additional data to digest
* Hashes additional data
* @param data Additional data to hash
*/

@@ -49,5 +53,7 @@ Md5Hash.prototype.update = function (data) {

/**
* Completes the hash computation and returns the final digest.
* Completes the hash computation and returns the final hash digest.
*
* @param truncate_to The maximum number of bytes to receive. Leave as undefined or 0 to receive the entire digest.
*
* @returns the final hash digest
*/

@@ -71,3 +77,4 @@ Md5Hash.prototype.finalize = function (truncate_to) {

*
* @module aws-crt
* @returns the data's hash digest
*
* @category Crypto

@@ -84,3 +91,2 @@ */

*
* @module aws-crt
* @category Crypto

@@ -92,4 +98,4 @@ */

/**
* Digests additional data
* @param data Additional data to digest
* Hashes additional data
* @param data Additional data to hash
*/

@@ -100,6 +106,8 @@ Sha256Hash.prototype.update = function (data) {

/**
* Completes the hash computation and returns the final digest.
*
* @param truncate_to The maximum number of bytes to receive. Leave as undefined or 0 to receive the entire digest.
*/
* Completes the hash computation and returns the final hash digest.
*
* @param truncate_to The maximum number of bytes to receive. Leave as undefined or 0 to receive the entire digest.
*
* @returns the final hash digest
*/
Sha256Hash.prototype.finalize = function (truncate_to) {

@@ -122,3 +130,4 @@ var digest = this.hash ? this.hash.toString() : '';

*
* @module aws-crt
* @returns the data's hash digest
*
* @category Crypto

@@ -137,3 +146,2 @@ */

*
* @module aws-crt
* @category Crypto

@@ -145,4 +153,4 @@ */

/**
* Digests additional data
* @param data Additional data to digest
* Hashes additional data
* @param data Additional data to hash
*/

@@ -153,6 +161,8 @@ Sha1Hash.prototype.update = function (data) {

/**
* Completes the hash computation and returns the final digest.
*
* @param truncate_to The maximum number of bytes to receive. Leave as undefined or 0 to receive the entire digest.
*/
* Completes the hash computation and returns the final hash digest.
*
* @param truncate_to The maximum number of bytes to receive. Leave as undefined or 0 to receive the entire digest.
*
* @returns the final hash digest
*/
Sha1Hash.prototype.finalize = function (truncate_to) {

@@ -175,3 +185,4 @@ var digest = this.hash ? this.hash.toString() : '';

*
* @module aws-crt
* @returns the data's hash digest
*
* @category Crypto

@@ -190,6 +201,9 @@ */

*
* @module aws-crt
* @category Crypto
*/
var Sha256Hmac = /** @class */ (function () {
/**
* Constructor for the Sha256Hmac class type
* @param secret secret key to seed the hmac process with
*/
function Sha256Hmac(secret) {

@@ -200,4 +214,4 @@ // @ts-ignore types file doesn't have this signature of create()

/**
* Digests additional data
* @param data Additional data to digest
* Hashes additional data
* @param data Additional data to hash
*/

@@ -208,6 +222,8 @@ Sha256Hmac.prototype.update = function (data) {

/**
* Completes the hash computation and returns the final digest.
*
* @param truncate_to The maximum number of bytes to receive. Leave as undefined or 0 to receive the entire digest.
*/
* Completes the hash computation and returns the final hmac digest.
*
* @param truncate_to The maximum number of bytes to receive. Leave as undefined or 0 to receive the entire digest.
*
* @returns the final hmac digest
*/
Sha256Hmac.prototype.finalize = function (truncate_to) {

@@ -231,3 +247,4 @@ var digest = this.hmac.finalize();

*
* @module aws-crt
* @returns the data's hmac digest
*
* @category Crypto

@@ -234,0 +251,0 @@ */

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
* @packageDocumentation
* @module crt
*/

@@ -8,9 +8,10 @@ /**

*
* @module aws-crt
* @category System
* @category System
*/
export declare class CrtError extends Error {
readonly error: any;
/** @var error - The original error, provided for context. Could be any type, often from underlying libraries */
/**
* @param error - The original error, provided for context. Could be any type, often from underlying libraries
*/
constructor(error: any);
}
"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -22,10 +22,15 @@ * SPDX-License-Identifier: Apache-2.0.

/**
* @packageDocumentation
* @module crt
*/
/**
* Represents an error thrown by the CRT browser shim
*
* @module aws-crt
* @category System
* @category System
*/
var CrtError = /** @class */ (function (_super) {
__extends(CrtError, _super);
/** @var error - The original error, provided for context. Could be any type, often from underlying libraries */
/**
* @param error - The original error, provided for context. Could be any type, often from underlying libraries
*/
function CrtError(error) {

@@ -32,0 +37,0 @@ var _this = _super.call(this, error.toString()) || this;

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
* @packageDocumentation
* @module http
*/
import { HttpHeader, HttpHeaders as CommonHttpHeaders, HttpProxyOptions } from '../common/http';
export { HttpHeader, HttpProxyOptions, HttpProxyAuthenticationType } from '../common/http';
import { CommonHttpProxyOptions, HttpHeader, HttpHeaders as CommonHttpHeaders, HttpClientConnectionConnected, HttpClientConnectionError, HttpClientConnectionClosed, HttpStreamComplete, HttpStreamData, HttpStreamError } from '../common/http';
export { HttpHeader, HttpProxyAuthenticationType } from '../common/http';
import { BufferedEventEmitter } from '../common/event';

@@ -12,3 +12,2 @@ import { ClientBootstrap, InputStream, SocketOptions, TlsConnectionOptions } from './io';

*
* @module aws-crt
* @category HTTP

@@ -18,9 +17,17 @@ */

private headers;
/** Construct from a collection of [name, value] pairs */
/** Construct from a collection of [name, value] pairs
*
* @param headers list of HttpHeader values to seat in this object
*/
constructor(headers?: HttpHeader[]);
/**
* Fetches the total length of all headers
*
* @returns the total length of all headers
*/
get length(): number;
/**
* Add a name/value pair
* @param name - The header name
* @param value - The header value
* @param name The header name
* @param value The header value
*/

@@ -70,22 +77,34 @@ add(name: string, value: string): void;

}
/** Represents a request to a web server from a client */
/**
* Options used when connecting to an HTTP endpoint via a proxy
*
* @category HTTP
*/
export declare class HttpProxyOptions extends CommonHttpProxyOptions {
}
/**
* Represents a request to a web server from a client
*
* @category HTTP
*/
export declare class HttpRequest {
/** The verb to use for the request (i.e. GET, POST, PUT, DELETE, HEAD) */
method: string;
/** The URI of the request */
path: string;
/** Additional custom headers to send to the server */
headers: HttpHeaders;
/** The request body, in the case of a POST or PUT request */
body?: InputStream | undefined;
constructor(
/** The verb to use for the request (i.e. GET, POST, PUT, DELETE, HEAD) */
method: string,
/** The URI of the request */
path: string,
/** Additional custom headers to send to the server */
headers?: HttpHeaders,
/** The request body, in the case of a POST or PUT request */
body?: InputStream | undefined);
/**
* Constructor for the HttpRequest class
*
* @param method The verb to use for the request (i.e. GET, POST, PUT, DELETE, HEAD)
* @param path The URI of the request
* @param headers Additional custom headers to send to the server
* @param body The request body, in the case of a POST or PUT request
*/
constructor(method: string, path: string, headers?: HttpHeaders, body?: InputStream | undefined);
}
/**
* Represents an HTTP connection from a client to a server
*
* @category HTTP
*/
export declare class HttpClientConnection extends BufferedEventEmitter {

@@ -98,10 +117,41 @@ _axios: any;

protected proxy_options?: HttpProxyOptions;
/**
* Http connection constructor, signature synced to native version for compatibility
*
* @param bootstrap - (native only) leave undefined
* @param host_name - endpoint to connection with
* @param port - port to connect to
* @param socketOptions - (native only) leave undefined
* @param tlsOptions - instantiate for TLS, but actual value is unused in browse implementation
* @param proxyOptions - options to control proxy usage when establishing the connection
*/
constructor(bootstrap: ClientBootstrap | undefined, host_name: string, port: number, socketOptions?: SocketOptions, tlsOptions?: TlsConnectionOptions, proxyOptions?: HttpProxyOptions);
/** Emitted when the connection is connected and ready to start streams */
on(event: 'connect', listener: () => void): this;
/** Emitted when an error occurs on the connection */
on(event: 'error', listener: (error: Error) => void): this;
/** Emitted when the connection has completed */
on(event: 'close', listener: () => void): this;
/**
* Emitted when the connection is connected and ready to start streams
*
* @param event type of event (connect)
* @param listener event listener to use
*
* @event
*/
on(event: 'connect', listener: HttpClientConnectionConnected): this;
/**
* Emitted when an error occurs on the connection
*
* @param event type of event (error)
* @param listener event listener to use
*
* @event
*/
on(event: 'error', listener: HttpClientConnectionError): this;
/**
* Emitted when the connection has completed
*
* @param event type of event (close)
* @param listener event listener to use
*
* @event
*/
on(event: 'close', listener: HttpClientConnectionClosed): this;
/**
* Make a client initiated request to this connection.

@@ -112,5 +162,18 @@ * @param request - The HttpRequest to attempt on this connection

request(request: HttpRequest): HttpClientStream;
/**
* Ends the connection
*/
close(): void;
}
/**
* Listener signature for event emitted from an {@link HttpClientStream} when the http response headers have arrived.
*
* @param status_code http response status code
* @param headers the response's set of headers
*
* @asMemberOf HttpClientStream
* @category HTTP
*/
export declare type HttpStreamResponse = (status_code: number, headers: HttpHeaders) => void;
/**
* Represents a single http message exchange (request/response) in HTTP.

@@ -120,2 +183,4 @@ *

* event delivery
*
* @category HTTP
*/

@@ -140,22 +205,49 @@ export declare class HttpClientStream extends BufferedEventEmitter {

/**
* Emitted when the header block arrives from the server.
* Emitted when the http response headers have arrived.
*
* @param event type of event (response)
* @param listener event listener to use
*
* @event
*/
on(event: 'response', listener: (status_code: number, headers: HttpHeaders) => void): this;
on(event: 'response', listener: HttpStreamResponse): this;
/**
* Emitted when a body chunk arrives from the server
* @param body_data - The chunk of body data
* Emitted when http response data is available.
*
* @param event type of event (data)
* @param listener event listener to use
*
* @event
*/
on(event: 'data', listener: (body_data: ArrayBuffer) => void): this;
on(event: 'data', listener: HttpStreamData): this;
/**
* Emitted when an error occurs
* @param error - A CrtError containing the error that occurred
* Emitted when an error occurs in stream processing
*
* @param event type of event (error)
* @param listener event listener to use
*
* @event
*/
on(event: 'error', listener: (error: Error) => void): this;
/** Emitted when stream has completed sucessfully. */
on(event: 'end', listener: () => void): this;
on(event: 'error', listener: HttpStreamError): this;
/**
* Emitted when the stream has completed
*
* @param event type of event (end)
* @param listener event listener to use
*
* @event
*/
on(event: 'end', listener: HttpStreamComplete): this;
/** @internal */
static _create(connection: HttpClientConnection): HttpClientStream;
/** @internal */
_on_response(response: any): void;
/** @internal */
_on_error(error: any): void;
}
/** Creates, manages, and vends connections to a given host/port endpoint */
/**
* Creates, manages, and vends connections to a given host/port endpoint
*
* @category HTTP
*/
export declare class HttpClientConnectionManager {

@@ -174,2 +266,15 @@ readonly bootstrap: ClientBootstrap | undefined;

private pending_requests;
/**
* Constructor for the HttpClientConnectionManager class. Signature stays in sync with native implementation
* for compatibility purposes (leads to some useless params)
*
* @param bootstrap - (native only) leave undefined
* @param host - endpoint to pool connections for
* @param port - port to connect to
* @param max_connections - maximum allowed connection count
* @param initial_window_size - (native only) leave as zero
* @param socket_options - (native only) leave null
* @param tls_opts - if not null TLS will be used, otherwise plain http will be used
* @param proxy_options - configuration for establishing connections through a proxy
*/
constructor(bootstrap: ClientBootstrap | undefined, host: string, port: number, max_connections: number, initial_window_size: number, socket_options?: SocketOptions | undefined, tls_opts?: TlsConnectionOptions | undefined, proxy_options?: HttpProxyOptions | undefined);

@@ -176,0 +281,0 @@ private remove;

"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -58,6 +58,9 @@ * SPDX-License-Identifier: Apache-2.0.

Object.defineProperty(exports, "__esModule", { value: true });
exports.HttpClientConnectionManager = exports.HttpClientStream = exports.HttpClientConnection = exports.HttpRequest = exports.HttpHeaders = void 0;
exports.HttpClientConnectionManager = exports.HttpClientStream = exports.HttpClientConnection = exports.HttpRequest = exports.HttpProxyOptions = exports.HttpHeaders = void 0;
/**
* @packageDocumentation
* @module http
*/
var http_1 = require("../common/http");
var http_2 = require("../common/http");
Object.defineProperty(exports, "HttpProxyOptions", { enumerable: true, get: function () { return http_2.HttpProxyOptions; } });
Object.defineProperty(exports, "HttpProxyAuthenticationType", { enumerable: true, get: function () { return http_2.HttpProxyAuthenticationType; } });

@@ -72,7 +75,9 @@ var event_1 = require("../common/event");

*
* @module aws-crt
* @category HTTP
*/
var HttpHeaders = /** @class */ (function () {
/** Construct from a collection of [name, value] pairs */
/** Construct from a collection of [name, value] pairs
*
* @param headers list of HttpHeader values to seat in this object
*/
function HttpHeaders(headers) {

@@ -98,2 +103,7 @@ var e_1, _a;

Object.defineProperty(HttpHeaders.prototype, "length", {
/**
* Fetches the total length of all headers
*
* @returns the total length of all headers
*/
get: function () {

@@ -111,4 +121,4 @@ var length = 0;

* Add a name/value pair
* @param name - The header name
* @param value - The header value
* @param name The header name
* @param value The header value
*/

@@ -278,13 +288,30 @@ HttpHeaders.prototype.add = function (name, value) {

exports.HttpHeaders = HttpHeaders;
/** Represents a request to a web server from a client */
/**
* Options used when connecting to an HTTP endpoint via a proxy
*
* @category HTTP
*/
var HttpProxyOptions = /** @class */ (function (_super) {
__extends(HttpProxyOptions, _super);
function HttpProxyOptions() {
return _super !== null && _super.apply(this, arguments) || this;
}
return HttpProxyOptions;
}(http_1.CommonHttpProxyOptions));
exports.HttpProxyOptions = HttpProxyOptions;
/**
* Represents a request to a web server from a client
*
* @category HTTP
*/
var HttpRequest = /** @class */ (function () {
function HttpRequest(
/** The verb to use for the request (i.e. GET, POST, PUT, DELETE, HEAD) */
method,
/** The URI of the request */
path,
/** Additional custom headers to send to the server */
headers,
/** The request body, in the case of a POST or PUT request */
body) {
/**
* Constructor for the HttpRequest class
*
* @param method The verb to use for the request (i.e. GET, POST, PUT, DELETE, HEAD)
* @param path The URI of the request
* @param headers Additional custom headers to send to the server
* @param body The request body, in the case of a POST or PUT request
*/
function HttpRequest(method, path, headers, body) {
if (headers === void 0) { headers = new HttpHeaders(); }

@@ -299,4 +326,19 @@ this.method = method;

exports.HttpRequest = HttpRequest;
/**
* Represents an HTTP connection from a client to a server
*
* @category HTTP
*/
var HttpClientConnection = /** @class */ (function (_super) {
__extends(HttpClientConnection, _super);
/**
* Http connection constructor, signature synced to native version for compatibility
*
* @param bootstrap - (native only) leave undefined
* @param host_name - endpoint to connection with
* @param port - port to connect to
* @param socketOptions - (native only) leave undefined
* @param tlsOptions - instantiate for TLS, but actual value is unused in browse implementation
* @param proxyOptions - options to control proxy usage when establishing the connection
*/
function HttpClientConnection(bootstrap, host_name, port, socketOptions, tlsOptions, proxyOptions) {

@@ -350,2 +392,5 @@ var _this = _super.call(this) || this;

};
/**
* Ends the connection
*/
HttpClientConnection.prototype.close = function () {

@@ -401,2 +446,4 @@ this.emit('close');

* event delivery
*
* @category HTTP
*/

@@ -435,2 +482,3 @@ var HttpClientStream = /** @class */ (function (_super) {

// Private helpers for stream_request()
/** @internal */
HttpClientStream._create = function (connection) {

@@ -440,2 +488,3 @@ return new HttpClientStream(connection);

// Convert axios' single response into a series of events
/** @internal */
HttpClientStream.prototype._on_response = function (response) {

@@ -457,2 +506,3 @@ this.response_status_code = response.status;

// and pass it on to the user
/** @internal */
HttpClientStream.prototype._on_error = function (error) {

@@ -479,4 +529,21 @@ var info = "";

exports.HttpClientStream = HttpClientStream;
/** Creates, manages, and vends connections to a given host/port endpoint */
/**
* Creates, manages, and vends connections to a given host/port endpoint
*
* @category HTTP
*/
var HttpClientConnectionManager = /** @class */ (function () {
/**
* Constructor for the HttpClientConnectionManager class. Signature stays in sync with native implementation
* for compatibility purposes (leads to some useless params)
*
* @param bootstrap - (native only) leave undefined
* @param host - endpoint to pool connections for
* @param port - port to connect to
* @param max_connections - maximum allowed connection count
* @param initial_window_size - (native only) leave as zero
* @param socket_options - (native only) leave null
* @param tls_opts - if not null TLS will be used, otherwise plain http will be used
* @param proxy_options - configuration for establishing connections through a proxy
*/
function HttpClientConnectionManager(bootstrap, host, port, max_connections, initial_window_size, socket_options, tls_opts, proxy_options) {

@@ -483,0 +550,0 @@ this.bootstrap = bootstrap;

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*
* @packageDocumentation
* @module IO
*/

@@ -10,3 +11,2 @@ export { TlsVersion, SocketType, SocketDomain } from "../common/io";

*
* @module aws-crt
* @category TLS

@@ -20,4 +20,3 @@ */

*
* @module aws-crt
* @category I/O
* @category IO
*/

@@ -32,4 +31,3 @@ export declare class InputStream {

*
* @module aws-crt
* @category I/O
* @category IO
*/

@@ -42,3 +40,2 @@ export declare class ClientBootstrap {

*
* @module aws-crt
* @category TLS

@@ -51,3 +48,2 @@ */

*
* @module aws-crt
* @category TLS

@@ -65,3 +61,2 @@ */

*
* @module aws-crt
* @category TLS

@@ -75,3 +70,2 @@ */

*
* @module aws-crt
* @category TLS

@@ -86,4 +80,3 @@ */

* Provided for compatibility with nodejs, but this version is largely unused.
* @module aws-crt
* @category I/O
* @category Network
*/

@@ -90,0 +83,0 @@ export declare class SocketOptions {

"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -21,2 +21,7 @@ * SPDX-License-Identifier: Apache-2.0.

exports.SocketOptions = exports.ClientTlsContext = exports.TlsContext = exports.TlsConnectionOptions = exports.ClientBootstrap = exports.InputStream = exports.is_alpn_available = void 0;
/**
*
* @packageDocumentation
* @module IO
*/
var io_1 = require("../common/io");

@@ -30,3 +35,2 @@ Object.defineProperty(exports, "TlsVersion", { enumerable: true, get: function () { return io_1.TlsVersion; } });

*
* @module aws-crt
* @category TLS

@@ -42,4 +46,3 @@ */

*
* @module aws-crt
* @category I/O
* @category IO
*/

@@ -57,4 +60,3 @@ var InputStream = /** @class */ (function () {

*
* @module aws-crt
* @category I/O
* @category IO
*/

@@ -72,3 +74,2 @@ var ClientBootstrap = /** @class */ (function () {

*
* @module aws-crt
* @category TLS

@@ -91,3 +92,2 @@ */

*
* @module aws-crt
* @category TLS

@@ -106,3 +106,2 @@ */

*
* @module aws-crt
* @category TLS

@@ -123,4 +122,3 @@ */

* Provided for compatibility with nodejs, but this version is largely unused.
* @module aws-crt
* @category I/O
* @category Network
*/

@@ -127,0 +125,0 @@ var SocketOptions = /** @class */ (function () {

@@ -1,19 +0,18 @@

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
import * as WebsocketUtils from "./ws";
import * as auth from "./auth";
import { BufferedEventEmitter } from "../common/event";
import { CrtError } from "../browser";
import { ClientBootstrap, SocketOptions } from "./io";
import { QoS, Payload, MqttRequest, MqttSubscribeRequest, MqttWill, OnMessageCallback } from "../common/mqtt";
import { QoS, Payload, MqttRequest, MqttSubscribeRequest, MqttWill, OnMessageCallback, MqttConnectionConnected, MqttConnectionDisconnected, MqttConnectionError, MqttConnectionInterrupted, MqttConnectionResumed } from "../common/mqtt";
export { QoS, Payload, MqttRequest, MqttSubscribeRequest, MqttWill } from "../common/mqtt";
/** @category MQTT */
/**
* @category MQTT
*/
export declare type WebsocketOptions = WebsocketUtils.WebsocketOptions;
/** @category MQTT */
export declare type AWSCredentials = WebsocketUtils.AWSCredentials;
/**
* @category MQTT
*/
export declare type AWSCredentials = auth.AWSCredentials;
/**
* Configuration options for an MQTT connection
*
* @module aws-crt
* @category MQTT

@@ -48,3 +47,3 @@ */

* The server will assume the connection is lost if no PING is received after 1.5X this value.
* This duration must be longer than {@link timeout}.
* This duration must be longer than {@link ping_timeout}.
*/

@@ -85,3 +84,2 @@ keep_alive?: number;

*
* @module aws-crt
* @category MQTT

@@ -101,3 +99,2 @@ */

*
* @module aws-crt
* @category MQTT

@@ -116,22 +113,56 @@ */

constructor(client: MqttClient, config: MqttConnectionConfig);
/** Emitted when the connection is ready and is about to start sending response data */
on(event: 'connect', listener: (session_present: boolean) => void): this;
/** Emitted when connection has closed sucessfully. */
on(event: 'disconnect', listener: () => void): this;
/**
* Emitted when an error occurs
* @param error - A CrtError containing the error that occurred
* Emitted when the connection successfully establishes itself for the first time
*
* @param event the type of event (connect)
* @param listener the event listener to use
*
* @event
*/
on(event: 'error', listener: (error: CrtError) => void): this;
on(event: 'connect', listener: MqttConnectionConnected): this;
/**
* Emitted when the connection is dropped unexpectedly. The error will contain the error
* Emitted when connection has disconnected sucessfully.
*
* @param event the type of event (disconnect)
* @param listener the event listener to use
*
* @event
*/
on(event: 'disconnect', listener: MqttConnectionDisconnected): this;
/**
* Emitted when an error occurs. The error will contain the error
* code and message.
*
* @param event the type of event (error)
* @param listener the event listener to use
*
* @event
*/
on(event: 'interrupt', listener: (error: CrtError) => void): this;
on(event: 'error', listener: MqttConnectionError): this;
/**
* Emitted when the connection reconnects. Only triggers on connections after the initial one.
* Emitted when the connection is dropped unexpectedly. The error will contain the error
* code and message. The underlying mqtt implementation will attempt to reconnect.
*
* @param event the type of event (interrupt)
* @param listener the event listener to use
*
* @event
*/
on(event: 'resume', listener: (return_code: number, session_present: boolean) => void): this;
on(event: 'interrupt', listener: MqttConnectionInterrupted): this;
/**
* Emitted when the connection reconnects (after an interrupt). Only triggers on connections after the initial one.
*
* @param event the type of event (resume)
* @param listener the event listener to use
*
* @event
*/
on(event: 'resume', listener: MqttConnectionResumed): this;
/**
* Emitted when any MQTT publish message arrives.
*
* @param event the type of event (message)
* @param listener the event listener to use
*
* @event
*/

@@ -138,0 +169,0 @@ on(event: 'message', listener: OnMessageCallback): this;

"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -87,2 +87,6 @@ * SPDX-License-Identifier: Apache-2.0.

exports.MqttClientConnection = exports.MqttClient = void 0;
/**
* @packageDocumentation
* @module mqtt
*/
var mqtt = __importStar(require("mqtt"));

@@ -99,3 +103,2 @@ var WebsocketUtils = __importStar(require("./ws"));

*
* @module aws-crt
* @category MQTT

@@ -197,3 +200,2 @@ */

*
* @module aws-crt
* @category MQTT

@@ -270,3 +272,2 @@ */

}
/** @internal */
MqttClientConnection.prototype.on = function (event, listener) {

@@ -273,0 +274,0 @@ return _super.prototype.on.call(this, event, listener);

@@ -1,6 +0,4 @@

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
/** @internal */
export declare const TextEncoder: any;
/** @internal */
export declare const TextDecoder: any;
"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -11,4 +11,6 @@ * SPDX-License-Identifier: Apache-2.0.

var window = ((_a = global !== null && global !== void 0 ? global : self) !== null && _a !== void 0 ? _a : this);
/** @internal */
exports.TextEncoder = (_b = window['TextEncoder']) !== null && _b !== void 0 ? _b : require('fastestsmallesttextencoderdecoder').TextEncoder;
/** @internal */
exports.TextDecoder = (_c = window['TextDecoder']) !== null && _c !== void 0 ? _c : require('fastestsmallesttextencoderdecoder').TextDecoder;
//# sourceMappingURL=polyfills.js.map

@@ -1,5 +0,1 @@

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
/** @internal */

@@ -6,0 +2,0 @@ export declare class Node<T> {

"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -4,0 +4,0 @@ * SPDX-License-Identifier: Apache-2.0.

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
* @packageDocumentation
* @module mqtt
*/

@@ -10,4 +10,3 @@ import { MqttConnectionConfig } from "./mqtt";

*
* @module aws-crt
* @category HTTP
* @category MQTT
*/

@@ -22,13 +21,2 @@ export interface WebsocketOptions {

}
/** Standard AWS Credentials */
export interface AWSCredentials {
/** Optional region */
aws_region?: string;
/** AWS access id */
aws_access_id: string;
/** AWS secret access key */
aws_secret_key: string;
/** STS token if one has been vended (by a {@link CredentialsProvider}) */
aws_sts_token?: string;
}
/** @internal */

@@ -35,0 +23,0 @@ export declare function create_websocket_url(config: MqttConnectionConfig): string;

"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -4,0 +4,0 @@ * SPDX-License-Identifier: Apache-2.0.

@@ -0,12 +1,15 @@

/// <reference types="node" />
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*
* A module containing support for a variety of cryptographic operations.
*
* @packageDocumentation
* @module crypto
* @preferred
*/
/// <reference types="node" />
/**
* The types that are acceptable to use as input for hashing.
*
* @module aws-crt
* @category Crypto
*/
export declare type Hashable = string | ArrayBuffer | DataView | Buffer;
"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -4,0 +4,0 @@ * SPDX-License-Identifier: Apache-2.0.

@@ -0,6 +1,6 @@

/// <reference types="node" />
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
* @packageDocumentation
* @module crt
*/
/// <reference types="node" />
import { EventEmitter } from 'events';

@@ -10,3 +10,2 @@ /**

*
* @module aws-crt
* @category Events

@@ -23,3 +22,2 @@ */

*
* @module aws-crt
* @category Events

@@ -26,0 +24,0 @@ */

"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -41,2 +41,6 @@ * SPDX-License-Identifier: Apache-2.0.

exports.BufferedEventEmitter = void 0;
/**
* @packageDocumentation
* @module crt
*/
var events_1 = require("events");

@@ -61,3 +65,2 @@ /**

*
* @module aws-crt
* @category Events

@@ -64,0 +67,0 @@ */

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*
* A module containing support for creating http connections and making requests on them.
*
* @packageDocumentation
* @module http
* @preferred
*/

@@ -8,4 +12,3 @@ /**

*
* @module aws-crt
* @category HTTP
* @category HTTP
*/

@@ -24,4 +27,3 @@ export declare enum HttpVersion {

*
* @module aws-crt
* @category HTTP
* @category HTTP
*/

@@ -83,7 +85,12 @@ export declare type HttpHeader = [string, string];

*
* @module aws-crt
* @category HTTP
*/
export declare enum HttpProxyAuthenticationType {
/**
* No to-proxy authentication logic
*/
None = 0,
/**
* Use basic authentication (user/pass). Supply these values in {@link HttpProxyOptions}
*/
Basic = 1

@@ -94,6 +101,5 @@ }

*
* @module aws-crt
* @category HTTP
*/
export declare class HttpProxyOptions {
export declare class CommonHttpProxyOptions {
host_name: string;

@@ -104,3 +110,60 @@ port: number;

auth_password?: string | undefined;
/**
*
* @param host_name endpoint of the proxy to use
* @param port port of proxy to use
* @param auth_method type of authentication to use with the proxy
* @param auth_username (basic authentication only) proxy username
* @param auth_password (basic authentication only) password associated with the username
*/
constructor(host_name: string, port: number, auth_method?: HttpProxyAuthenticationType, auth_username?: string | undefined, auth_password?: string | undefined);
}
/**
* Listener signature for event emitted from an {@link HttpClientConnection} when the connection reaches the
* connected state
*
* @asMemberOf HttpClientConnection
* @category HTTP
*/
export declare type HttpClientConnectionConnected = () => void;
/**
* Listener signature for event emitted from an {@link HttpClientConnection} when an error occurs
*
* @param error - A CrtError containing the error that occurred
*
* @asMemberOf HttpClientConnection
* @category HTTP
*/
export declare type HttpClientConnectionError = (error: Error) => void;
/**
* Listener signature for event emitted from an {@link HttpClientConnection} when the connection has been closed
*
* @asMemberOf HttpClientConnection
* @category HTTP
*/
export declare type HttpClientConnectionClosed = () => void;
/**
* Listener signature for event emitted from an {@link HttpClientStream} when http response data is available
*
* @param body_data - The chunk of body data
*
* @asMemberOf HttpClientStream
* @category HTTP
*/
export declare type HttpStreamData = (body_data: ArrayBuffer) => void;
/**
* Listener signature for event emitted from an {@link HttpClientStream} when an http stream error occurs
*
* @param error - A CrtError containing the error that occurred
*
* @asMemberOf HttpClientStream
* @category HTTP
*/
export declare type HttpStreamError = (error: Error) => void;
/**
* Listener signature for event emitted from an {@link HttpClientStream} when the http stream has completed.
*
* @asMemberOf HttpClientStream
* @category HTTP
*/
export declare type HttpStreamComplete = () => void;
"use strict";
/**
/*
*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -7,8 +8,15 @@ * SPDX-License-Identifier: Apache-2.0.

Object.defineProperty(exports, "__esModule", { value: true });
exports.HttpProxyOptions = exports.HttpProxyAuthenticationType = exports.HttpVersion = void 0;
exports.CommonHttpProxyOptions = exports.HttpProxyAuthenticationType = exports.HttpVersion = void 0;
/**
*
* A module containing support for creating http connections and making requests on them.
*
* @packageDocumentation
* @module http
* @preferred
*/
/**
* HTTP protocol version
*
* @module aws-crt
* @category HTTP
* @category HTTP
*/

@@ -28,3 +36,2 @@ var HttpVersion;

*
* @module aws-crt
* @category HTTP

@@ -34,3 +41,9 @@ */

(function (HttpProxyAuthenticationType) {
/**
* No to-proxy authentication logic
*/
HttpProxyAuthenticationType[HttpProxyAuthenticationType["None"] = 0] = "None";
/**
* Use basic authentication (user/pass). Supply these values in {@link HttpProxyOptions}
*/
HttpProxyAuthenticationType[HttpProxyAuthenticationType["Basic"] = 1] = "Basic";

@@ -42,7 +55,14 @@ })(HttpProxyAuthenticationType = exports.HttpProxyAuthenticationType || (exports.HttpProxyAuthenticationType = {}));

*
* @module aws-crt
* @category HTTP
*/
var HttpProxyOptions = /** @class */ (function () {
function HttpProxyOptions(host_name, port, auth_method, auth_username, auth_password) {
var CommonHttpProxyOptions = /** @class */ (function () {
/**
*
* @param host_name endpoint of the proxy to use
* @param port port of proxy to use
* @param auth_method type of authentication to use with the proxy
* @param auth_username (basic authentication only) proxy username
* @param auth_password (basic authentication only) password associated with the username
*/
function CommonHttpProxyOptions(host_name, port, auth_method, auth_username, auth_password) {
if (auth_method === void 0) { auth_method = HttpProxyAuthenticationType.None; }

@@ -55,5 +75,5 @@ this.host_name = host_name;

}
return HttpProxyOptions;
return CommonHttpProxyOptions;
}());
exports.HttpProxyOptions = HttpProxyOptions;
exports.CommonHttpProxyOptions = CommonHttpProxyOptions;
//# sourceMappingURL=http.js.map
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*
* A module containing a grab bag of support for core network I/O functionality, including sockets, TLS, DNS, logging,
* error handling, streams, and connection -> thread mapping.
*
* Categories include:
* - Network: socket configuration
* - TLS: tls configuration
* - Logging: logging controls and configuration
* - IO: everything else
*
* @packageDocumentation
* @module IO
* @preferred
*/

@@ -8,3 +19,2 @@ /**

*
* @module aws-crt
* @category TLS

@@ -21,4 +31,3 @@ */

/**
* @module aws-crt
* @category I/O
* @category Network
*/

@@ -40,9 +49,11 @@ export declare enum SocketType {

/**
* @module aws-crt
* @category I/O
* @category Network
*/
export declare enum SocketDomain {
/** IPv4 sockets */
IPV4 = 0,
/** IPv6 sockets */
IPV6 = 1,
/** UNIX domain socket/Windows named pipes */
LOCAL = 2
}
"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -9,5 +9,19 @@ * SPDX-License-Identifier: Apache-2.0.

/**
*
* A module containing a grab bag of support for core network I/O functionality, including sockets, TLS, DNS, logging,
* error handling, streams, and connection -> thread mapping.
*
* Categories include:
* - Network: socket configuration
* - TLS: tls configuration
* - Logging: logging controls and configuration
* - IO: everything else
*
* @packageDocumentation
* @module IO
* @preferred
*/
/**
* TLS Version
*
* @module aws-crt
* @category TLS

@@ -25,4 +39,3 @@ */

/**
* @module aws-crt
* @category I/O
* @category Network
*/

@@ -45,11 +58,13 @@ var SocketType;

/**
* @module aws-crt
* @category I/O
* @category Network
*/
var SocketDomain;
(function (SocketDomain) {
/** IPv4 sockets */
SocketDomain[SocketDomain["IPV4"] = 0] = "IPV4";
/** IPv6 sockets */
SocketDomain[SocketDomain["IPV6"] = 1] = "IPV6";
/** UNIX domain socket/Windows named pipes */
SocketDomain[SocketDomain["LOCAL"] = 2] = "LOCAL";
})(SocketDomain = exports.SocketDomain || (exports.SocketDomain = {}));
//# sourceMappingURL=io.js.map
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*
* A module containing support for mqtt connection establishment and operations.
*
* @packageDocumentation
* @module mqtt
* @preferred
*/

@@ -9,5 +13,10 @@ /**

*
* @module aws-crt
* @category MQTT
* @category MQTT
*/
import { CrtError } from "../browser/error";
/**
* Quality of service control for mqtt publish operations
*
* @category MQTT
*/
export declare enum QoS {

@@ -46,3 +55,2 @@ /**

*
* @module aws-crt
* @category MQTT

@@ -62,3 +70,2 @@ */

*
* @module aws-crt
* @category MQTT

@@ -70,3 +77,2 @@ */

*
* @module aws-crt
* @category MQTT

@@ -81,3 +87,2 @@ */

*
* @module aws-crt
* @category MQTT

@@ -102,3 +107,2 @@ */

*
* @module aws-crt
* @category MQTT

@@ -125,1 +129,49 @@ */

}
/**
* Listener signature for event emitted from an {@link MqttClientConnection} when the connection reaches an initial
* connected state
*
* @param session_present true if the reconnection went to an existing session, false if this is a clean session
*
* @asMemberOf MqttClientConnection
* @category MQTT
*/
export declare type MqttConnectionConnected = (session_present: boolean) => void;
/**
* Listener signature for event emitted from an {@link MqttClientConnection} when the connection has fully disconnected
* by user request
*
* @asMemberOf MqttClientConnection
* @category MQTT
*/
export declare type MqttConnectionDisconnected = () => void;
/**
* Listener signature for event emitted from an {@link MqttClientConnection} when an error occurs
*
* @param error the error that occurred
*
* @asMemberOf MqttClientConnection
* @category MQTT
*/
export declare type MqttConnectionError = (error: CrtError) => void;
/**
* Listener signature for event emitted from an {@link MqttClientConnection} when the connection has been
* interrupted unexpectedly.
*
* @param error description of the error that occurred
*
* @asMemberOf MqttClientConnection
* @category MQTT
*/
export declare type MqttConnectionInterrupted = (error: CrtError) => void;
/**
* Listener signature for event emitted from an {@link MqttClientConnection} when the connection successfully
* reestablishes itself after an interruption
*
* @param return_code MQTT connect return code (should be 0 for a successful reconnection)
* @param session_present true if the reconnection went to an existing session, false if this is a clean session
*
* @asMemberOf MqttClientConnection
* @category MQTT
*/
export declare type MqttConnectionResumed = (return_code: number, session_present: boolean) => void;
"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -9,7 +9,5 @@ * SPDX-License-Identifier: Apache-2.0.

/**
* MQTT Quality of Service
* [MQTT-4.3]
* Quality of service control for mqtt publish operations
*
* @module aws-crt
* @category MQTT
* @category MQTT
*/

@@ -51,3 +49,2 @@ var QoS;

*
* @module aws-crt
* @category MQTT

@@ -54,0 +51,0 @@ */

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*
* A module containing miscellaneous functionality for error reporting, platform functionality, and package-wide logic.
*
* @packageDocumentation
* @module crt
* @preferred
*/

@@ -8,3 +12,2 @@ /**

*
* @module aws-crt
* @category System

@@ -16,3 +19,2 @@ */

*
* @module aws-crt
* @category System

@@ -24,3 +26,2 @@ */

*
* @module aws-crt
* @category System

@@ -32,5 +33,4 @@ */

*
* @module aws-crt
* @category System
*/
export declare function crt_version(): any;
"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -9,5 +9,12 @@ * SPDX-License-Identifier: Apache-2.0.

/**
*
* A module containing miscellaneous functionality for error reporting, platform functionality, and package-wide logic.
*
* @packageDocumentation
* @module crt
* @preferred
*/
/**
* Returns true if this script is running under nodejs
*
* @module aws-crt
* @category System

@@ -24,3 +31,2 @@ */

*
* @module aws-crt
* @category System

@@ -35,3 +41,2 @@ */

*
* @module aws-crt
* @category System

@@ -55,3 +60,2 @@ */

*
* @module aws-crt
* @category System

@@ -58,0 +62,0 @@ */

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
* @packageDocumentation
* @module crt
*/

@@ -9,3 +9,2 @@ /**

*
* @module aws-crt
* @category System

@@ -27,5 +26,4 @@ */

*
* @module aws-crt
* @category System
*/
export declare function using<T extends ResourceSafe>(resource: T, func: (resource: T) => void): Promise<void>;
"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -55,3 +55,2 @@ * SPDX-License-Identifier: Apache-2.0.

*
* @module aws-crt
* @category System

@@ -58,0 +57,0 @@ */

@@ -0,12 +1,15 @@

/// <reference types="node" />
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*
* A module containing support for a variety of cryptographic operations.
*
* @packageDocumentation
* @module crypto
* @preferred
*/
/// <reference types="node" />
/**
* The types that are acceptable to use as input for hashing.
*
* @module aws-crt
* @category Crypto
*/
export declare type Hashable = string | ArrayBuffer | DataView | Buffer;
"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -4,0 +4,0 @@ * SPDX-License-Identifier: Apache-2.0.

@@ -0,6 +1,6 @@

/// <reference types="node" />
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
* @packageDocumentation
* @module crt
*/
/// <reference types="node" />
import { EventEmitter } from 'events';

@@ -10,3 +10,2 @@ /**

*
* @module aws-crt
* @category Events

@@ -23,3 +22,2 @@ */

*
* @module aws-crt
* @category Events

@@ -26,0 +24,0 @@ */

"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -8,2 +8,6 @@ * SPDX-License-Identifier: Apache-2.0.

exports.BufferedEventEmitter = void 0;
/**
* @packageDocumentation
* @module crt
*/
const events_1 = require("events");

@@ -27,3 +31,2 @@ /**

*
* @module aws-crt
* @category Events

@@ -30,0 +33,0 @@ */

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*
* A module containing support for creating http connections and making requests on them.
*
* @packageDocumentation
* @module http
* @preferred
*/

@@ -8,4 +12,3 @@ /**

*
* @module aws-crt
* @category HTTP
* @category HTTP
*/

@@ -24,4 +27,3 @@ export declare enum HttpVersion {

*
* @module aws-crt
* @category HTTP
* @category HTTP
*/

@@ -83,7 +85,12 @@ export declare type HttpHeader = [string, string];

*
* @module aws-crt
* @category HTTP
*/
export declare enum HttpProxyAuthenticationType {
/**
* No to-proxy authentication logic
*/
None = 0,
/**
* Use basic authentication (user/pass). Supply these values in {@link HttpProxyOptions}
*/
Basic = 1

@@ -94,6 +101,5 @@ }

*
* @module aws-crt
* @category HTTP
*/
export declare class HttpProxyOptions {
export declare class CommonHttpProxyOptions {
host_name: string;

@@ -104,3 +110,60 @@ port: number;

auth_password?: string | undefined;
/**
*
* @param host_name endpoint of the proxy to use
* @param port port of proxy to use
* @param auth_method type of authentication to use with the proxy
* @param auth_username (basic authentication only) proxy username
* @param auth_password (basic authentication only) password associated with the username
*/
constructor(host_name: string, port: number, auth_method?: HttpProxyAuthenticationType, auth_username?: string | undefined, auth_password?: string | undefined);
}
/**
* Listener signature for event emitted from an {@link HttpClientConnection} when the connection reaches the
* connected state
*
* @asMemberOf HttpClientConnection
* @category HTTP
*/
export declare type HttpClientConnectionConnected = () => void;
/**
* Listener signature for event emitted from an {@link HttpClientConnection} when an error occurs
*
* @param error - A CrtError containing the error that occurred
*
* @asMemberOf HttpClientConnection
* @category HTTP
*/
export declare type HttpClientConnectionError = (error: Error) => void;
/**
* Listener signature for event emitted from an {@link HttpClientConnection} when the connection has been closed
*
* @asMemberOf HttpClientConnection
* @category HTTP
*/
export declare type HttpClientConnectionClosed = () => void;
/**
* Listener signature for event emitted from an {@link HttpClientStream} when http response data is available
*
* @param body_data - The chunk of body data
*
* @asMemberOf HttpClientStream
* @category HTTP
*/
export declare type HttpStreamData = (body_data: ArrayBuffer) => void;
/**
* Listener signature for event emitted from an {@link HttpClientStream} when an http stream error occurs
*
* @param error - A CrtError containing the error that occurred
*
* @asMemberOf HttpClientStream
* @category HTTP
*/
export declare type HttpStreamError = (error: Error) => void;
/**
* Listener signature for event emitted from an {@link HttpClientStream} when the http stream has completed.
*
* @asMemberOf HttpClientStream
* @category HTTP
*/
export declare type HttpStreamComplete = () => void;
"use strict";
/**
/*
*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -7,8 +8,15 @@ * SPDX-License-Identifier: Apache-2.0.

Object.defineProperty(exports, "__esModule", { value: true });
exports.HttpProxyOptions = exports.HttpProxyAuthenticationType = exports.HttpVersion = void 0;
exports.CommonHttpProxyOptions = exports.HttpProxyAuthenticationType = exports.HttpVersion = void 0;
/**
*
* A module containing support for creating http connections and making requests on them.
*
* @packageDocumentation
* @module http
* @preferred
*/
/**
* HTTP protocol version
*
* @module aws-crt
* @category HTTP
* @category HTTP
*/

@@ -28,3 +36,2 @@ var HttpVersion;

*
* @module aws-crt
* @category HTTP

@@ -34,3 +41,9 @@ */

(function (HttpProxyAuthenticationType) {
/**
* No to-proxy authentication logic
*/
HttpProxyAuthenticationType[HttpProxyAuthenticationType["None"] = 0] = "None";
/**
* Use basic authentication (user/pass). Supply these values in {@link HttpProxyOptions}
*/
HttpProxyAuthenticationType[HttpProxyAuthenticationType["Basic"] = 1] = "Basic";

@@ -42,6 +55,13 @@ })(HttpProxyAuthenticationType = exports.HttpProxyAuthenticationType || (exports.HttpProxyAuthenticationType = {}));

*
* @module aws-crt
* @category HTTP
*/
class HttpProxyOptions {
class CommonHttpProxyOptions {
/**
*
* @param host_name endpoint of the proxy to use
* @param port port of proxy to use
* @param auth_method type of authentication to use with the proxy
* @param auth_username (basic authentication only) proxy username
* @param auth_password (basic authentication only) password associated with the username
*/
constructor(host_name, port, auth_method = HttpProxyAuthenticationType.None, auth_username, auth_password) {

@@ -55,3 +75,3 @@ this.host_name = host_name;

}
exports.HttpProxyOptions = HttpProxyOptions;
exports.CommonHttpProxyOptions = CommonHttpProxyOptions;
//# sourceMappingURL=http.js.map
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*
* A module containing a grab bag of support for core network I/O functionality, including sockets, TLS, DNS, logging,
* error handling, streams, and connection -> thread mapping.
*
* Categories include:
* - Network: socket configuration
* - TLS: tls configuration
* - Logging: logging controls and configuration
* - IO: everything else
*
* @packageDocumentation
* @module IO
* @preferred
*/

@@ -8,3 +19,2 @@ /**

*
* @module aws-crt
* @category TLS

@@ -21,4 +31,3 @@ */

/**
* @module aws-crt
* @category I/O
* @category Network
*/

@@ -40,9 +49,11 @@ export declare enum SocketType {

/**
* @module aws-crt
* @category I/O
* @category Network
*/
export declare enum SocketDomain {
/** IPv4 sockets */
IPV4 = 0,
/** IPv6 sockets */
IPV6 = 1,
/** UNIX domain socket/Windows named pipes */
LOCAL = 2
}
"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -9,5 +9,19 @@ * SPDX-License-Identifier: Apache-2.0.

/**
*
* A module containing a grab bag of support for core network I/O functionality, including sockets, TLS, DNS, logging,
* error handling, streams, and connection -> thread mapping.
*
* Categories include:
* - Network: socket configuration
* - TLS: tls configuration
* - Logging: logging controls and configuration
* - IO: everything else
*
* @packageDocumentation
* @module IO
* @preferred
*/
/**
* TLS Version
*
* @module aws-crt
* @category TLS

@@ -25,4 +39,3 @@ */

/**
* @module aws-crt
* @category I/O
* @category Network
*/

@@ -45,11 +58,13 @@ var SocketType;

/**
* @module aws-crt
* @category I/O
* @category Network
*/
var SocketDomain;
(function (SocketDomain) {
/** IPv4 sockets */
SocketDomain[SocketDomain["IPV4"] = 0] = "IPV4";
/** IPv6 sockets */
SocketDomain[SocketDomain["IPV6"] = 1] = "IPV6";
/** UNIX domain socket/Windows named pipes */
SocketDomain[SocketDomain["LOCAL"] = 2] = "LOCAL";
})(SocketDomain = exports.SocketDomain || (exports.SocketDomain = {}));
//# sourceMappingURL=io.js.map
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*
* A module containing support for mqtt connection establishment and operations.
*
* @packageDocumentation
* @module mqtt
* @preferred
*/

@@ -9,5 +13,10 @@ /**

*
* @module aws-crt
* @category MQTT
* @category MQTT
*/
import { CrtError } from "../browser/error";
/**
* Quality of service control for mqtt publish operations
*
* @category MQTT
*/
export declare enum QoS {

@@ -46,3 +55,2 @@ /**

*
* @module aws-crt
* @category MQTT

@@ -62,3 +70,2 @@ */

*
* @module aws-crt
* @category MQTT

@@ -70,3 +77,2 @@ */

*
* @module aws-crt
* @category MQTT

@@ -81,3 +87,2 @@ */

*
* @module aws-crt
* @category MQTT

@@ -102,3 +107,2 @@ */

*
* @module aws-crt
* @category MQTT

@@ -125,1 +129,49 @@ */

}
/**
* Listener signature for event emitted from an {@link MqttClientConnection} when the connection reaches an initial
* connected state
*
* @param session_present true if the reconnection went to an existing session, false if this is a clean session
*
* @asMemberOf MqttClientConnection
* @category MQTT
*/
export declare type MqttConnectionConnected = (session_present: boolean) => void;
/**
* Listener signature for event emitted from an {@link MqttClientConnection} when the connection has fully disconnected
* by user request
*
* @asMemberOf MqttClientConnection
* @category MQTT
*/
export declare type MqttConnectionDisconnected = () => void;
/**
* Listener signature for event emitted from an {@link MqttClientConnection} when an error occurs
*
* @param error the error that occurred
*
* @asMemberOf MqttClientConnection
* @category MQTT
*/
export declare type MqttConnectionError = (error: CrtError) => void;
/**
* Listener signature for event emitted from an {@link MqttClientConnection} when the connection has been
* interrupted unexpectedly.
*
* @param error description of the error that occurred
*
* @asMemberOf MqttClientConnection
* @category MQTT
*/
export declare type MqttConnectionInterrupted = (error: CrtError) => void;
/**
* Listener signature for event emitted from an {@link MqttClientConnection} when the connection successfully
* reestablishes itself after an interruption
*
* @param return_code MQTT connect return code (should be 0 for a successful reconnection)
* @param session_present true if the reconnection went to an existing session, false if this is a clean session
*
* @asMemberOf MqttClientConnection
* @category MQTT
*/
export declare type MqttConnectionResumed = (return_code: number, session_present: boolean) => void;
"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -9,7 +9,5 @@ * SPDX-License-Identifier: Apache-2.0.

/**
* MQTT Quality of Service
* [MQTT-4.3]
* Quality of service control for mqtt publish operations
*
* @module aws-crt
* @category MQTT
* @category MQTT
*/

@@ -51,3 +49,2 @@ var QoS;

*
* @module aws-crt
* @category MQTT

@@ -54,0 +51,0 @@ */

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*
* A module containing miscellaneous functionality for error reporting, platform functionality, and package-wide logic.
*
* @packageDocumentation
* @module crt
* @preferred
*/

@@ -8,3 +12,2 @@ /**

*
* @module aws-crt
* @category System

@@ -16,3 +19,2 @@ */

*
* @module aws-crt
* @category System

@@ -24,3 +26,2 @@ */

*
* @module aws-crt
* @category System

@@ -32,5 +33,4 @@ */

*
* @module aws-crt
* @category System
*/
export declare function crt_version(): any;
"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -9,5 +9,12 @@ * SPDX-License-Identifier: Apache-2.0.

/**
*
* A module containing miscellaneous functionality for error reporting, platform functionality, and package-wide logic.
*
* @packageDocumentation
* @module crt
* @preferred
*/
/**
* Returns true if this script is running under nodejs
*
* @module aws-crt
* @category System

@@ -24,3 +31,2 @@ */

*
* @module aws-crt
* @category System

@@ -35,3 +41,2 @@ */

*
* @module aws-crt
* @category System

@@ -55,3 +60,2 @@ */

*
* @module aws-crt
* @category System

@@ -58,0 +62,0 @@ */

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
* @packageDocumentation
* @module crt
*/

@@ -9,3 +9,2 @@ /**

*
* @module aws-crt
* @category System

@@ -27,5 +26,4 @@ */

*
* @module aws-crt
* @category System
*/
export declare function using<T extends ResourceSafe>(resource: T, func: (resource: T) => void): Promise<void>;
"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -28,3 +28,2 @@ * SPDX-License-Identifier: Apache-2.0.

*
* @module aws-crt
* @category System

@@ -31,0 +30,0 @@ */

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
* @packageDocumentation
* @module crt
*/
/**
* @moduledefinition aws-crt
*/
import * as platform from './common/platform';

@@ -9,0 +6,0 @@ import * as resource_safety from './common/resource_safety';

"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -27,6 +27,7 @@ * SPDX-License-Identifier: Apache-2.0.

exports.CrtError = exports.resource_safety = exports.platform = exports.iot = exports.auth = exports.crypto = exports.http = exports.mqtt = exports.io = exports.crt = void 0;
// This is the entry point for the AWS CRT nodejs native libraries
/**
* @moduledefinition aws-crt
* @packageDocumentation
* @module crt
*/
// This is the entry point for the AWS CRT nodejs native libraries
/* common libs */

@@ -33,0 +34,0 @@ const platform = __importStar(require("./common/platform"));

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
* Module for AWS Authentication logic - signing http requests, events, chunks, etc...
*
* @packageDocumentation
* @module auth
* @preferred
*/

@@ -8,3 +11,5 @@ import crt_native from './binding';

import { ClientBootstrap } from './io';
/** @category System */
/**
* @internal
*/
declare type StringLike = string | ArrayBuffer | DataView;

@@ -14,3 +19,2 @@ /**

*
* @module aws-crt
* @category Auth

@@ -71,6 +75,21 @@ */

*
* @module aws-crt
* We don't currently expose an interface for fetching credentials from Javascript.
*
* @category Auth
*/
export declare class AwsCredentialsProvider extends crt_native.AwsCredentialsProvider {
/**
* Creates a new default credentials provider to be used internally for AWS credentials resolution:
*
* The CRT's default provider chain currently sources in this order:
*
* 1. Environment
* 2. Profile
* 3. (conditional, off by default) ECS
* 4. (conditional, on by default) EC2 Instance Metadata
*
* @param bootstrap (optional) client bootstrap to be used to establish any required network connections
*
* @returns a new credentials provider using default credentials resolution rules
*/
static newDefault(bootstrap?: ClientBootstrap | undefined): AwsCredentialsProvider;

@@ -83,6 +102,61 @@ }

*
* @module aws-crt
* @category Auth
*/
export declare type AwsSigningConfig = crt_native.AwsSigningConfig;
export interface AwsSigningConfig {
/** Which signing process to invoke */
algorithm: AwsSigningAlgorithm;
/** What kind of signature to compute */
signature_type: AwsSignatureType;
/** Credentials provider to fetch signing credentials with */
provider: AwsCredentialsProvider;
/** The region to sign against */
region: string;
/** Name of service to sign a request for */
service?: string;
/**
* Date and time to use during the signing process. If not provided then
* the current time in UTC is used. Naive dates (lacking timezone info)
* are assumed to be in local time
*/
date?: Date;
/**
* Headers to skip when signing.
*
* Skipping auth-required headers will result in an unusable signature.
* Headers injected by the signing process are not skippable.
* This function does not override the internal check function
* (x-amzn-trace-id, user-agent), but rather supplements it.
* In particular, a header will get signed if and only if it returns
* true to both the internal check (skips x-amzn-trace-id, user-agent)
* and is found in this list (if defined)
*/
header_blacklist?: string[];
/**
* Set true to double-encode the resource path when constructing the
* canonical request. By default, all services except S3 use double encoding.
*/
use_double_uri_encode?: boolean;
/**
* Whether the resource paths are normalized when building the canonical request.
*/
should_normalize_uri_path?: boolean;
/**
* Should the session token be omitted from the signing process? This should only be
* true when making a websocket handshake with IoT Core.
*/
omit_session_token?: boolean;
/**
* Value to use as the canonical request's body value.
*
* Typically, this is the SHA-256 of the payload, written as lowercase hex.
* If this has been precalculated, it can be set here.
* Special values used by certain services can also be set (see {@link AwsSignedBodyValue}).
* If undefined (the default), the typical value will be calculated from the payload during signing.
*/
signed_body_value?: string;
/** Controls what header, if any, should be added to the request, containing the body value */
signed_body_header?: AwsSignedBodyHeaderType;
/** Query param signing only: how long the pre-signed URL is valid for */
expiration_in_seconds?: number;
}
/**

@@ -111,7 +185,6 @@ * Perform AWS HTTP request signing.

* @param config Configuration for signing.
* @returns A Future whose result will be the signed
* @returns A promise whose result will be the signed
* {@link HttpRequest}. The future will contain an exception
* if the signing process fails.
*
* @module aws-crt
* @category Auth

@@ -121,2 +194,5 @@ */

/**
*
* @internal
*
* Test only.

@@ -123,0 +199,0 @@ * Verifies:

"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -20,2 +20,9 @@ * SPDX-License-Identifier: Apache-2.0.

exports.aws_verify_sigv4a_signing = exports.aws_sign_request = exports.AwsCredentialsProvider = exports.AwsSignedBodyHeaderType = exports.AwsSignedBodyValue = exports.AwsSignatureType = exports.AwsSigningAlgorithm = void 0;
/**
* Module for AWS Authentication logic - signing http requests, events, chunks, etc...
*
* @packageDocumentation
* @module auth
* @preferred
*/
const binding_1 = __importDefault(require("./binding"));

@@ -26,3 +33,2 @@ const error_1 = require("./error");

*
* @module aws-crt
* @category Auth

@@ -87,3 +93,4 @@ */

*
* @module aws-crt
* We don't currently expose an interface for fetching credentials from Javascript.
*
* @category Auth

@@ -93,2 +100,16 @@ */

class AwsCredentialsProvider extends binding_1.default.AwsCredentialsProvider {
/**
* Creates a new default credentials provider to be used internally for AWS credentials resolution:
*
* The CRT's default provider chain currently sources in this order:
*
* 1. Environment
* 2. Profile
* 3. (conditional, off by default) ECS
* 4. (conditional, on by default) EC2 Instance Metadata
*
* @param bootstrap (optional) client bootstrap to be used to establish any required network connections
*
* @returns a new credentials provider using default credentials resolution rules
*/
static newDefault(bootstrap = undefined) {

@@ -122,7 +143,6 @@ return super.newDefault(bootstrap != null ? bootstrap.native_handle() : null);

* @param config Configuration for signing.
* @returns A Future whose result will be the signed
* @returns A promise whose result will be the signed
* {@link HttpRequest}. The future will contain an exception
* if the signing process fails.
*
* @module aws-crt
* @category Auth

@@ -153,2 +173,5 @@ */

/**
*
* @internal
*
* Test only.

@@ -155,0 +178,0 @@ * Verifies:

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
* Module for AWS IoT configuration and connection establishment
*
* @packageDocumentation
* @module aws-iot
* @preferred
*/

@@ -9,9 +12,27 @@ import { MqttConnectionConfig, MqttWill } from "./mqtt";

import { AwsCredentialsProvider, AwsSigningConfig } from "./auth";
/** @category IoT */
/**
* Websocket-specific mqtt connection configuration options
*
* @category IoT
*/
export interface WebsocketConfig {
/** Sources the AWS Credentials used to sign the websocket connection handshake */
credentials_provider: AwsCredentialsProvider;
/**
* (Optional) factory function to create the configuration used to sign the websocket handshake. Leave null
* to use the default settings.
*/
create_signing_config?: () => AwsSigningConfig;
/** (Optional) http proxy configuration */
proxy_options?: HttpProxyOptions;
/** AWS region the websocket connection is being established in. Must match the region embedded in the
* endpoint.
*/
region: string;
/**
* (Optional) override for the service name used in signing the websocket handshake. Leave null to use the
* default (iotdevicegateway)
*/
service?: string;
/** (Optional) TLS configuration to use when establishing the connection */
tls_ctx_options?: io.TlsContextOptions;

@@ -23,3 +44,2 @@ }

*
* @module aws-crt
* @category IoT

@@ -126,3 +146,3 @@ */

/**
* Returns the configured MqttConnectionConfig. On the first invocation of this function, the tls context is cached
* Returns the configured MqttConnectionConfig. On the first invocation of this function, the TLS context is cached
* and re-used on all subsequent calls to build().

@@ -129,0 +149,0 @@ * @returns The configured MqttConnectionConfig

"use strict";
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {

@@ -39,3 +43,2 @@ if (k2 === undefined) k2 = k;

*
* @module aws-crt
* @category IoT

@@ -253,3 +256,3 @@ */

/**
* Returns the configured MqttConnectionConfig. On the first invocation of this function, the tls context is cached
* Returns the configured MqttConnectionConfig. On the first invocation of this function, the TLS context is cached
* and re-used on all subsequent calls to build().

@@ -263,4 +266,4 @@ * @returns The configured MqttConnectionConfig

/*
* By caching and reusing the tls context we get an enormous memory savings on a per-connection basis.
* The tradeoff is that you can't modify tls options in between calls to build.
* By caching and reusing the TLS context we get an enormous memory savings on a per-connection basis.
* The tradeoff is that you can't modify TLS options in between calls to build.
* Previously we were making a new one with every single connection which had a huge negative impact on large

@@ -267,0 +270,0 @@ * scale tests.

@@ -1,2 +0,2 @@

/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -6,4 +6,12 @@ * SPDX-License-Identifier: Apache-2.0.

// The only exported types are http-related. If this changes, we'll need to rework the pseudo-module configuration
// for documentation
/**
* @packageDocumentation
* @module http
*/
import { InputStream } from "./io";
import { AwsSigningAlgorithm, AwsSignatureType, AwsSignedBodyValue, AwsSignedBodyHeaderType } from "./auth";
import { AwsSigningConfig } from "./auth";
import { HttpHeader, HttpHeaders as CommonHttpHeaders } from "../common/http";

@@ -18,3 +26,3 @@ import { OnMessageCallback, QoS } from "../common/mqtt";

/** @category System */
/** @internal */
type StringLike = string | ArrayBuffer | ArrayBufferView;

@@ -274,3 +282,3 @@

*
* @module aws-crt
* @module http
* @category HTTP

@@ -347,2 +355,4 @@ */

* The request may be transformed (ex: signing the request) before its data is eventually sent.
*
* @internal
*/

@@ -370,65 +380,2 @@ export class HttpRequest {

/**
* Configuration for use in AWS-related signing.
* AwsSigningConfig is immutable.
* It is good practice to use a new config for each signature, or the date might get too old.
*/
export interface AwsSigningConfig {
/** Which signing process to invoke */
algorithm: AwsSigningAlgorithm;
/** What kind of signature to compute */
signature_type: AwsSignatureType;
/** Credentials provider to fetch signing credentials with */
provider: AwsCredentialsProvider;
/** The region to sign against */
region: string;
/** Name of service to sign a request for */
service?: string;
/**
* Date and time to use during the signing process. If not provided then
* the current time in UTC is used. Naive dates (lacking timezone info)
* are assumed to be in local time
*/
date?: Date;
/**
* Headers to skip when signing.
*
* Skipping auth-required headers will result in an unusable signature.
* Headers injected by the signing process are not skippable.
* This function does not override the internal check function
* (x-amzn-trace-id, user-agent), but rather supplements it.
* In particular, a header will get signed if and only if it returns
* true to both the internal check (skips x-amzn-trace-id, user-agent)
* and is found in this list (if defined)
*/
header_blacklist?: string[];
/**
* Set true to double-encode the resource path when constructing the
* canonical request. By default, all services except S3 use double encoding.
*/
use_double_uri_encode?: boolean;
/**
* Whether the resource paths are normalized when building the canonical request.
*/
should_normalize_uri_path?: boolean;
/**
* Should the session token be omitted from the signing process? This should only be
* true when making a websocket handshake with IoT Core.
*/
omit_session_token?: boolean;
/**
* Value to use as the canonical request's body value.
*
* Typically, this is the SHA-256 of the payload, written as lowercase hex.
* If this has been precalculated, it can be set here.
* Special values used by certain services can also be set (see {@link AwsSignedBodyValue}).
* If undefined (the default), the typical value will be calculated from the payload during signing.
*/
signed_body_value?: string;
/** Controls what header, if any, should be added to the request, containing the body value */
signed_body_header?: AwsSignedBodyHeaderType;
/** Query param signing only: how long the pre-signed URL is valid for */
expiration_in_seconds?: number;
}
/** @internal */

@@ -435,0 +382,0 @@ export function aws_sign_request(

"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -4,0 +4,0 @@ * SPDX-License-Identifier: Apache-2.0.

@@ -1,5 +0,1 @@

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
import { Hashable } from "../common/crypto";

@@ -12,3 +8,2 @@ /**

*
* @module aws-crt
* @category Crypto

@@ -18,10 +13,9 @@ */

/**
* Computes an crc32 checksum.
* Computes a crc32c checksum.
*
* @param data The data to checksum
* @param previous previous crc32 checksum result. Used if you are buffering large input.
* @param previous previous crc32c checksum result. Used if you are buffering large input.
*
* @module aws-crt
* @category Crypto
*/
export declare function crc32c(data: Hashable, previous?: number): number;
"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -11,2 +11,6 @@ * SPDX-License-Identifier: Apache-2.0.

exports.crc32c = exports.crc32 = void 0;
/**
* @packageDocumentation
* @module crypto
*/
const binding_1 = __importDefault(require("./binding"));

@@ -19,3 +23,2 @@ /**

*
* @module aws-crt
* @category Crypto

@@ -28,8 +31,7 @@ */

/**
* Computes an crc32 checksum.
* Computes a crc32c checksum.
*
* @param data The data to checksum
* @param previous previous crc32 checksum result. Used if you are buffering large input.
* @param previous previous crc32c checksum result. Used if you are buffering large input.
*
* @module aws-crt
* @category Crypto

@@ -36,0 +38,0 @@ */

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
/**
* If the ```AWS_CRT_MEMORY_TRACING``` is environment variable is set to 1 or 2,

@@ -10,3 +6,2 @@ * will return the native memory usage in bytes. Otherwise, returns 0.

*
* @module aws-crt
* @category System

@@ -20,5 +15,4 @@ */

*
* @module aws-crt
* @category System
*/
export declare function native_memory_dump(): void;
"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -12,2 +12,6 @@ * SPDX-License-Identifier: Apache-2.0.

/**
* @packageDocumentation
* @module crt
*/
/**
* Memory reporting is controlled by the AWS_CRT_MEMORY_TRACING environment

@@ -20,3 +24,2 @@ * variable. Possible values are:

* stack unwinding/backtrace API.
* @module aws-crt
* @category System

@@ -30,3 +33,2 @@ */

*
* @module aws-crt
* @category System

@@ -43,3 +45,2 @@ */

*
* @module aws-crt
* @category System

@@ -46,0 +47,0 @@ */

@@ -1,5 +0,1 @@

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
import { NativeResource } from "./native_resource";

@@ -14,8 +10,8 @@ import { Hashable } from "../common/crypto";

/**
* Digest additional data.
* @param data Additional data to digest
* Hash additional data.
* @param data Additional data to hash
*/
update(data: Hashable): void;
/**
* Completes the hash computation and returns the final digest.
* Completes the hash computation and returns the final hash digest.
*

@@ -30,3 +26,2 @@ * @param truncate_to The maximum number of bytes to receive. Leave as undefined or 0 to receive the entire digest.

*
* @module aws-crt
* @category Crypto

@@ -44,3 +39,2 @@ */

*
* @module aws-crt
* @category Crypto

@@ -52,3 +46,2 @@ */

*
* @module aws-crt
* @category Crypto

@@ -66,3 +59,2 @@ */

*
* @module aws-crt
* @category Crypto

@@ -74,3 +66,2 @@ */

*
* @module aws-crt
* @category Crypto

@@ -88,3 +79,2 @@ */

*
* @module aws-crt
* @category Crypto

@@ -96,3 +86,2 @@ */

*
* @module aws-crt
* @category Crypto

@@ -102,7 +91,9 @@ */

/**
* Digest additional data.
* Hash additional data.
*
* @param data additional data to hash
*/
update(data: Hashable): void;
/**
* Completes the hash computation and returns the final digest.
* Completes the hash computation and returns the final hmac digest.
*

@@ -117,3 +108,2 @@ * @param truncate_to The maximum number of bytes to receive. Leave as undefined or 0 to receive the entire digest.

*
* @module aws-crt
* @category Crypto

@@ -132,3 +122,2 @@ */

*
* @module aws-crt
* @category Crypto

@@ -135,0 +124,0 @@ */

"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -11,2 +11,6 @@ * SPDX-License-Identifier: Apache-2.0.

exports.hmac_sha256 = exports.Sha256Hmac = exports.hash_sha1 = exports.Sha1Hash = exports.hash_sha256 = exports.Sha256Hash = exports.hash_md5 = exports.Md5Hash = void 0;
/**
* @packageDocumentation
* @module crypto
*/
const binding_1 = __importDefault(require("./binding"));

@@ -21,4 +25,4 @@ const native_resource_1 = require("./native_resource");

/**
* Digest additional data.
* @param data Additional data to digest
* Hash additional data.
* @param data Additional data to hash
*/

@@ -29,3 +33,3 @@ update(data) {

/**
* Completes the hash computation and returns the final digest.
* Completes the hash computation and returns the final hash digest.
*

@@ -44,3 +48,2 @@ * @param truncate_to The maximum number of bytes to receive. Leave as undefined or 0 to receive the entire digest.

*
* @module aws-crt
* @category Crypto

@@ -61,3 +64,2 @@ */

*
* @module aws-crt
* @category Crypto

@@ -72,3 +74,2 @@ */

*
* @module aws-crt
* @category Crypto

@@ -89,3 +90,2 @@ */

*
* @module aws-crt
* @category Crypto

@@ -100,3 +100,2 @@ */

*
* @module aws-crt
* @category Crypto

@@ -117,3 +116,2 @@ */

*
* @module aws-crt
* @category Crypto

@@ -128,3 +126,2 @@ */

*
* @module aws-crt
* @category Crypto

@@ -134,3 +131,5 @@ */

/**
* Digest additional data.
* Hash additional data.
*
* @param data additional data to hash
*/

@@ -141,3 +140,3 @@ update(data) {

/**
* Completes the hash computation and returns the final digest.
* Completes the hash computation and returns the final hmac digest.
*

@@ -156,3 +155,2 @@ * @param truncate_to The maximum number of bytes to receive. Leave as undefined or 0 to receive the entire digest.

*
* @module aws-crt
* @category Crypto

@@ -174,3 +172,2 @@ */

*
* @module aws-crt
* @category Crypto

@@ -177,0 +174,0 @@ */

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
/**
* Represents an error encountered in native code. Can also be used to convert a numeric error code into
* a human-readable string.
*
* @module aws-crt
* @category System

@@ -11,0 +6,0 @@ */

"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -11,2 +11,6 @@ * SPDX-License-Identifier: Apache-2.0.

exports.CrtError = void 0;
/**
* @packageDocumentation
* @module crt
*/
const binding_1 = __importDefault(require("./binding"));

@@ -18,3 +22,2 @@ const util_1 = require("util");

*
* @module aws-crt
* @category System

@@ -21,0 +24,0 @@ */

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
* @packageDocumentation
* @module http
*/

@@ -9,13 +9,23 @@ import crt_native from './binding';

import { ClientBootstrap, SocketOptions, TlsConnectionOptions, InputStream } from './io';
import { HttpProxyAuthenticationType, HttpProxyOptions as CommonHttpProxyOptions } from '../common/http';
export { HttpHeader, HttpProxyAuthenticationType } from '../common/http';
import { CommonHttpProxyOptions, HttpProxyAuthenticationType, HttpClientConnectionConnected, HttpClientConnectionError, HttpClientConnectionClosed, HttpStreamComplete, HttpStreamData, HttpStreamError } from '../common/http';
/** @internal */
export { HttpHeader } from '../common/http';
/** @internal */
export { HttpProxyAuthenticationType } from '../common/http';
import { BufferedEventEmitter } from '../common/event';
/** @category HTTP */
/**
* @category HTTP
*/
export declare type HttpHeaders = crt_native.HttpHeaders;
/** @category HTTP */
/**
* @category HTTP
*/
export declare const HttpHeaders: typeof crt_native.HttpHeaders;
/** @category HTTP */
/** @internal */
declare type nativeHttpRequest = crt_native.HttpRequest;
/** @category HTTP */
/** @internal */
declare const nativeHttpRequest: typeof crt_native.HttpRequest;
/**
* @category HTTP
*/
export declare class HttpRequest extends nativeHttpRequest {

@@ -34,3 +44,2 @@ constructor(method: string, path: string, headers?: HttpHeaders, body?: InputStream);

*
* @module aws-crt
* @category HTTP

@@ -46,8 +55,29 @@ */

close(): void;
/** Emitted when the connection is connected and ready to start streams */
on(event: 'connect', listener: () => void): this;
/** Emitted when an error occurs on the connection */
on(event: 'error', listener: (error: Error) => void): this;
/** Emitted when the connection has completed */
on(event: 'close', listener: () => void): this;
/**
* Emitted when the connection is connected and ready to start streams
*
* @param event type of event (connect)
* @param listener event listener to use
*
* @event
*/
on(event: 'connect', listener: HttpClientConnectionConnected): this;
/**
* Emitted when an error occurs on the connection
*
* @param event type of event (error)
* @param listener event listener to use
*
* @event
*/
on(event: 'error', listener: HttpClientConnectionError): this;
/**
* Emitted when the connection has completed
*
* @param event type of event (close)
* @param listener event listener to use
*
* @event
*/
on(event: 'close', listener: HttpClientConnectionClosed): this;
}

@@ -57,7 +87,6 @@ /**

*
* The original behavior was to make a tunneling connection if tls was used, and a forwarding connection if it was not.
* The original behavior was to make a tunneling connection if TLS was used, and a forwarding connection if it was not.
* There are legitimate use cases for plaintext tunneling connections, and so the implicit behavior has now
* been replaced by this setting, with a default that maps to the old behavior.
*
* @module aws-crt
* @category HTTP

@@ -83,3 +112,2 @@ */

*
* @module aws-crt
* @category HTTP

@@ -110,3 +138,2 @@ */

*
* @module aws-crt
* @category HTTP

@@ -155,3 +182,2 @@ */

*
* @module aws-crt
* @category HTTP

@@ -181,2 +207,21 @@ */

/**
* Listener signature for event emitted from an {@link HttpClientStream} when inline headers are delivered while communicating over H2
*
* @param headers the set of headers
*
* @asMemberOf HttpClientStream
* @category HTTP
*/
export declare type HttpStreamHeaders = (headers: HttpHeaders) => void;
/**
* Listener signature for event emitted from an {@link HttpClientStream} when the http response headers have arrived.
*
* @param status_code http response status code
* @param headers the response's set of headers
*
* @asMemberOf HttpClientStream
* @category HTTP
*/
export declare type HttpStreamResponse = (status_code: number, headers: HttpHeaders) => void;
/**
* Stream that sends a request and receives a response.

@@ -189,3 +234,2 @@ *

*
* @module aws-crt
* @category HTTP

@@ -203,25 +247,46 @@ */

/**
* Emitted when the header block arrives from the server.
* HTTP/1.1 - After all leading headers have been delivered
* H2 - After the initial header block has been delivered
* Emitted when the http response headers have arrived.
*
* @param event type of event (response)
* @param listener event listener to use
*
* @event
*/
on(event: 'response', listener: (status_code: number, headers: HttpHeaders) => void): this;
on(event: 'response', listener: HttpStreamResponse): this;
/**
* Emitted when inline headers are delivered while communicating over H2
* @param status_code - The HTTP status code returned from the server
* @param headers - The full set of headers returned from the server in the header block
*/
on(event: 'headers', listener: (headers: HttpHeaders) => void): this;
* Emitted when http response data is available.
*
* @param event type of event (data)
* @param listener event listener to use
*
* @event
*/
on(event: 'data', listener: HttpStreamData): this;
/**
* Emitted when a body chunk arrives from the server
* @param body_data - The chunk of body data
* Emitted when an error occurs in stream processing
*
* @param event type of event (error)
* @param listener event listener to use
*
* @event
*/
on(event: 'data', listener: (body_data: ArrayBuffer) => void): this;
on(event: 'error', listener: HttpStreamError): this;
/**
* Emitted when an error occurs
* @param error - A CrtError containing the error that occurred
* Emitted when the stream has completed
*
* @param event type of event (end)
* @param listener event listener to use
*
* @event
*/
on(event: 'error', listener: (error: Error) => void): this;
/** Emitted when stream has completed successfully. */
on(event: 'end', listener: () => void): this;
on(event: 'end', listener: HttpStreamComplete): this;
/**
* Emitted when inline headers are delivered while communicating over H2
*
* @param event type of event (headers)
* @param listener event listener to use
*
* @event
*/
on(event: 'headers', listener: HttpStreamHeaders): this;
/** @internal */

@@ -233,3 +298,2 @@ _on_response(status_code: Number, header_array: [string, string][]): void;

*
* @module aws-crt
* @category HTTP

@@ -236,0 +300,0 @@ */

"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -11,2 +11,6 @@ * SPDX-License-Identifier: Apache-2.0.

exports.HttpClientConnectionManager = exports.HttpClientStream = exports.HttpStream = exports.HttpClientConnection = exports.HttpProxyOptions = exports.HttpProxyConnectionType = exports.HttpConnection = exports.HttpRequest = exports.HttpHeaders = void 0;
/**
* @packageDocumentation
* @module http
*/
const binding_1 = __importDefault(require("./binding"));

@@ -16,9 +20,15 @@ const native_resource_1 = require("./native_resource");

const http_1 = require("../common/http");
/** @internal */
var http_2 = require("../common/http");
Object.defineProperty(exports, "HttpProxyAuthenticationType", { enumerable: true, get: function () { return http_2.HttpProxyAuthenticationType; } });
const event_1 = require("../common/event");
/** @category HTTP */
/**
* @category HTTP
*/
exports.HttpHeaders = binding_1.default.HttpHeaders;
/** @category HTTP */
/** @internal */
const nativeHttpRequest = binding_1.default.HttpRequest;
/**
* @category HTTP
*/
class HttpRequest extends nativeHttpRequest {

@@ -33,3 +43,2 @@ constructor(method, path, headers, body) {

*
* @module aws-crt
* @category HTTP

@@ -50,3 +59,2 @@ */

}
/** @internal */
// Overridden to allow uncorking on ready

@@ -67,7 +75,6 @@ on(event, listener) {

*
* The original behavior was to make a tunneling connection if tls was used, and a forwarding connection if it was not.
* The original behavior was to make a tunneling connection if TLS was used, and a forwarding connection if it was not.
* There are legitimate use cases for plaintext tunneling connections, and so the implicit behavior has now
* been replaced by this setting, with a default that maps to the old behavior.
*
* @module aws-crt
* @category HTTP

@@ -95,6 +102,5 @@ */

*
* @module aws-crt
* @category HTTP
*/
class HttpProxyOptions extends http_1.HttpProxyOptions {
class HttpProxyOptions extends http_1.CommonHttpProxyOptions {
/**

@@ -127,3 +133,2 @@ *

*
* @module aws-crt
* @category HTTP

@@ -199,3 +204,2 @@ */

*
* @module aws-crt
* @category HTTP

@@ -254,3 +258,2 @@ */

*
* @module aws-crt
* @category HTTP

@@ -270,3 +273,2 @@ */

}
/** @internal */
// Overridden to allow uncorking on ready and response

@@ -293,3 +295,2 @@ on(event, listener) {

*
* @module aws-crt
* @category HTTP

@@ -296,0 +297,0 @@ */

@@ -1,5 +0,1 @@

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
/// <reference types="node" />

@@ -14,5 +10,8 @@ import { NativeResource } from "./native_resource";

* via callback.
* @returns Long-form description of the error
* @see CrtError
*
* nodejs only.
*
* @category System
*/

@@ -24,5 +23,8 @@ export declare function error_code_to_string(error_code: number): string;

* via callback.
* @return error name as a string
* @see CrtError
*
* nodejs only.
*
* @category System
*/

@@ -32,3 +34,2 @@ export declare function error_code_to_name(error_code: number): string;

* The amount of detail that will be logged
* @module aws-crt
* @category Logging

@@ -57,3 +58,2 @@ */

* nodejs only.
* @module aws-crt
* @category Logging

@@ -67,3 +67,2 @@ */

* nodejs only.
* @module aws-crt
* @category TLS

@@ -77,4 +76,3 @@ */

* nodejs only.
* @module aws-crt
* @category I/O
* @category IO
*/

@@ -91,4 +89,3 @@ export declare class InputStream extends NativeResource {

* nodejs only.
* @module aws-crt
* @category I/O
* @category IO
*/

@@ -102,4 +99,3 @@ export declare class ClientBootstrap extends NativeResource {

* nodejs only.
* @module aws-crt
* @category I/O
* @category Network
*/

@@ -113,3 +109,2 @@ export declare class SocketOptions extends NativeResource {

* nodejs only.
* @module aws-crt
* @category TLS

@@ -165,2 +160,4 @@ */

* @param private_key - Client private key, in PEM format
*
* @returns newly configured TlsContextOptions object
*/

@@ -172,2 +169,4 @@ static create_client_with_mtls(certificate: string, private_key: string): TlsContextOptions;

* @param private_key_filepath - Path to private key, in PEM format
*
* @returns newly configured TlsContextOptions object
*/

@@ -179,2 +178,4 @@ static create_client_with_mtls_from_path(certificate_filepath: string, private_key_filepath: string): TlsContextOptions;

* @param pkcs12_password - PKCS#12 password
*
* @returns newly configured TlsContextOptions object
*/

@@ -187,2 +188,3 @@ static create_client_with_mtls_pkcs_from_path(pkcs12_filepath: string, pkcs12_password: string): TlsContextOptions;

*
* @returns newly configured TlsContextOptions object
*/

@@ -196,2 +198,3 @@ static create_server_with_mtls_from_path(certificate_filepath: string, private_key_filepath: string): TlsContextOptions;

*
* @returns newly configured TlsContextOptions object
*/

@@ -201,3 +204,3 @@ static create_server_with_mtls_pkcs_from_path(pkcs12_filepath: string, pkcs12_password: string): TlsContextOptions;

/**
* TLS context used for client/server TLS communications over sockets.
* Abstract base TLS context used for client/server TLS communications over sockets.
*

@@ -208,3 +211,2 @@ * @see ClientTlsContext

* nodejs only.
* @module aws-crt
* @category TLS

@@ -221,3 +223,2 @@ */

* nodejs only.
* @module aws-crt
* @category TLS

@@ -234,3 +235,2 @@ */

* nodejs only.
* @module aws-crt
* @category TLS

@@ -245,3 +245,2 @@ */

* nodejs only.
* @module aws-crt
* @category TLS

@@ -248,0 +247,0 @@ */

"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -11,2 +11,7 @@ * SPDX-License-Identifier: Apache-2.0.

exports.TlsConnectionOptions = exports.ServerTlsContext = exports.ClientTlsContext = exports.TlsContext = exports.TlsContextOptions = exports.SocketOptions = exports.ClientBootstrap = exports.InputStream = exports.is_alpn_available = exports.enable_logging = exports.LogLevel = exports.error_code_to_name = exports.error_code_to_string = void 0;
/**
*
* @packageDocumentation
* @module IO
*/
const binding_1 = __importDefault(require("./binding"));

@@ -23,5 +28,8 @@ const native_resource_1 = require("./native_resource");

* via callback.
* @returns Long-form description of the error
* @see CrtError
*
* nodejs only.
*
* @category System
*/

@@ -36,5 +44,8 @@ function error_code_to_string(error_code) {

* via callback.
* @return error name as a string
* @see CrtError
*
* nodejs only.
*
* @category System
*/

@@ -47,3 +58,2 @@ function error_code_to_name(error_code) {

* The amount of detail that will be logged
* @module aws-crt
* @category Logging

@@ -73,3 +83,2 @@ */

* nodejs only.
* @module aws-crt
* @category Logging

@@ -86,3 +95,2 @@ */

* nodejs only.
* @module aws-crt
* @category TLS

@@ -99,4 +107,3 @@ */

* nodejs only.
* @module aws-crt
* @category I/O
* @category IO
*/

@@ -123,4 +130,3 @@ class InputStream extends native_resource_1.NativeResource {

* nodejs only.
* @module aws-crt
* @category I/O
* @category IO
*/

@@ -137,4 +143,3 @@ class ClientBootstrap extends native_resource_1.NativeResource {

* nodejs only.
* @module aws-crt
* @category I/O
* @category Network
*/

@@ -151,3 +156,2 @@ class SocketOptions extends native_resource_1.NativeResource {

* nodejs only.
* @module aws-crt
* @category TLS

@@ -192,2 +196,4 @@ */

* @param private_key - Client private key, in PEM format
*
* @returns newly configured TlsContextOptions object
*/

@@ -205,2 +211,4 @@ static create_client_with_mtls(certificate, private_key) {

* @param private_key_filepath - Path to private key, in PEM format
*
* @returns newly configured TlsContextOptions object
*/

@@ -218,2 +226,4 @@ static create_client_with_mtls_from_path(certificate_filepath, private_key_filepath) {

* @param pkcs12_password - PKCS#12 password
*
* @returns newly configured TlsContextOptions object
*/

@@ -232,2 +242,3 @@ static create_client_with_mtls_pkcs_from_path(pkcs12_filepath, pkcs12_password) {

*
* @returns newly configured TlsContextOptions object
*/

@@ -247,2 +258,3 @@ static create_server_with_mtls_from_path(certificate_filepath, private_key_filepath) {

*
* @returns newly configured TlsContextOptions object
*/

@@ -259,3 +271,3 @@ static create_server_with_mtls_pkcs_from_path(pkcs12_filepath, pkcs12_password) {

/**
* TLS context used for client/server TLS communications over sockets.
* Abstract base TLS context used for client/server TLS communications over sockets.
*

@@ -266,3 +278,2 @@ * @see ClientTlsContext

* nodejs only.
* @module aws-crt
* @category TLS

@@ -282,3 +293,2 @@ */

* nodejs only.
* @module aws-crt
* @category TLS

@@ -302,3 +312,2 @@ */

* nodejs only.
* @module aws-crt
* @category TLS

@@ -320,3 +329,2 @@ */

* nodejs only.
* @module aws-crt
* @category TLS

@@ -323,0 +331,0 @@ */

@@ -1,13 +0,7 @@

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
import { NativeResource } from "./native_resource";
import { BufferedEventEmitter } from '../common/event';
import { CrtError } from './error';
import * as io from "./io";
import { HttpProxyOptions, HttpRequest } from './http';
export { HttpProxyOptions } from './http';
import { QoS, Payload, MqttRequest, MqttSubscribeRequest, MqttWill, OnMessageCallback } from "../common/mqtt";
/** @category MQTT */
import { QoS, Payload, MqttRequest, MqttSubscribeRequest, MqttWill, OnMessageCallback, MqttConnectionConnected, MqttConnectionDisconnected, MqttConnectionError, MqttConnectionInterrupted, MqttConnectionResumed } from "../common/mqtt";
export { QoS, Payload, MqttRequest, MqttSubscribeRequest, MqttWill, OnMessageCallback } from "../common/mqtt";

@@ -17,3 +11,2 @@ /**

*
* @module aws-crt
* @category MQTT

@@ -30,3 +23,3 @@ */

* Creates a new {@link MqttClientConnection}
* @param config Configuration for the connection
* @param config Configuration for the mqtt connection
* @returns A new connection

@@ -39,3 +32,2 @@ */

*
* @module aws-crt
* @category MQTT

@@ -72,3 +64,3 @@ */

* The server will assume the connection is lost if no PING is received after 1.5X this value.
* This duration must be longer than {@link timeout}.
* This duration must be longer than {@link ping_timeout}.
*/

@@ -125,3 +117,2 @@ keep_alive?: number;

*
* @module aws-crt
* @category MQTT

@@ -139,22 +130,56 @@ */

private close;
/** Emitted when the connection is ready and is about to start sending response data */
on(event: 'connect', listener: (session_present: boolean) => void): this;
/** Emitted when connection has disconnected sucessfully. */
on(event: 'disconnect', listener: () => void): this;
/**
* Emitted when an error occurs
* @param error - A CrtError containing the error that occurred
* Emitted when the connection successfully establishes itself for the first time
*
* @param event the type of event (connect)
* @param listener the event listener to use
*
* @event
*/
on(event: 'error', listener: (error: CrtError) => void): this;
on(event: 'connect', listener: MqttConnectionConnected): this;
/**
* Emitted when the connection is dropped unexpectedly. The error will contain the error
* Emitted when connection has disconnected sucessfully.
*
* @param event the type of event (disconnect)
* @param listener the event listener to use
*
* @event
*/
on(event: 'disconnect', listener: MqttConnectionDisconnected): this;
/**
* Emitted when an error occurs. The error will contain the error
* code and message.
*
* @param event the type of event (error)
* @param listener the event listener to use
*
* @event
*/
on(event: 'interrupt', listener: (error: CrtError) => void): this;
on(event: 'error', listener: MqttConnectionError): this;
/**
* Emitted when the connection reconnects. Only triggers on connections after the initial one.
* Emitted when the connection is dropped unexpectedly. The error will contain the error
* code and message. The underlying mqtt implementation will attempt to reconnect.
*
* @param event the type of event (interrupt)
* @param listener the event listener to use
*
* @event
*/
on(event: 'resume', listener: (return_code: number, session_present: boolean) => void): this;
on(event: 'interrupt', listener: MqttConnectionInterrupted): this;
/**
* Emitted when the connection reconnects (after an interrupt). Only triggers on connections after the initial one.
*
* @param event the type of event (resume)
* @param listener the event listener to use
*
* @event
*/
on(event: 'resume', listener: MqttConnectionResumed): this;
/**
* Emitted when any MQTT publish message arrives.
*
* @param event the type of event (message)
* @param listener the event listener to use
*
* @event
*/

@@ -161,0 +186,0 @@ on(event: 'message', listener: OnMessageCallback): this;

"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -39,2 +39,6 @@ * SPDX-License-Identifier: Apache-2.0.

exports.MqttClientConnection = exports.MqttClient = void 0;
/**
* @packageDocumentation
* @module mqtt
*/
const binding_1 = __importDefault(require("./binding"));

@@ -47,3 +51,2 @@ const native_resource_1 = require("./native_resource");

Object.defineProperty(exports, "HttpProxyOptions", { enumerable: true, get: function () { return http_1.HttpProxyOptions; } });
/** @category MQTT */
var mqtt_1 = require("../common/mqtt");

@@ -55,3 +58,2 @@ Object.defineProperty(exports, "QoS", { enumerable: true, get: function () { return mqtt_1.QoS; } });

*
* @module aws-crt
* @category MQTT

@@ -70,3 +72,3 @@ */

* Creates a new {@link MqttClientConnection}
* @param config Configuration for the connection
* @param config Configuration for the mqtt connection
* @returns A new connection

@@ -102,3 +104,2 @@ */

*
* @module aws-crt
* @category MQTT

@@ -138,3 +139,2 @@ */

}
/** @internal */
// Overridden to allow uncorking on ready

@@ -141,0 +141,0 @@ on(event, listener) {

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
/**
* Represents an object allocated natively inside the AWS CRT.

@@ -12,2 +8,3 @@ * @internal

constructor(handle: any);
/** @internal */
native_handle(): any;

@@ -14,0 +11,0 @@ }

"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -16,2 +16,3 @@ * SPDX-License-Identifier: Apache-2.0.

}
/** @internal */
native_handle() {

@@ -18,0 +19,0 @@ return this.handle;

@@ -1,6 +0,2 @@

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
import { TextEncoder, TextDecoder } from 'util';
export { TextEncoder, TextDecoder, };
"use strict";
/**
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.

@@ -4,0 +4,0 @@ * SPDX-License-Identifier: Apache-2.0.

{
"name": "aws-crt",
"version": "1.10.1",
"version": "1.10.2",
"description": "NodeJS/browser bindings to the aws-c-* libraries",

@@ -26,3 +26,4 @@ "homepage": "https://github.com/awslabs/aws-crt-nodejs",

"devDependencies": {
"@convergencelabs/typedoc-plugin-custom-modules": "^0.4.0",
"typedoc-plugin-external-module-name": "^4.0.6",
"typedoc-plugin-remove-references": "^0.0.5",
"@types/crypto-js": "^3.1.43",

@@ -41,2 +42,3 @@ "@types/jest": "^27.0.1",

"typedoc": "^0.17.8",
"typedoc-plugin-as-member-of": "^1.0.2",
"typescript": "^3.9.9",

@@ -43,0 +45,0 @@ "uuid": "^8.3.2",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc