@uipath/uipath-typescript 1.1.2 → 1.2.0

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.
@@ -546,11 +546,8 @@ class ApiClient {
546
546
  return this.tokenManager.getValidToken();
547
547
  }
548
548
  async getDefaultHeaders() {
549
- // Get headers from execution context first
550
- const contextHeaders = this.executionContext.getHeaders();
551
549
  const token = await this.getValidToken();
552
550
  return {
553
- ...contextHeaders,
554
551
  'Authorization': `Bearer ${token}`,
555
552
  'Content-Type': CONTENT_TYPES.JSON,
556
553
  ...this.defaultHeaders,
@@ -562,8 +559,13 @@ class ApiClient {
562
559
  const normalizedPath = path.startsWith('/') ? path.substring(1) : path;
563
560
  // Construct URL with org and tenant names
564
561
  const url = new URL(`${this.config.orgName}/${this.config.tenantName}/${normalizedPath}`, this.config.baseUrl).toString();
562
+ const isFormData = options.body instanceof FormData;
563
+ const defaultHeaders = await this.getDefaultHeaders();
564
+ if (isFormData) {
565
+ delete defaultHeaders['Content-Type'];
566
+ }
565
567
  const headers = {
566
- ...await this.getDefaultHeaders(),
568
+ ...defaultHeaders,
567
569
  ...options.headers
568
570
  };
569
571
  // Convert params to URLSearchParams
@@ -574,11 +576,15 @@ class ApiClient {
574
576
  });
575
577
  }
576
578
  const fullUrl = searchParams.toString() ? `${url}?${searchParams.toString()}` : url;
579
+ let body = undefined;
580
+ if (options.body) {
581
+ body = isFormData ? options.body : JSON.stringify(options.body);
582
+ }
577
583
  try {
578
584
  const response = await fetch(fullUrl, {
579
585
  method,
580
586
  headers,
581
- body: options.body ? JSON.stringify(options.body) : undefined,
587
+ body,
582
588
  signal: options.signal
583
589
  });
584
590
  if (!response.ok) {
@@ -1669,7 +1675,7 @@ const AssetMap = {
1669
1675
  // Connection string placeholder that will be replaced during build
1670
1676
  const CONNECTION_STRING = "InstrumentationKey=a6efa11d-1feb-4508-9738-e13e12dcae5e;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com/;LiveEndpoint=https://westeurope.livediagnostics.monitor.azure.com/;ApplicationId=7c58eb1c-9581-4ba6-839e-11725848a037";
1671
1677
  // SDK Version placeholder
1672
- const SDK_VERSION = "1.1.2";
1678
+ const SDK_VERSION = "1.2.0";
1673
1679
  const VERSION = "Version";
1674
1680
  const SERVICE = "Service";
1675
1681
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -544,11 +544,8 @@ class ApiClient {
544
544
  return this.tokenManager.getValidToken();
545
545
  }
546
546
  async getDefaultHeaders() {
547
- // Get headers from execution context first
548
- const contextHeaders = this.executionContext.getHeaders();
549
547
  const token = await this.getValidToken();
550
548
  return {
551
- ...contextHeaders,
552
549
  'Authorization': `Bearer ${token}`,
553
550
  'Content-Type': CONTENT_TYPES.JSON,
554
551
  ...this.defaultHeaders,
@@ -560,8 +557,13 @@ class ApiClient {
560
557
  const normalizedPath = path.startsWith('/') ? path.substring(1) : path;
561
558
  // Construct URL with org and tenant names
562
559
  const url = new URL(`${this.config.orgName}/${this.config.tenantName}/${normalizedPath}`, this.config.baseUrl).toString();
560
+ const isFormData = options.body instanceof FormData;
561
+ const defaultHeaders = await this.getDefaultHeaders();
562
+ if (isFormData) {
563
+ delete defaultHeaders['Content-Type'];
564
+ }
563
565
  const headers = {
564
- ...await this.getDefaultHeaders(),
566
+ ...defaultHeaders,
565
567
  ...options.headers
566
568
  };
567
569
  // Convert params to URLSearchParams
@@ -572,11 +574,15 @@ class ApiClient {
572
574
  });
573
575
  }
574
576
  const fullUrl = searchParams.toString() ? `${url}?${searchParams.toString()}` : url;
577
+ let body = undefined;
578
+ if (options.body) {
579
+ body = isFormData ? options.body : JSON.stringify(options.body);
580
+ }
575
581
  try {
576
582
  const response = await fetch(fullUrl, {
577
583
  method,
578
584
  headers,
579
- body: options.body ? JSON.stringify(options.body) : undefined,
585
+ body,
580
586
  signal: options.signal
581
587
  });
582
588
  if (!response.ok) {
@@ -1667,7 +1673,7 @@ const AssetMap = {
1667
1673
  // Connection string placeholder that will be replaced during build
1668
1674
  const CONNECTION_STRING = "InstrumentationKey=a6efa11d-1feb-4508-9738-e13e12dcae5e;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com/;LiveEndpoint=https://westeurope.livediagnostics.monitor.azure.com/;ApplicationId=7c58eb1c-9581-4ba6-839e-11725848a037";
1669
1675
  // SDK Version placeholder
1670
- const SDK_VERSION = "1.1.2";
1676
+ const SDK_VERSION = "1.2.0";
1671
1677
  const VERSION = "Version";
1672
1678
  const SERVICE = "Service";
1673
1679
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -546,11 +546,8 @@ class ApiClient {
546
546
  return this.tokenManager.getValidToken();
547
547
  }
548
548
  async getDefaultHeaders() {
549
- // Get headers from execution context first
550
- const contextHeaders = this.executionContext.getHeaders();
551
549
  const token = await this.getValidToken();
552
550
  return {
553
- ...contextHeaders,
554
551
  'Authorization': `Bearer ${token}`,
555
552
  'Content-Type': CONTENT_TYPES.JSON,
556
553
  ...this.defaultHeaders,
@@ -562,8 +559,13 @@ class ApiClient {
562
559
  const normalizedPath = path.startsWith('/') ? path.substring(1) : path;
563
560
  // Construct URL with org and tenant names
564
561
  const url = new URL(`${this.config.orgName}/${this.config.tenantName}/${normalizedPath}`, this.config.baseUrl).toString();
562
+ const isFormData = options.body instanceof FormData;
563
+ const defaultHeaders = await this.getDefaultHeaders();
564
+ if (isFormData) {
565
+ delete defaultHeaders['Content-Type'];
566
+ }
565
567
  const headers = {
566
- ...await this.getDefaultHeaders(),
568
+ ...defaultHeaders,
567
569
  ...options.headers
568
570
  };
569
571
  // Convert params to URLSearchParams
@@ -574,11 +576,15 @@ class ApiClient {
574
576
  });
575
577
  }
576
578
  const fullUrl = searchParams.toString() ? `${url}?${searchParams.toString()}` : url;
579
+ let body = undefined;
580
+ if (options.body) {
581
+ body = isFormData ? options.body : JSON.stringify(options.body);
582
+ }
577
583
  try {
578
584
  const response = await fetch(fullUrl, {
579
585
  method,
580
586
  headers,
581
- body: options.body ? JSON.stringify(options.body) : undefined,
587
+ body,
582
588
  signal: options.signal
583
589
  });
584
590
  if (!response.ok) {
@@ -1716,7 +1722,7 @@ const BucketMap = {
1716
1722
  // Connection string placeholder that will be replaced during build
1717
1723
  const CONNECTION_STRING = "InstrumentationKey=a6efa11d-1feb-4508-9738-e13e12dcae5e;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com/;LiveEndpoint=https://westeurope.livediagnostics.monitor.azure.com/;ApplicationId=7c58eb1c-9581-4ba6-839e-11725848a037";
1718
1724
  // SDK Version placeholder
1719
- const SDK_VERSION = "1.1.2";
1725
+ const SDK_VERSION = "1.2.0";
1720
1726
  const VERSION = "Version";
1721
1727
  const SERVICE = "Service";
1722
1728
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -544,11 +544,8 @@ class ApiClient {
544
544
  return this.tokenManager.getValidToken();
545
545
  }
546
546
  async getDefaultHeaders() {
547
- // Get headers from execution context first
548
- const contextHeaders = this.executionContext.getHeaders();
549
547
  const token = await this.getValidToken();
550
548
  return {
551
- ...contextHeaders,
552
549
  'Authorization': `Bearer ${token}`,
553
550
  'Content-Type': CONTENT_TYPES.JSON,
554
551
  ...this.defaultHeaders,
@@ -560,8 +557,13 @@ class ApiClient {
560
557
  const normalizedPath = path.startsWith('/') ? path.substring(1) : path;
561
558
  // Construct URL with org and tenant names
562
559
  const url = new URL(`${this.config.orgName}/${this.config.tenantName}/${normalizedPath}`, this.config.baseUrl).toString();
560
+ const isFormData = options.body instanceof FormData;
561
+ const defaultHeaders = await this.getDefaultHeaders();
562
+ if (isFormData) {
563
+ delete defaultHeaders['Content-Type'];
564
+ }
563
565
  const headers = {
564
- ...await this.getDefaultHeaders(),
566
+ ...defaultHeaders,
565
567
  ...options.headers
566
568
  };
567
569
  // Convert params to URLSearchParams
@@ -572,11 +574,15 @@ class ApiClient {
572
574
  });
573
575
  }
574
576
  const fullUrl = searchParams.toString() ? `${url}?${searchParams.toString()}` : url;
577
+ let body = undefined;
578
+ if (options.body) {
579
+ body = isFormData ? options.body : JSON.stringify(options.body);
580
+ }
575
581
  try {
576
582
  const response = await fetch(fullUrl, {
577
583
  method,
578
584
  headers,
579
- body: options.body ? JSON.stringify(options.body) : undefined,
585
+ body,
580
586
  signal: options.signal
581
587
  });
582
588
  if (!response.ok) {
@@ -1714,7 +1720,7 @@ const BucketMap = {
1714
1720
  // Connection string placeholder that will be replaced during build
1715
1721
  const CONNECTION_STRING = "InstrumentationKey=a6efa11d-1feb-4508-9738-e13e12dcae5e;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com/;LiveEndpoint=https://westeurope.livediagnostics.monitor.azure.com/;ApplicationId=7c58eb1c-9581-4ba6-839e-11725848a037";
1716
1722
  // SDK Version placeholder
1717
- const SDK_VERSION = "1.1.2";
1723
+ const SDK_VERSION = "1.2.0";
1718
1724
  const VERSION = "Version";
1719
1725
  const SERVICE = "Service";
1720
1726
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -559,11 +559,8 @@ class ApiClient {
559
559
  return this.tokenManager.getValidToken();
560
560
  }
561
561
  async getDefaultHeaders() {
562
- // Get headers from execution context first
563
- const contextHeaders = this.executionContext.getHeaders();
564
562
  const token = await this.getValidToken();
565
563
  return {
566
- ...contextHeaders,
567
564
  'Authorization': `Bearer ${token}`,
568
565
  'Content-Type': CONTENT_TYPES.JSON,
569
566
  ...this.defaultHeaders,
@@ -575,8 +572,13 @@ class ApiClient {
575
572
  const normalizedPath = path.startsWith('/') ? path.substring(1) : path;
576
573
  // Construct URL with org and tenant names
577
574
  const url = new URL(`${this.config.orgName}/${this.config.tenantName}/${normalizedPath}`, this.config.baseUrl).toString();
575
+ const isFormData = options.body instanceof FormData;
576
+ const defaultHeaders = await this.getDefaultHeaders();
577
+ if (isFormData) {
578
+ delete defaultHeaders['Content-Type'];
579
+ }
578
580
  const headers = {
579
- ...await this.getDefaultHeaders(),
581
+ ...defaultHeaders,
580
582
  ...options.headers
581
583
  };
582
584
  // Convert params to URLSearchParams
@@ -587,11 +589,15 @@ class ApiClient {
587
589
  });
588
590
  }
589
591
  const fullUrl = searchParams.toString() ? `${url}?${searchParams.toString()}` : url;
592
+ let body = undefined;
593
+ if (options.body) {
594
+ body = isFormData ? options.body : JSON.stringify(options.body);
595
+ }
590
596
  try {
591
597
  const response = await fetch(fullUrl, {
592
598
  method,
593
599
  headers,
594
- body: options.body ? JSON.stringify(options.body) : undefined,
600
+ body,
595
601
  signal: options.signal
596
602
  });
597
603
  if (!response.ok) {
@@ -1824,7 +1830,7 @@ const MAESTRO_ENDPOINTS = {
1824
1830
  // Connection string placeholder that will be replaced during build
1825
1831
  const CONNECTION_STRING = "InstrumentationKey=a6efa11d-1feb-4508-9738-e13e12dcae5e;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com/;LiveEndpoint=https://westeurope.livediagnostics.monitor.azure.com/;ApplicationId=7c58eb1c-9581-4ba6-839e-11725848a037";
1826
1832
  // SDK Version placeholder
1827
- const SDK_VERSION = "1.1.2";
1833
+ const SDK_VERSION = "1.2.0";
1828
1834
  const VERSION = "Version";
1829
1835
  const SERVICE = "Service";
1830
1836
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -557,11 +557,8 @@ class ApiClient {
557
557
  return this.tokenManager.getValidToken();
558
558
  }
559
559
  async getDefaultHeaders() {
560
- // Get headers from execution context first
561
- const contextHeaders = this.executionContext.getHeaders();
562
560
  const token = await this.getValidToken();
563
561
  return {
564
- ...contextHeaders,
565
562
  'Authorization': `Bearer ${token}`,
566
563
  'Content-Type': CONTENT_TYPES.JSON,
567
564
  ...this.defaultHeaders,
@@ -573,8 +570,13 @@ class ApiClient {
573
570
  const normalizedPath = path.startsWith('/') ? path.substring(1) : path;
574
571
  // Construct URL with org and tenant names
575
572
  const url = new URL(`${this.config.orgName}/${this.config.tenantName}/${normalizedPath}`, this.config.baseUrl).toString();
573
+ const isFormData = options.body instanceof FormData;
574
+ const defaultHeaders = await this.getDefaultHeaders();
575
+ if (isFormData) {
576
+ delete defaultHeaders['Content-Type'];
577
+ }
576
578
  const headers = {
577
- ...await this.getDefaultHeaders(),
579
+ ...defaultHeaders,
578
580
  ...options.headers
579
581
  };
580
582
  // Convert params to URLSearchParams
@@ -585,11 +587,15 @@ class ApiClient {
585
587
  });
586
588
  }
587
589
  const fullUrl = searchParams.toString() ? `${url}?${searchParams.toString()}` : url;
590
+ let body = undefined;
591
+ if (options.body) {
592
+ body = isFormData ? options.body : JSON.stringify(options.body);
593
+ }
588
594
  try {
589
595
  const response = await fetch(fullUrl, {
590
596
  method,
591
597
  headers,
592
- body: options.body ? JSON.stringify(options.body) : undefined,
598
+ body,
593
599
  signal: options.signal
594
600
  });
595
601
  if (!response.ok) {
@@ -1822,7 +1828,7 @@ const MAESTRO_ENDPOINTS = {
1822
1828
  // Connection string placeholder that will be replaced during build
1823
1829
  const CONNECTION_STRING = "InstrumentationKey=a6efa11d-1feb-4508-9738-e13e12dcae5e;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com/;LiveEndpoint=https://westeurope.livediagnostics.monitor.azure.com/;ApplicationId=7c58eb1c-9581-4ba6-839e-11725848a037";
1824
1830
  // SDK Version placeholder
1825
- const SDK_VERSION = "1.1.2";
1831
+ const SDK_VERSION = "1.2.0";
1826
1832
  const VERSION = "Version";
1827
1833
  const SERVICE = "Service";
1828
1834
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -51,7 +51,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
51
51
  // Connection string placeholder that will be replaced during build
52
52
  const CONNECTION_STRING = "InstrumentationKey=a6efa11d-1feb-4508-9738-e13e12dcae5e;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com/;LiveEndpoint=https://westeurope.livediagnostics.monitor.azure.com/;ApplicationId=7c58eb1c-9581-4ba6-839e-11725848a037";
53
53
  // SDK Version placeholder
54
- const SDK_VERSION = "1.1.2";
54
+ const SDK_VERSION = "1.2.0";
55
55
  const VERSION = "Version";
56
56
  const SERVICE = "Service";
57
57
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -829,11 +829,8 @@ class ApiClient {
829
829
  return this.tokenManager.getValidToken();
830
830
  }
831
831
  async getDefaultHeaders() {
832
- // Get headers from execution context first
833
- const contextHeaders = this.executionContext.getHeaders();
834
832
  const token = await this.getValidToken();
835
833
  return {
836
- ...contextHeaders,
837
834
  'Authorization': `Bearer ${token}`,
838
835
  'Content-Type': CONTENT_TYPES.JSON,
839
836
  ...this.defaultHeaders,
@@ -845,8 +842,13 @@ class ApiClient {
845
842
  const normalizedPath = path.startsWith('/') ? path.substring(1) : path;
846
843
  // Construct URL with org and tenant names
847
844
  const url = new URL(`${this.config.orgName}/${this.config.tenantName}/${normalizedPath}`, this.config.baseUrl).toString();
845
+ const isFormData = options.body instanceof FormData;
846
+ const defaultHeaders = await this.getDefaultHeaders();
847
+ if (isFormData) {
848
+ delete defaultHeaders['Content-Type'];
849
+ }
848
850
  const headers = {
849
- ...await this.getDefaultHeaders(),
851
+ ...defaultHeaders,
850
852
  ...options.headers
851
853
  };
852
854
  // Convert params to URLSearchParams
@@ -857,11 +859,15 @@ class ApiClient {
857
859
  });
858
860
  }
859
861
  const fullUrl = searchParams.toString() ? `${url}?${searchParams.toString()}` : url;
862
+ let body = undefined;
863
+ if (options.body) {
864
+ body = isFormData ? options.body : JSON.stringify(options.body);
865
+ }
860
866
  try {
861
867
  const response = await fetch(fullUrl, {
862
868
  method,
863
869
  headers,
864
- body: options.body ? JSON.stringify(options.body) : undefined,
870
+ body,
865
871
  signal: options.signal
866
872
  });
867
873
  if (!response.ok) {
@@ -49,7 +49,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
49
49
  // Connection string placeholder that will be replaced during build
50
50
  const CONNECTION_STRING = "InstrumentationKey=a6efa11d-1feb-4508-9738-e13e12dcae5e;IngestionEndpoint=https://westeurope-5.in.applicationinsights.azure.com/;LiveEndpoint=https://westeurope.livediagnostics.monitor.azure.com/;ApplicationId=7c58eb1c-9581-4ba6-839e-11725848a037";
51
51
  // SDK Version placeholder
52
- const SDK_VERSION = "1.1.2";
52
+ const SDK_VERSION = "1.2.0";
53
53
  const VERSION = "Version";
54
54
  const SERVICE = "Service";
55
55
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -827,11 +827,8 @@ class ApiClient {
827
827
  return this.tokenManager.getValidToken();
828
828
  }
829
829
  async getDefaultHeaders() {
830
- // Get headers from execution context first
831
- const contextHeaders = this.executionContext.getHeaders();
832
830
  const token = await this.getValidToken();
833
831
  return {
834
- ...contextHeaders,
835
832
  'Authorization': `Bearer ${token}`,
836
833
  'Content-Type': CONTENT_TYPES.JSON,
837
834
  ...this.defaultHeaders,
@@ -843,8 +840,13 @@ class ApiClient {
843
840
  const normalizedPath = path.startsWith('/') ? path.substring(1) : path;
844
841
  // Construct URL with org and tenant names
845
842
  const url = new URL(`${this.config.orgName}/${this.config.tenantName}/${normalizedPath}`, this.config.baseUrl).toString();
843
+ const isFormData = options.body instanceof FormData;
844
+ const defaultHeaders = await this.getDefaultHeaders();
845
+ if (isFormData) {
846
+ delete defaultHeaders['Content-Type'];
847
+ }
846
848
  const headers = {
847
- ...await this.getDefaultHeaders(),
849
+ ...defaultHeaders,
848
850
  ...options.headers
849
851
  };
850
852
  // Convert params to URLSearchParams
@@ -855,11 +857,15 @@ class ApiClient {
855
857
  });
856
858
  }
857
859
  const fullUrl = searchParams.toString() ? `${url}?${searchParams.toString()}` : url;
860
+ let body = undefined;
861
+ if (options.body) {
862
+ body = isFormData ? options.body : JSON.stringify(options.body);
863
+ }
858
864
  try {
859
865
  const response = await fetch(fullUrl, {
860
866
  method,
861
867
  headers,
862
- body: options.body ? JSON.stringify(options.body) : undefined,
868
+ body,
863
869
  signal: options.signal
864
870
  });
865
871
  if (!response.ok) {