@xoxno/sdk-js 1.0.214 → 1.0.216

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.
@@ -0,0 +1 @@
1
+ export {};
@@ -5,7 +5,27 @@ export type SafeHeaders = Record<string, string> & {
5
5
  export type OurRequestInit = Omit<RequestInit, 'body' | 'headers'> & {
6
6
  headers?: SafeHeaders;
7
7
  debug?: boolean;
8
+ /**
9
+ * Milliseconds before the request is aborted, as a client-wide default or a
10
+ * per-call override. `0` disables the deadline for that call.
11
+ *
12
+ * Defaults to {@link DEFAULT_REQUEST_TIMEOUT_MS} for requests with no body.
13
+ * Requests that send a body are left unbounded by default because their
14
+ * duration depends on the caller's uplink — a multipart upload on a slow
15
+ * mobile connection is not a stalled request. Pass `timeout` explicitly to
16
+ * bound those.
17
+ */
18
+ timeout?: number;
8
19
  };
20
+ /**
21
+ * Default read deadline. Without one, a stalled response is bounded only by
22
+ * whatever the host runtime imposes (in Node, undici's Agent), which is
23
+ * typically longer than the caller's own budget — a Next.js `'use cache'` fill,
24
+ * for instance, gives up at `staticPageGenerationTimeout * 0.9` and turns the
25
+ * stall into a hard error instead of a fetch rejection the caller can degrade
26
+ * on. Generous enough that only a genuinely stuck read hits it.
27
+ */
28
+ export declare const DEFAULT_REQUEST_TIMEOUT_MS = 30000;
9
29
  /**
10
30
  * Host-supplied configuration for {@link XOXNOClient}.
11
31
  *
@@ -42,5 +62,6 @@ export declare class XOXNOClient {
42
62
  fetchWithTimeout: <T>(path: string, { params, ...options }?: RequestInit & {
43
63
  debug?: boolean;
44
64
  params?: Record<string, any>;
65
+ timeout?: number;
45
66
  }) => Promise<T>;
46
67
  }