@uipath/solution-sdk 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.
package/dist/index.js CHANGED
@@ -8544,7 +8544,7 @@ class TextApiResponse {
8544
8544
  var package_default = {
8545
8545
  name: "@uipath/solution-sdk",
8546
8546
  license: "MIT",
8547
- version: "1.202.0-preview.136",
8547
+ version: "1.202.0-preview.138",
8548
8548
  repository: {
8549
8549
  type: "git",
8550
8550
  url: "https://github.com/UiPath/cli.git",
@@ -14404,6 +14404,14 @@ var RETRY_HINTS = [
14404
14404
  "RetryAfter30Seconds",
14405
14405
  "RetryAfter60Seconds"
14406
14406
  ];
14407
+ var CLI_ERROR_CODE_VALUES = new Set(CLI_ERROR_CODES);
14408
+ var RETRY_HINT_VALUES = new Set(RETRY_HINTS);
14409
+ function isCliErrorCode(value) {
14410
+ return typeof value === "string" && CLI_ERROR_CODE_VALUES.has(value);
14411
+ }
14412
+ function isRetryHint(value) {
14413
+ return typeof value === "string" && RETRY_HINT_VALUES.has(value);
14414
+ }
14407
14415
  var RESULTS = {
14408
14416
  Success: "Success",
14409
14417
  Failure: "Failure",
@@ -15214,8 +15222,6 @@ function emitInvocationRequest(name, success, properties) {
15214
15222
 
15215
15223
  // ../common/src/trackedAction.ts
15216
15224
  var pollSignalSlot = singleton("PollSignal");
15217
- var cliErrorCodeValues = new Set(CLI_ERROR_CODES);
15218
- var retryHintValues = new Set(RETRY_HINTS);
15219
15225
  var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
15220
15226
  var TELEMETRY_ARG_VALUE_WITHHELD = "<provided>";
15221
15227
  var TELEMETRY_ARG_VALUE_DEFAULTED = "<default>";
@@ -15294,12 +15300,6 @@ function deriveCommandPath(cmd) {
15294
15300
  }
15295
15301
  return commandTelemetryName(parts);
15296
15302
  }
15297
- function isCliErrorCode(value) {
15298
- return typeof value === "string" && cliErrorCodeValues.has(value);
15299
- }
15300
- function isRetryHint(value) {
15301
- return typeof value === "string" && retryHintValues.has(value);
15302
- }
15303
15303
  function isErrorContext(value) {
15304
15304
  return value !== null && typeof value === "object";
15305
15305
  }
@@ -17901,4 +17901,4 @@ export {
17901
17901
  uploadOrOverwriteSolution
17902
17902
  };
17903
17903
 
17904
- //# debugId=1A2BECA476AAF7AA64756E2164756E21
17904
+ //# debugId=CE11D385CFED5B9064756E2164756E21
@@ -13932,6 +13932,14 @@ var RETRY_HINTS = [
13932
13932
  "RetryAfter30Seconds",
13933
13933
  "RetryAfter60Seconds"
13934
13934
  ];
13935
+ var CLI_ERROR_CODE_VALUES = new Set(CLI_ERROR_CODES);
13936
+ var RETRY_HINT_VALUES = new Set(RETRY_HINTS);
13937
+ function isCliErrorCode(value) {
13938
+ return typeof value === "string" && CLI_ERROR_CODE_VALUES.has(value);
13939
+ }
13940
+ function isRetryHint(value) {
13941
+ return typeof value === "string" && RETRY_HINT_VALUES.has(value);
13942
+ }
13935
13943
  var RESULTS = {
13936
13944
  Success: "Success",
13937
13945
  Failure: "Failure",
@@ -14742,8 +14750,6 @@ function emitInvocationRequest(name, success, properties) {
14742
14750
 
14743
14751
  // ../common/src/trackedAction.ts
14744
14752
  var pollSignalSlot = singleton("PollSignal");
14745
- var cliErrorCodeValues = new Set(CLI_ERROR_CODES);
14746
- var retryHintValues = new Set(RETRY_HINTS);
14747
14753
  var TELEMETRY_COMMAND_ARG_PREFIX = "uip.cmd.arg.";
14748
14754
  var TELEMETRY_ARG_VALUE_WITHHELD = "<provided>";
14749
14755
  var TELEMETRY_ARG_VALUE_DEFAULTED = "<default>";
@@ -14822,12 +14828,6 @@ function deriveCommandPath(cmd) {
14822
14828
  }
14823
14829
  return commandTelemetryName(parts);
14824
14830
  }
14825
- function isCliErrorCode(value) {
14826
- return typeof value === "string" && cliErrorCodeValues.has(value);
14827
- }
14828
- function isRetryHint(value) {
14829
- return typeof value === "string" && retryHintValues.has(value);
14830
- }
14831
14831
  function isErrorContext(value) {
14832
14832
  return value !== null && typeof value === "object";
14833
14833
  }
@@ -16788,8 +16788,7 @@ class ToolsFactoryRepository {
16788
16788
  getProjectToolFactory(projectType) {
16789
16789
  const factory = this.projectFactoryMap.get(projectType);
16790
16790
  if (!factory) {
16791
- const known = [...this.projectFactoryMap.keys()].join(", ");
16792
- throw new Error(`Cannot pack project type '${projectType}': no packager is installed for it. ` + `Project types that can be packed: ${known || "none"}.`);
16791
+ throw new Error(`Cannot pack project type '${projectType}': no packager is installed for it.`);
16793
16792
  }
16794
16793
  return factory;
16795
16794
  }
@@ -32433,6 +32432,26 @@ async function findProjectFile2(projectDir) {
32433
32432
  null
32434
32433
  ];
32435
32434
  }
32435
+
32436
+ class ProjectManifestError extends Error {
32437
+ __projectManifestError = true;
32438
+ reason;
32439
+ constructor(message, reason) {
32440
+ super(message);
32441
+ this.name = "ProjectManifestError";
32442
+ this.reason = reason;
32443
+ }
32444
+ }
32445
+ function isProjectManifestError(error) {
32446
+ return !!error && typeof error === "object" && error.__projectManifestError === true;
32447
+ }
32448
+ function isMissingProjectTypeError(error) {
32449
+ return isProjectManifestError(error) && error.reason === "no-project-type";
32450
+ }
32451
+ function lastPathSegment(filePath) {
32452
+ const parts = filePath.split(/[/\\]/);
32453
+ return parts[parts.length - 1] ?? filePath;
32454
+ }
32436
32455
  async function readProjectFile(filePath, useProjectJson) {
32437
32456
  const fs7 = getFileSystem();
32438
32457
  const [readError, rawContent] = await catchError2(fs7.readFile(filePath, "utf-8"));
@@ -32442,7 +32461,7 @@ async function readProjectFile(filePath, useProjectJson) {
32442
32461
  const [parseError, content] = catchError2(() => JSON.parse(rawContent));
32443
32462
  if (parseError) {
32444
32463
  return [
32445
- new Error(`Invalid JSON in project file: ${parseError.message}`),
32464
+ new ProjectManifestError(`Invalid JSON in project file: ${parseError.message}`, "invalid-json"),
32446
32465
  null
32447
32466
  ];
32448
32467
  }
@@ -32457,7 +32476,16 @@ async function readProjectFile(filePath, useProjectJson) {
32457
32476
  }
32458
32477
  ];
32459
32478
  }
32460
- return [new Error(`ProjectType not found in ${filePath}`), null];
32479
+ if (lastPathSegment(filePath) === "uipath.json") {
32480
+ return [
32481
+ new ProjectManifestError(`${filePath} has no 'ProjectType'. A uipath.json is only read as a code-first Functions project, which also needs a 'functions' entry. Other project types are registered from project.uiproj or project.json, not from uipath.json.`, "no-project-type"),
32482
+ null
32483
+ ];
32484
+ }
32485
+ return [
32486
+ new ProjectManifestError(`ProjectType not found in ${filePath}`, "no-project-type"),
32487
+ null
32488
+ ];
32461
32489
  }
32462
32490
  return [null, { content, projectType: normalizeProjectType(projectType) }];
32463
32491
  }
@@ -33280,6 +33308,7 @@ async function resourceRefreshAsync(solutionPath = ".", options = {}) {
33280
33308
  }
33281
33309
  export {
33282
33310
  EntryPointSpecEnhancer,
33311
+ ProjectManifestError,
33283
33312
  addProjectArtifactsToSolutionAsync,
33284
33313
  applyEntryPointEnhancementAsync,
33285
33314
  assertSolutionManifest,
@@ -33293,6 +33322,8 @@ export {
33293
33322
  findProjectFile2 as findProjectFile,
33294
33323
  findResourceByKeyInRcs,
33295
33324
  findResourceInRcs,
33325
+ isMissingProjectTypeError,
33326
+ isProjectManifestError,
33296
33327
  normalizeFolderPath,
33297
33328
  readProjectFile,
33298
33329
  readSolutionFile,
@@ -33308,4 +33339,4 @@ export {
33308
33339
  writeSolutionFile
33309
33340
  };
33310
33341
 
33311
- //# debugId=721B6823ADAAAA3D64756E2164756E21
33342
+ //# debugId=BE6597D080D5AC2664756E2164756E21
@@ -32,6 +32,35 @@ export interface ParsedSolutionFile {
32
32
  * project.uiproj, project.json, then uipath.json (code-first JS/TS Functions).
33
33
  */
34
34
  export declare function findProjectFile(projectDir: string): Promise<[Error, null] | [null, ProjectFileInfo]>;
35
+ /**
36
+ * Which way the manifest was unusable. `invalid-json` is a syntax error in the
37
+ * file; `no-project-type` is a file that parsed but declares no type. Callers
38
+ * that add guidance need the difference — advice about the wrong manifest
39
+ * makes no sense for a file that is merely mistyped.
40
+ */
41
+ export type ProjectManifestErrorReason = "invalid-json" | "no-project-type";
42
+ /**
43
+ * The manifest was read but is not usable: bad JSON, or no `ProjectType` to
44
+ * act on. Distinct from the raw `fs.readFile` failure `readProjectFile` also
45
+ * returns (EACCES on a file that exists, say) — that one is a local
46
+ * filesystem problem, not bad input, and callers must not classify the two
47
+ * the same way. `__projectManifestError` lets callers duck-type across bundle
48
+ * boundaries where `instanceof` fails.
49
+ */
50
+ export declare class ProjectManifestError extends Error {
51
+ readonly __projectManifestError = true;
52
+ readonly reason: ProjectManifestErrorReason;
53
+ constructor(message: string, reason: ProjectManifestErrorReason);
54
+ }
55
+ /** True when `error` is a {@link ProjectManifestError}, duck-typed. */
56
+ export declare function isProjectManifestError(error: unknown): boolean;
57
+ /**
58
+ * True when the manifest parsed but names no `ProjectType`. Callers gate
59
+ * "this may be the wrong manifest" guidance on this rather than on the file
60
+ * name alone: a `uipath.json` with a JSON typo is a different problem and
61
+ * must keep the parse error as its only advice.
62
+ */
63
+ export declare function isMissingProjectTypeError(error: unknown): boolean;
35
64
  /**
36
65
  * Reads and parses a project manifest, extracting the project type.
37
66
  */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/solution-sdk",
3
3
  "license": "MIT",
4
- "version": "1.202.0-preview.136",
4
+ "version": "1.202.0-preview.138",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/UiPath/cli.git",
@@ -39,5 +39,5 @@
39
39
  "dist"
40
40
  ],
41
41
  "private": false,
42
- "gitHead": "f6270de2c7c04f4c43b2f5187b0c3d3c314c2610"
42
+ "gitHead": "46372d5c4c4ae9352e9457a99e9d5efc1890cb48"
43
43
  }