@uipath/uipath-typescript 1.1.0 → 1.1.1

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.
@@ -1677,7 +1677,7 @@ const AssetMap = {
1677
1677
  // Connection string placeholder that will be replaced during build
1678
1678
  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";
1679
1679
  // SDK Version placeholder
1680
- const SDK_VERSION = "1.1.0";
1680
+ const SDK_VERSION = "1.1.1";
1681
1681
  const VERSION = "Version";
1682
1682
  const SERVICE = "Service";
1683
1683
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -1675,7 +1675,7 @@ const AssetMap = {
1675
1675
  // Connection string placeholder that will be replaced during build
1676
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";
1677
1677
  // SDK Version placeholder
1678
- const SDK_VERSION = "1.1.0";
1678
+ const SDK_VERSION = "1.1.1";
1679
1679
  const VERSION = "Version";
1680
1680
  const SERVICE = "Service";
1681
1681
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -1724,7 +1724,7 @@ const BucketMap = {
1724
1724
  // Connection string placeholder that will be replaced during build
1725
1725
  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
1726
  // SDK Version placeholder
1727
- const SDK_VERSION = "1.1.0";
1727
+ const SDK_VERSION = "1.1.1";
1728
1728
  const VERSION = "Version";
1729
1729
  const SERVICE = "Service";
1730
1730
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -1722,7 +1722,7 @@ const BucketMap = {
1722
1722
  // Connection string placeholder that will be replaced during build
1723
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";
1724
1724
  // SDK Version placeholder
1725
- const SDK_VERSION = "1.1.0";
1725
+ const SDK_VERSION = "1.1.1";
1726
1726
  const VERSION = "Version";
1727
1727
  const SERVICE = "Service";
1728
1728
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -1832,7 +1832,7 @@ const MAESTRO_ENDPOINTS = {
1832
1832
  // Connection string placeholder that will be replaced during build
1833
1833
  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";
1834
1834
  // SDK Version placeholder
1835
- const SDK_VERSION = "1.1.0";
1835
+ const SDK_VERSION = "1.1.1";
1836
1836
  const VERSION = "Version";
1837
1837
  const SERVICE = "Service";
1838
1838
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -1830,7 +1830,7 @@ const MAESTRO_ENDPOINTS = {
1830
1830
  // Connection string placeholder that will be replaced during build
1831
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";
1832
1832
  // SDK Version placeholder
1833
- const SDK_VERSION = "1.1.0";
1833
+ const SDK_VERSION = "1.1.1";
1834
1834
  const VERSION = "Version";
1835
1835
  const SERVICE = "Service";
1836
1836
  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.0";
54
+ const SDK_VERSION = "1.1.1";
55
55
  const VERSION = "Version";
56
56
  const SERVICE = "Service";
57
57
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -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.0";
52
+ const SDK_VERSION = "1.1.1";
53
53
  const VERSION = "Version";
54
54
  const SERVICE = "Service";
55
55
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -3879,6 +3879,15 @@ class ExecutionContext {
3879
3879
  */
3880
3880
  const isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';
3881
3881
 
3882
+ /**
3883
+ * Session storage keys used by the auth module
3884
+ */
3885
+ const AUTH_STORAGE_KEYS = {
3886
+ TOKEN_PREFIX: 'uipath_sdk_user_token-',
3887
+ OAUTH_CONTEXT: 'uipath_sdk_oauth_context',
3888
+ CODE_VERIFIER: 'uipath_sdk_code_verifier',
3889
+ };
3890
+
3882
3891
  // Type guard to check if config has OAuth credentials
3883
3892
  function hasOAuthConfig(config) {
3884
3893
  return Boolean(config.clientId && config.redirectUri && config.scope);
@@ -4188,7 +4197,6 @@ class TokenManager {
4188
4197
  this.executionContext = executionContext;
4189
4198
  this.config = config;
4190
4199
  this.isOAuth = isOAuth;
4191
- this.STORAGE_KEY_PREFIX = 'uipath_sdk_user_token-';
4192
4200
  this.refreshPromise = null;
4193
4201
  }
4194
4202
  /**
@@ -4242,7 +4250,7 @@ class TokenManager {
4242
4250
  * Gets the storage key for this TokenManager instance
4243
4251
  */
4244
4252
  _getStorageKey() {
4245
- return `${this.STORAGE_KEY_PREFIX}${this.config.clientId}`;
4253
+ return `${AUTH_STORAGE_KEYS.TOKEN_PREFIX}${this.config.clientId}`;
4246
4254
  }
4247
4255
  /**
4248
4256
  * Loads token from session storage if available
@@ -4488,7 +4496,7 @@ class AuthService {
4488
4496
  return false;
4489
4497
  const urlParams = new URLSearchParams(window.location.search);
4490
4498
  const code = urlParams.get('code');
4491
- const hasCodeVerifier = sessionStorage.getItem('uipath_sdk_code_verifier');
4499
+ const hasCodeVerifier = sessionStorage.getItem(AUTH_STORAGE_KEYS.CODE_VERIFIER);
4492
4500
  return !!(code && hasCodeVerifier);
4493
4501
  }
4494
4502
  /**
@@ -4499,7 +4507,7 @@ class AuthService {
4499
4507
  return null;
4500
4508
  }
4501
4509
  try {
4502
- const stored = sessionStorage.getItem('uipath_sdk_oauth_context');
4510
+ const stored = sessionStorage.getItem(AUTH_STORAGE_KEYS.OAUTH_CONTEXT);
4503
4511
  if (!stored) {
4504
4512
  return null;
4505
4513
  }
@@ -4507,13 +4515,13 @@ class AuthService {
4507
4515
  // Validate required fields
4508
4516
  if (!context.codeVerifier || !context.clientId || !context.redirectUri ||
4509
4517
  !context.baseUrl || !context.orgName) {
4510
- sessionStorage.removeItem('uipath_sdk_oauth_context');
4518
+ sessionStorage.removeItem(AUTH_STORAGE_KEYS.OAUTH_CONTEXT);
4511
4519
  return null;
4512
4520
  }
4513
4521
  return context;
4514
4522
  }
4515
4523
  catch (error) {
4516
- sessionStorage.removeItem('uipath_sdk_oauth_context');
4524
+ sessionStorage.removeItem(AUTH_STORAGE_KEYS.OAUTH_CONTEXT);
4517
4525
  console.warn('Failed to parse stored OAuth context from session storage', error);
4518
4526
  return null;
4519
4527
  }
@@ -4588,7 +4596,7 @@ class AuthService {
4588
4596
  throw new Error('OAuth flow is only supported in browser environments');
4589
4597
  }
4590
4598
  // Check if we have a stored code verifier indicating we're in an OAuth flow
4591
- const codeVerifier = sessionStorage.getItem('uipath_sdk_code_verifier');
4599
+ const codeVerifier = sessionStorage.getItem(AUTH_STORAGE_KEYS.CODE_VERIFIER);
4592
4600
  const isInOAuthFlow = codeVerifier !== null;
4593
4601
  const urlParams = new URLSearchParams(window.location.search);
4594
4602
  const code = urlParams.get('code');
@@ -4597,7 +4605,7 @@ class AuthService {
4597
4605
  // We're expecting a callback - validate parameters
4598
4606
  if (!code) {
4599
4607
  // Clear stored state on error
4600
- sessionStorage.removeItem('uipath_sdk_code_verifier');
4608
+ sessionStorage.removeItem(AUTH_STORAGE_KEYS.CODE_VERIFIER);
4601
4609
  throw new Error('Authorization code missing in OAuth callback');
4602
4610
  }
4603
4611
  // Validate the authorization code format before using it
@@ -4605,7 +4613,7 @@ class AuthService {
4605
4613
  const codePattern = /^[A-Za-z0-9\-._~+/]+=*$/;
4606
4614
  if (!codePattern.test(code)) {
4607
4615
  // Clear stored state on error
4608
- sessionStorage.removeItem('uipath_sdk_code_verifier');
4616
+ sessionStorage.removeItem(AUTH_STORAGE_KEYS.CODE_VERIFIER);
4609
4617
  throw new Error('Invalid authorization code format');
4610
4618
  }
4611
4619
  // Authorization code is present and validated, so we can exchange it for a token.
@@ -4646,6 +4654,24 @@ class AuthService {
4646
4654
  hasValidToken() {
4647
4655
  return this.tokenManager.hasValidToken();
4648
4656
  }
4657
+ /**
4658
+ * Clears all authentication state including tokens and stored OAuth context.
4659
+ */
4660
+ logout() {
4661
+ this.tokenManager.clearToken();
4662
+ // Clear OAuth context from session storage. These are normally cleaned up in _handleOAuthCallback after a successful
4663
+ // token exchange, but if a user calls logout() while an OAuth flow is
4664
+ // mid-redirect (before callback completes), they'd be left behind.
4665
+ if (isBrowser) {
4666
+ try {
4667
+ sessionStorage.removeItem(AUTH_STORAGE_KEYS.OAUTH_CONTEXT);
4668
+ sessionStorage.removeItem(AUTH_STORAGE_KEYS.CODE_VERIFIER);
4669
+ }
4670
+ catch (error) {
4671
+ console.warn('Failed to clear OAuth context from session storage', error);
4672
+ }
4673
+ }
4674
+ }
4649
4675
  /**
4650
4676
  * Get the current token
4651
4677
  */
@@ -4777,8 +4803,8 @@ class AuthService {
4777
4803
  tenantName: this.config.tenantName,
4778
4804
  scope
4779
4805
  };
4780
- sessionStorage.setItem('uipath_sdk_oauth_context', JSON.stringify(oauthContext));
4781
- sessionStorage.setItem('uipath_sdk_code_verifier', codeVerifier);
4806
+ sessionStorage.setItem(AUTH_STORAGE_KEYS.OAUTH_CONTEXT, JSON.stringify(oauthContext));
4807
+ sessionStorage.setItem(AUTH_STORAGE_KEYS.CODE_VERIFIER, codeVerifier);
4782
4808
  const authUrl = this.getAuthorizationUrl({
4783
4809
  clientId,
4784
4810
  redirectUri,
@@ -4788,7 +4814,7 @@ class AuthService {
4788
4814
  window.location.href = authUrl;
4789
4815
  }
4790
4816
  async _handleOAuthCallback(code, clientId, redirectUri) {
4791
- const codeVerifier = sessionStorage.getItem('uipath_sdk_code_verifier');
4817
+ const codeVerifier = sessionStorage.getItem(AUTH_STORAGE_KEYS.CODE_VERIFIER);
4792
4818
  if (!codeVerifier) {
4793
4819
  throw new Error('Code verifier not found in session storage. Authentication may have been interrupted.');
4794
4820
  }
@@ -4799,8 +4825,8 @@ class AuthService {
4799
4825
  codeVerifier
4800
4826
  });
4801
4827
  // Clear OAuth context and code verifier after successful token exchange
4802
- sessionStorage.removeItem('uipath_sdk_oauth_context');
4803
- sessionStorage.removeItem('uipath_sdk_code_verifier');
4828
+ sessionStorage.removeItem(AUTH_STORAGE_KEYS.OAUTH_CONTEXT);
4829
+ sessionStorage.removeItem(AUTH_STORAGE_KEYS.CODE_VERIFIER);
4804
4830
  const url = new URL(window.location.href);
4805
4831
  url.searchParams.delete('code');
4806
4832
  url.searchParams.delete('state');
@@ -4826,7 +4852,7 @@ function normalizeBaseUrl(url) {
4826
4852
  // Connection string placeholder that will be replaced during build
4827
4853
  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";
4828
4854
  // SDK Version placeholder
4829
- const SDK_VERSION = "1.1.0";
4855
+ const SDK_VERSION = "1.1.1";
4830
4856
  const VERSION = "Version";
4831
4857
  const SERVICE = "Service";
4832
4858
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -5034,6 +5060,65 @@ const telemetryClient = TelemetryClient.getInstance();
5034
5060
  /**
5035
5061
  * SDK Track decorator and function for telemetry
5036
5062
  */
5063
+ /**
5064
+ * Common tracking logic shared between method and function decorators
5065
+ */
5066
+ function createTrackedFunction(originalFunction, nameOrOptions, fallbackName, opts) {
5067
+ return function (...args) {
5068
+ // Determine if we should track this call
5069
+ let shouldTrack = true;
5070
+ if (opts.condition !== undefined) {
5071
+ if (typeof opts.condition === 'function') {
5072
+ shouldTrack = opts.condition.apply(this, args);
5073
+ }
5074
+ else {
5075
+ shouldTrack = opts.condition;
5076
+ }
5077
+ }
5078
+ // Track the event if enabled
5079
+ if (shouldTrack) {
5080
+ // Use the full name provided in the decorator (e.g., "Queue.GetAll")
5081
+ const serviceMethod = typeof nameOrOptions === 'string'
5082
+ ? nameOrOptions
5083
+ : fallbackName;
5084
+ // Use 'Sdk.Run' as the name and serviceMethod as the service
5085
+ telemetryClient.track(serviceMethod, SDK_RUN_EVENT, opts.attributes);
5086
+ }
5087
+ // Execute the original function
5088
+ return originalFunction.apply(this, args);
5089
+ };
5090
+ }
5091
+ /**
5092
+ * Track decorator that can be used to automatically track function calls
5093
+ *
5094
+ * Usage:
5095
+ * @track("Service.Method")
5096
+ * function myFunction() { ... }
5097
+ *
5098
+ * @track("Queue.GetAll")
5099
+ * async getAll() { ... }
5100
+ *
5101
+ * @track("Tasks.Create")
5102
+ * async create() { ... }
5103
+ *
5104
+ * @track("Assets.Update", { condition: false })
5105
+ * function myFunction() { ... }
5106
+ *
5107
+ * @track("Processes.Start", { attributes: { customProp: "value" } })
5108
+ * function myFunction() { ... }
5109
+ */
5110
+ function track(nameOrOptions, options) {
5111
+ return function decorator(_target, propertyKey, descriptor) {
5112
+ const opts = typeof nameOrOptions === 'object' ? nameOrOptions : options || {};
5113
+ if (descriptor && typeof descriptor.value === 'function') {
5114
+ // Method decorator
5115
+ descriptor.value = createTrackedFunction(descriptor.value, nameOrOptions, propertyKey || 'unknown_method', opts);
5116
+ return descriptor;
5117
+ }
5118
+ // Function decorator
5119
+ return (originalFunction) => createTrackedFunction(originalFunction, nameOrOptions, originalFunction.name || 'unknown_function', opts);
5120
+ };
5121
+ }
5037
5122
  /**
5038
5123
  * Direct tracking function
5039
5124
  */
@@ -5252,6 +5337,18 @@ class UiPath {
5252
5337
  getToken() {
5253
5338
  return __classPrivateFieldGet(this, _UiPath_authService, "f").getToken();
5254
5339
  }
5340
+ /**
5341
+ * Logout from the SDK, clearing all authentication state.
5342
+ * After calling this method, the user will need to re-initialize to authenticate again.
5343
+ */
5344
+ logout() {
5345
+ // Secret-based auth has no session to end — skip silently
5346
+ if (hasSecretConfig(__classPrivateFieldGet(this, _UiPath_config, "f"))) {
5347
+ return;
5348
+ }
5349
+ __classPrivateFieldGet(this, _UiPath_authService, "f").logout();
5350
+ __classPrivateFieldSet(this, _UiPath_initialized, false, "f");
5351
+ }
5255
5352
  }
5256
5353
  _UiPath_config = new WeakMap(), _UiPath_authService = new WeakMap(), _UiPath_initialized = new WeakMap();
5257
5354
 
@@ -5278,8 +5375,16 @@ function getLimitedPageSize(pageSize) {
5278
5375
  return Math.max(1, Math.min(pageSize, MAX_PAGE_SIZE));
5279
5376
  }
5280
5377
 
5378
+ exports.APP_NAME = APP_NAME;
5281
5379
  exports.AuthenticationError = AuthenticationError;
5282
5380
  exports.AuthorizationError = AuthorizationError;
5381
+ exports.CLOUD_CLIENT_ID = CLOUD_CLIENT_ID;
5382
+ exports.CLOUD_ORGANIZATION_NAME = CLOUD_ORGANIZATION_NAME;
5383
+ exports.CLOUD_REDIRECT_URI = CLOUD_REDIRECT_URI;
5384
+ exports.CLOUD_ROLE_NAME = CLOUD_ROLE_NAME;
5385
+ exports.CLOUD_TENANT_NAME = CLOUD_TENANT_NAME;
5386
+ exports.CLOUD_URL = CLOUD_URL;
5387
+ exports.CONNECTION_STRING = CONNECTION_STRING;
5283
5388
  exports.DEFAULT_ITEMS_FIELD = DEFAULT_ITEMS_FIELD;
5284
5389
  exports.DEFAULT_PAGE_SIZE = DEFAULT_PAGE_SIZE;
5285
5390
  exports.DEFAULT_TOTAL_COUNT_FIELD = DEFAULT_TOTAL_COUNT_FIELD;
@@ -5289,9 +5394,16 @@ exports.MAX_PAGE_SIZE = MAX_PAGE_SIZE;
5289
5394
  exports.NetworkError = NetworkError;
5290
5395
  exports.NotFoundError = NotFoundError;
5291
5396
  exports.RateLimitError = RateLimitError;
5397
+ exports.SDK_LOGGER_NAME = SDK_LOGGER_NAME;
5398
+ exports.SDK_RUN_EVENT = SDK_RUN_EVENT;
5399
+ exports.SDK_SERVICE_NAME = SDK_SERVICE_NAME;
5400
+ exports.SDK_VERSION = SDK_VERSION;
5401
+ exports.SERVICE = SERVICE;
5292
5402
  exports.ServerError = ServerError;
5403
+ exports.UNKNOWN = UNKNOWN;
5293
5404
  exports.UiPath = UiPath;
5294
5405
  exports.UiPathError = UiPathError;
5406
+ exports.VERSION = VERSION;
5295
5407
  exports.ValidationError = ValidationError;
5296
5408
  exports.getErrorDetails = getErrorDetails;
5297
5409
  exports.getLimitedPageSize = getLimitedPageSize;
@@ -5303,3 +5415,6 @@ exports.isRateLimitError = isRateLimitError;
5303
5415
  exports.isServerError = isServerError;
5304
5416
  exports.isUiPathError = isUiPathError;
5305
5417
  exports.isValidationError = isValidationError;
5418
+ exports.telemetryClient = telemetryClient;
5419
+ exports.track = track;
5420
+ exports.trackEvent = trackEvent;
@@ -56,6 +56,11 @@ interface IUiPath {
56
56
  * Get the current authentication token
57
57
  */
58
58
  getToken(): string | undefined;
59
+ /**
60
+ * Logout from the SDK, clearing all authentication state.
61
+ * After calling this method, the user will need to re-initialize to authenticate again.
62
+ */
63
+ logout(): void;
59
64
  }
60
65
 
61
66
  /**
@@ -116,6 +121,11 @@ declare class UiPath implements IUiPath {
116
121
  * Get the current authentication token
117
122
  */
118
123
  getToken(): string | undefined;
124
+ /**
125
+ * Logout from the SDK, clearing all authentication state.
126
+ * After calling this method, the user will need to re-initialize to authenticate again.
127
+ */
128
+ logout(): void;
119
129
  }
120
130
 
121
131
  /**
@@ -394,5 +404,103 @@ declare const DEFAULT_TOTAL_COUNT_FIELD = "@odata.count";
394
404
  */
395
405
  declare function getLimitedPageSize(pageSize?: number): number;
396
406
 
397
- export { AuthenticationError, AuthorizationError, DEFAULT_ITEMS_FIELD, DEFAULT_PAGE_SIZE, DEFAULT_TOTAL_COUNT_FIELD, ErrorType, HttpStatus, MAX_PAGE_SIZE, NetworkError, NotFoundError, RateLimitError, ServerError, UiPath, UiPathError, ValidationError, getErrorDetails, getLimitedPageSize, isAuthenticationError, isAuthorizationError, isNetworkError, isNotFoundError, isRateLimitError, isServerError, isUiPathError, isValidationError };
407
+ /**
408
+ * Telemetry type definitions
409
+ */
410
+ interface TelemetryAttributes {
411
+ [key: string]: string | number | boolean;
412
+ }
413
+ interface TelemetryConfig {
414
+ baseUrl?: string;
415
+ orgName?: string;
416
+ tenantName?: string;
417
+ clientId?: string;
418
+ redirectUri?: string;
419
+ }
420
+ interface TrackOptions {
421
+ condition?: boolean | ((...args: any[]) => boolean);
422
+ attributes?: TelemetryAttributes;
423
+ }
424
+
425
+ /**
426
+ * SDK Track decorator and function for telemetry
427
+ */
428
+
429
+ /**
430
+ * Track decorator that can be used to automatically track function calls
431
+ *
432
+ * Usage:
433
+ * @track("Service.Method")
434
+ * function myFunction() { ... }
435
+ *
436
+ * @track("Queue.GetAll")
437
+ * async getAll() { ... }
438
+ *
439
+ * @track("Tasks.Create")
440
+ * async create() { ... }
441
+ *
442
+ * @track("Assets.Update", { condition: false })
443
+ * function myFunction() { ... }
444
+ *
445
+ * @track("Processes.Start", { attributes: { customProp: "value" } })
446
+ * function myFunction() { ... }
447
+ */
448
+ declare function track(nameOrOptions?: string | TrackOptions, options?: TrackOptions): MethodDecorator | ((target: any) => any);
449
+ /**
450
+ * Direct tracking function
451
+ */
452
+ declare function trackEvent(eventName: string, name?: string, attributes?: TelemetryAttributes): void;
453
+
454
+ /**
455
+ * Singleton telemetry client
456
+ */
457
+ declare class TelemetryClient {
458
+ private static instance;
459
+ private isInitialized;
460
+ private logProvider?;
461
+ private logger?;
462
+ private telemetryContext?;
463
+ private constructor();
464
+ static getInstance(): TelemetryClient;
465
+ /**
466
+ * Initialize telemetry
467
+ */
468
+ initialize(config?: TelemetryConfig): void;
469
+ private getConnectionString;
470
+ private setupTelemetryProvider;
471
+ /**
472
+ * Track a telemetry event
473
+ */
474
+ track(eventName: string, name?: string, extraAttributes?: TelemetryAttributes): void;
475
+ /**
476
+ * Get enriched attributes for telemetry events
477
+ */
478
+ private getEnrichedAttributes;
479
+ /**
480
+ * Create cloud URL from base URL, organization ID, and tenant ID
481
+ */
482
+ private createCloudUrl;
483
+ }
484
+ declare const telemetryClient: TelemetryClient;
485
+
486
+ /**
487
+ * SDK Telemetry constants
488
+ */
489
+ declare 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";
490
+ declare const SDK_VERSION = "1.1.1";
491
+ declare const VERSION = "Version";
492
+ declare const SERVICE = "Service";
493
+ declare const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
494
+ declare const CLOUD_TENANT_NAME = "CloudTenantName";
495
+ declare const CLOUD_URL = "CloudUrl";
496
+ declare const CLOUD_CLIENT_ID = "CloudClientId";
497
+ declare const CLOUD_REDIRECT_URI = "CloudRedirectUri";
498
+ declare const APP_NAME = "ApplicationName";
499
+ declare const CLOUD_ROLE_NAME = "uipath-ts-sdk";
500
+ declare const SDK_SERVICE_NAME = "UiPath.TypeScript.Sdk";
501
+ declare const SDK_LOGGER_NAME = "uipath-ts-sdk-telemetry";
502
+ declare const SDK_RUN_EVENT = "Sdk.Run";
503
+ declare const UNKNOWN = "";
504
+
505
+ export { APP_NAME, AuthenticationError, AuthorizationError, CLOUD_CLIENT_ID, CLOUD_ORGANIZATION_NAME, CLOUD_REDIRECT_URI, CLOUD_ROLE_NAME, CLOUD_TENANT_NAME, CLOUD_URL, CONNECTION_STRING, DEFAULT_ITEMS_FIELD, DEFAULT_PAGE_SIZE, DEFAULT_TOTAL_COUNT_FIELD, ErrorType, HttpStatus, MAX_PAGE_SIZE, NetworkError, NotFoundError, RateLimitError, SDK_LOGGER_NAME, SDK_RUN_EVENT, SDK_SERVICE_NAME, SDK_VERSION, SERVICE, ServerError, UNKNOWN, UiPath, UiPathError, VERSION, ValidationError, getErrorDetails, getLimitedPageSize, isAuthenticationError, isAuthorizationError, isNetworkError, isNotFoundError, isRateLimitError, isServerError, isUiPathError, isValidationError, telemetryClient, track, trackEvent };
398
506
  export type { HasPaginationOptions, NonPaginatedResponse, PaginatedResponse, PaginationCursor, PaginationMethodUnion, PaginationOptions, UiPathSDKConfig };