@aresdefencelabs/wasm-http-runtime 0.0.7 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abi.d.ts +1 -1
- package/dist/abi.js +2 -1
- package/package.json +1 -1
package/dist/abi.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare function createAresAbiImports<Env>(state: RuntimeState<Env>): {
|
|
|
9
9
|
free_mem(ptr: number, size: number): void;
|
|
10
10
|
abi_log(messagePtr: number): void;
|
|
11
11
|
abi_http_get_user_agent_name(): number;
|
|
12
|
-
|
|
12
|
+
abi_http_fetch_blocking_async(requestJsonCstrPtr: number): Promise<number>;
|
|
13
13
|
abi_http_response_get_status(responseId: number): number;
|
|
14
14
|
abi_http_response_get_body_len(responseId: number): number;
|
|
15
15
|
abi_http_response_copy_body(responseId: number, outPtr: number, maxLen: number): number;
|
package/dist/abi.js
CHANGED
|
@@ -101,7 +101,7 @@ export function createAresAbiImports(state) {
|
|
|
101
101
|
const alloc = getAllocOrThrow(instance);
|
|
102
102
|
return writeCString(memory, alloc, userAgent);
|
|
103
103
|
},
|
|
104
|
-
async
|
|
104
|
+
async abi_http_fetch_blocking_async(requestJsonCstrPtr) {
|
|
105
105
|
const instance = getInstanceOrThrow(state);
|
|
106
106
|
const memory = getMemoryOrThrow(instance);
|
|
107
107
|
try {
|
|
@@ -115,6 +115,7 @@ export function createAresAbiImports(state) {
|
|
|
115
115
|
headers: outbound.headers,
|
|
116
116
|
body: outbound.body ?? undefined
|
|
117
117
|
});
|
|
118
|
+
console.log("[AresWasm] abi_http_fetch_blocking fetch completed, status =", response.status);
|
|
118
119
|
const bodyText = await response.text();
|
|
119
120
|
const bodyBytes = utf8ByteLength(bodyText);
|
|
120
121
|
if (bodyBytes > state.options.maxResponseBodyBytes) {
|
package/package.json
CHANGED