@uipath/uipath-typescript 1.3.0 → 1.3.2

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.
Files changed (41) hide show
  1. package/dist/assets/index.cjs +5 -8
  2. package/dist/assets/index.d.ts +3 -1
  3. package/dist/assets/index.mjs +5 -8
  4. package/dist/attachments/index.cjs +5 -8
  5. package/dist/attachments/index.d.ts +3 -1
  6. package/dist/attachments/index.mjs +5 -8
  7. package/dist/buckets/index.cjs +5 -8
  8. package/dist/buckets/index.d.ts +3 -1
  9. package/dist/buckets/index.mjs +5 -8
  10. package/dist/cases/index.cjs +5 -8
  11. package/dist/cases/index.d.ts +3 -1
  12. package/dist/cases/index.mjs +5 -8
  13. package/dist/conversational-agent/index.cjs +38 -16
  14. package/dist/conversational-agent/index.d.ts +26 -4
  15. package/dist/conversational-agent/index.mjs +38 -16
  16. package/dist/core/index.cjs +7 -5
  17. package/dist/core/index.d.ts +2 -2
  18. package/dist/core/index.mjs +7 -5
  19. package/dist/entities/index.cjs +680 -284
  20. package/dist/entities/index.d.ts +559 -45
  21. package/dist/entities/index.mjs +681 -285
  22. package/dist/index.cjs +520 -89
  23. package/dist/index.d.ts +604 -52
  24. package/dist/index.mjs +521 -90
  25. package/dist/index.umd.js +520 -89
  26. package/dist/jobs/index.cjs +57 -27
  27. package/dist/jobs/index.d.ts +70 -11
  28. package/dist/jobs/index.mjs +57 -27
  29. package/dist/maestro-processes/index.cjs +5 -8
  30. package/dist/maestro-processes/index.d.ts +3 -1
  31. package/dist/maestro-processes/index.mjs +5 -8
  32. package/dist/processes/index.cjs +5 -8
  33. package/dist/processes/index.d.ts +3 -1
  34. package/dist/processes/index.mjs +5 -8
  35. package/dist/queues/index.cjs +5 -8
  36. package/dist/queues/index.d.ts +3 -1
  37. package/dist/queues/index.mjs +5 -8
  38. package/dist/tasks/index.cjs +5 -8
  39. package/dist/tasks/index.d.ts +3 -1
  40. package/dist/tasks/index.mjs +5 -8
  41. package/package.json +1 -1
