@uipath/common 1.202.0-preview.134 → 1.202.0-preview.137

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
@@ -2007,16 +2007,21 @@ function requireLoader() {
2007
2007
  state.result += _result;
2008
2008
  }
2009
2009
  }
2010
+ function chargeMergeWork(state) {
2011
+ state.totalMergeKeys++;
2012
+ if (state.maxTotalMergeKeys !== -1 && state.totalMergeKeys > state.maxTotalMergeKeys) {
2013
+ throwError(state, "merge keys exceeded maxTotalMergeKeys (" + state.maxTotalMergeKeys + ")");
2014
+ }
2015
+ }
2010
2016
  function mergeMappings(state, destination, source, overridableKeys) {
2011
2017
  if (!common2.isObject(source)) {
2012
2018
  throwError(state, "cannot merge mappings; the provided source object is unacceptable");
2013
2019
  }
2020
+ chargeMergeWork(state);
2014
2021
  const sourceKeys = Object.keys(source);
2015
2022
  for (let index = 0, quantity = sourceKeys.length;index < quantity; index += 1) {
2016
2023
  const key = sourceKeys[index];
2017
- if (state.maxTotalMergeKeys !== -1 && ++state.totalMergeKeys > state.maxTotalMergeKeys) {
2018
- throwError(state, "merge keys exceeded maxTotalMergeKeys (" + state.maxTotalMergeKeys + ")");
2019
- }
2024
+ chargeMergeWork(state);
2020
2025
  if (!_hasOwnProperty.call(destination, key)) {
2021
2026
  setProperty(destination, key, source[key]);
2022
2027
  overridableKeys[key] = true;
@@ -2044,6 +2049,9 @@ function requireLoader() {
2044
2049
  }
2045
2050
  if (keyTag === "tag:yaml.org,2002:merge") {
2046
2051
  if (Array.isArray(valueNode)) {
2052
+ if (valueNode.length > 100) {
2053
+ throwError(state, "abnormal merge sequence size");
2054
+ }
2047
2055
  for (let index = 0, quantity = valueNode.length;index < quantity; index += 1) {
2048
2056
  mergeMappings(state, _result, valueNode[index], overridableKeys);
2049
2057
  }
@@ -11272,6 +11280,14 @@ var RETRY_HINTS = [
11272
11280
  "RetryAfter30Seconds",
11273
11281
  "RetryAfter60Seconds"
11274
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
+ }
11275
11291
  var RESULTS = {
11276
11292
  Success: "Success",
11277
11293
  Failure: "Failure",
@@ -12215,8 +12231,6 @@ function resetInvocationRequest() {
12215
12231
 
12216
12232
  // src/trackedAction.ts
12217
12233
  var pollSignalSlot = singleton("PollSignal");
12218
- var cliErrorCodeValues = new Set(CLI_ERROR_CODES);
12219
- var retryHintValues = new Set(RETRY_HINTS);
12220
12234
  var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
12221
12235
  var processContext = {
12222
12236
  exit: (code) => {
@@ -12307,12 +12321,6 @@ function deriveCommandPath(cmd) {
12307
12321
  }
12308
12322
  return commandTelemetryName(parts);
12309
12323
  }
12310
- function isCliErrorCode(value) {
12311
- return typeof value === "string" && cliErrorCodeValues.has(value);
12312
- }
12313
- function isRetryHint(value) {
12314
- return typeof value === "string" && retryHintValues.has(value);
12315
- }
12316
12324
  function isErrorContext(value) {
12317
12325
  return value !== null && typeof value === "object";
12318
12326
  }
@@ -14095,10 +14103,12 @@ export {
14095
14103
  instructionsFor,
14096
14104
  invocationElapsedMs,
14097
14105
  invocationStartedAt,
14106
+ isCliErrorCode,
14098
14107
  isFailureStatus,
14099
14108
  isGuid,
14100
14109
  isHtmlDocument,
14101
14110
  isPreviewBuild,
14111
+ isRetryHint,
14102
14112
  isSuccessStatus,
14103
14113
  isTelemetryDisabled,
14104
14114
  isTerminalStatus,
@@ -14197,4 +14207,4 @@ export {
14197
14207
  writeTelemetrySpoolFile
14198
14208
  };
14199
14209
 
14200
- //# debugId=1209F26CEF86AB4564756E2164756E21
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.134",
4
+ "version": "1.202.0-preview.137",
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": "a335728adbdb02f28308e4f55d8936d0b150444b"
78
+ "gitHead": "bbb20a6d3501afc3435a92af9ae2e9f7ab2e34f6"
79
79
  }