@uipath/common 1.202.0-preview.149 → 1.202.0-preview.151

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.
@@ -24,6 +24,23 @@ export type RetryHint = (typeof RETRY_HINTS)[number];
24
24
  export declare function isCliErrorCode(value: unknown): value is CliErrorCode;
25
25
  /** Narrow an arbitrary value to a {@link RetryHint}. See {@link isCliErrorCode}. */
26
26
  export declare function isRetryHint(value: unknown): value is RetryHint;
27
+ /**
28
+ * The `ErrorCode` an error carries, when it classified itself.
29
+ *
30
+ * Companion to `carriedInstructions` (error-handler): a thrower that knows its
31
+ * failure mode can say so, and the renderer uses it instead of defaulting to
32
+ * `unknown_error`. Duck-typed and validated for the same reason — the error may
33
+ * have crossed a bundle boundary, and an unrecognised string must not reach the
34
+ * envelope as a code no consumer can branch on.
35
+ *
36
+ * Lives here, beside {@link isCliErrorCode}, rather than next to
37
+ * `carriedInstructions`: error-handler reaches formatter type-only on purpose,
38
+ * and a runtime edge from there pulls this module's telemetry imports into the
39
+ * browser bundle, which cannot require node builtins.
40
+ */
41
+ export declare function carriedErrorCode(error: unknown): CliErrorCode | undefined;
42
+ /** The `Retry` hint an error carries. See {@link carriedErrorCode}. */
43
+ export declare function carriedRetry(error: unknown): RetryHint | undefined;
27
44
  /** Canonical string constants for {@link ResultType} values. */
28
45
  export declare const RESULTS: {
29
46
  readonly Success: "Success";
package/dist/index.js CHANGED
@@ -10765,6 +10765,18 @@ function isCliErrorCode(value) {
10765
10765
  function isRetryHint(value) {
10766
10766
  return typeof value === "string" && RETRY_HINT_VALUES.has(value);
10767
10767
  }
10768
+ function carriedErrorCode(error) {
10769
+ if (!error || typeof error !== "object")
10770
+ return;
10771
+ const code = error.errorCode;
10772
+ return isCliErrorCode(code) ? code : undefined;
10773
+ }
10774
+ function carriedRetry(error) {
10775
+ if (!error || typeof error !== "object")
10776
+ return;
10777
+ const retry = error.retry;
10778
+ return isRetryHint(retry) ? retry : undefined;
10779
+ }
10768
10780
  var RESULTS = {
10769
10781
  Success: "Success",
10770
10782
  Failure: "Failure",
@@ -13513,7 +13525,9 @@ export {
13513
13525
  buildOrchestratorUrl,
13514
13526
  buildSkillEventTelemetryAttribution,
13515
13527
  canPrompt,
13528
+ carriedErrorCode,
13516
13529
  carriedInstructions,
13530
+ carriedRetry,
13517
13531
  catchError,
13518
13532
  claimPendingSpoolFiles,
13519
13533
  classifiedFailure,
@@ -13684,4 +13698,4 @@ export {
13684
13698
  writeTelemetrySpoolFile
13685
13699
  };
13686
13700
 
13687
- //# debugId=E388413E446272F364756E2164756E21
13701
+ //# debugId=0C2EC5E3F8DF6D7564756E2164756E21
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/common",
3
3
  "license": "SEE LICENSE IN LICENSE.txt",
4
- "version": "1.202.0-preview.149",
4
+ "version": "1.202.0-preview.151",
5
5
  "description": "Common infrastructure needed by uip tools.",
6
6
  "repository": {
7
7
  "type": "git",
@@ -75,5 +75,5 @@
75
75
  "mihaigirleanu",
76
76
  "vlad-uipath"
77
77
  ],
78
- "gitHead": "d32b9f0191b9dc454edd2ce20024383cc3eb3f37"
78
+ "gitHead": "98bbaa985d34352b6fa380561c2f9269832be5e6"
79
79
  }