@uipath/rules-tool 1.206.0-preview.310 → 1.206.0-preview.312

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  FirstPartyServiceApi2
3
- } from "./tool-yfaf9b8c.js";
3
+ } from "./tool-bvzdfw28.js";
4
4
  export {
5
5
  FirstPartyServiceApi2 as FirstPartyServiceApi
6
6
  };
@@ -5,12 +5,14 @@ import {
5
5
  findCatalogEntityAsync2,
6
6
  toResourceReference2,
7
7
  exportResourceDefinitionAsync2,
8
+ ResourceExportError2,
8
9
  readSpecEntryPoints2
9
- } from "./tool-yfaf9b8c.js";
10
+ } from "./tool-bvzdfw28.js";
10
11
  import"./tool-0tbve332.js";
11
12
  import"./tool-3755q59j.js";
12
13
  import"./tool-syavphgt.js";
13
14
  export {
15
+ ResourceExportError2 as ResourceExportError,
14
16
  addProjectArtifactsToSolutionAsync2 as addProjectArtifactsToSolutionAsync,
15
17
  createResourceBuilderServices2 as createResourceBuilderServices,
16
18
  exportResourceDefinitionAsync2 as exportResourceDefinitionAsync,
@@ -20,4 +22,4 @@ export {
20
22
  toResourceReference2 as toResourceReference
21
23
  };
22
24
 
23
- //# debugId=E74EC712ED5645CE64756E2164756E21
25
+ //# debugId=C4E74E7249593BDD64756E2164756E21
@@ -8,7 +8,7 @@ import {
8
8
  JsonSerializerFactory2,
9
9
  JsonSerializerProxy2,
10
10
  StreamSerializer2
11
- } from "./tool-yfaf9b8c.js";
11
+ } from "./tool-bvzdfw28.js";
12
12
  export {
13
13
  CAMEL_CASE_ENUM_PROPERTIES2 as CAMEL_CASE_ENUM_PROPERTIES,
14
14
  JsonSerializer2 as JsonSerializer,
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  metadata2,
7
7
  registerCommands2
8
- } from "./tool-bdknjenw.js";
8
+ } from "./tool-pg61e8zk.js";
9
9
 
10
10
  // src/index.ts
11
11
  var program = new Command;
@@ -1,5 +1,7 @@
1
+ import {
2
+ catchError
3
+ } from "./tool-syavphgt.js";
1
4
  import"./tool-3755q59j.js";
2
- import"./tool-syavphgt.js";
3
5
  import {
4
6
  getSolutionAuthContext,
5
7
  createResourceBuilderServices2,
@@ -7,8 +9,9 @@ import {
7
9
  findCatalogEntityAsync2,
8
10
  toResourceReference2,
9
11
  exportResourceDefinitionAsync2,
12
+ ResourceExportError2,
10
13
  readSpecEntryPoints2
11
- } from "./tool-yfaf9b8c.js";
14
+ } from "./tool-bvzdfw28.js";
12
15
  import {
13
16
  RulesCommandError2
14
17
  } from "./tool-jzdt6z77.js";
@@ -28,7 +31,13 @@ async function describeRuleAsync(name, folder) {
28
31
  await findRuleByName2(await createRulesApi2(undefined, folder), name, folder);
29
32
  throw new RulesCommandError2(`Business rule '${name}' is not in the resource catalog for folder '${folder.path}' yet.`, "not_found", "The rule exists in Orchestrator but the resource catalog does not list it yet, which is normal right after a deploy. Run the command again shortly.", "RetryAfter60Seconds");
30
33
  }
31
- const definition = await exportResourceDefinitionAsync2(importer, toResourceReference2(entity));
34
+ const [exportError, definition] = await catchError(exportResourceDefinitionAsync2(importer, toResourceReference2(entity)));
35
+ if (exportError) {
36
+ if (exportError instanceof ResourceExportError2 && exportError.status === 404) {
37
+ throw new RulesCommandError2(`Business rule '${name}' is in the resource catalog for folder '${folder.path}', but Orchestrator could not export it (404).`, "not_found", "This is normal for a few minutes right after a deploy. Run the command again shortly. If it keeps failing, the rule may have been deleted and the catalog not caught up yet.", "RetryAfter60Seconds", { httpStatus: 404 });
38
+ }
39
+ throw exportError;
40
+ }
32
41
  return readEntryPoints(definition?.spec, name);
33
42
  }
