@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.
@@ -547,11 +547,8 @@ class ApiClient {
547
547
  return this.tokenManager.getValidToken();
548
548
  }
549
549
  async getDefaultHeaders() {
550
- // Get headers from execution context first
551
- const contextHeaders = this.executionContext.getHeaders();
552
550
  const token = await this.getValidToken();
553
551
  return {
554
- ...contextHeaders,
555
552
  'Authorization': `Bearer ${token}`,
556
553
  'Content-Type': CONTENT_TYPES.JSON,
557
554
  ...this.defaultHeaders,
@@ -563,8 +560,13 @@ class ApiClient {
563
560
  const normalizedPath = path.startsWith('/') ? path.substring(1) : path;
564
561
  // Construct URL with org and tenant names
565
562
  const url = new URL(`${this.config.orgName}/${this.config.tenantName}/${normalizedPath}`, this.config.baseUrl).toString();
563
+ const isFormData = options.body instanceof FormData;
564
+ const defaultHeaders = await this.getDefaultHeaders();
565
+ if (isFormData) {
566
+ delete defaultHeaders['Content-Type'];
567
+ }
566
568
  const headers = {
567
- ...await this.getDefaultHeaders(),
569
+ ...defaultHeaders,
568
570
  ...options.headers
569
571
  };
570
572
  // Convert params to URLSearchParams
@@ -575,11 +577,15 @@ class ApiClient {
575
577
  });
576
578
  }
577
579
  const fullUrl = searchParams.toString() ? `${url}?${searchParams.toString()}` : url;
580
+ let body = undefined;
581
+ if (options.body) {
582
+ body = isFormData ? options.body : JSON.stringify(options.body);
583
+ }
578
584
  try {
579
585
  const response = await fetch(fullUrl, {
580
586
  method,
581
587
  headers,
582
- body: options.body ? JSON.stringify(options.body) : undefined,
588
+ body,
583
589
  signal: options.signal
584
590
  });
585
591
  if (!response.ok) {
@@ -1726,7 +1732,7 @@ class BpmnHelpers {
1726
1732
  // Connection string placeholder that will be replaced during build
1727
1733
  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";
1728
1734
  // SDK Version placeholder
1729
- const SDK_VERSION = "1.1.2";
1735
+ const SDK_VERSION = "1.2.0";
1730
1736
  const VERSION = "Version";
1731
1737
  const SERVICE = "Service";
1732
1738
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -545,11 +545,8 @@ class ApiClient {
545
545
  return this.tokenManager.getValidToken();
546
546
  }
547
547
  async getDefaultHeaders() {
548
- // Get headers from execution context first
549
- const contextHeaders = this.executionContext.getHeaders();
550
548
  const token = await this.getValidToken();
551
549
  return {
552
- ...contextHeaders,
553
550
  'Authorization': `Bearer ${token}`,
554
551
  'Content-Type': CONTENT_TYPES.JSON,
555
552
  ...this.defaultHeaders,
@@ -561,8 +558,13 @@ class ApiClient {
561
558
  const normalizedPath = path.startsWith('/') ? path.substring(1) : path;
562
559
  // Construct URL with org and tenant names
563
560
  const url = new URL(`${this.config.orgName}/${this.config.tenantName}/${normalizedPath}`, this.config.baseUrl).toString();
561
+ const isFormData = options.body instanceof FormData;
562
+ const defaultHeaders = await this.getDefaultHeaders();
563
+ if (isFormData) {
564
+ delete defaultHeaders['Content-Type'];
565
+ }
564
566
  const headers = {
565
- ...await this.getDefaultHeaders(),
567
+ ...defaultHeaders,
566
568
  ...options.headers
567
569
  };
568
570
  // Convert params to URLSearchParams
@@ -573,11 +575,15 @@ class ApiClient {
573
575
  });
574
576
  }
575
577
  const fullUrl = searchParams.toString() ? `${url}?${searchParams.toString()}` : url;
578
+ let body = undefined;
579
+ if (options.body) {
580
+ body = isFormData ? options.body : JSON.stringify(options.body);
581
+ }
576
582
  try {
577
583
  const response = await fetch(fullUrl, {
578
584
  method,
579
585
  headers,
580
- body: options.body ? JSON.stringify(options.body) : undefined,
586
+ body,
581
587
  signal: options.signal
582
588
  });
583
589
  if (!response.ok) {
@@ -1724,7 +1730,7 @@ class BpmnHelpers {
1724
1730
  // Connection string placeholder that will be replaced during build
1725
1731
  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";
1726
1732
  // SDK Version placeholder
1727
- const SDK_VERSION = "1.1.2";
1733
+ const SDK_VERSION = "1.2.0";
1728
1734
  const VERSION = "Version";
1729
1735
  const SERVICE = "Service";
1730
1736
  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) {
@@ -1706,7 +1712,7 @@ const PROCESS_ENDPOINTS = {
1706
1712
  // Connection string placeholder that will be replaced during build
1707
1713
  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";
1708
1714
  // SDK Version placeholder
1709
- const SDK_VERSION = "1.1.2";
1715
+ const SDK_VERSION = "1.2.0";
1710
1716
  const VERSION = "Version";
1711
1717
  const SERVICE = "Service";
1712
1718
  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) {
@@ -1704,7 +1710,7 @@ const PROCESS_ENDPOINTS = {
1704
1710
  // Connection string placeholder that will be replaced during build
1705
1711
  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";
1706
1712
  // SDK Version placeholder
1707
- const SDK_VERSION = "1.1.2";
1713
+ const SDK_VERSION = "1.2.0";
1708
1714
  const VERSION = "Version";
1709
1715
  const SERVICE = "Service";
1710
1716
  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) {
@@ -1670,7 +1676,7 @@ const QueueMap = {
1670
1676
  // Connection string placeholder that will be replaced during build
1671
1677
  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";
1672
1678
  // SDK Version placeholder
1673
- const SDK_VERSION = "1.1.2";
1679
+ const SDK_VERSION = "1.2.0";
1674
1680
  const VERSION = "Version";
1675
1681
  const SERVICE = "Service";
1676
1682
  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) {
@@ -1668,7 +1674,7 @@ const QueueMap = {
1668
1674
  // Connection string placeholder that will be replaced during build
1669
1675
  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";
1670
1676
  // SDK Version placeholder
1671
- const SDK_VERSION = "1.1.2";
1677
+ const SDK_VERSION = "1.2.0";
1672
1678
  const VERSION = "Version";
1673
1679
  const SERVICE = "Service";
1674
1680
  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) {
@@ -1896,7 +1902,7 @@ const TASK_ENDPOINTS = {
1896
1902
  // Connection string placeholder that will be replaced during build
1897
1903
  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";
1898
1904
  // SDK Version placeholder
1899
- const SDK_VERSION = "1.1.2";
1905
+ const SDK_VERSION = "1.2.0";
1900
1906
  const VERSION = "Version";
1901
1907
  const SERVICE = "Service";
1902
1908
  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) {
@@ -1894,7 +1900,7 @@ const TASK_ENDPOINTS = {
1894
1900
  // Connection string placeholder that will be replaced during build
1895
1901
  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";
1896
1902
  // SDK Version placeholder
1897
- const SDK_VERSION = "1.1.2";
1903
+ const SDK_VERSION = "1.2.0";
1898
1904
  const VERSION = "Version";
1899
1905
  const SERVICE = "Service";
1900
1906
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/uipath-typescript",
3
- "version": "1.1.2",
3
+ "version": "1.2.0",
4
4
  "description": "UiPath TypeScript SDK",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -187,4 +187,4 @@
187
187
  "workspaces": [
188
188
  "packages/*"
189
189
  ]
190
- }
190
+ }