@uipath/case-tool 1.203.0-preview.205 → 1.204.0-preview.206

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.
Files changed (85) hide show
  1. package/README.md +6 -1
  2. package/dist/THIRD-PARTY-NOTICES.md +48 -9
  3. package/dist/authoring-0hr88kff.js +623 -0
  4. package/dist/{case-api-v6cjyrfw.js → case-api-gdaj9469.js} +5 -5
  5. package/dist/case-bindings-service-c2mze9vj.js +476 -0
  6. package/dist/{case-debug-studio-web-service-shg84pn8.js → case-debug-studio-web-service-cc0vj7md.js} +11 -10
  7. package/dist/case-described-io-service-cpe5h2ks.js +132 -0
  8. package/dist/{case-format-service-q345a2fd.js → case-format-service-qwyjyt0y.js} +2 -2
  9. package/dist/{case-pack-service-29rza2q2.js → case-pack-service-47yrvmg0.js} +11 -11
  10. package/dist/case-shape-reader-mw58avr0.js +13 -0
  11. package/dist/case-splice-service-9zvw19ca.js +312 -0
  12. package/dist/{case-validate-service-2n2bqc1g.js → case-validate-service-vrvx19c1.js} +415 -1449
  13. package/dist/{connector-enrichment-service-h662r92z.js → connector-enrichment-service-rg87npf0.js} +20 -18
  14. package/dist/{connector-lookup-service-y7x6xsc6.js → connector-lookup-service-c49pvfwb.js} +7 -7
  15. package/dist/{connector-task-spec-qm6q8qma.js → connector-task-spec-t3tjeeqt.js} +86 -26
  16. package/dist/{debug-service-8x087xxt.js → debug-service-vf5mw0nr.js} +3 -3
  17. package/dist/{embedded-file-reader-0sjt4nkj.js → embedded-file-reader-v8c2yj2a.js} +2 -2
  18. package/dist/{enrichment-service-7vbxcwge.js → enrichment-service-78b0gqck.js} +8 -7
  19. package/dist/index-hhsf00x8.js +15 -0
  20. package/dist/{index-fz4ttsde.js → index-j2r3jb6c.js} +5 -3
  21. package/dist/{index-jxj2jz45.js → index-rgw7caht.js} +416 -87
  22. package/dist/{index-k4xz16db.js → index-wmffgzmr.js} +12522 -7316
  23. package/dist/{index-va9sm89y.js → index-ynnr55wk.js} +59 -27
  24. package/dist/index.js +15 -11
  25. package/dist/{input-reader-pnh948bq.js → input-reader-bb0ptk2v.js} +2 -2
  26. package/dist/migration-diagnosis-ag2sgd1e.js +71 -0
  27. package/dist/{node-strategy-gc4sg6a2.js → node-strategy-5pz40tee.js} +1 -1
  28. package/dist/{node-sync-service-mehbp4qq.js → node-sync-service-xw3tpfj5.js} +6 -6
  29. package/dist/out-target-1f4n9vqb.js +70 -0
  30. package/dist/{packager-tool-wefb1zw3.js → packager-tool-0p3td5zv.js} +8 -7
  31. package/dist/packager-tool-21qfsbxn.js +17 -0
  32. package/dist/{strict-sdd-audit-8e2fh9jg.js → packager-tool-4e56rmwe.js} +2771 -1746
  33. package/dist/{packager-tool-sfkyb4kz.js → packager-tool-4rqd21wc.js} +194 -2
  34. package/dist/packager-tool-57pzrd0g.js +32 -0
  35. package/dist/{packager-tool-kpcjnxd1.js → packager-tool-58kx79ta.js} +586 -113
  36. package/dist/{packager-tool-hrdan5ms.js → packager-tool-5qghkdd0.js} +2 -2
  37. package/dist/packager-tool-5qp9xza1.js +10 -0
  38. package/dist/packager-tool-8a9yqfq7.js +76 -0
  39. package/dist/{packager-tool-40vq60aa.js → packager-tool-8mpxsyje.js} +4 -4
  40. package/dist/{packager-tool-e3k5gzd3.js → packager-tool-a6wztj6y.js} +669 -100
  41. package/dist/{packager-tool-p0zh9hw6.js → packager-tool-ayevyw80.js} +5 -5
  42. package/dist/packager-tool-b250k6w4.js +75 -0
  43. package/dist/packager-tool-bfgdz1zh.js +73 -0
  44. package/dist/{packager-tool-p7jgrm5r.js → packager-tool-cmwets3m.js} +1 -1
  45. package/dist/{packager-tool-d4sjk46c.js → packager-tool-cv05dwac.js} +18 -21
  46. package/dist/packager-tool-d7jjng8a.js +21 -0
  47. package/dist/packager-tool-dthjwajc.js +13 -0
  48. package/dist/{packager-tool-zcsm7dsj.js → packager-tool-e760vtgg.js} +4 -4
  49. package/dist/packager-tool-f78ntj5g.js +228 -0
  50. package/dist/{packager-tool-2xfyykm0.js → packager-tool-ggbvxvey.js} +320 -200
  51. package/dist/{packager-tool-6karkrc8.js → packager-tool-jx0yq0b5.js} +6 -6
  52. package/dist/{packager-tool-cg2j4rma.js → packager-tool-kacqd7h7.js} +4 -4
  53. package/dist/packager-tool-mknccck5.js +24 -0
  54. package/dist/{packager-tool-sv0d6wb6.js → packager-tool-nj4seavy.js} +7 -3
  55. package/dist/{packager-tool-adcaxdhs.js → packager-tool-paepfv5d.js} +1 -1
  56. package/dist/{packager-tool-052kvydg.js → packager-tool-pm646ag4.js} +1 -1
  57. package/dist/{packager-tool-dd8bq6az.js → packager-tool-rgpdaxbx.js} +548 -108
  58. package/dist/{packager-tool-8q7vzh65.js → packager-tool-s3e2kepj.js} +455 -13
  59. package/dist/{packager-tool-r84ng21s.js → packager-tool-sag9gz55.js} +3 -1
  60. package/dist/{packager-tool-0mj06yen.js → packager-tool-sq931c23.js} +5 -22
  61. package/dist/{packager-tool-yrsrzz1a.js → packager-tool-v99ygh9f.js} +23 -8
  62. package/dist/packager-tool-wj9d9mqe.js +267 -0
  63. package/dist/{packager-tool-hz1mz8fs.js → packager-tool-wjaya2k2.js} +2 -2
  64. package/dist/packager-tool-xcd87qyx.js +44 -0
  65. package/dist/{packager-tool-0v3s8r01.js → packager-tool-xdxr3ync.js} +4 -2
  66. package/dist/{packager-tool-61hxhgeg.js → packager-tool-xkgq5fkf.js} +3 -3
  67. package/dist/packager-tool.js +6 -6
  68. package/dist/{project-artifacts-8snev67g.js → project-artifacts-wzrhketn.js} +1 -1
  69. package/dist/resolved-check-p99hysaw.js +50 -0
  70. package/dist/{resourcesSyncService-pmfwz9cd.js → resourcesSyncService-1ezvhcbc.js} +25 -18
  71. package/dist/rule-group-members-zje7n3kf.js +76 -0
  72. package/dist/sdd-convert-service-gp9733qv.js +1962 -0
  73. package/dist/{sdd-lookup-x08j9g9m.js → sdd-lookup-vpjej1kt.js} +2 -2
  74. package/dist/sdd-resolve-service-4hx64x3z.js +288 -0
  75. package/dist/strict-case-rules-ksy8q7pg.js +731 -0
  76. package/dist/strict-entry-points-v14d7y50.js +124 -0
  77. package/dist/strict-sdd-audit-k6hh0mbr.js +23 -0
  78. package/dist/task-selector-8bjn35dv.js +57 -0
  79. package/dist/tool.js +15 -11
  80. package/dist/{trigger-enrichment-service-xexg7qbk.js → trigger-enrichment-service-pjw5ysny.js} +41 -23
  81. package/package.json +2 -2
  82. package/dist/authoring-kngaggwm.js +0 -360
  83. package/dist/case-bindings-service-1wxfghzd.js +0 -240
  84. package/dist/packager-tool-83qnybab.js +0 -1564
  85. package/dist/strict-case-rules-x6t0vb40.js +0 -409
