@mercuryworkshop/epoxy-tls
Advanced tools
Comparing version
@@ -7,3 +7,7 @@ /* tslint:disable */ | ||
write: WritableStream<Uint8Array>, | ||
} | ||
}; | ||
type EpoxyWispTransport = string | (() => { read: ReadableStream<ArrayBuffer>, write: WritableStream<Uint8Array> }); | ||
type EpoxyWebSocketInput = string | ArrayBuffer; | ||
type EpoxyWebSocketHeadersInput = Headers | { [key: string]: string }; | ||
type EpoxyUrlInput = string | URL; | ||
@@ -22,6 +26,6 @@ | ||
/** | ||
* @param {any} wisp_url | ||
* @param {EpoxyWispTransport} transport | ||
* @param {EpoxyClientOptions} options | ||
*/ | ||
constructor(wisp_url: any, options: EpoxyClientOptions); | ||
constructor(transport: EpoxyWispTransport, options: EpoxyClientOptions); | ||
/** | ||
@@ -33,29 +37,29 @@ * @returns {Promise<void>} | ||
* @param {EpoxyHandlers} handlers | ||
* @param {string} url | ||
* @param {EpoxyUrlInput} url | ||
* @param {(string)[]} protocols | ||
* @param {any} headers | ||
* @param {EpoxyWebSocketHeadersInput} headers | ||
* @returns {Promise<EpoxyWebSocket>} | ||
*/ | ||
connect_websocket(handlers: EpoxyHandlers, url: string, protocols: (string)[], headers: any): Promise<EpoxyWebSocket>; | ||
connect_websocket(handlers: EpoxyHandlers, url: EpoxyUrlInput, protocols: (string)[], headers: EpoxyWebSocketHeadersInput): Promise<EpoxyWebSocket>; | ||
/** | ||
* @param {string} url | ||
* @param {EpoxyUrlInput} url | ||
* @returns {Promise<EpoxyIoStream>} | ||
*/ | ||
connect_tcp(url: string): Promise<EpoxyIoStream>; | ||
connect_tcp(url: EpoxyUrlInput): Promise<EpoxyIoStream>; | ||
/** | ||
* @param {string} url | ||
* @param {EpoxyUrlInput} url | ||
* @returns {Promise<EpoxyIoStream>} | ||
*/ | ||
connect_tls(url: string): Promise<EpoxyIoStream>; | ||
connect_tls(url: EpoxyUrlInput): Promise<EpoxyIoStream>; | ||
/** | ||
* @param {string} url | ||
* @param {EpoxyUrlInput} url | ||
* @returns {Promise<EpoxyIoStream>} | ||
*/ | ||
connect_udp(url: string): Promise<EpoxyIoStream>; | ||
connect_udp(url: EpoxyUrlInput): Promise<EpoxyIoStream>; | ||
/** | ||
* @param {string} url | ||
* @param {EpoxyUrlInput} url | ||
* @param {object} options | ||
* @returns {Promise<Response>} | ||
*/ | ||
fetch(url: string, options: object): Promise<Response>; | ||
fetch(url: EpoxyUrlInput, options: object): Promise<Response>; | ||
buffer_size: number; | ||
@@ -95,6 +99,6 @@ redirect_limit: number; | ||
/** | ||
* @param {any} payload | ||
* @param {EpoxyWebSocketInput} payload | ||
* @returns {Promise<void>} | ||
*/ | ||
send(payload: any): Promise<void>; | ||
send(payload: EpoxyWebSocketInput): Promise<void>; | ||
/** | ||
@@ -101,0 +105,0 @@ * @param {number} code |
@@ -7,3 +7,7 @@ /* tslint:disable */ | ||
write: WritableStream<Uint8Array>, | ||
} | ||
}; | ||
type EpoxyWispTransport = string | (() => { read: ReadableStream<ArrayBuffer>, write: WritableStream<Uint8Array> }); | ||
type EpoxyWebSocketInput = string | ArrayBuffer; | ||
type EpoxyWebSocketHeadersInput = Headers | { [key: string]: string }; | ||
type EpoxyUrlInput = string | URL; | ||
@@ -22,6 +26,6 @@ | ||
/** | ||
* @param {any} wisp_url | ||
* @param {EpoxyWispTransport} transport | ||
* @param {EpoxyClientOptions} options | ||
*/ | ||
constructor(wisp_url: any, options: EpoxyClientOptions); | ||
constructor(transport: EpoxyWispTransport, options: EpoxyClientOptions); | ||
/** | ||
@@ -33,29 +37,29 @@ * @returns {Promise<void>} | ||
* @param {EpoxyHandlers} handlers | ||
* @param {string} url | ||
* @param {EpoxyUrlInput} url | ||
* @param {(string)[]} protocols | ||
* @param {any} headers | ||
* @param {EpoxyWebSocketHeadersInput} headers | ||
* @returns {Promise<EpoxyWebSocket>} | ||
*/ | ||
connect_websocket(handlers: EpoxyHandlers, url: string, protocols: (string)[], headers: any): Promise<EpoxyWebSocket>; | ||
connect_websocket(handlers: EpoxyHandlers, url: EpoxyUrlInput, protocols: (string)[], headers: EpoxyWebSocketHeadersInput): Promise<EpoxyWebSocket>; | ||
/** | ||
* @param {string} url | ||
* @param {EpoxyUrlInput} url | ||
* @returns {Promise<EpoxyIoStream>} | ||
*/ | ||
connect_tcp(url: string): Promise<EpoxyIoStream>; | ||
connect_tcp(url: EpoxyUrlInput): Promise<EpoxyIoStream>; | ||
/** | ||
* @param {string} url | ||
* @param {EpoxyUrlInput} url | ||
* @returns {Promise<EpoxyIoStream>} | ||
*/ | ||
connect_tls(url: string): Promise<EpoxyIoStream>; | ||
connect_tls(url: EpoxyUrlInput): Promise<EpoxyIoStream>; | ||
/** | ||
* @param {string} url | ||
* @param {EpoxyUrlInput} url | ||
* @returns {Promise<EpoxyIoStream>} | ||
*/ | ||
connect_udp(url: string): Promise<EpoxyIoStream>; | ||
connect_udp(url: EpoxyUrlInput): Promise<EpoxyIoStream>; | ||
/** | ||
* @param {string} url | ||
* @param {EpoxyUrlInput} url | ||
* @param {object} options | ||
* @returns {Promise<Response>} | ||
*/ | ||
fetch(url: string, options: object): Promise<Response>; | ||
fetch(url: EpoxyUrlInput, options: object): Promise<Response>; | ||
buffer_size: number; | ||
@@ -95,6 +99,6 @@ redirect_limit: number; | ||
/** | ||
* @param {any} payload | ||
* @param {EpoxyWebSocketInput} payload | ||
* @returns {Promise<void>} | ||
*/ | ||
send(payload: any): Promise<void>; | ||
send(payload: EpoxyWebSocketInput): Promise<void>; | ||
/** | ||
@@ -101,0 +105,0 @@ * @param {number} code |
@@ -1,2 +0,2 @@ | ||
import { object_get, object_set, convert_body_inner, entries_of_object_inner, define_property, ws_key, from_entries } from 'data:application/javascript;base64,CmV4cG9ydCBmdW5jdGlvbiBvYmplY3RfZ2V0KG9iaiwgaykgeyAKCXRyeSB7CgkJcmV0dXJuIG9ialtrXQoJfSBjYXRjaCh4KSB7CgkJcmV0dXJuIHVuZGVmaW5lZAoJfQp9OwpleHBvcnQgZnVuY3Rpb24gb2JqZWN0X3NldChvYmosIGssIHYpIHsKCXRyeSB7IG9ialtrXSA9IHYgfSBjYXRjaCB7fQp9OwoKZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGNvbnZlcnRfYm9keV9pbm5lcihib2R5KSB7CglsZXQgcmVxID0gbmV3IFJlcXVlc3QoIiIsIHsgbWV0aG9kOiAiUE9TVCIsIGR1cGxleDogImhhbGYiLCBib2R5IH0pOwoJbGV0IHR5cGUgPSByZXEuaGVhZGVycy5nZXQoImNvbnRlbnQtdHlwZSIpOwoJcmV0dXJuIFtuZXcgVWludDhBcnJheShhd2FpdCByZXEuYXJyYXlCdWZmZXIoKSksIHR5cGVdOwp9CgpleHBvcnQgZnVuY3Rpb24gZW50cmllc19vZl9vYmplY3RfaW5uZXIob2JqKSB7CglyZXR1cm4gT2JqZWN0LmVudHJpZXMob2JqKS5tYXAoeCA9PiB4Lm1hcChTdHJpbmcpKTsKfQoKZXhwb3J0IGZ1bmN0aW9uIGRlZmluZV9wcm9wZXJ0eShvYmosIGssIHYpIHsKCU9iamVjdC5kZWZpbmVQcm9wZXJ0eShvYmosIGssIHsgdmFsdWU6IHYsIHdyaXRhYmxlOiBmYWxzZSB9KTsKfQoKZXhwb3J0IGZ1bmN0aW9uIHdzX2tleSgpIHsKCWxldCBrZXkgPSBuZXcgVWludDhBcnJheSgxNik7CgljcnlwdG8uZ2V0UmFuZG9tVmFsdWVzKGtleSk7CglyZXR1cm4gYnRvYShBcnJheS5mcm9tKGtleSkubWFwKFN0cmluZy5mcm9tQ2hhckNvZGUpLmpvaW4oJycpKTsKfQoKZXhwb3J0IGZ1bmN0aW9uIGZyb21fZW50cmllcyhlbnRyaWVzKXsKICAgIHZhciByZXQgPSB7fTsKICAgIGZvcih2YXIgaSA9IDA7IGkgPCBlbnRyaWVzLmxlbmd0aDsgaSsrKSByZXRbZW50cmllc1tpXVswXV0gPSBlbnRyaWVzW2ldWzFdOwogICAgcmV0dXJuIHJldDsKfQo='; | ||
import { object_get, object_set, convert_body_inner, entries_of_object_inner, define_property, ws_key, from_entries } from 'data:application/javascript;base64,CmV4cG9ydCBmdW5jdGlvbiBvYmplY3RfZ2V0KG9iaiwgaykgeyAKCXRyeSB7CgkJcmV0dXJuIG9ialtrXQoJfSBjYXRjaCh4KSB7CgkJcmV0dXJuIHVuZGVmaW5lZAoJfQp9OwpleHBvcnQgZnVuY3Rpb24gb2JqZWN0X3NldChvYmosIGssIHYpIHsKCXRyeSB7IG9ialtrXSA9IHYgfSBjYXRjaCB7fQp9OwoKZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGNvbnZlcnRfYm9keV9pbm5lcihib2R5KSB7CglsZXQgcmVxID0gbmV3IFJlcXVlc3QoIiIsIHsgbWV0aG9kOiAiUE9TVCIsIGR1cGxleDogImhhbGYiLCBib2R5IH0pOwoJbGV0IHR5cGUgPSByZXEuaGVhZGVycy5nZXQoImNvbnRlbnQtdHlwZSIpOwoJcmV0dXJuIFtuZXcgVWludDhBcnJheShhd2FpdCByZXEuYXJyYXlCdWZmZXIoKSksIHR5cGVdOwp9CgpleHBvcnQgZnVuY3Rpb24gZW50cmllc19vZl9vYmplY3RfaW5uZXIob2JqKSB7CglyZXR1cm4gT2JqZWN0LmVudHJpZXMob2JqKS5tYXAoeCA9PiB4Lm1hcChTdHJpbmcpKTsKfQoKZXhwb3J0IGZ1bmN0aW9uIGRlZmluZV9wcm9wZXJ0eShvYmosIGssIHYpIHsKCU9iamVjdC5kZWZpbmVQcm9wZXJ0eShvYmosIGssIHsgdmFsdWU6IHYsIHdyaXRhYmxlOiBmYWxzZSB9KTsKfQoKZXhwb3J0IGZ1bmN0aW9uIHdzX2tleSgpIHsKCWxldCBrZXkgPSBuZXcgVWludDhBcnJheSgxNik7CgljcnlwdG8uZ2V0UmFuZG9tVmFsdWVzKGtleSk7CglyZXR1cm4gYnRvYShTdHJpbmcuZnJvbUNoYXJDb2RlLmFwcGx5KG51bGwsIGtleSkpOwp9CgpleHBvcnQgZnVuY3Rpb24gZnJvbV9lbnRyaWVzKGVudHJpZXMpewogICAgdmFyIHJldCA9IHt9OwogICAgZm9yKHZhciBpID0gMDsgaSA8IGVudHJpZXMubGVuZ3RoOyBpKyspIHJldFtlbnRyaWVzW2ldWzBdXSA9IGVudHJpZXNbaV1bMV07CiAgICByZXR1cm4gcmV0Owp9Cg=='; | ||
@@ -184,8 +184,8 @@ let wasm; | ||
} | ||
function __wbg_adapter_34(arg0, arg1) { | ||
wasm._dyn_core__ops__function__Fn_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h484fc966955fbceb(arg0, arg1); | ||
function __wbg_adapter_34(arg0, arg1, arg2) { | ||
wasm.closure17_externref_shim(arg0, arg1, arg2); | ||
} | ||
function __wbg_adapter_37(arg0, arg1, arg2) { | ||
wasm.closure21_externref_shim(arg0, arg1, arg2); | ||
function __wbg_adapter_37(arg0, arg1) { | ||
wasm._dyn_core__ops__function__Fn_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hd2c6946638856f14(arg0, arg1); | ||
} | ||
@@ -218,3 +218,3 @@ | ||
function __wbg_adapter_40(arg0, arg1, arg2) { | ||
wasm.closure200_externref_shim(arg0, arg1, arg2); | ||
wasm.closure201_externref_shim(arg0, arg1, arg2); | ||
} | ||
@@ -277,3 +277,3 @@ | ||
function __wbg_adapter_163(arg0, arg1, arg2, arg3) { | ||
wasm.closure138_externref_shim(arg0, arg1, arg2, arg3); | ||
wasm.closure139_externref_shim(arg0, arg1, arg2, arg3); | ||
} | ||
@@ -371,9 +371,9 @@ | ||
/** | ||
* @param {any} wisp_url | ||
* @param {EpoxyWispTransport} transport | ||
* @param {EpoxyClientOptions} options | ||
*/ | ||
constructor(wisp_url, options) { | ||
constructor(transport, options) { | ||
_assertClass(options, EpoxyClientOptions); | ||
var ptr0 = options.__destroy_into_raw(); | ||
const ret = wasm.epoxyclient_new(wisp_url, ptr0); | ||
const ret = wasm.epoxyclient_new(transport, ptr0); | ||
if (ret[2]) { | ||
@@ -395,5 +395,5 @@ throw takeFromExternrefTable0(ret[1]); | ||
* @param {EpoxyHandlers} handlers | ||
* @param {string} url | ||
* @param {EpoxyUrlInput} url | ||
* @param {(string)[]} protocols | ||
* @param {any} headers | ||
* @param {EpoxyWebSocketHeadersInput} headers | ||
* @returns {Promise<EpoxyWebSocket>} | ||
@@ -404,41 +404,33 @@ */ | ||
var ptr0 = handlers.__destroy_into_raw(); | ||
const ptr1 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const ptr1 = passArrayJsValueToWasm0(protocols, wasm.__wbindgen_malloc); | ||
const len1 = WASM_VECTOR_LEN; | ||
const ptr2 = passArrayJsValueToWasm0(protocols, wasm.__wbindgen_malloc); | ||
const len2 = WASM_VECTOR_LEN; | ||
const ret = wasm.epoxyclient_connect_websocket(this.__wbg_ptr, ptr0, ptr1, len1, ptr2, len2, headers); | ||
const ret = wasm.epoxyclient_connect_websocket(this.__wbg_ptr, ptr0, url, ptr1, len1, headers); | ||
return ret; | ||
} | ||
/** | ||
* @param {string} url | ||
* @param {EpoxyUrlInput} url | ||
* @returns {Promise<EpoxyIoStream>} | ||
*/ | ||
connect_tcp(url) { | ||
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ret = wasm.epoxyclient_connect_tcp(this.__wbg_ptr, ptr0, len0); | ||
const ret = wasm.epoxyclient_connect_tcp(this.__wbg_ptr, url); | ||
return ret; | ||
} | ||
/** | ||
* @param {string} url | ||
* @param {EpoxyUrlInput} url | ||
* @returns {Promise<EpoxyIoStream>} | ||
*/ | ||
connect_tls(url) { | ||
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ret = wasm.epoxyclient_connect_tls(this.__wbg_ptr, ptr0, len0); | ||
const ret = wasm.epoxyclient_connect_tls(this.__wbg_ptr, url); | ||
return ret; | ||
} | ||
/** | ||
* @param {string} url | ||
* @param {EpoxyUrlInput} url | ||
* @returns {Promise<EpoxyIoStream>} | ||
*/ | ||
connect_udp(url) { | ||
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ret = wasm.epoxyclient_connect_udp(this.__wbg_ptr, ptr0, len0); | ||
const ret = wasm.epoxyclient_connect_udp(this.__wbg_ptr, url); | ||
return ret; | ||
} | ||
/** | ||
* @param {string} url | ||
* @param {EpoxyUrlInput} url | ||
* @param {object} options | ||
@@ -448,5 +440,3 @@ * @returns {Promise<Response>} | ||
fetch(url, options) { | ||
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ret = wasm.epoxyclient_fetch(this.__wbg_ptr, ptr0, len0, options); | ||
const ret = wasm.epoxyclient_fetch(this.__wbg_ptr, url, options); | ||
return ret; | ||
@@ -725,3 +715,3 @@ } | ||
/** | ||
* @param {any} payload | ||
* @param {EpoxyWebSocketInput} payload | ||
* @returns {Promise<void>} | ||
@@ -944,3 +934,3 @@ */ | ||
}; | ||
imports.wbg.__wbg_objectget_40ed2c8179ab51e7 = function(arg0, arg1, arg2) { | ||
imports.wbg.__wbg_objectget_28380229ca51cdae = function(arg0, arg1, arg2) { | ||
const ret = object_get(arg0, getStringFromWasm0(arg1, arg2)); | ||
@@ -957,12 +947,2 @@ return ret; | ||
}, arguments) }; | ||
imports.wbg.__wbg_instanceof_ArrayBuffer_74945570b4a62ec7 = function(arg0) { | ||
let result; | ||
try { | ||
result = arg0 instanceof ArrayBuffer; | ||
} catch (_) { | ||
result = false; | ||
} | ||
const ret = result; | ||
return ret; | ||
}; | ||
imports.wbg.__wbindgen_string_get = function(arg0, arg1) { | ||
@@ -984,2 +964,13 @@ const obj = arg1; | ||
}; | ||
imports.wbg.__wbg_wskey_f20549b262efb024 = function(arg0) { | ||
const ret = ws_key(); | ||
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len1 = WASM_VECTOR_LEN; | ||
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); | ||
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); | ||
}; | ||
imports.wbg.__wbg_epoxywebsocket_new = function(arg0) { | ||
const ret = EpoxyWebSocket.__wrap(arg0); | ||
return ret; | ||
}; | ||
imports.wbg.__wbg_new_034f913e7636e987 = function() { | ||
@@ -1014,3 +1005,3 @@ const ret = new Array(); | ||
}, arguments) }; | ||
imports.wbg.__wbg_defineproperty_7e82f31084e57cb8 = function(arg0, arg1, arg2, arg3) { | ||
imports.wbg.__wbg_defineproperty_516cc13b9a77a372 = function(arg0, arg1, arg2, arg3) { | ||
define_property(arg0, getStringFromWasm0(arg1, arg2), arg3); | ||
@@ -1022,3 +1013,3 @@ }; | ||
}; | ||
imports.wbg.__wbg_objectset_49227fb5127dfbeb = function(arg0, arg1, arg2, arg3) { | ||
imports.wbg.__wbg_objectset_89a54adf3c7abcce = function(arg0, arg1, arg2, arg3) { | ||
object_set(arg0, getStringFromWasm0(arg1, arg2), arg3); | ||
@@ -1030,13 +1021,2 @@ }; | ||
}; | ||
imports.wbg.__wbg_wskey_6b1ba9d565805fa7 = function(arg0) { | ||
const ret = ws_key(); | ||
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len1 = WASM_VECTOR_LEN; | ||
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); | ||
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); | ||
}; | ||
imports.wbg.__wbg_epoxywebsocket_new = function(arg0) { | ||
const ret = EpoxyWebSocket.__wrap(arg0); | ||
return ret; | ||
}; | ||
imports.wbg.__wbindgen_cb_drop = function(arg0) { | ||
@@ -1064,2 +1044,19 @@ const obj = arg0.original; | ||
}; | ||
imports.wbg.__wbg_instanceof_Url_f00efbf8074b8fcf = function(arg0) { | ||
let result; | ||
try { | ||
result = arg0 instanceof URL; | ||
} catch (_) { | ||
result = false; | ||
} | ||
const ret = result; | ||
return ret; | ||
}; | ||
imports.wbg.__wbg_href_07ab8fba72e97d85 = function(arg0, arg1) { | ||
const ret = arg1.href; | ||
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len1 = WASM_VECTOR_LEN; | ||
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); | ||
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); | ||
}; | ||
imports.wbg.__wbg_new_fec2611eb9180f95 = function(arg0) { | ||
@@ -1077,6 +1074,6 @@ const ret = new Uint8Array(arg0); | ||
}, arguments) }; | ||
imports.wbg.__wbg_log_cfc7ca7e5c69a01e = function(arg0, arg1) { | ||
imports.wbg.__wbg_log_29cba8557a9b60d6 = function(arg0, arg1) { | ||
console.log(getStringFromWasm0(arg0, arg1)); | ||
}; | ||
imports.wbg.__wbg_convertbodyinner_2e966a2a0ebb9e93 = function() { return handleError(function (arg0) { | ||
imports.wbg.__wbg_convertbodyinner_fdfe53d2661edfab = function() { return handleError(function (arg0) { | ||
const ret = convert_body_inner(arg0); | ||
@@ -1089,3 +1086,3 @@ return ret; | ||
}; | ||
imports.wbg.__wbg_entriesofobjectinner_c8d3c67aef14492e = function(arg0, arg1) { | ||
imports.wbg.__wbg_entriesofobjectinner_ccc751ae34b94906 = function(arg0, arg1) { | ||
const ret = entries_of_object_inner(arg1); | ||
@@ -1139,3 +1136,3 @@ const ptr1 = passArrayJsValueToWasm0(ret, wasm.__wbindgen_malloc); | ||
}; | ||
imports.wbg.__wbg_fromentries_9e32d12e39a505b3 = function() { return handleError(function (arg0) { | ||
imports.wbg.__wbg_fromentries_568f4968056f873d = function() { return handleError(function (arg0) { | ||
const ret = from_entries(arg0); | ||
@@ -1165,2 +1162,6 @@ return ret; | ||
}, arguments) }; | ||
imports.wbg.__wbindgen_is_function = function(arg0) { | ||
const ret = typeof(arg0) === 'function'; | ||
return ret; | ||
}; | ||
imports.wbg.__wbg_newwithstrsequence_e105150b01b32f72 = function() { return handleError(function (arg0, arg1, arg2) { | ||
@@ -1248,6 +1249,2 @@ const ret = new WebSocket(getStringFromWasm0(arg0, arg1), arg2); | ||
}; | ||
imports.wbg.__wbindgen_is_function = function(arg0) { | ||
const ret = typeof(arg0) === 'function'; | ||
return ret; | ||
}; | ||
imports.wbg.__wbg_call_a9ef466721e824f2 = function() { return handleError(function (arg0, arg1) { | ||
@@ -1281,2 +1278,12 @@ const ret = arg0.call(arg1); | ||
}; | ||
imports.wbg.__wbg_instanceof_ArrayBuffer_74945570b4a62ec7 = function(arg0) { | ||
let result; | ||
try { | ||
result = arg0 instanceof ArrayBuffer; | ||
} catch (_) { | ||
result = false; | ||
} | ||
const ret = result; | ||
return ret; | ||
}; | ||
imports.wbg.__wbg_call_3bfa248576352471 = function() { return handleError(function (arg0, arg1, arg2) { | ||
@@ -1364,11 +1371,11 @@ const ret = arg0.call(arg1, arg2); | ||
}; | ||
imports.wbg.__wbg_setTimeout_fba1b48a90e30862 = function() { return handleError(function (arg0, arg1, arg2) { | ||
imports.wbg.__wbg_setTimeout_2cb6c793c4aa44f8 = function() { return handleError(function (arg0, arg1, arg2) { | ||
const ret = arg0.setTimeout(arg1, arg2); | ||
return ret; | ||
}, arguments) }; | ||
imports.wbg.__wbg_performance_1430613edb72ce03 = function(arg0) { | ||
imports.wbg.__wbg_performance_ffc4e815dfb3449f = function(arg0) { | ||
const ret = arg0.performance; | ||
return ret; | ||
}; | ||
imports.wbg.__wbg_now_eab901b1d3b8a295 = function(arg0) { | ||
imports.wbg.__wbg_now_8799be02ba81a22e = function(arg0) { | ||
const ret = arg0.now(); | ||
@@ -1404,12 +1411,12 @@ return ret; | ||
}; | ||
imports.wbg.__wbindgen_closure_wrapper1274 = function(arg0, arg1, arg2) { | ||
const ret = makeMutClosure(arg0, arg1, 113, __wbg_adapter_40); | ||
imports.wbg.__wbindgen_closure_wrapper1281 = function(arg0, arg1, arg2) { | ||
const ret = makeMutClosure(arg0, arg1, 114, __wbg_adapter_40); | ||
return ret; | ||
}; | ||
imports.wbg.__wbindgen_closure_wrapper1738 = function(arg0, arg1, arg2) { | ||
const ret = makeMutClosure(arg0, arg1, 113, __wbg_adapter_43); | ||
imports.wbg.__wbindgen_closure_wrapper1742 = function(arg0, arg1, arg2) { | ||
const ret = makeMutClosure(arg0, arg1, 114, __wbg_adapter_43); | ||
return ret; | ||
}; | ||
imports.wbg.__wbindgen_closure_wrapper4005 = function(arg0, arg1, arg2) { | ||
const ret = makeMutClosure(arg0, arg1, 113, __wbg_adapter_43); | ||
imports.wbg.__wbindgen_closure_wrapper4014 = function(arg0, arg1, arg2) { | ||
const ret = makeMutClosure(arg0, arg1, 114, __wbg_adapter_43); | ||
return ret; | ||
@@ -1500,2 +1507,2 @@ }; | ||
export default __wbg_init; | ||
export const info = { version: "2.1.9-1", minimal: 0===1, release: 1===1 }; | ||
export const info = { version: "2.1.10-1", minimal: 0===1, release: 1===1 }; |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
type EpoxyIoStream = { | ||
read: ReadableStream<Uint8Array>, | ||
write: WritableStream<Uint8Array>, | ||
}; | ||
type EpoxyWispTransport = string | (() => { read: ReadableStream<ArrayBuffer>, write: WritableStream<Uint8Array> }); | ||
type EpoxyWebSocketInput = string | ArrayBuffer; | ||
type EpoxyWebSocketHeadersInput = Headers | { [key: string]: string }; | ||
type EpoxyUrlInput = string | URL; | ||
export class EpoxyClient { | ||
@@ -14,6 +25,6 @@ /** | ||
/** | ||
* @param {any} wisp_url | ||
* @param {EpoxyWispTransport} transport | ||
* @param {EpoxyClientOptions} options | ||
*/ | ||
constructor(wisp_url: any, options: EpoxyClientOptions); | ||
constructor(transport: EpoxyWispTransport, options: EpoxyClientOptions); | ||
/** | ||
@@ -24,7 +35,7 @@ * @returns {Promise<void>} | ||
/** | ||
* @param {string} url | ||
* @param {EpoxyUrlInput} url | ||
* @param {object} options | ||
* @returns {Promise<Response>} | ||
*/ | ||
fetch(url: string, options: object): Promise<Response>; | ||
fetch(url: EpoxyUrlInput, options: object): Promise<Response>; | ||
buffer_size: number; | ||
@@ -31,0 +42,0 @@ redirect_limit: number; |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
type EpoxyIoStream = { | ||
read: ReadableStream<Uint8Array>, | ||
write: WritableStream<Uint8Array>, | ||
}; | ||
type EpoxyWispTransport = string | (() => { read: ReadableStream<ArrayBuffer>, write: WritableStream<Uint8Array> }); | ||
type EpoxyWebSocketInput = string | ArrayBuffer; | ||
type EpoxyWebSocketHeadersInput = Headers | { [key: string]: string }; | ||
type EpoxyUrlInput = string | URL; | ||
export class EpoxyClient { | ||
@@ -14,6 +25,6 @@ /** | ||
/** | ||
* @param {any} wisp_url | ||
* @param {EpoxyWispTransport} transport | ||
* @param {EpoxyClientOptions} options | ||
*/ | ||
constructor(wisp_url: any, options: EpoxyClientOptions); | ||
constructor(transport: EpoxyWispTransport, options: EpoxyClientOptions); | ||
/** | ||
@@ -24,7 +35,7 @@ * @returns {Promise<void>} | ||
/** | ||
* @param {string} url | ||
* @param {EpoxyUrlInput} url | ||
* @param {object} options | ||
* @returns {Promise<Response>} | ||
*/ | ||
fetch(url: string, options: object): Promise<Response>; | ||
fetch(url: EpoxyUrlInput, options: object): Promise<Response>; | ||
buffer_size: number; | ||
@@ -31,0 +42,0 @@ redirect_limit: number; |
@@ -1,2 +0,2 @@ | ||
import { object_get, object_set, convert_body_inner, entries_of_object_inner, define_property, from_entries } from 'data:application/javascript;base64,CmV4cG9ydCBmdW5jdGlvbiBvYmplY3RfZ2V0KG9iaiwgaykgeyAKCXRyeSB7CgkJcmV0dXJuIG9ialtrXQoJfSBjYXRjaCh4KSB7CgkJcmV0dXJuIHVuZGVmaW5lZAoJfQp9OwpleHBvcnQgZnVuY3Rpb24gb2JqZWN0X3NldChvYmosIGssIHYpIHsKCXRyeSB7IG9ialtrXSA9IHYgfSBjYXRjaCB7fQp9OwoKZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGNvbnZlcnRfYm9keV9pbm5lcihib2R5KSB7CglsZXQgcmVxID0gbmV3IFJlcXVlc3QoIiIsIHsgbWV0aG9kOiAiUE9TVCIsIGR1cGxleDogImhhbGYiLCBib2R5IH0pOwoJbGV0IHR5cGUgPSByZXEuaGVhZGVycy5nZXQoImNvbnRlbnQtdHlwZSIpOwoJcmV0dXJuIFtuZXcgVWludDhBcnJheShhd2FpdCByZXEuYXJyYXlCdWZmZXIoKSksIHR5cGVdOwp9CgpleHBvcnQgZnVuY3Rpb24gZW50cmllc19vZl9vYmplY3RfaW5uZXIob2JqKSB7CglyZXR1cm4gT2JqZWN0LmVudHJpZXMob2JqKS5tYXAoeCA9PiB4Lm1hcChTdHJpbmcpKTsKfQoKZXhwb3J0IGZ1bmN0aW9uIGRlZmluZV9wcm9wZXJ0eShvYmosIGssIHYpIHsKCU9iamVjdC5kZWZpbmVQcm9wZXJ0eShvYmosIGssIHsgdmFsdWU6IHYsIHdyaXRhYmxlOiBmYWxzZSB9KTsKfQoKZXhwb3J0IGZ1bmN0aW9uIHdzX2tleSgpIHsKCWxldCBrZXkgPSBuZXcgVWludDhBcnJheSgxNik7CgljcnlwdG8uZ2V0UmFuZG9tVmFsdWVzKGtleSk7CglyZXR1cm4gYnRvYShBcnJheS5mcm9tKGtleSkubWFwKFN0cmluZy5mcm9tQ2hhckNvZGUpLmpvaW4oJycpKTsKfQoKZXhwb3J0IGZ1bmN0aW9uIGZyb21fZW50cmllcyhlbnRyaWVzKXsKICAgIHZhciByZXQgPSB7fTsKICAgIGZvcih2YXIgaSA9IDA7IGkgPCBlbnRyaWVzLmxlbmd0aDsgaSsrKSByZXRbZW50cmllc1tpXVswXV0gPSBlbnRyaWVzW2ldWzFdOwogICAgcmV0dXJuIHJldDsKfQo='; | ||
import { object_get, object_set, convert_body_inner, entries_of_object_inner, define_property, from_entries } from 'data:application/javascript;base64,CmV4cG9ydCBmdW5jdGlvbiBvYmplY3RfZ2V0KG9iaiwgaykgeyAKCXRyeSB7CgkJcmV0dXJuIG9ialtrXQoJfSBjYXRjaCh4KSB7CgkJcmV0dXJuIHVuZGVmaW5lZAoJfQp9OwpleHBvcnQgZnVuY3Rpb24gb2JqZWN0X3NldChvYmosIGssIHYpIHsKCXRyeSB7IG9ialtrXSA9IHYgfSBjYXRjaCB7fQp9OwoKZXhwb3J0IGFzeW5jIGZ1bmN0aW9uIGNvbnZlcnRfYm9keV9pbm5lcihib2R5KSB7CglsZXQgcmVxID0gbmV3IFJlcXVlc3QoIiIsIHsgbWV0aG9kOiAiUE9TVCIsIGR1cGxleDogImhhbGYiLCBib2R5IH0pOwoJbGV0IHR5cGUgPSByZXEuaGVhZGVycy5nZXQoImNvbnRlbnQtdHlwZSIpOwoJcmV0dXJuIFtuZXcgVWludDhBcnJheShhd2FpdCByZXEuYXJyYXlCdWZmZXIoKSksIHR5cGVdOwp9CgpleHBvcnQgZnVuY3Rpb24gZW50cmllc19vZl9vYmplY3RfaW5uZXIob2JqKSB7CglyZXR1cm4gT2JqZWN0LmVudHJpZXMob2JqKS5tYXAoeCA9PiB4Lm1hcChTdHJpbmcpKTsKfQoKZXhwb3J0IGZ1bmN0aW9uIGRlZmluZV9wcm9wZXJ0eShvYmosIGssIHYpIHsKCU9iamVjdC5kZWZpbmVQcm9wZXJ0eShvYmosIGssIHsgdmFsdWU6IHYsIHdyaXRhYmxlOiBmYWxzZSB9KTsKfQoKZXhwb3J0IGZ1bmN0aW9uIHdzX2tleSgpIHsKCWxldCBrZXkgPSBuZXcgVWludDhBcnJheSgxNik7CgljcnlwdG8uZ2V0UmFuZG9tVmFsdWVzKGtleSk7CglyZXR1cm4gYnRvYShTdHJpbmcuZnJvbUNoYXJDb2RlLmFwcGx5KG51bGwsIGtleSkpOwp9CgpleHBvcnQgZnVuY3Rpb24gZnJvbV9lbnRyaWVzKGVudHJpZXMpewogICAgdmFyIHJldCA9IHt9OwogICAgZm9yKHZhciBpID0gMDsgaSA8IGVudHJpZXMubGVuZ3RoOyBpKyspIHJldFtlbnRyaWVzW2ldWzBdXSA9IGVudHJpZXNbaV1bMV07CiAgICByZXR1cm4gcmV0Owp9Cg=='; | ||
@@ -184,8 +184,8 @@ let wasm; | ||
} | ||
function __wbg_adapter_34(arg0, arg1, arg2) { | ||
wasm.closure4_externref_shim(arg0, arg1, arg2); | ||
function __wbg_adapter_34(arg0, arg1) { | ||
wasm._dyn_core__ops__function__Fn_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h4500bc74d67cc1bf(arg0, arg1); | ||
} | ||
function __wbg_adapter_37(arg0, arg1) { | ||
wasm._dyn_core__ops__function__Fn_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h704723396dd04e08(arg0, arg1); | ||
function __wbg_adapter_37(arg0, arg1, arg2) { | ||
wasm.closure8_externref_shim(arg0, arg1, arg2); | ||
} | ||
@@ -218,7 +218,7 @@ | ||
function __wbg_adapter_40(arg0, arg1, arg2) { | ||
wasm.closure175_externref_shim(arg0, arg1, arg2); | ||
wasm.closure176_externref_shim(arg0, arg1, arg2); | ||
} | ||
function __wbg_adapter_43(arg0, arg1) { | ||
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h52a3e68b4f1c95ef(arg0, arg1); | ||
wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__he0a6c1632a68b2bc(arg0, arg1); | ||
} | ||
@@ -277,3 +277,3 @@ | ||
function __wbg_adapter_150(arg0, arg1, arg2, arg3) { | ||
wasm.closure111_externref_shim(arg0, arg1, arg2, arg3); | ||
wasm.closure112_externref_shim(arg0, arg1, arg2, arg3); | ||
} | ||
@@ -371,9 +371,9 @@ | ||
/** | ||
* @param {any} wisp_url | ||
* @param {EpoxyWispTransport} transport | ||
* @param {EpoxyClientOptions} options | ||
*/ | ||
constructor(wisp_url, options) { | ||
constructor(transport, options) { | ||
_assertClass(options, EpoxyClientOptions); | ||
var ptr0 = options.__destroy_into_raw(); | ||
const ret = wasm.epoxyclient_new(wisp_url, ptr0); | ||
const ret = wasm.epoxyclient_new(transport, ptr0); | ||
if (ret[2]) { | ||
@@ -394,3 +394,3 @@ throw takeFromExternrefTable0(ret[1]); | ||
/** | ||
* @param {string} url | ||
* @param {EpoxyUrlInput} url | ||
* @param {object} options | ||
@@ -400,5 +400,3 @@ * @returns {Promise<Response>} | ||
fetch(url, options) { | ||
const ptr0 = passStringToWasm0(url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ret = wasm.epoxyclient_fetch(this.__wbg_ptr, ptr0, len0, options); | ||
const ret = wasm.epoxyclient_fetch(this.__wbg_ptr, url, options); | ||
return ret; | ||
@@ -812,3 +810,3 @@ } | ||
}; | ||
imports.wbg.__wbg_objectget_40ed2c8179ab51e7 = function(arg0, arg1, arg2) { | ||
imports.wbg.__wbg_objectget_28380229ca51cdae = function(arg0, arg1, arg2) { | ||
const ret = object_get(arg0, getStringFromWasm0(arg1, arg2)); | ||
@@ -847,3 +845,20 @@ return ret; | ||
}; | ||
imports.wbg.__wbg_convertbodyinner_2e966a2a0ebb9e93 = function() { return handleError(function (arg0) { | ||
imports.wbg.__wbg_instanceof_Url_f00efbf8074b8fcf = function(arg0) { | ||
let result; | ||
try { | ||
result = arg0 instanceof URL; | ||
} catch (_) { | ||
result = false; | ||
} | ||
const ret = result; | ||
return ret; | ||
}; | ||
imports.wbg.__wbg_href_07ab8fba72e97d85 = function(arg0, arg1) { | ||
const ret = arg1.href; | ||
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
const len1 = WASM_VECTOR_LEN; | ||
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); | ||
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); | ||
}; | ||
imports.wbg.__wbg_convertbodyinner_fdfe53d2661edfab = function() { return handleError(function (arg0) { | ||
const ret = convert_body_inner(arg0); | ||
@@ -906,3 +921,3 @@ return ret; | ||
}, arguments) }; | ||
imports.wbg.__wbg_defineproperty_7e82f31084e57cb8 = function(arg0, arg1, arg2, arg3) { | ||
imports.wbg.__wbg_defineproperty_516cc13b9a77a372 = function(arg0, arg1, arg2, arg3) { | ||
define_property(arg0, getStringFromWasm0(arg1, arg2), arg3); | ||
@@ -914,3 +929,3 @@ }; | ||
}; | ||
imports.wbg.__wbg_objectset_49227fb5127dfbeb = function(arg0, arg1, arg2, arg3) { | ||
imports.wbg.__wbg_objectset_89a54adf3c7abcce = function(arg0, arg1, arg2, arg3) { | ||
object_set(arg0, getStringFromWasm0(arg1, arg2), arg3); | ||
@@ -952,6 +967,6 @@ }; | ||
}, arguments) }; | ||
imports.wbg.__wbg_log_cfc7ca7e5c69a01e = function(arg0, arg1) { | ||
imports.wbg.__wbg_log_29cba8557a9b60d6 = function(arg0, arg1) { | ||
console.log(getStringFromWasm0(arg0, arg1)); | ||
}; | ||
imports.wbg.__wbg_entriesofobjectinner_c8d3c67aef14492e = function(arg0, arg1) { | ||
imports.wbg.__wbg_entriesofobjectinner_ccc751ae34b94906 = function(arg0, arg1) { | ||
const ret = entries_of_object_inner(arg1); | ||
@@ -1005,3 +1020,3 @@ const ptr1 = passArrayJsValueToWasm0(ret, wasm.__wbindgen_malloc); | ||
}; | ||
imports.wbg.__wbg_fromentries_9e32d12e39a505b3 = function() { return handleError(function (arg0) { | ||
imports.wbg.__wbg_fromentries_568f4968056f873d = function() { return handleError(function (arg0) { | ||
const ret = from_entries(arg0); | ||
@@ -1013,2 +1028,6 @@ return ret; | ||
}, arguments) }; | ||
imports.wbg.__wbindgen_is_function = function(arg0) { | ||
const ret = typeof(arg0) === 'function'; | ||
return ret; | ||
}; | ||
imports.wbg.__wbg_newwithstrsequence_e105150b01b32f72 = function() { return handleError(function (arg0, arg1, arg2) { | ||
@@ -1092,6 +1111,2 @@ const ret = new WebSocket(getStringFromWasm0(arg0, arg1), arg2); | ||
}; | ||
imports.wbg.__wbindgen_is_function = function(arg0) { | ||
const ret = typeof(arg0) === 'function'; | ||
return ret; | ||
}; | ||
imports.wbg.__wbg_call_a9ef466721e824f2 = function() { return handleError(function (arg0, arg1) { | ||
@@ -1222,11 +1237,11 @@ const ret = arg0.call(arg1); | ||
}, arguments) }; | ||
imports.wbg.__wbg_setTimeout_fba1b48a90e30862 = function() { return handleError(function (arg0, arg1, arg2) { | ||
imports.wbg.__wbg_setTimeout_2cb6c793c4aa44f8 = function() { return handleError(function (arg0, arg1, arg2) { | ||
const ret = arg0.setTimeout(arg1, arg2); | ||
return ret; | ||
}, arguments) }; | ||
imports.wbg.__wbg_performance_1430613edb72ce03 = function(arg0) { | ||
imports.wbg.__wbg_performance_ffc4e815dfb3449f = function(arg0) { | ||
const ret = arg0.performance; | ||
return ret; | ||
}; | ||
imports.wbg.__wbg_now_eab901b1d3b8a295 = function(arg0) { | ||
imports.wbg.__wbg_now_8799be02ba81a22e = function(arg0) { | ||
const ret = arg0.now(); | ||
@@ -1252,12 +1267,12 @@ return ret; | ||
}; | ||
imports.wbg.__wbindgen_closure_wrapper774 = function(arg0, arg1, arg2) { | ||
const ret = makeMutClosure(arg0, arg1, 97, __wbg_adapter_40); | ||
imports.wbg.__wbindgen_closure_wrapper777 = function(arg0, arg1, arg2) { | ||
const ret = makeMutClosure(arg0, arg1, 98, __wbg_adapter_40); | ||
return ret; | ||
}; | ||
imports.wbg.__wbindgen_closure_wrapper1208 = function(arg0, arg1, arg2) { | ||
const ret = makeMutClosure(arg0, arg1, 97, __wbg_adapter_43); | ||
imports.wbg.__wbindgen_closure_wrapper1207 = function(arg0, arg1, arg2) { | ||
const ret = makeMutClosure(arg0, arg1, 98, __wbg_adapter_43); | ||
return ret; | ||
}; | ||
imports.wbg.__wbindgen_closure_wrapper3297 = function(arg0, arg1, arg2) { | ||
const ret = makeMutClosure(arg0, arg1, 97, __wbg_adapter_43); | ||
imports.wbg.__wbindgen_closure_wrapper3301 = function(arg0, arg1, arg2) { | ||
const ret = makeMutClosure(arg0, arg1, 98, __wbg_adapter_43); | ||
return ret; | ||
@@ -1348,2 +1363,2 @@ }; | ||
export default __wbg_init; | ||
export const info = { version: "2.1.9-1", minimal: 1===1, release: 1===1 }; | ||
export const info = { version: "2.1.10-1", minimal: 1===1, release: 1===1 }; |
{ | ||
"name": "@mercuryworkshop/epoxy-tls", | ||
"version": "2.1.9-1", | ||
"version": "2.1.10-1", | ||
"description": "A wasm library for using raw encrypted tls/ssl/tcp/udp/https/websocket streams on the browser", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
4727875
0.23%15829
0.55%