@cadraos/sdk 0.3.14 → 0.3.15

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.
@@ -1876,7 +1876,8 @@ interface RequestOptions {
1876
1876
  /**
1877
1877
  * Per-request timeout in milliseconds. Overrides the client-wide
1878
1878
  * `config.timeout` for this call only (p93 AIF-010: a paid AI-function run
1879
- * may take up to 60 s while every other call keeps the 30 s default).
1879
+ * waits for the server's route ceiling while every other call keeps the
1880
+ * 30 s default).
1880
1881
  */
1881
1882
  timeoutMs?: number;
1882
1883
  }
@@ -1888,6 +1889,8 @@ declare class HttpClient {
1888
1889
  private tokenRefreshAttempts;
1889
1890
  private readonly maxTokenRefreshAttempts;
1890
1891
  constructor(config: HttpClientConfig);
1892
+ /** The client-wide request timeout (ms) this client was configured with. */
1893
+ get timeoutMs(): number;
1891
1894
  /**
1892
1895
  * Get authorization header value
1893
1896
  */
@@ -1876,7 +1876,8 @@ interface RequestOptions {
1876
1876
  /**
1877
1877
  * Per-request timeout in milliseconds. Overrides the client-wide
1878
1878
  * `config.timeout` for this call only (p93 AIF-010: a paid AI-function run
1879
- * may take up to 60 s while every other call keeps the 30 s default).
1879
+ * waits for the server's route ceiling while every other call keeps the
1880
+ * 30 s default).
1880
1881
  */
1881
1882
  timeoutMs?: number;
1882
1883
  }
@@ -1888,6 +1889,8 @@ declare class HttpClient {
1888
1889
  private tokenRefreshAttempts;
1889
1890
  private readonly maxTokenRefreshAttempts;
1890
1891
  constructor(config: HttpClientConfig);
1892
+ /** The client-wide request timeout (ms) this client was configured with. */
1893
+ get timeoutMs(): number;
1891
1894
  /**
1892
1895
  * Get authorization header value
1893
1896
  */
@@ -294,6 +294,10 @@ var HttpClient = class {
294
294
  constructor(config) {
295
295
  this.config = config;
296
296
  }
297
+ /** The client-wide request timeout (ms) this client was configured with. */
298
+ get timeoutMs() {
299
+ return this.config.timeout;
300
+ }
297
301
  /**
298
302
  * Get authorization header value
299
303
  */
@@ -3420,7 +3424,7 @@ var RemoteRunnersAPI = class extends BaseResourceAPI {
3420
3424
  };
3421
3425
 
3422
3426
  // src/resources/ai-functions.ts
3423
- var AI_FUNCTION_RUN_TIMEOUT_MS = 6e4;
3427
+ var AI_FUNCTION_RUN_TIMEOUT_MS = 31e4;
3424
3428
  var AI_FUNCTION_DESCRIPTOR_TTL_MS = 6e4;
3425
3429
  function checkAiFunctionParameters(parameters, variables) {
3426
3430
  const issues = [];
@@ -3533,7 +3537,7 @@ var AiFunctionsAPI = class extends BaseResourceAPI {
3533
3537
  try {
3534
3538
  return await this.httpPost("/run", body, {
3535
3539
  skipRetry: true,
3536
- timeoutMs: AI_FUNCTION_RUN_TIMEOUT_MS
3540
+ timeoutMs: Math.max(AI_FUNCTION_RUN_TIMEOUT_MS, this.http.timeoutMs ?? 0)
3537
3541
  });
3538
3542
  } catch (error) {
3539
3543
  throw this.mapRunError(error, functionKey);