fix(client): Fix CI configuration, prevent socket hangs with auto-drain, and apply various client/core TypeScript fixes and test updates

This commit is contained in:
2025-08-18 00:21:14 +00:00
parent 9b9c8fd618
commit ee750dea58
34 changed files with 2144 additions and 892 deletions

View File

@@ -4,7 +4,10 @@ import { CoreResponse as AbstractCoreResponse } from '../core_base/response.js';
/**
* Fetch-based implementation of Core Response class
*/
export class CoreResponse<T = any> extends AbstractCoreResponse<T> implements types.IFetchResponse<T> {
export class CoreResponse<T = any>
extends AbstractCoreResponse<T>
implements types.IFetchResponse<T>
{
private response: Response;
private responseClone: Response;
@@ -20,12 +23,12 @@ export class CoreResponse<T = any> extends AbstractCoreResponse<T> implements ty
// Clone the response so we can read the body multiple times if needed
this.response = response;
this.responseClone = response.clone();
this.ok = response.ok;
this.status = response.status;
this.statusText = response.statusText;
this.url = response.url;
// Convert Headers to plain object
this.headers = {};
response.headers.forEach((value, key) => {
@@ -73,13 +76,15 @@ export class CoreResponse<T = any> extends AbstractCoreResponse<T> implements ty
* Node.js stream method - not available in browser
*/
streamNode(): never {
throw new Error('streamNode() is not available in browser/fetch environment. Use stream() for web-style ReadableStream.');
throw new Error(
'streamNode() is not available in browser/fetch environment. Use stream() for web-style ReadableStream.',
);
}
/**
* Get the raw Response object
*/
raw(): Response {
return this.responseClone;
}
}
}