@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.
@@ -2872,7 +2872,8 @@ interface RequestOptions {
2872
2872
  /**
2873
2873
  * Per-request timeout in milliseconds. Overrides the client-wide
2874
2874
  * `config.timeout` for this call only (p93 AIF-010: a paid AI-function run
2875
- * may take up to 60 s while every other call keeps the 30 s default).
2875
+ * waits for the server's route ceiling while every other call keeps the
2876
+ * 30 s default).
2876
2877
  */
2877
2878
  timeoutMs?: number;
2878
2879
  }
@@ -2884,6 +2885,8 @@ declare class HttpClient {
2884
2885
  private tokenRefreshAttempts;
2885
2886
  private readonly maxTokenRefreshAttempts;
2886
2887
  constructor(config: HttpClientConfig);
2888
+ /** The client-wide request timeout (ms) this client was configured with. */
2889
+ get timeoutMs(): number;
2887
2890
  /**
2888
2891
  * Get authorization header value
2889
2892
  */
@@ -2872,7 +2872,8 @@ interface RequestOptions {
2872
2872
  /**
2873
2873
  * Per-request timeout in milliseconds. Overrides the client-wide
2874
2874
  * `config.timeout` for this call only (p93 AIF-010: a paid AI-function run
2875
- * may take up to 60 s while every other call keeps the 30 s default).
2875
+ * waits for the server's route ceiling while every other call keeps the
2876
+ * 30 s default).
2876
2877
  */
2877
2878
  timeoutMs?: number;
2878
2879
  }
@@ -2884,6 +2885,8 @@ declare class HttpClient {
2884
2885
  private tokenRefreshAttempts;
2885
2886
  private readonly maxTokenRefreshAttempts;
2886
2887
  constructor(config: HttpClientConfig);
2888
+ /** The client-wide request timeout (ms) this client was configured with. */
2889
+ get timeoutMs(): number;
2887
2890
  /**
2888
2891
  * Get authorization header value
2889
2892
  */
@@ -3891,6 +3891,10 @@ var HttpClient = class {
3891
3891
  constructor(config) {
3892
3892
  this.config = config;
3893
3893
  }
3894
+ /** The client-wide request timeout (ms) this client was configured with. */
3895
+ get timeoutMs() {
3896
+ return this.config.timeout;
3897
+ }
3894
3898
  /**
3895
3899
  * Get authorization header value
3896
3900
  */
@@ -7007,7 +7011,7 @@ var RemoteRunnersAPI = class extends BaseResourceAPI {
7007
7011
  };
7008
7012
 
7009
7013
  // src/resources/ai-functions.ts
7010
- var AI_FUNCTION_RUN_TIMEOUT_MS = 6e4;
7014
+ var AI_FUNCTION_RUN_TIMEOUT_MS = 31e4;
7011
7015
  var AI_FUNCTION_DESCRIPTOR_TTL_MS = 6e4;
7012
7016
  function checkAiFunctionParameters(parameters, variables) {
7013
7017
  const issues = [];
@@ -7120,7 +7124,7 @@ var AiFunctionsAPI = class extends BaseResourceAPI {
7120
7124
  try {
7121
7125
  return await this.httpPost("/run", body, {
7122
7126
  skipRetry: true,
7123
- timeoutMs: AI_FUNCTION_RUN_TIMEOUT_MS
7127
+ timeoutMs: Math.max(AI_FUNCTION_RUN_TIMEOUT_MS, this.http.timeoutMs ?? 0)
7124
7128
  });
7125
7129
  } catch (error) {
7126
7130
  throw this.mapRunError(error, functionKey);