@uipath/common 1.202.0-preview.136 → 1.202.0-preview.138

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.
@@ -14,6 +14,16 @@ export declare const CLI_ERROR_CODES: readonly ["invalid_argument", "authenticat
14
14
  export type CliErrorCode = (typeof CLI_ERROR_CODES)[number];
15
15
  export declare const RETRY_HINTS: readonly ["RetryWillNotFix", "RetryLater", "RetryAfter1Second", "RetryAfter10Seconds", "RetryAfter30Seconds", "RetryAfter60Seconds"];
16
16
  export type RetryHint = (typeof RETRY_HINTS)[number];
17
+ /**
18
+ * Narrow an arbitrary value to a {@link CliErrorCode}.
19
+ *
20
+ * Codes read off a caught error (or any other value the CLI did not produce
21
+ * itself) have to be checked rather than cast, or an unrecognised string
22
+ * reaches the output as an ErrorCode no consumer knows how to branch on.
23
+ */
24
+ export declare function isCliErrorCode(value: unknown): value is CliErrorCode;
25
+ /** Narrow an arbitrary value to a {@link RetryHint}. See {@link isCliErrorCode}. */
26
+ export declare function isRetryHint(value: unknown): value is RetryHint;
17
27
  /** Canonical string constants for {@link ResultType} values. */
18
28
  export declare const RESULTS: {
19
29
  readonly Success: "Success";
package/dist/index.js CHANGED
@@ -11280,6 +11280,14 @@ var RETRY_HINTS = [
11280
11280
  "RetryAfter30Seconds",
11281
11281
  "RetryAfter60Seconds"
11282
11282
  ];
11283
+ var CLI_ERROR_CODE_VALUES = new Set(CLI_ERROR_CODES);
11284
+ var RETRY_HINT_VALUES = new Set(RETRY_HINTS);
11285
+ function isCliErrorCode(value) {
11286
+ return typeof value === "string" && CLI_ERROR_CODE_VALUES.has(value);
11287
+ }
11288
+ function isRetryHint(value) {
11289
+ return typeof value === "string" && RETRY_HINT_VALUES.has(value);
11290
+ }
11283
11291
  var RESULTS = {
11284
11292
  Success: "Success",
11285
11293
  Failure: "Failure",
@@ -12223,8 +12231,6 @@ function resetInvocationRequest() {
12223
12231
 
12224
12232
  // src/trackedAction.ts
12225
12233
  var pollSignalSlot = singleton("PollSignal");
12226
- var cliErrorCodeValues = new Set(CLI_ERROR_CODES);
12227
- var retryHintValues = new Set(RETRY_HINTS);
12228
12234
  var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
12229
12235
  var processContext = {
12230
12236
  exit: (code) => {
@@ -12315,12 +12321,6 @@ function deriveCommandPath(cmd) {
12315
12321
  }
12316
12322
  return commandTelemetryName(parts);
12317
12323
  }
12318
- function isCliErrorCode(value) {
12319
- return typeof value === "string" && cliErrorCodeValues.has(value);
12320
- }
12321
- function isRetryHint(value) {
12322
- return typeof value === "string" && retryHintValues.has(value);
12323
- }
12324
12324
  function isErrorContext(value) {
12325
12325
  return value !== null && typeof value === "object";
12326
12326
  }
@@ -14103,10 +14103,12 @@ export {
14103
14103
  instructionsFor,
14104
14104
  invocationElapsedMs,
14105
14105
  invocationStartedAt,
14106
+ isCliErrorCode,
14106
14107
  isFailureStatus,
14107
14108
  isGuid,
14108
14109
  isHtmlDocument,
14109
14110
  isPreviewBuild,
14111
+ isRetryHint,
14110
14112
  isSuccessStatus,
14111
14113
  isTelemetryDisabled,
14112
14114
  isTerminalStatus,
@@ -14205,4 +14207,4 @@ export {
14205
14207
  writeTelemetrySpoolFile
14206
14208
  };
14207
14209
 
14208
- //# debugId=32AF799EBF618DA564756E2164756E21
14210
+ //# debugId=39D73B2CDA6F6AF764756E2164756E21
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/common",
3
3
  "license": "MIT",
4
- "version": "1.202.0-preview.136",
4
+ "version": "1.202.0-preview.138",
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": "f6270de2c7c04f4c43b2f5187b0c3d3c314c2610"
78
+ "gitHead": "46372d5c4c4ae9352e9457a99e9d5efc1890cb48"
79
79
  }