@@ -230,6 +230,8 @@ declare class BaseService {
230
230
  *
231
231
  * @param instance - UiPath SDK instance providing authentication and configuration.
232
232
  * Services receive this via dependency injection in the modular pattern.
233
+ * @param headers - Optional default headers to include in every request (e.g. `x-uipath-external-user-id` for
234
+ * CAS external-app auth)
233
235
  *
234
236
  * @example
235
237
  * ```typescript
@@ -249,7 +251,7 @@ declare class BaseService {
249
251
  * const entities = new Entities(sdk);
250
252
  * ```
251
253
  */
252
- constructor(instance: IUiPath);
254
+ constructor(instance: IUiPath, headers?: Record<string, string>);
253
255
  /**
254
256
  * Gets a valid authentication token, refreshing if necessary.
255
257
  * Use this when you need to manually add Authorization headers (e.g., direct uploads).
@@ -4634,7 +4636,11 @@ interface ConversationalAgentServiceModel {
4634
4636
  * Options for ConversationalAgentService constructor
4635
4637
  */
4636
4638
  interface ConversationalAgentOptions {
4637
- /** External User ID (optional) */
4639
+ /**
4640
+ * External user ID required when authenticating via an app-scoped external app
4641
+ * (client credential grant). Must be set when the access token was issued for an
4642
+ * external app client; omit for standard UiPath user tokens.
4643
+ */
4638
4644
  externalUserId?: string;
4639
4645
  /** Log level for debugging */
4640
4646
  logLevel?: LogLevel;
@@ -6093,8 +6099,9 @@ declare class ConversationService extends BaseService implements ConversationSer
6093
6099
  * Creates an instance of the Conversations service.
6094
6100
  *
6095
6101
  * @param instance - UiPath SDK instance providing authentication and configuration
6102
+ * @param options - Optional configuration (e.g. externalUserId for external app auth)
6096
6103
  */
6097
- constructor(instance: IUiPath$1);
6104
+ constructor(instance: IUiPath$1, options?: ConversationalAgentOptions);
6098
6105
  /**
6099
6106
  * Creates a new conversation
6100
6107
  *
@@ -6338,6 +6345,13 @@ declare class ConversationService extends BaseService implements ConversationSer
6338
6345
  * ```
6339
6346
  */
6340
6347
  declare class ExchangeService extends BaseService implements ExchangeServiceModel {
6348
+ /**
6349
+ * Creates an instance of the ExchangeService.
6350
+ *
6351
+ * @param instance - UiPath SDK instance providing authentication and configuration
6352
+ * @param options - Optional configuration (e.g. externalUserId for external app auth)
6353
+ */
6354
+ constructor(instance: IUiPath$1, options?: ConversationalAgentOptions);
6341
6355
  /**
6342
6356
  * Gets all exchanges for a conversation with optional filtering and pagination
6343
6357
  *
@@ -6452,6 +6466,13 @@ declare class ExchangeService extends BaseService implements ExchangeServiceMode
6452
6466
  * ```
6453
6467
  */
6454
6468
  declare class MessageService extends BaseService implements MessageServiceModel {
6469
+ /**
6470
+ * Creates an instance of the MessageService.
6471
+ *
6472
+ * @param instance - UiPath SDK instance providing authentication and configuration
6473
+ * @param options - Optional configuration (e.g. externalUserId for external app auth)
6474
+ */
6475
+ constructor(instance: IUiPath$1, options?: ConversationalAgentOptions);
6455
6476
  /**
6456
6477
  * Gets a message by ID
6457
6478
  *
@@ -6513,8 +6534,9 @@ declare class ConversationalAgentService extends BaseService implements Conversa
6513
6534
  * Creates an instance of the ConversationalAgent service.
6514
6535
  *
6515
6536
  * @param instance - UiPath SDK instance providing authentication and configuration
6537
+ * @param options - Optional configuration (e.g. externalUserId for external app auth)
6516
6538
  */
6517
- constructor(instance: IUiPath$1);
6539
+ constructor(instance: IUiPath$1, options?: ConversationalAgentOptions);
6518
6540
  /**
6519
6541
  * Registers a handler that is called whenever the WebSocket connection status changes.
6520
6542
  *
@@ -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.3.0";
52
+ const SDK_VERSION = "1.3.2";
53
53
  const VERSION = "Version";
54
54
  const SERVICE = "Service";
55
55
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -796,26 +796,27 @@ const RESPONSE_TYPES = {
796
796
  BLOB: 'blob',
797
797
  ARRAYBUFFER: 'arraybuffer'
798
798
  };
799
+ /**
800
+ * Header key for external user ID (used in both HTTP and WebSocket for external app auth
801
+ * in Conversational Agents Service)
802
+ */
803
+ const EXTERNAL_USER_ID = 'x-uipath-external-user-id';
799
804
  /**
800
805
  * Query parameter keys sent during WebSocket connection
801
806
  */
802
807
  const WEBSOCKET_QUERY_PARAMS = {
803
808
  ORGANIZATION_ID: 'x-uipath-internal-accountid',
804
809
  TENANT_ID: 'x-uipath-internal-tenantid',
805
- EXTERNAL_USER_ID: 'x-uipath-external-user-id'
810
+ EXTERNAL_USER_ID,
806
811
  };
807
812
 
808
813
  class ApiClient {
809
814
  constructor(config, executionContext, tokenManager, clientConfig = {}) {
810
- this.defaultHeaders = {};
811
815
  this.config = config;
812
816
  this.executionContext = executionContext;
813
817
  this.clientConfig = clientConfig;
814
818
  this.tokenManager = tokenManager;
815
819
  }
816
- setDefaultHeaders(headers) {
817
- this.defaultHeaders = { ...this.defaultHeaders, ...headers };
818
- }
819
820
  /**
820
821
  * Gets a valid authentication token, refreshing if necessary.
821
822
  * Used internally for API requests and exposed for services that need manual auth headers.
@@ -831,7 +832,6 @@ class ApiClient {
831
832
  return {
832
833
  'Authorization': `Bearer ${token}`,
833
834
  'Content-Type': CONTENT_TYPES.JSON,
834
- ...this.defaultHeaders,
835
835
  ...this.clientConfig.headers
836
836
  };
837
837
  }
@@ -1695,6 +1695,8 @@ class BaseService {
1695
1695
  *
1696
1696
  * @param instance - UiPath SDK instance providing authentication and configuration.
1697
1697
  * Services receive this via dependency injection in the modular pattern.
1698
+ * @param headers - Optional default headers to include in every request (e.g. `x-uipath-external-user-id` for
1699
+ * CAS external-app auth)
1698
1700
  *
1699
1701
  * @example
1700
1702
  * ```typescript
@@ -1714,11 +1716,11 @@ class BaseService {
1714
1716
  * const entities = new Entities(sdk);
1715
1717
  * ```
1716
1718
  */
1717
- constructor(instance) {
1719
+ constructor(instance, headers) {
1718
1720
  // Private field - not visible via Object.keys() or any reflection
1719
1721
  _BaseService_apiClient.set(this, void 0);
1720
1722
  const { config, context, tokenManager } = SDKInternalsRegistry.get(instance);
1721
- __classPrivateFieldSet(this, _BaseService_apiClient, new ApiClient(config, context, tokenManager), "f");
1723
+ __classPrivateFieldSet(this, _BaseService_apiClient, new ApiClient(config, context, tokenManager, headers ? { headers } : {}), "f");
1722
1724
  }
1723
1725
  /**
1724
1726
  * Gets a valid authentication token, refreshing if necessary.
@@ -5009,6 +5011,15 @@ function transformMessage(message) {
5009
5011
  * ```
5010
5012
  */
5011
5013
  class ExchangeService extends BaseService {
5014
+ /**
5015
+ * Creates an instance of the ExchangeService.
5016
+ *
5017
+ * @param instance - UiPath SDK instance providing authentication and configuration
5018
+ * @param options - Optional configuration (e.g. externalUserId for external app auth)
5019
+ */
5020
+ constructor(instance, options) {
5021
+ super(instance, options?.externalUserId ? { [EXTERNAL_USER_ID]: options.externalUserId } : undefined);
5022
+ }
5012
5023
  /**
5013
5024
  * Gets all exchanges for a conversation with optional filtering and pagination
5014
5025
  *
@@ -5981,13 +5992,14 @@ class ConversationService extends BaseService {
5981
5992
  * Creates an instance of the Conversations service.
5982
5993
  *
5983
5994
  * @param instance - UiPath SDK instance providing authentication and configuration
5995
+ * @param options - Optional configuration (e.g. externalUserId for external app auth)
5984
5996
  */
5985
- constructor(instance) {
5986
- super(instance);
5997
+ constructor(instance, options) {
5998
+ super(instance, options?.externalUserId ? { [EXTERNAL_USER_ID]: options.externalUserId } : undefined);
5987
5999
  /** Event helper for conversation events */
5988
6000
  this._eventHelper = null;
5989
- this._sessionManager = new SessionManager(instance);
5990
- this._exchangeService = new ExchangeService(instance);
6001
+ this._sessionManager = new SessionManager(instance, options);
6002
+ this._exchangeService = new ExchangeService(instance, options);
5991
6003
  }
5992
6004
  // ==================== Conversation CRUD Operations ====================
5993
6005
  /**
@@ -6369,6 +6381,15 @@ __decorate([
6369
6381
  * ```
6370
6382
  */
6371
6383
  class MessageService extends BaseService {
6384
+ /**
6385
+ * Creates an instance of the MessageService.
6386
+ *
6387
+ * @param instance - UiPath SDK instance providing authentication and configuration
6388
+ * @param options - Optional configuration (e.g. externalUserId for external app auth)
6389
+ */
6390
+ constructor(instance, options) {
6391
+ super(instance, options?.externalUserId ? { [EXTERNAL_USER_ID]: options.externalUserId } : undefined);
6392
+ }
6372
6393
  /**
6373
6394
  * Gets a message by ID
6374
6395
  *
@@ -6439,11 +6460,12 @@ class ConversationalAgentService extends BaseService {
6439
6460
  * Creates an instance of the ConversationalAgent service.
6440
6461
  *
6441
6462
  * @param instance - UiPath SDK instance providing authentication and configuration
6463
+ * @param options - Optional configuration (e.g. externalUserId for external app auth)
6442
6464
  */
6443
- constructor(instance) {
6444
- super(instance);
6465
+ constructor(instance, options) {
6466
+ super(instance, options?.externalUserId ? { [EXTERNAL_USER_ID]: options.externalUserId } : undefined);
6445
6467
  // Create conversation service with WebSocket support
6446
- this.conversations = new ConversationService(instance);
6468
+ this.conversations = new ConversationService(instance, options);
6447
6469
  }
6448
6470
  /**
6449
6471
  * Registers a handler that is called whenever the WebSocket connection status changes.
@@ -4851,6 +4851,7 @@ class TokenManager {
4851
4851
  }
4852
4852
  }
4853
4853
 
4854
+ const GUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
4854
4855
  class AuthService {
4855
4856
  constructor(config, executionContext) {
4856
4857
  // Only use stored OAuth context when completing an active callback (URL has ?code=).
@@ -5134,6 +5135,8 @@ class AuthService {
5134
5135
  */
5135
5136
  getAuthorizationUrl(params) {
5136
5137
  const orgName = this.config.orgName;
5138
+ const isGuid = GUID_REGEX.test(orgName);
5139
+ const acrValues = isGuid ? `tenant:${orgName}` : `tenantName:${orgName}`;
5137
5140
  const queryParams = new URLSearchParams({
5138
5141
  response_type: 'code',
5139
5142
  client_id: params.clientId,
@@ -5143,13 +5146,12 @@ class AuthService {
5143
5146
  scope: params.scope + ' offline_access',
5144
5147
  state: params.state || this.generateCodeVerifier().slice(0, 16)
5145
5148
  });
5146
- return `${this.config.baseUrl}/${orgName}/${IDENTITY_ENDPOINTS.AUTHORIZE}?${queryParams.toString()}`;
5149
+ return `${this.config.baseUrl}/${IDENTITY_ENDPOINTS.AUTHORIZE}?${queryParams.toString()}&acr_values=${acrValues}`;
5147
5150
  }
5148
5151
  /**
5149
5152
  * Exchanges the authorization code for an access token and automatically updates the current token
5150
5153
  */
5151
5154
  async _getAccessToken(params) {
5152
- const orgName = this.config.orgName;
5153
5155
  const body = new URLSearchParams({
5154
5156
  grant_type: 'authorization_code',
5155
5157
  client_id: params.clientId,
@@ -5157,7 +5159,7 @@ class AuthService {
5157
5159
  redirect_uri: params.redirectUri,
5158
5160
  code_verifier: params.codeVerifier
5159
5161
  });
5160
- const response = await fetch(`${this.config.baseUrl}/${orgName}/${IDENTITY_ENDPOINTS.TOKEN}`, {
5162
+ const response = await fetch(`${this.config.baseUrl}/${IDENTITY_ENDPOINTS.TOKEN}`, {
5161
5163
  method: 'POST',
5162
5164
  headers: {
5163
5165
  'Content-Type': 'application/x-www-form-urlencoded'
@@ -5278,7 +5280,7 @@ function normalizeBaseUrl(url) {
5278
5280
  // Connection string placeholder that will be replaced during build
5279
5281
  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";
5280
5282
  // SDK Version placeholder
5281
- const SDK_VERSION = "1.3.0";
5283
+ const SDK_VERSION = "1.3.2";
5282
5284
  const VERSION = "Version";
5283
5285
  const SERVICE = "Service";
5284
5286
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -5667,7 +5669,7 @@ var _UiPath_instances, _UiPath_config, _UiPath_authService, _UiPath_initialized,
5667
5669
  *
5668
5670
  * Supports two usage patterns:
5669
5671
  * 1. Full config in constructor — for server-side or explicit configuration
5670
- * 2. No config / partial config — loads from meta tags injected by @uipath/coded-apps plugin
5672
+ * 2. No config / partial config — loads from meta tags injected by @uipath/coded-apps-dev plugin
5671
5673
  *
5672
5674
  * @example
5673
5675
  * ```typescript
@@ -91,7 +91,7 @@ interface IUiPath {
91
91
  *
92
92
  * Supports two usage patterns:
93
93
  * 1. Full config in constructor — for server-side or explicit configuration
94
- * 2. No config / partial config — loads from meta tags injected by @uipath/coded-apps plugin
94
+ * 2. No config / partial config — loads from meta tags injected by @uipath/coded-apps-dev plugin
95
95
  *
96
96
  * @example
97
97
  * ```typescript
@@ -519,7 +519,7 @@ declare const telemetryClient: TelemetryClient;
519
519
  * SDK Telemetry constants
520
520
  */
521
521
  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";
522
- declare const SDK_VERSION = "1.3.0";
522
+ declare const SDK_VERSION = "1.3.2";
523
523
  declare const VERSION = "Version";
524
524
  declare const SERVICE = "Service";
525
525
  declare const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -4849,6 +4849,7 @@ class TokenManager {
4849
4849
  }
4850
4850
  }
4851
4851
 
4852
+ const GUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
4852
4853
  class AuthService {
4853
4854
  constructor(config, executionContext) {
4854
4855
  // Only use stored OAuth context when completing an active callback (URL has ?code=).
@@ -5132,6 +5133,8 @@ class AuthService {
5132
5133
  */
5133
5134
  getAuthorizationUrl(params) {
5134
5135
  const orgName = this.config.orgName;
5136
+ const isGuid = GUID_REGEX.test(orgName);
5137
+ const acrValues = isGuid ? `tenant:${orgName}` : `tenantName:${orgName}`;
5135
5138
  const queryParams = new URLSearchParams({
5136
5139
  response_type: 'code',
5137
5140
  client_id: params.clientId,
@@ -5141,13 +5144,12 @@ class AuthService {
5141
5144
  scope: params.scope + ' offline_access',
5142
5145
  state: params.state || this.generateCodeVerifier().slice(0, 16)
5143
5146
  });
5144
- return `${this.config.baseUrl}/${orgName}/${IDENTITY_ENDPOINTS.AUTHORIZE}?${queryParams.toString()}`;
5147
+ return `${this.config.baseUrl}/${IDENTITY_ENDPOINTS.AUTHORIZE}?${queryParams.toString()}&acr_values=${acrValues}`;
5145
5148
  }
5146
5149
  /**
5147
5150
  * Exchanges the authorization code for an access token and automatically updates the current token
5148
5151
  */
5149
5152
  async _getAccessToken(params) {
5150
- const orgName = this.config.orgName;
5151
5153
  const body = new URLSearchParams({
5152
5154
  grant_type: 'authorization_code',
5153
5155
  client_id: params.clientId,
@@ -5155,7 +5157,7 @@ class AuthService {
5155
5157
  redirect_uri: params.redirectUri,
5156
5158
  code_verifier: params.codeVerifier
5157
5159
  });
5158
- const response = await fetch(`${this.config.baseUrl}/${orgName}/${IDENTITY_ENDPOINTS.TOKEN}`, {
5160
+ const response = await fetch(`${this.config.baseUrl}/${IDENTITY_ENDPOINTS.TOKEN}`, {
5159
5161
  method: 'POST',
5160
5162
  headers: {
5161
5163
  'Content-Type': 'application/x-www-form-urlencoded'
@@ -5276,7 +5278,7 @@ function normalizeBaseUrl(url) {
5276
5278
  // Connection string placeholder that will be replaced during build
5277
5279
  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";
5278
5280
  // SDK Version placeholder
5279
- const SDK_VERSION = "1.3.0";
5281
+ const SDK_VERSION = "1.3.2";
5280
5282
  const VERSION = "Version";
5281
5283
  const SERVICE = "Service";
5282
5284
  const CLOUD_ORGANIZATION_NAME = "CloudOrganizationName";
@@ -5665,7 +5667,7 @@ var _UiPath_instances, _UiPath_config, _UiPath_authService, _UiPath_initialized,
5665
5667
  *
5666
5668
  * Supports two usage patterns:
5667
5669
  * 1. Full config in constructor — for server-side or explicit configuration
5668
- * 2. No config / partial config — loads from meta tags injected by @uipath/coded-apps plugin
5670
+ * 2. No config / partial config — loads from meta tags injected by @uipath/coded-apps-dev plugin
5669
5671
  *
5670
5672
  * @example
5671
5673
  * ```typescript