@niobium/api-transport-crypt
Advanced tools
Comparing version 0.2.6 to 0.2.7
18
index.js
/** @typedef {{our: string, their:string, salt: string}} CryptoOptions */ | ||
/** @typedef {{timeout?: number}} ApiTransportOptions */ | ||
/** @typedef {import('@niobium/events').Events} Events */ | ||
/** @typedef {import('@niobium/api-transport').ApiTransportClient} ApiTransportClient */ | ||
/** @typedef {import('@niobium/api-transport').ApiTransport} ApiTransport */ | ||
/** @typedef {import('@niobium/api-transport').ApiTransportProto} ApiTransportProto */ | ||
/** @typedef {import('@niobium/events').Events} Events */ | ||
const {ApiTransportServer, ApiTransportClient, ApiTransport, ApiTransportProto} = require('@niobium/api-transport'); | ||
const {ApiTransportServer, ApiTransportClient, ApiTransport, ApiTransportProto,} = require('@niobium/api-transport'); | ||
const {AesCrypt, ECDH_KeyDerivation, nTools} = require('@niobium/crypt'); | ||
@@ -38,3 +32,4 @@ const crypt = new AesCrypt(); | ||
* @param {ApiTransportOptions} options | ||
*/ | ||
* @return {ApiTransportServerCrypted&ApiTransportServer} | ||
* */ | ||
static createSecureInstance(io, cryptoOptions, options) { | ||
@@ -59,2 +54,5 @@ return new ApiTransportServerCrypted(io, cryptoOptions, options); | ||
/** | ||
* @class {ApiTransportClientCrypted&ApiTransportClient} | ||
*/ | ||
class ApiTransportClientCrypted extends ApiTransportClient { | ||
@@ -66,3 +64,3 @@ /** | ||
* @param {ApiTransportOptions} options | ||
* @return {ApiTransportClientCrypted&ApiTransportClient&Events} | ||
* @return {ApiTransportClientCrypted&ApiTransportClient} | ||
*/ | ||
@@ -78,2 +76,3 @@ static createSecureInstance(socket, cryptoOptions, options) { | ||
* @param {ApiTransportOptions} options | ||
* @return {ApiTransportClientCrypted&ApiTransportClient} | ||
*/ | ||
@@ -89,3 +88,2 @@ constructor(socket, cryptoOptions, options) { | ||
/** @type {{ApiTransportServerCrypted: ApiTransportServerCrypted & ApiTransportServer & ApiTransportProto & Events, crypt: AesCrypt, ApiTransportClientCrypted: ApiTransportClientCrypted & ApiTransportClient & ApiTransport & ApiTransportProto & Events}} */ | ||
module.exports = { | ||
@@ -92,0 +90,0 @@ ApiTransportServerCrypted, |
{ | ||
"name" : "@niobium/api-transport-crypt", | ||
"version" : "0.2.6", | ||
"version" : "0.2.7", | ||
"main" : "./index.js", | ||
"dependencies" : { | ||
"@niobium/api-transport": "^0.2.6", | ||
"@niobium/api-transport": "^0.2.7", | ||
"@niobium/crypt" : "^0.0.6", | ||
@@ -8,0 +8,0 @@ "@niobium/events" : "^0.2.0", |
3068
79