@uipath/conversational-tool 1.201.0-preview.115 → 1.201.0-preview.121

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.
@@ -7124,7 +7124,7 @@ class ErrorResponseParser {
7124
7124
  }
7125
7125
  async parse(response) {
7126
7126
  try {
7127
- const errorBody = await response.json();
7127
+ const errorBody = await response.clone().json();
7128
7128
  const strategy = this.strategies.find((s) => s.canParse(errorBody));
7129
7129
  return strategy.parse(errorBody, response);
7130
7130
  } catch {
@@ -7177,22 +7177,20 @@ class ApiClient {
7177
7177
  async getValidToken() {
7178
7178
  return this.tokenManager.getValidToken();
7179
7179
  }
7180
- async getDefaultHeaders() {
7180
+ async getDefaultHeaders(includeDefaultContentType) {
7181
7181
  const token = await this.getValidToken();
7182
- return {
7183
- Authorization: `Bearer ${token}`,
7184
- "Content-Type": CONTENT_TYPES.JSON,
7185
- ...this.clientConfig.headers
7186
- };
7182
+ const base = { Authorization: `Bearer ${token}` };
7183
+ if (includeDefaultContentType) {
7184
+ base["Content-Type"] = CONTENT_TYPES.JSON;
7185
+ }
7186
+ return { ...base, ...this.clientConfig.headers };
7187
7187
  }
7188
7188
  async request(method, path, options = {}) {
7189
7189
  const normalizedPath = path.startsWith("/") ? path.substring(1) : path;
7190
7190
  const url2 = new URL(`${this.config.orgName}/${this.config.tenantName}/${normalizedPath}`, this.config.baseUrl).toString();
7191
7191
  const isFormData = options.body instanceof FormData;
7192
- const defaultHeaders = await this.getDefaultHeaders();
7193
- if (isFormData) {
7194
- delete defaultHeaders["Content-Type"];
7195
- }
7192
+ const isBodyless = isFormData || method === "GET" || method === "HEAD";
7193
+ const defaultHeaders = await this.getDefaultHeaders(!isBodyless);
7196
7194
  const traceId = crypto.randomUUID().replace(/-/g, "");
7197
7195
  const spanId = crypto.randomUUID().replace(/-/g, "").slice(0, 16);
7198
7196
  const traceparentValue = `00-${traceId}-${spanId}-01`;
@@ -10846,4 +10844,4 @@ export {
10846
10844
  AgentMap
10847
10845
  };
10848
10846
 
10849
- //# debugId=09A8FFC87FFBF0C864756E2164756E21
10847
+ //# debugId=6F5B0322874243C264756E2164756E21
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  Command,
4
4
  metadata,
5
5
  registerCommands
6
- } from "./tool-tm0qkj7j.js";
6
+ } from "./tool-0r077at7.js";
7
7
  import"./tool-a8ky4eng.js";
8
8
  import"./tool-9qecd4wb.js";
9
9
  import"./tool-4pvh3k50.js";