@@ -6,6 +6,7 @@ var RESOURCE_TYPES = [
6
6
  "processOrchestration",
7
7
  "caseManagement",
8
8
  "flow",
9
+ "function",
9
10
  "typecache-activities",
10
11
  "typecache-triggers",
11
12
  "typecache-packages",
@@ -44,6 +45,7 @@ var GET_SEARCHABLE_TYPES = [
44
45
  { type: "processOrchestration", idField: "entityKey" },
45
46
  { type: "caseManagement", idField: "entityKey" },
46
47
  { type: "flow", idField: "entityKey" },
48
+ { type: "function", idField: "entityKey" },
47
49
  { type: "action-apps", idField: "id" },
48
50
  ...TYPECACHE_INDEX_TYPES.map((type) => ({
49
51
  type,
@@ -54,4 +56,4 @@ var GET_SEARCHABLE_TYPES = [
54
56
 
55
57
  export { RESOURCE_TYPES, TYPECACHE_ACTIVITY_INDEX_TYPES, TYPECACHE_TRIGGER_INDEX_TYPES, TYPECACHE_PACKAGE_INDEX_TYPES, TYPECACHE_INDEX_TYPES, GET_SEARCHABLE_TYPES };
56
58
 
57
- //# debugId=A7AD4F9C62720BB264756E2164756E21
59
+ //# debugId=114584F4923AC76664756E2164756E21
@@ -1,23 +1,6 @@
1
- // src/utils/shortId.ts
2
- var ALPHANUMERIC = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
3
- var getRandomBytes = (n) => globalThis.crypto.getRandomValues(new Uint8Array(n));
4
- function prefixedId(prefix, count = 6) {
5
- let result = prefix;
6
- const limit = 256 - 256 % ALPHANUMERIC.length;
7
- const bytes = getRandomBytes(count * 2);
8
- let i = 0;
9
- let byteIdx = 0;
10
- while (i < count) {
11
- if (byteIdx >= bytes.length)
12
- break;
13
- const b = bytes[byteIdx++];
14
- if (b < limit) {
15
- result += ALPHANUMERIC[b % ALPHANUMERIC.length];
16
- i++;
17
- }
18
- }
19
- return result;
20
- }
1
+ import {
2
+ prefixedId
3
+ } from "./packager-tool-mknccck5.js";
21
4
 
22
5
  // src/utils/binding-builder.ts
23
6
  function createBinding(propertyAttribute, defaultValue, resource, resourceKey) {
@@ -60,6 +43,6 @@ function createConnectorBindings(connectorKey, connectionId, folderKey) {
60
43
  return [connectionBinding, folderKeyBinding];
61
44
  }
62
45
 
63
- export { prefixedId, createTaskBindings, createConnectorBindings };
46
+ export { createTaskBindings, createConnectorBindings };
64
47
 
65
- //# debugId=23ED2DE520E5BD2164756E2164756E21
48
+ //# debugId=536BD326FFC9BE9264756E2164756E21
@@ -13,7 +13,7 @@ import {
13
13
  } from "./packager-tool-yc4kw997.js";
14
14
  import {
15
15
  getFileSystem
16
- } from "./packager-tool-0v3s8r01.js";
16
+ } from "./packager-tool-xdxr3ync.js";
17
17
  import {
18
18
  __require
19
19
  } from "./packager-tool-1yh8g550.js";
@@ -732,6 +732,11 @@ var pickName = (claims) => {
732
732
  const username = asString(claims?.preferred_username);
733
733
  return asString(claims?.name) ?? (looksLikeEmail(username) ? undefined : username);
734
734
  };
735
+ var pickScopes = (claims) => {
736
+ const raw = claims?.scope;
737
+ const scopes = Array.isArray(raw) ? raw.filter((entry) => asString(entry) !== undefined) : typeof raw === "string" ? raw.split(/\s+/).filter(Boolean) : [];
738
+ return scopes.length > 0 ? scopes : undefined;
739
+ };
735
740
  var resolveSessionIdentity = (accessToken, authFlow) => {
736
741
  const claims = accessToken ? decodeClaims(accessToken) : undefined;
737
742
  const email = pickEmail(claims);
@@ -757,6 +762,7 @@ var resolveSessionIdentity = (accessToken, authFlow) => {
757
762
  identity.clientId = clientId;
758
763
  return identity;
759
764
  };
765
+ var readTokenScopes = (accessToken) => accessToken ? pickScopes(decodeClaims(accessToken)) : undefined;
760
766
 
761
767
  // ../auth/src/envAuth.ts
762
768
  var ENV_AUTH_ENABLE_VAR = "UIPATH_CLI_ENABLE_ENV_AUTH";
@@ -829,6 +835,7 @@ var readAuthFromEnv = () => {
829
835
  const expiration = getTokenExpiration(accessToken);
830
836
  const loginStatus = expiration && expiration <= new Date ? "Expired" : "Logged in";
831
837
  const identity = resolveSessionIdentity(accessToken);
838
+ const scopes = readTokenScopes(accessToken);
832
839
  return {
833
840
  loginStatus,
834
841
  accessToken,
@@ -839,7 +846,8 @@ var readAuthFromEnv = () => {
839
846
  tenantId,
840
847
  expiration,
841
848
  source: "env-vars" /* EnvironmentVariables */,
842
- ...identity ? { identity } : {}
849
+ ...identity ? { identity } : {},
850
+ ...scopes ? { scopes } : {}
843
851
  };
844
852
  };
845
853
 
@@ -1487,10 +1495,15 @@ async function buildFileStatus(tokens, credentials, globalHint) {
1487
1495
  }
1488
1496
  function identityFields(accessToken, credentials) {
1489
1497
  const identity = resolveSessionIdentity(accessToken, parseAuthFlow(credentials[AUTH_FLOW_ENV_VAR]));
1490
- return identity ? { identity } : {};
1498
+ const scopes = readTokenScopes(accessToken);
1499
+ return {
1500
+ ...identity ? { identity } : {},
1501
+ ...scopes ? { scopes } : {}
1502
+ };
1491
1503
  }
1492
1504
  function buildRobotStatus(robotCreds) {
1493
1505
  const identity = resolveSessionIdentity(robotCreds.accessToken);
1506
+ const scopes = readTokenScopes(robotCreds.accessToken);
1494
1507
  return {
1495
1508
  loginStatus: "Logged in",
1496
1509
  accessToken: robotCreds.accessToken,
@@ -1502,7 +1515,8 @@ function buildRobotStatus(robotCreds) {
1502
1515
  issuer: robotCreds.issuer,
1503
1516
  expiration: getTokenExpiration(robotCreds.accessToken),
1504
1517
  source: "robot" /* Robot */,
1505
- ...identity ? { identity } : {}
1518
+ ...identity ? { identity } : {},
1519
+ ...scopes ? { scopes } : {}
1506
1520
  };
1507
1521
  }
1508
1522
  var isFileNotFoundError = (error) => {
@@ -1769,7 +1783,8 @@ var getAuthContext = async (options = {}) => {
1769
1783
  organizationId: status.organizationId,
1770
1784
  organizationName: status.organizationName,
1771
1785
  tenantId: status.tenantId,
1772
- tenantName
1786
+ tenantName,
1787
+ identity: status.identity
1773
1788
  };
1774
1789
  };
1775
1790
  var getAuthEnv = async (options = {}) => {
@@ -2417,7 +2432,7 @@ var authenticate = async ({
2417
2432
  const { BrowserAuthStrategy } = await import("./browser-strategy-6atc7v8s.js");
2418
2433
  strategy = new BrowserAuthStrategy;
2419
2434
  } else {
2420
- const { NodeAuthStrategy } = await import("./node-strategy-gc4sg6a2.js");
2435
+ const { NodeAuthStrategy } = await import("./node-strategy-5pz40tee.js");
2421
2436
  strategy = new NodeAuthStrategy;
2422
2437
  }
2423
2438
  const code = await strategy.execute(authUrl, effectiveRedirectUriUrl, state, {
@@ -2437,6 +2452,6 @@ var authenticate = async ({
2437
2452
  });
2438
2453
  };
2439
2454
 
2440
- export { setAuthFileConfig, InvalidBaseUrlError, DEFAULT_AUTH_PROFILE, AuthProfileValidationError, normalizeAuthProfileName, setActiveAuthProfile, clearActiveAuthProfile, getActiveAuthProfile, runWithAuthProfile, resolveAuthProfileFilePath, getActiveAuthProfileFilePath, getAuthProfilesRootPath, resolveAuthProfileDirPath, listAuthProfileNamesAsync, authProfileExistsAsync, deleteAuthProfileAsync, parseJWT, parseAuthFlow, resolveSessionIdentity, ENV_AUTH_ENABLE_VAR, ENFORCE_ROBOT_AUTH_VAR, ENV_AUTH_VARS, EnvAuthConfigError, isEnvAuthEnabled, isRobotAuthEnforced, readAuthFromEnv, refreshTokenFingerprint, loadRefreshBreaker, saveRefreshBreaker, clearRefreshBreaker, registerRobotClientLoader, TokenRefreshOAuthError, isTokenRefreshOAuthFailure, refreshAccessToken, AUTH_FLOW_ENV_VAR, DEFAULT_AUTH_FILENAME, DEFAULT_ENV_FILENAME, resolveEnvFileLocationAsync, resolveEnvFilePathAsync, loadEnvFileAsync, saveEnvFileAsync, CredentialSource, getLoginStatusAsync, getLoginStatusWithDeps, getAuthContext, getAuthEnv, describeAuthProfilesAsync, ClientCredentialsAuthenticationError, clientCredentialsLogin, JWT_BEARER_ASSERTION_TYPE, FederatedCredentialsAuthenticationError, federatedCredentialsLogin, fetchTenantsAndOrganizations, TENANT_SELECTION_REQUIRED_CODE, INVALID_TENANT_CODE, TenantSelectionError, TenantSelectionRequiredError, InvalidTenantError, isTenantSelectionError, selectTenantWithDeps, interactiveLoginWithDeps, interactiveLogin, logoutWithDeps, logout, authenticate };
2455
+ export { setAuthFileConfig, InvalidBaseUrlError, DEFAULT_AUTH_PROFILE, AuthProfileValidationError, normalizeAuthProfileName, setActiveAuthProfile, clearActiveAuthProfile, getActiveAuthProfile, runWithAuthProfile, resolveAuthProfileFilePath, getActiveAuthProfileFilePath, getAuthProfilesRootPath, resolveAuthProfileDirPath, listAuthProfileNamesAsync, authProfileExistsAsync, deleteAuthProfileAsync, parseJWT, parseAuthFlow, resolveSessionIdentity, readTokenScopes, ENV_AUTH_ENABLE_VAR, ENFORCE_ROBOT_AUTH_VAR, ENV_AUTH_VARS, EnvAuthConfigError, isEnvAuthEnabled, isRobotAuthEnforced, readAuthFromEnv, refreshTokenFingerprint, loadRefreshBreaker, saveRefreshBreaker, clearRefreshBreaker, registerRobotClientLoader, TokenRefreshOAuthError, isTokenRefreshOAuthFailure, refreshAccessToken, AUTH_FLOW_ENV_VAR, DEFAULT_AUTH_FILENAME, DEFAULT_ENV_FILENAME, resolveEnvFileLocationAsync, resolveEnvFilePathAsync, loadEnvFileAsync, saveEnvFileAsync, CredentialSource, getLoginStatusAsync, getLoginStatusWithDeps, getAuthContext, getAuthEnv, describeAuthProfilesAsync, ClientCredentialsAuthenticationError, clientCredentialsLogin, JWT_BEARER_ASSERTION_TYPE, FederatedCredentialsAuthenticationError, federatedCredentialsLogin, fetchTenantsAndOrganizations, TENANT_SELECTION_REQUIRED_CODE, INVALID_TENANT_CODE, TenantSelectionError, TenantSelectionRequiredError, InvalidTenantError, isTenantSelectionError, selectTenantWithDeps, interactiveLoginWithDeps, interactiveLogin, logoutWithDeps, logout, authenticate };
2441
2456
 
2442
- //# debugId=9A92DFA480A9998F64756E2164756E21
2457
+ //# debugId=13BF51602EF4AFD864756E2164756E21
@@ -0,0 +1,267 @@
1
+ import {
2
+ NugetConstants,
3
+ NugetPackager,
4
+ Path,
5
+ ProjectTool,
6
+ TemporaryStorageService,
7
+ ToolResult,
8
+ ensureContentOperateFile,
9
+ toolsFactoryRepository
10
+ } from "./packager-tool-4rqd21wc.js";
11
+
12
+ // ../packager/packager-tool-case/src/case-plan-file.ts
13
+ var CasePlanFileNames = [
14
+ "caseplan.case",
15
+ "caseplan.json",
16
+ "case.stage.json",
17
+ "default.stage.json"
18
+ ];
19
+ var casePlanSidecarName = (casePlanFileName) => `${casePlanFileName}.bpmn`;
20
+ var findCasePlanFileName = (entries) => {
21
+ const present = new Set(entries);
22
+ return CasePlanFileNames.find((candidate) => present.has(candidate));
23
+ };
24
+ var stripDeclaredFilePathPrefix = (filePath) => {
25
+ const withoutLeadingSlash = filePath.startsWith("/") ? filePath.slice(1) : filePath;
26
+ return withoutLeadingSlash.startsWith("content/") ? withoutLeadingSlash.slice("content/".length) : withoutLeadingSlash;
27
+ };
28
+ var resolveDeclaredFileName = (filePath) => {
29
+ const stripped = stripDeclaredFilePathPrefix(filePath.split("#")[0]);
30
+ return stripped.includes("/") ? "" : stripped;
31
+ };
32
+ var normalizeEntryPointPath = (filePath) => `/${stripDeclaredFilePathPrefix(filePath)}`;
33
+ var entryPointBpmnNames = (entryPointsJson) => {
34
+ try {
35
+ const parsed = JSON.parse(entryPointsJson);
36
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
37
+ throw new Error("document is not an object");
38
+ }
39
+ if (parsed.entryPoints !== undefined && !Array.isArray(parsed.entryPoints)) {
40
+ throw new Error("entryPoints is not a list");
41
+ }
42
+ const resolvedNames = (parsed.entryPoints ?? []).map((entry) => typeof entry.filePath === "string" ? resolveDeclaredFileName(entry.filePath) : "");
43
+ if (resolvedNames.includes("")) {
44
+ throw new Error("an entry point has no usable filePath");
45
+ }
46
+ const names = resolvedNames.filter((name) => name.endsWith(".bpmn"));
47
+ return [...new Set(names)];
48
+ } catch {
49
+ return null;
50
+ }
51
+ };
52
+ var misnamedEntryPointBpmn = (declared, casePlanFileName) => {
53
+ const own = casePlanSidecarName(casePlanFileName);
54
+ const otherPlans = new Set(CasePlanFileNames.filter((name) => name !== casePlanFileName).map(casePlanSidecarName));
55
+ return declared.find((file) => file !== own && otherPlans.has(file));
56
+ };
57
+ var buildCasePackageDescriptor = (contentFileNames) => ({
58
+ $schema: "https://cloud.uipath.com/draft/2024-12/package-descriptor",
59
+ files: {
60
+ [NugetConstants.OperateFileName]: `${NugetConstants.ContentFolderName}/${NugetConstants.OperateFileName}`,
61
+ [NugetConstants.EntryPointsFileName]: `${NugetConstants.ContentFolderName}/${NugetConstants.EntryPointsFileName}`,
62
+ [NugetConstants.BindingsFileId]: `${NugetConstants.ContentFolderName}/${NugetConstants.BindingsV2FileName}`,
63
+ ...Object.fromEntries(contentFileNames.filter((name) => name.endsWith(".bpmn") || CasePlanFileNames.includes(name)).map((name) => [
64
+ name,
65
+ `${NugetConstants.ContentFolderName}/${name}`
66
+ ]))
67
+ }
68
+ });
69
+
70
+ // ../packager/packager-tool-case/src/case-bpmn-compiler.ts
71
+ var COMPILER_KEY = Symbol.for("@uipath/packager-tool-case/caseBpmnCompiler");
72
+ var _global = globalThis;
73
+ function registerCaseBpmnCompiler(caseBpmnCompiler) {
74
+ _global[COMPILER_KEY] = caseBpmnCompiler;
75
+ }
76
+ function getCaseBpmnCompiler() {
77
+ return _global[COMPILER_KEY];
78
+ }
79
+
80
+ // ../packager/packager-tool-case/src/case-tool.ts
81
+ var CaseConstants = {
82
+ EntryPointsFileName: "entry-points.json"
83
+ };
84
+
85
+ class CaseTool extends ProjectTool {
86
+ _temporaryStorage;
87
+ constructor(fileSystem, logger) {
88
+ super(fileSystem, logger);
89
+ this._temporaryStorage = new TemporaryStorageService(fileSystem);
90
+ }
91
+ async restoreAsync(_options, _cancellationToken) {
92
+ this.logger.info("Restore operation is not required for Case Management projects");
93
+ return ToolResult.success();
94
+ }
95
+ async validateAsync(_options, _cancellationToken) {
96
+ this.logger.info("Validate operation is not required for Case Management projects");
97
+ return ToolResult.success();
98
+ }
99
+ async buildAsync(options, _cancellationToken) {
100
+ const tempFolder = await this._temporaryStorage.getTempFolderPath();
101
+ const localBuildFolder = Path.join(tempFolder, NugetConstants.OutputFolderName);
102
+ const contentFolder = Path.join(localBuildFolder, NugetConstants.ContentFolderName);
103
+ try {
104
+ this.logger.progress("Copying files...");
105
+ await this.copyFiles(options.projectPath, contentFolder);
106
+ this.logger.progress("Compiling case plan to BPMN...");
107
+ const compileResult = await this.compileCasePlan(options.projectPath, contentFolder);
108
+ if (!compileResult.isSuccess) {
109
+ return compileResult;
110
+ }
111
+ this.logger.progress("Creating operate.json file...");
112
+ await this.createOperateFile(options, contentFolder);
113
+ this.logger.progress("Creating package-descriptor.json file...");
114
+ await this.createPackageDescriptor(localBuildFolder, contentFolder);
115
+ return new ToolResult("SUCCESS" /* Success */, "done", [
116
+ localBuildFolder
117
+ ]);
118
+ } catch (error) {
119
+ const errorMessage = error instanceof Error ? error.toString() : String(error);
120
+ this.logger.error(errorMessage);
121
+ return ToolResult.error("INTERNAL_ERROR" /* InternalError */, "An error occurred while building Case Management project files");
122
+ }
123
+ }
124
+ async packAsync(options, cancellationToken) {
125
+ const buildResult = await this.buildAsync(options, cancellationToken);
126
+ if (!buildResult.isSuccess) {
127
+ return buildResult;
128
+ }
129
+ const localBuildFolder = buildResult.packages[0];
130
+ try {
131
+ this.logger.progress("Creating NuGet package...");
132
+ const nupkgFileName = `${options.package.id}.${options.package.version}.nupkg`;
133
+ const nupkgPath = Path.join(options.outputPath, nupkgFileName);
134
+ const packager = new NugetPackager(this.fileSystem);
135
+ const result = await packager.packAsync(localBuildFolder, options.package, nupkgPath);
136
+ this.logger.progress("Package created successfully");
137
+ return new ToolResult("SUCCESS" /* Success */, "done", [
138
+ result.outputPath
139
+ ]);
140
+ } catch (error) {
141
+ const errorMessage = error instanceof Error ? error.toString() : String(error);
142
+ this.logger.error(errorMessage);
143
+ return ToolResult.error("INTERNAL_ERROR" /* InternalError */, "An error occurred while packing Case Management project");
144
+ }
145
+ }
146
+ async dispose() {
147
+ this.logger.info("Disposing Case Management Tool");
148
+ try {
149
+ await this._temporaryStorage.cleanup();
150
+ } catch {}
151
+ }
152
+ async copyFiles(sourcePath, contentFolder) {
153
+ await this.fileSystem.mkdir(contentFolder);
154
+ const files = await this.fileSystem.readdir(sourcePath);
155
+ for (const file of files) {
156
+ const sourceFile = Path.join(sourcePath, file);
157
+ const stat = await this.fileSystem.stat(sourceFile);
158
+ if (stat?.isFile()) {
159
+ const content = await this.fileSystem.readFile(sourceFile);
160
+ if (content) {
161
+ const destinationFile = Path.join(contentFolder, file);
162
+ await this.fileSystem.writeFile(destinationFile, content);
163
+ }
164
+ }
165
+ }
166
+ }
167
+ async compileCasePlan(projectPath, contentFolder) {
168
+ const compile = getCaseBpmnCompiler();
169
+ const casePlanFileName = findCasePlanFileName(await this.fileSystem.readdir(projectPath));
170
+ if (!compile || !casePlanFileName) {
171
+ return this.checkEntryPointBpmnPresent(contentFolder, casePlanFileName);
172
+ }
173
+ const sidecarFileName = casePlanSidecarName(casePlanFileName);
174
+ const casePlanPath = Path.join(projectPath, casePlanFileName);
175
+ const casePlan = await this.fileSystem.readFile(casePlanPath);
176
+ if (!casePlan || casePlan.length === 0) {
177
+ return ToolResult.error("INTERNAL_ERROR" /* InternalError */, `'${casePlanFileName}' in ${projectPath} is empty, so there is nothing to compile into '${sidecarFileName}'. Author the case plan, or re-scaffold the project with 'uip maestro case init'.`);
178
+ }
179
+ try {
180
+ const bpmnXml = await compile(new TextDecoder().decode(casePlan));
181
+ await this.fileSystem.writeFile(Path.join(contentFolder, sidecarFileName), bpmnXml);
182
+ return await this.checkEntryPointBpmnPresent(contentFolder, casePlanFileName);
183
+ } catch (error) {
184
+ const message = error instanceof Error ? error.message : String(error);
185
+ this.logger.error(message);
186
+ return ToolResult.error("INTERNAL_ERROR" /* InternalError */, `Failed to compile '${casePlanFileName}' into '${sidecarFileName}': ${message}. Run 'uip maestro case validate ${projectPath}' to find the problem in the case plan, then pack again.`);
187
+ }
188
+ }
189
+ async checkEntryPointBpmnPresent(contentFolder, casePlanFileName) {
190
+ const referenced = await this.readEntryPointBpmnFiles(contentFolder);
191
+ if (referenced === null) {
192
+ return ToolResult.error("INTERNAL_ERROR" /* InternalError */, `'${CaseConstants.EntryPointsFileName}' could not be read as JSON, so pack cannot check that the BPMN it declares is in the package. Fix or re-scaffold '${CaseConstants.EntryPointsFileName}', then pack again.`);
193
+ }
194
+ const own = casePlanFileName ? casePlanSidecarName(casePlanFileName) : undefined;
195
+ const fix = own ?? `Author a case plan (${CasePlanFileNames.join(", ")}) so pack can compile it (see 'uip maestro case init'), then pack again.`;
196
+ const firstEntry = await this.firstEntryPointFileName(contentFolder);
197
+ if (firstEntry && !referenced.includes(firstEntry)) {
198
+ const firstEntryFix = own ? `Point the first entry point at '${own}', then pack again.` : fix;
199
+ return ToolResult.error("INTERNAL_ERROR" /* InternalError */, `'${CaseConstants.EntryPointsFileName}' first entry point resolves to '${firstEntry}', which is not a declared .bpmn file this project ships, so operate.json's main would name a file pack cannot produce. ${firstEntryFix}`);
200
+ }
201
+ if (referenced.length === 0) {
202
+ return ToolResult.success();
203
+ }
204
+ const contentFiles = await this.fileSystem.readdir(contentFolder);
205
+ const missing = referenced.filter((file) => !contentFiles.includes(file));
206
+ if (missing.length === 0) {
207
+ if (casePlanFileName) {
208
+ const misnamed = misnamedEntryPointBpmn(referenced, casePlanFileName);
209
+ if (misnamed) {
210
+ return ToolResult.error("INTERNAL_ERROR" /* InternalError */, `'${CaseConstants.EntryPointsFileName}' points at 'content/${misnamed}', the sidecar of a case plan this project does not carry. '${casePlanFileName}' compiles to '${own}', so the entry point would resolve to a BPMN pack did not produce. Point it at '${own}', then pack again.`);
211
+ }
212
+ }
213
+ return ToolResult.success();
214
+ }
215
+ const missingFix = casePlanFileName ? `Add the missing file to the project, or point '${CaseConstants.EntryPointsFileName}' at the BPMN the project does ship, then pack again.` : fix;
216
+ const missingList = missing.map((f) => `'content/${f}'`).join(", ");
217
+ return ToolResult.error("INTERNAL_ERROR" /* InternalError */, `'${CaseConstants.EntryPointsFileName}' points at ${missingList}, which the package does not contain, so it would deploy and activate and then fault every job. ${missingFix}`);
218
+ }
219
+ async readEntryPointBpmnFiles(contentFolder) {
220
+ const entryPointsPath = Path.join(contentFolder, CaseConstants.EntryPointsFileName);
221
+ if (!await this.fileSystem.exists(entryPointsPath)) {
222
+ return [];
223
+ }
224
+ const raw = await this.fileSystem.readFile(entryPointsPath);
225
+ if (!raw || raw.length === 0) {
226
+ return null;
227
+ }
228
+ return entryPointBpmnNames(new TextDecoder().decode(raw));
229
+ }
230
+ async firstEntryPointFileName(contentFolder) {
231
+ const raw = await this.fileSystem.readFile(Path.join(contentFolder, CaseConstants.EntryPointsFileName));
232
+ const parsed = JSON.parse(raw ? new TextDecoder().decode(raw) : "{}");
233
+ const filePath = parsed.entryPoints?.[0]?.filePath ?? "";
234
+ return resolveDeclaredFileName(filePath);
235
+ }
236
+ async createOperateFile(options, contentFolder) {
237
+ await ensureContentOperateFile(this.fileSystem, {
238
+ contentFolder,
239
+ projectPath: options.projectPath,
240
+ projectStorageId: options.projectStorageId,
241
+ contentType: "CaseManagement" /* CaseManagement */
242
+ });
243
+ }
244
+ async createPackageDescriptor(localBuildFolder, contentFolder) {
245
+ const contentFiles = await this.fileSystem.readdir(contentFolder);
246
+ const packageDescriptorPath = Path.join(localBuildFolder, NugetConstants.ContentFolderName, NugetConstants.PackageDescriptorFileName);
247
+ const packageDescriptorJson = JSON.stringify(buildCasePackageDescriptor(contentFiles), null, 2);
248
+ await this.fileSystem.writeFile(packageDescriptorPath, packageDescriptorJson);
249
+ }
250
+ }
251
+
252
+ // ../packager/packager-tool-case/src/case-tool-factory.ts
253
+ class CaseToolFactory {
254
+ supportedTypes = [
255
+ "CaseManagement" /* CaseManagement */
256
+ ];
257
+ async createAsync(logger, fileSystem) {
258
+ return new CaseTool(fileSystem, logger);
259
+ }
260
+ }
261
+
262
+ // ../packager/packager-tool-case/src/index.ts
263
+ toolsFactoryRepository.registerProjectToolFactory(new CaseToolFactory);
264
+
265
+ export { registerCaseBpmnCompiler, CasePlanFileNames, casePlanSidecarName, findCasePlanFileName, resolveDeclaredFileName, normalizeEntryPointPath, entryPointBpmnNames, misnamedEntryPointBpmn, buildCasePackageDescriptor, CaseToolFactory };
266
+
267
+ //# debugId=3611FD39A370A3B664756E2164756E21
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  readStdin
3
- } from "./packager-tool-kpcjnxd1.js";
3
+ } from "./packager-tool-58kx79ta.js";
4
4
  import {
5
5
  getFileSystem
6
- } from "./packager-tool-0v3s8r01.js";
6
+ } from "./packager-tool-xdxr3ync.js";
7
7
 
8
8
  // ../maestro-sdk/src/json-input.ts
9
9
  async function readJsonFile(filePath) {
@@ -0,0 +1,44 @@
1
+ import {
2
+ prefixedId
3
+ } from "./packager-tool-mknccck5.js";
4
+ import {
5
+ DEFAULT_TRIGGER_ID,
6
+ DEFAULT_TRIGGER_LABEL
7
+ } from "./packager-tool-nj4seavy.js";
8
+
9
+ // src/utils/case-document.ts
10
+ var CASE_PLAN_FILENAME = "caseplan.json";
11
+ function buildMinimalCaseDocument(options) {
12
+ return {
13
+ id: prefixedId("case-", 10),
14
+ name: options.name,
15
+ version: options.schemaVersion,
16
+ ...options.description !== undefined && {
17
+ description: options.description
18
+ },
19
+ bindings: [],
20
+ variables: { inputOutputs: [] },
21
+ metadata: {
22
+ caseIdentifier: options.caseIdentifier ?? options.name,
23
+ caseAppEnabled: options.caseAppEnabled ?? false,
24
+ caseIdentifierType: options.identifierType ?? "constant",
25
+ publishVersion: 2
26
+ },
27
+ nodes: [
28
+ {
29
+ id: DEFAULT_TRIGGER_ID,
30
+ type: "uipath.case.trigger",
31
+ data: {
32
+ typeVersion: "1.0.0",
33
+ display: { label: DEFAULT_TRIGGER_LABEL },
34
+ inputs: { serviceType: "None" }
35
+ }
36
+ }
37
+ ],
38
+ edges: []
39
+ };
40
+ }
41
+
42
+ export { CASE_PLAN_FILENAME, buildMinimalCaseDocument };
43
+
44
+ //# debugId=5271E14EC19FCE1A64756E2164756E21
@@ -230,8 +230,10 @@ class NodeFileSystem {
230
230
 
231
231
  // ../filesystem/src/index.ts
232
232
  var fsInstance = new NodeFileSystem;
233
+ var setFileSystem = (_fs) => () => {};
233
234
  var getFileSystem = () => fsInstance;
235
+ var getFileSystemAsync = async () => fsInstance;
234
236
 
235
- export { getFileSystem };
237
+ export { NodeFileSystem, setFileSystem, getFileSystem, getFileSystemAsync };
236
238
 
237
- //# debugId=25EC9C9B4767723E64756E2164756E21
239
+ //# debugId=3E49815A855BD0ED64756E2164756E21
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  catchError
3
- } from "./packager-tool-kpcjnxd1.js";
3
+ } from "./packager-tool-58kx79ta.js";
4
4
 
5
5
  // src/services/schema-utils.ts
6
6
  function getMutatedType(variable) {
@@ -351,6 +351,6 @@ function addVarIdsToInputsOutputs(params) {
351
351
  return { inputsWithVars, outputsWithVars };
352
352
  }
353
353
 
354
- export { transformSchemaToVariables, convertActionArgsToVariables, mapEntryPointVariablesToInputOutput, buildErrorOutput, addVarIdsToInputsOutputs };
354
+ export { transformSchemaToVariables, convertActionArgsToVariables, FILE_TYPE_JSON_SCHEMA, mapEntryPointVariablesToInputOutput, buildErrorOutput, addVarIdsToInputsOutputs };
355
355
 
356
- //# debugId=F4923EB769649F2664756E2164756E21
356
+ //# debugId=DBAEB71CB3648B7264756E2164756E21
@@ -1,10 +1,10 @@
1
- import {
2
- toolsFactoryRepository
3
- } from "./packager-tool-sfkyb4kz.js";
4
1
  import {
5
2
  CaseToolFactory,
6
3
  registerCaseBpmnCompiler
7
- } from "./packager-tool-83qnybab.js";
4
+ } from "./packager-tool-wj9d9mqe.js";
5
+ import {
6
+ toolsFactoryRepository
7
+ } from "./packager-tool-4rqd21wc.js";
8
8
  import"./packager-tool-b098y4a2.js";
9
9
  import {
10
10
  __require,
@@ -13,7 +13,7 @@ import {
13
13
 
14
14
  // ../packager/packager-tool-case/src/node.ts
15
15
  var compileCasePlan = async (casePlanJson) => {
16
- const { serializeCaseDiskJsonToBpmnAndRulesJson } = await import("./index-k4xz16db.js").then((m)=>__toESM(m.default,1));
16
+ const { serializeCaseDiskJsonToBpmnAndRulesJson } = await import("./index-wmffgzmr.js").then((m)=>__toESM(m.default,1));
17
17
  const { bpmnXml } = await serializeCaseDiskJsonToBpmnAndRulesJson(casePlanJson);
18
18
  return bpmnXml;
19
19
  };
@@ -30,4 +30,4 @@ export {
30
30
  registerPackagerFactories
31
31
  };
32
32
 
33
- //# debugId=59E72E6560C763B364756E2164756E21
33
+ //# debugId=39B4FB59B227752B64756E2164756E21
@@ -4,7 +4,7 @@ import {
4
4
 
5
5
  // src/services/project-artifacts.ts
6
6
  async function ensureProjectArtifacts(args) {
7
- const { addProjectArtifactsToSolutionAsync } = await import("./index-jxj2jz45.js");
7
+ const { addProjectArtifactsToSolutionAsync } = await import("./index-rgw7caht.js");
8
8
  return addProjectArtifactsToSolutionAsync(args);
9
9
  }
10
10
  export {
@@ -0,0 +1,50 @@
1
+ import {
2
+ namedValue
3
+ } from "./packager-tool-f78ntj5g.js";
4
+ import"./packager-tool-1yh8g550.js";
5
+
6
+ // src/services/sdd-convert/resolved-check.ts
7
+ var isDeferredEntry = (entry) => {
8
+ if (typeof entry.selected?.name === "string" && entry.selected.name !== "") {
9
+ return false;
10
+ }
11
+ if (entry.gateDecision === "resolve-at-build")
12
+ return true;
13
+ return [entry.taskTypeId, entry.typeId, entry.connectionId].some((slot) => typeof slot === "string" && slot.trimStart().toLowerCase().startsWith("<unresolved"));
14
+ };
15
+ var staleResolvedEntry = (model, entries) => {
16
+ for (const entry of entries) {
17
+ const picked = entry.selected;
18
+ const selected = typeof picked?.name === "string" && picked.name !== "";
19
+ if (!selected && !isDeferredEntry(entry))
20
+ continue;
21
+ const where = `stage "${entry.stage ?? ""}" task "${entry.task ?? ""}"`;
22
+ const task = model.stages.find((stage) => stage.name === entry.stage)?.tasks.find((candidate) => candidate.name === entry.task);
23
+ if (task === undefined)
24
+ return `${where} is not a task in this SDD`;
25
+ const query = entry.searchQuery;
26
+ if (query === undefined) {
27
+ return `${where} carries no \`searchQuery\`, so it cannot be matched to this SDD's task`;
28
+ }
29
+ const name = namedValue(task.resourceName);
30
+ const folder = namedValue(task.folder);
31
+ const queried = { name: query.name ?? "", folder: query.folder ?? "" };
32
+ const differs = [];
33
+ if (queried.name !== name) {
34
+ differs.push(`its \`searchQuery.name\` is "${queried.name}" and this SDD names the resource "${name}"`);
35
+ }
36
+ if (queried.folder !== folder) {
37
+ differs.push(queried.folder === "" ? `its \`searchQuery\` has no folder and this SDD names the folder "${folder}"` : folder === "" ? `its \`searchQuery.folder\` is "${queried.folder}" and this SDD names no folder` : `its \`searchQuery.folder\` is "${queried.folder}" and this SDD names the folder "${folder}"`);
38
+ }
39
+ if (differs.length > 0) {
40
+ return `${where} does not match: ${differs.join("; and ")}`;
41
+ }
42
+ }
43
+ return;
44
+ };
45
+ export {
46
+ isDeferredEntry,
47
+ staleResolvedEntry
48
+ };
49
+
50
+ //# debugId=594536652D5E05EC64756E2164756E21