fix: expose client fetch and signed adjustments
Quality / quality (ubuntu-latest) (push) Failing after 9m49s
Quality / quality (windows-latest) (push) Canceled after 0s

This commit is contained in:
2026-08-23 18:56:05 +05:30
parent 6258495b67
commit 4be4b2c346
8 changed files with 64 additions and 8 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@wrnexus/csr",
"version": "0.8.31",
"version": "0.8.32",
"type": "module",
"main": "src/index.ts",
"exports": {
+15
View File
@@ -19,6 +19,21 @@ export { ACTION_RUNTIME } from "./action-runtime.ts";
export { createApiClient } from "./api-client.ts";
export type { ApiClientOptions, ApiRequest } from "./api-client.ts";
/** Public client transport used by `.wrn` client functions for dynamic URLs. */
export function useFetch<T = unknown>(
path: string,
methodOrOptions?:
string | { method?: string; query?: unknown; params?: unknown; body?: unknown; data?: unknown },
input?: unknown,
): Promise<T> {
const client = (
globalThis as typeof globalThis & { useFetch?: (...args: unknown[]) => Promise<T> }
).useFetch;
if (!client)
return Promise.reject(new Error("WRN-CSR: useFetch is only available in the browser runtime"));
return client(path, methodOrOptions, input);
}
const CONTROLLER_SECTIONS = ["PRIMARY", "UI", "PIN"] as const;
function runtimeForMode(development: boolean): string {