34
43
  async function listRulesAcrossFoldersAsync(limit, offset) {
@@ -68,4 +77,4 @@ export {
68
77
  listRulesAcrossFoldersAsync
69
78
  };
70
79
 
71
- //# debugId=20E2B7D41910710264756E2164756E21
80
+ //# debugId=5FEA07F48ACDA86D64756E2164756E21
@@ -12,7 +12,7 @@ import {
12
12
  import {
13
13
  buildSolutionPackageFromDir,
14
14
  uploadOrOverwriteSolution
15
- } from "./tool-s5qjpxfk.js";
15
+ } from "./tool-v0n0z37s.js";
16
16
  import {
17
17
  RulesCommandError2,
18
18
  isJsonObject2
@@ -2,7 +2,7 @@ import {
2
2
  getFileSystem,
3
3
  catchError
4
4
  } from "./tool-syavphgt.js";
5
- import"./tool-s5qjpxfk.js";
5
+ import"./tool-v0n0z37s.js";
6
6
  import"./tool-jzdt6z77.js";
7
7
  import {
8
8
  prepareProjectLocation,
@@ -16,7 +16,7 @@ import {
16
16
 
17
17
  // src/services/project-artifacts.ts
18
18
  async function ensureProjectArtifacts(args) {
19
- const { addProjectArtifactsToSolutionAsync } = await import("./index-88sps467.js");
19
+ const { addProjectArtifactsToSolutionAsync } = await import("./index-7105pjnn.js");
20
20
  return addProjectArtifactsToSolutionAsync(args);
21
21
  }
22
22
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  SolutionDefinitionHelper2
3
- } from "./tool-yfaf9b8c.js";
3
+ } from "./tool-bvzdfw28.js";
4
4
  export {
5
5
  SolutionDefinitionHelper2 as SolutionDefinitionHelper
6
6
  };
@@ -6198,7 +6198,7 @@ class MultiFileSolutionDefinitionProvider {
6198
6198
  const metadataReader = this.metadataReaderAccessor?.();
6199
6199
  if (!metadataReader)
6200
6200
  return void this.logger.warn("Solution %s has resources sharing a key, and no metadata reader is available to resolve them; they are left in place and this read will not agree with one that can resolve them", solution.key);
6201
- const { SolutionDefinitionHelper } = await import("./solution-definition-helper-trxp0zbj.js");
6201
+ const { SolutionDefinitionHelper } = await import("./solution-definition-helper-tyqk2mb3.js");
6202
6202
  await new SolutionDefinitionHelper(metadataReader, this.logger).replaceDuplicateKeysAsync(solution, cancellationToken);
6203
6203
  }
6204
6204
  getSolutionKey(context) {
@@ -6522,7 +6522,7 @@ var service_tokens_ServiceLifetime = /* @__PURE__ */ function(ServiceLifetime) {
6522
6522
  async function createDefaultEmbeddedFileReaderAsync() {
6523
6523
  const [{ EmbeddedFileReader }, { JsonSerializerFactory }] = await Promise.all([
6524
6524
  import("./embedded-file-reader-pxpwcq3n.js"),
6525
- import("./index-s9wmt93c.js")
6525
+ import("./index-c9z3zjpg.js")
6526
6526
  ]);
6527
6527
  return new EmbeddedFileReader(new JsonSerializerFactory);
6528
6528
  }
@@ -14301,7 +14301,7 @@ class FirstPartyServiceClientProxy {
14301
14301
  const tenantKey = await this.accessProvider.getTenantKeyAsync(cancellationToken);
14302
14302
  if (!accountKey)
14303
14303
  throw new BadRequestException(ErrorCodes.AuthenticationFailed, "Unable to obtain account key");
14304
- const client = new (await import("./first-party-service-ej32b6j2.js")).FirstPartyServiceApi({
14304
+ const client = new (await import("./first-party-service-xybnzzaz.js")).FirstPartyServiceApi({
14305
14305
  baseUrl: fullBaseUrl,
14306
14306
  customFetch: fetchWithTimeout(LONG_RUNNING_TIMEOUT_MS),
14307
14307
  baseApiParams: {
@@ -19955,9 +19955,30 @@ function toCatalogReference(reference) {
19955
19955
  };
19956
19956
  }
19957
19957
  async function exportResourceDefinitionAsync2(importer, reference) {
19958
- const payload = await importer.exportResourceAsync(reference);
19958
+ const [error, payload] = await catchError(importer.exportResourceAsync(reference));
19959
+ if (error) {
19960
+ throw withExportStatus(error);
19961
+ }
19959
19962
  return payload.resourceDefinitions.find((d) => d.key === reference.key);
19960
19963
  }
19964
+
19965
+ class ResourceExportError2 extends Error {
19966
+ status;
19967
+ constructor(message, status, cause) {
19968
+ super(message, { cause });
19969
+ this.status = status;
19970
+ this.name = "ResourceExportError";
19971
+ }
19972
+ }
19973
+ function withExportStatus(error) {
19974
+ if (!(error instanceof Error) || !("exceptionData" in error)) {
19975
+ return error;
19976
+ }
19977
+ const data = error.exceptionData;
19978
+ const text = typeof data === "object" && data !== null ? data.errorMessage : undefined;
19979
+ const match = typeof text === "string" ? /^HTTP (\d{3})\b/.exec(text) : null;
19980
+ return match ? new ResourceExportError2(error.message, Number(match[1]), error) : error;
19981
+ }
19961
19982
  function readSpecProperty(spec, name) {
19962
19983
  if (!spec) {
19963
19984
  return;
@@ -20017,6 +20038,6 @@ var TYPE_IS_IDENTITY_REPLACE_OPTIONS = new Set([
20017
20038
  "SameNameAndType"
20018
20039
  ]);
20019
20040
  var BINDINGS_JSON_FALLBACK_TYPES = new Set(["agent", "function"]);
20020
- export { getSolutionAuthContext, JsonSerializerNames2, JsonSerializer2, CAMEL_CASE_ENUM_PROPERTIES2, SHARED_CORE_ABSTRACTIONS_PASCAL_CASE_PROPERTIES2, RESOURCE_BUILDER_PASCAL_CASE_PROPERTIES2, PASCAL_CASE_ENUM_PROPERTIES2, JsonSerializerFactory2, JsonSerializerProxy2, StreamSerializer2, SolutionDefinitionHelper2, FirstPartyServiceApi2, createResourceBuilderServices2, addProjectArtifactsToSolutionAsync2, getRemoteResourceClients2, findCatalogEntityAsync2, toResourceReference2, exportResourceDefinitionAsync2, readSpecEntryPoints2 };
20041
+ export { getSolutionAuthContext, JsonSerializerNames2, JsonSerializer2, CAMEL_CASE_ENUM_PROPERTIES2, SHARED_CORE_ABSTRACTIONS_PASCAL_CASE_PROPERTIES2, RESOURCE_BUILDER_PASCAL_CASE_PROPERTIES2, PASCAL_CASE_ENUM_PROPERTIES2, JsonSerializerFactory2, JsonSerializerProxy2, StreamSerializer2, SolutionDefinitionHelper2, FirstPartyServiceApi2, createResourceBuilderServices2, addProjectArtifactsToSolutionAsync2, getRemoteResourceClients2, findCatalogEntityAsync2, toResourceReference2, exportResourceDefinitionAsync2, ResourceExportError2, readSpecEntryPoints2 };
20021
20042
 
20022
- //# debugId=66BA74F83D04187B64756E2164756E21
20043
+ //# debugId=267C65346CE7DB1464756E2164756E21
@@ -16,7 +16,7 @@ var package_default = {
16
16
  name: "@uipath/rules-tool",
17
17
  author: "UiPath",
18
18
  license: "SEE LICENSE IN LICENSE.txt",
19
- version: "1.206.0-preview.310",
19
+ version: "1.206.0-preview.312",
20
20
  description: "Create and manage UiPath Business Rules (DMN) projects.",
21
21
  private: false,
22
22
  repository: {
@@ -93,7 +93,7 @@ var RULES_DEBUG_EXAMPLES = [
93
93
  var registerDebugCommand = (program) => {
94
94
  program.command("debug").description("Upload the rules project's solution to Studio Web and evaluate it once through the rules engine. Returns the decision outputs and errors, and the trace id that shows which rules fired.").argument("<project-path>", "Path to the business rules project directory (must contain project.uiproj)").option("-i, --inputs <json>", "Input values as a JSON object or @file.json").option("--folder-path <path>", "Folder to evaluate in and record the run's trace under (default: your personal workspace)").option("--folder-key <key>", "Key (GUID) of the folder to evaluate in and record the run's trace under").option("--timeout <seconds>", "Maximum seconds to wait for the rules engine to evaluate (default: 120)", (value) => parseBoundedInt(value, "--timeout", { min: 1, max: 3600 })).option("--login-validity <minutes>", "Minimum minutes before token expiration to trigger a refresh (default: 10)", (value) => Number.parseInt(value, 10), 10).examples(RULES_DEBUG_EXAMPLES).trackedAction(processContext, async (projectPath, options) => {
95
95
  const { reportRulesFailure } = await import("./rules-command-error-2x1vm0wt.js");
96
- const { debugRuleProjectAsync } = await import("./rules-debug-service-pfbxg459.js");
96
+ const { debugRuleProjectAsync } = await import("./rules-debug-service-402prnwx.js");
97
97
  const [error, result] = await catchError(debugRuleProjectAsync(projectPath, options));
98
98
  if (error) {
99
99
  await reportRulesFailure("Failed to debug business rules project", error);
@@ -197,7 +197,7 @@ var registerDescribeCommand = (program) => {
197
197
  }
198
198
  const [error, entryPoints] = await catchError((async () => {
199
199
  const folder = await rules.resolveRequiredFolder(options);
200
- const { describeRuleAsync } = await import("./rule-catalog-780050xk.js");
200
+ const { describeRuleAsync } = await import("./rule-catalog-drpaxvwg.js");
201
201
  return describeRuleAsync(name, folder);
202
202
  })());
203
203
  if (error) {
@@ -290,7 +290,7 @@ Packing or uploading the solution will sync solution resources automatically.`
290
290
  ];
291
291
  var registerInitCommand = (program) => {
292
292
  program.command("init").description("Create a new business rules project seeded with one decision table. If run outside an existing solution, a parent '<name>Solution' is scaffolded automatically and the rules project is created inside it. If run inside an existing solution, the project is added to that solution.").argument("<name>", "Business rules project name").option("--force", "Force initialization even if target directory exists and is not empty").option("--skip-solution-registration", "Do not auto-register this project in the surrounding solution").examples(RULES_INIT_EXAMPLES).trackedAction(processContext, async (name, options) => {
293
- const { rulesInitAsync } = await import("./rules-init-service-1cea7bc6.js");
293
+ const { rulesInitAsync } = await import("./rules-init-service-tz95ezcn.js");
294
294
  const [error, result] = await catchError(rulesInitAsync(name, {
295
295
  force: options.force,
296
296
  skipRegistration: options.skipSolutionRegistration === true
@@ -414,7 +414,7 @@ async function listRulesAcrossFolders(options) {
414
414
  if (options.tenant !== undefined) {
415
415
  throw new RulesCommandError("'uip rules list --all-folders' does not support --tenant: it lists rules from the resource catalog of the tenant you are logged in to.", "invalid_argument", "Drop --all-folders and pass --folder-path <path> or --folder-key <key> to list one folder in that tenant, or run 'uip login tenant set <tenant-name>' to switch tenants.");
416
416
  }
417
- const { listRulesAcrossFoldersAsync } = await import("./rule-catalog-780050xk.js");
417
+ const { listRulesAcrossFoldersAsync } = await import("./rule-catalog-drpaxvwg.js");
418
418
  const result = await listRulesAcrossFoldersAsync(options.limit, options.offset);
419
419
  if (!result) {
420
420
  throw new RulesCommandError("Listing business rules across folders needs the Node CLI: the browser build cannot read the resource catalog.", "configuration_error", "Drop --all-folders and pass --folder-path <path> or --folder-key <key> to list one folder.");
@@ -609,4 +609,4 @@ var registerCommands2 = async (program) => {
609
609
 
610
610
  export { metadata2, registerCommands2 };
611
611
 
612
- //# debugId=7BE19198F16B1D5964756E2164756E21
612
+ //# debugId=35AC4F2C758788C164756E2164756E21
@@ -1591,7 +1591,7 @@ var package_default = {
1591
1591
  name: "@uipath/solution-sdk",
1592
1592
  author: "UiPath",
1593
1593
  license: "SEE LICENSE IN LICENSE.txt",
1594
- version: "1.206.0-preview.310",
1594
+ version: "1.206.0-preview.312",
1595
1595
  repository: {
1596
1596
  type: "git",
1597
1597
  url: "https://github.com/UiPath/cli.git",
@@ -1850,4 +1850,4 @@ var SUCCEEDED = "creationsucceeded";
1850
1850
  var TERMINAL = new Set([SUCCEEDED, "creationfailed", "validationfailed"]);
1851
1851
  export { buildSolutionPackageFromDir, uploadOrOverwriteSolution };
1852
1852
 
1853
- //# debugId=D62D8FDB6C71B53364756E2164756E21
1853
+ //# debugId=09B0A3A57D71B36864756E2164756E21
package/dist/tool.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  metadata2,
3
3
  registerCommands2
4
- } from "./tool-bdknjenw.js";
4
+ } from "./tool-pg61e8zk.js";
5
5
  import"./tool-syavphgt.js";
6
6
  export {
7
7
  metadata2 as metadata,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@uipath/rules-tool",
3
3
  "author": "UiPath",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
- "version": "1.206.0-preview.310",
5
+ "version": "1.206.0-preview.312",
6
6
  "description": "Create and manage UiPath Business Rules (DMN) projects.",
7
7
  "private": false,
8
8
  "repository": {
@@ -27,5 +27,5 @@
27
27
  "files": [
28
28
  "dist"
29
29
  ],
30
- "gitHead": "493ebd2c2baccd31ad19b739e42605d7c89f720d"
30
+ "gitHead": "ee91749054ba110153977dd920a4c84761ce82cd"
31
31
  }