@uipath/pm-tool 1.198.0-preview.90 → 1.199.0-preview.91

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 (2) hide show
  1. package/dist/tool.js +252 -9
  2. package/package.json +2 -2
package/dist/tool.js CHANGED
@@ -21230,7 +21230,7 @@ var init_server = __esm(() => {
21230
21230
  var package_default = {
21231
21231
  name: "@uipath/pm-tool",
21232
21232
  license: "MIT",
21233
- version: "1.198.0-preview.90",
21233
+ version: "1.199.0-preview.91",
21234
21234
  description: "Process Mining — process apps, transformations, and data ingestion.",
21235
21235
  private: false,
21236
21236
  repository: {
@@ -27859,6 +27859,7 @@ var SKILL_ATTRIBUTION = attributionRecord([
27859
27859
  var KNOWN_SKILL_NAMES = new Set(Object.keys(SKILL_ATTRIBUTION));
27860
27860
  var COMMAND_ATTRIBUTION = commandAttribution([
27861
27861
  ["cli", "troubleshoot", ["uip.feedback"]],
27862
+ ["llm-gateway", "operate", ["uip.llm-gateway"]],
27862
27863
  ["llm-gateway", "operate", ["uip.llm-configuration", "uip.model-hub"]],
27863
27864
  ["context-grounding", "build", ["uip.context-grounding"]],
27864
27865
  ["api-workflow", "build", ["uip.api-workflow"]],
@@ -28203,6 +28204,20 @@ Command.prototype.trackedAction = function(context, fn, properties) {
28203
28204
  }));
28204
28205
  });
28205
28206
  };
28207
+
28208
+ // ../common/src/confirmation.ts
28209
+ function requireConfirmation(flags, operation) {
28210
+ if (flags.yes === true || flags.force === true) {
28211
+ return true;
28212
+ }
28213
+ OutputFormatter.error({
28214
+ Result: RESULTS.Failure,
28215
+ Message: `Confirmation required: this will ${operation} and cannot be undone.`,
28216
+ Instructions: "Re-run with --yes to confirm."
28217
+ });
28218
+ processContext.exit(1);
28219
+ return false;
28220
+ }
28206
28221
  // ../common/src/console-guard.ts
28207
28222
  var guardInstalledSlot = singleton("ConsoleGuardInstalled");
28208
28223
  var savedOriginalsSlot = singleton("ConsoleGuardOriginals");
@@ -28326,6 +28341,7 @@ var resolveConfigAsync = async ({
28326
28341
  customAuthority,
28327
28342
  customClientId,
28328
28343
  customClientSecret,
28344
+ customClientAssertion,
28329
28345
  customScopes
28330
28346
  } = {}) => {
28331
28347
  const fileAuth = getAuthFileConfig();
@@ -28351,7 +28367,7 @@ var resolveConfigAsync = async ({
28351
28367
  if (!clientSecret && fileAuth.clientSecret) {
28352
28368
  clientSecret = fileAuth.clientSecret;
28353
28369
  }
28354
- const isExternalAppAuth = clientId !== DEFAULT_CLIENT_ID && Boolean(clientSecret);
28370
+ const isExternalAppAuth = clientId !== DEFAULT_CLIENT_ID && (Boolean(clientSecret) || Boolean(customClientAssertion));
28355
28371
  const scopes = resolveScopes(isExternalAppAuth, customScopes, fileAuth.scopes);
28356
28372
  return {
28357
28373
  clientId,
@@ -29469,7 +29485,6 @@ var getAuthContext = async (options = {}) => {
29469
29485
  tenantName
29470
29486
  };
29471
29487
  };
29472
-
29473
29488
  // ../auth/src/index.ts
29474
29489
  init_constants();
29475
29490
 
@@ -29544,6 +29559,9 @@ async function pmGet(config, path3) {
29544
29559
  async function pmPost(config, path3, body) {
29545
29560
  return pmRequest(config, "POST", path3, body);
29546
29561
  }
29562
+ async function pmDelete(config, path3) {
29563
+ return pmRequest(config, "DELETE", path3);
29564
+ }
29547
29565
  async function pmGetRaw(config, path3) {
29548
29566
  const response = await fetch(buildPmUrl(config, path3), {
29549
29567
  method: "GET",
@@ -29578,6 +29596,7 @@ async function pmPutRaw(config, path3, content, etag) {
29578
29596
  }
29579
29597
 
29580
29598
  // src/commands/_shared.ts
29599
+ init_src();
29581
29600
  function fail(message, instructions) {
29582
29601
  OutputFormatter.error({
29583
29602
  Result: RESULTS.Failure,
@@ -29606,6 +29625,31 @@ function unwrapData(payload) {
29606
29625
  }
29607
29626
  return payload;
29608
29627
  }
29628
+ async function resolveJsonBody(file, inline, flag = "body") {
29629
+ const noun = flag === "filters" ? "filter spec" : "request body";
29630
+ const Noun = flag === "filters" ? "Filter spec" : "Request body";
29631
+ const Label = flag === "filters" ? "Filters" : "Body";
29632
+ if (file !== undefined && inline !== undefined) {
29633
+ throw new Error(`Provide only one of --${flag} or --${flag}-json, not both.`);
29634
+ }
29635
+ let raw;
29636
+ if (file !== undefined) {
29637
+ const content = await getFileSystem().readFile(file, "utf-8");
29638
+ if (content === null) {
29639
+ throw new Error(`${Label} file not found: ${file}`);
29640
+ }
29641
+ raw = String(content);
29642
+ } else if (inline !== undefined) {
29643
+ raw = inline;
29644
+ } else {
29645
+ throw new Error(`A ${noun} is required: pass --${flag} <json-file> or --${flag}-json <json>.`);
29646
+ }
29647
+ const [parseErr, parsed] = catchError(() => JSON.parse(raw));
29648
+ if (parseErr) {
29649
+ throw new Error(`${Noun} is not valid JSON: ${parseErr.message}`);
29650
+ }
29651
+ return parsed;
29652
+ }
29609
29653
 
29610
29654
  // src/commands/app-types.ts
29611
29655
  var APP_TYPES_LIST_EXAMPLES = [
@@ -29680,6 +29724,16 @@ var APPS_CREATE_EXAMPLES = [
29680
29724
  }
29681
29725
  }
29682
29726
  ];
29727
+ var APPS_DELETE_EXAMPLES = [
29728
+ {
29729
+ Description: "Delete a process app by id",
29730
+ Command: "uip pm apps delete 9c46289e --yes",
29731
+ Output: {
29732
+ Code: "PmAppsDelete",
29733
+ Data: { AppId: "9c46289e", Status: "Deleted" }
29734
+ }
29735
+ }
29736
+ ];
29683
29737
  function registerAppsCommand(program2) {
29684
29738
  const appsCmd = program2.command("apps").description("Manage Process Mining process apps");
29685
29739
  appsCmd.command("list").description("List process apps").addOption(new Option("--stage <stage>", "App stage to list").choices(STAGES).default("dev")).examples(APPS_LIST_EXAMPLES).trackedAction(processContext, async (options) => {
@@ -29712,6 +29766,23 @@ function registerAppsCommand(program2) {
29712
29766
  Data: { AppId: appId, Name: name, Type: options.type }
29713
29767
  });
29714
29768
  });
29769
+ appsCmd.command("delete <app-id>").description("Delete a process app").option("-y, --yes", "Confirm this irreversible operation (required; the CLI never prompts)").examples(APPS_DELETE_EXAMPLES).trackedAction(processContext, async (appId, options) => {
29770
+ if (!requireConfirmation(options, `delete process app '${appId}'`))
29771
+ return;
29772
+ const config = await loadConfigOrExit();
29773
+ if (!config)
29774
+ return;
29775
+ const [err] = await catchError(pmDelete(config, `/apps/${appId}`));
29776
+ if (err) {
29777
+ fail(err.message, "Check the app id (uip pm apps list).");
29778
+ return;
29779
+ }
29780
+ OutputFormatter.success({
29781
+ Result: "Success",
29782
+ Code: "PmAppsDelete",
29783
+ Data: { AppId: appId, Status: "Deleted" }
29784
+ });
29785
+ });
29715
29786
  }
29716
29787
  async function createApp(config, name, options) {
29717
29788
  let version = options.typeVersion;
@@ -29925,9 +29996,180 @@ function registerIngestionsCommand(program2) {
29925
29996
  });
29926
29997
  }
29927
29998
 
29999
+ // src/commands/query.ts
30000
+ var STAGES4 = ["dev", "published"];
30001
+ var LAYOUT_TYPES = ["graph", "process-model"];
30002
+ var QUERY_RUN_EXAMPLES = [
30003
+ {
30004
+ Description: "Run an aggregate query from a JSON body (group-by + metrics)",
30005
+ Command: "uip pm query run 9c46289e --body ./query.json",
30006
+ Output: {
30007
+ Code: "PmQueryRun",
30008
+ Data: {
30009
+ Number_of_cases: { Ungrouped: 1043 }
30010
+ }
30011
+ }
30012
+ }
30013
+ ];
30014
+ var QUERY_RCA_EXAMPLES = [
30015
+ {
30016
+ Description: "Root-cause analysis: which attributes explain the selected set",
30017
+ Command: `uip pm query rca 9c46289e --body-json '{"argument":"Case_ID","exploreAttributes":["Case_type"],"selectedSet":[[{"kind":"values","dimension":"Case_status","type":"string","values":["Open"],"invert":false,"displayType":"list"}]]}'`,
30018
+ Output: {
30019
+ Code: "PmQueryRca",
30020
+ Data: { Data: {}, Warnings: null }
30021
+ }
30022
+ }
30023
+ ];
30024
+ var QUERY_INFO_EXAMPLES = [
30025
+ {
30026
+ Description: "Discover the fields, metrics and processes available for query bodies",
30027
+ Command: "uip pm query info 9c46289e",
30028
+ Output: {
30029
+ Code: "PmQueryInfo",
30030
+ Data: { fields: [], processes: [] }
30031
+ }
30032
+ }
30033
+ ];
30034
+ var QUERY_PERCENTILE_EXAMPLES = [
30035
+ {
30036
+ Description: "Compute the 50th/90th/95th percentiles of case throughput time",
30037
+ Command: "uip pm query percentile 9c46289e --field PF__throughput_time --values 0.5,0.9,0.95",
30038
+ Output: {
30039
+ Code: "PmQueryPercentile",
30040
+ Data: { values: [3600, 86400, 172800] }
30041
+ }
30042
+ }
30043
+ ];
30044
+ function registerQueryCommand(program2) {
30045
+ const queryCmd = program2.command("query").description("Query a process app: aggregate data, details, RCA, insights, " + "percentiles, layout and query metadata");
30046
+ registerBodyQuery(queryCmd, {
30047
+ name: "run",
30048
+ subpath: "",
30049
+ code: "PmQueryRun",
30050
+ summary: "Run an aggregate (group-by + metrics) data query",
30051
+ examples: QUERY_RUN_EXAMPLES,
30052
+ withLimit: true
30053
+ });
30054
+ registerBodyQuery(queryCmd, {
30055
+ name: "details",
30056
+ subpath: "/details",
30057
+ code: "PmQueryDetails",
30058
+ summary: "Run a details (raw table rows) data query",
30059
+ withLimit: true
30060
+ });
30061
+ registerBodyQuery(queryCmd, {
30062
+ name: "rca",
30063
+ subpath: "/rca",
30064
+ code: "PmQueryRca",
30065
+ summary: "Run a root-cause analysis query (body needs a non-empty 'selectedSet')",
30066
+ examples: QUERY_RCA_EXAMPLES,
30067
+ withLimit: true
30068
+ });
30069
+ registerBodyQuery(queryCmd, {
30070
+ name: "insights",
30071
+ subpath: "/processInsights",
30072
+ code: "PmQueryInsights",
30073
+ summary: "Run process insights (body needs 'processId' and 1..10 'metrics')",
30074
+ withLimit: true
30075
+ });
30076
+ queryCmd.command("info <app-id>").description("Get query metadata: the fields, metrics and processes available to build query bodies").addOption(new Option("--stage <stage>", "App stage").choices(STAGES4).default("dev")).examples(QUERY_INFO_EXAMPLES).trackedAction(processContext, async (appId, options) => {
30077
+ const config = await loadConfigOrExit();
30078
+ if (!config)
30079
+ return;
30080
+ const [err, result] = await catchError(pmGet(config, `/query/${appId}/${options.stage}/info`));
30081
+ if (err) {
30082
+ fail(err.message, "Check the app id (uip pm apps list) and that the stage has a completed ingestion.");
30083
+ return;
30084
+ }
30085
+ OutputFormatter.success({
30086
+ Result: "Success",
30087
+ Code: "PmQueryInfo",
30088
+ Data: result
30089
+ });
30090
+ });
30091
+ queryCmd.command("layout <app-id>").description("Get the persisted global graph layout of a process app").addOption(new Option("--type <type>", "Layout to read: the process 'graph' or the 'process-model'").choices(LAYOUT_TYPES).default("graph")).addOption(new Option("--stage <stage>", "App stage").choices(STAGES4).default("dev")).trackedAction(processContext, async (appId, options) => {
30092
+ const config = await loadConfigOrExit();
30093
+ if (!config)
30094
+ return;
30095
+ const endpoint = options.type === "process-model" ? "processModelGlobalLayout" : "graphLayout";
30096
+ const [err, result] = await catchError(pmGet(config, `/query/${appId}/${options.stage}/${endpoint}`));
30097
+ if (err) {
30098
+ fail(err.message, "Check the app id (uip pm apps list) and that the stage has a completed ingestion.");
30099
+ return;
30100
+ }
30101
+ OutputFormatter.success({
30102
+ Result: "Success",
30103
+ Code: "PmQueryLayout",
30104
+ Data: result
30105
+ });
30106
+ });
30107
+ queryCmd.command("percentile <app-id>").description("Compute percentiles of a numeric field").requiredOption("--field <field-id>", "Field id to compute percentiles over (uip pm query info)").requiredOption("--values <list>", "Comma-separated percentile points in 0..1, e.g. '0.5,0.9,0.95'").option("--filters <json-file>", "Path to a JSON file with a filter spec (array of AND-ed filter groups)").option("--filters-json <json>", "Inline JSON filter spec").addOption(new Option("--stage <stage>", "App stage").choices(STAGES4).default("dev")).examples(QUERY_PERCENTILE_EXAMPLES).trackedAction(processContext, async (appId, options) => {
30108
+ const config = await loadConfigOrExit();
30109
+ if (!config)
30110
+ return;
30111
+ const [buildErr, body] = await catchError(buildPercentileBody(options));
30112
+ if (buildErr) {
30113
+ fail(buildErr.message, "Pass --values as comma-separated numbers in 0..1 and a valid --filters/--filters-json spec.");
30114
+ return;
30115
+ }
30116
+ const [err, result] = await catchError(pmPost(config, `/query/${appId}/${options.stage}/percentile`, body));
30117
+ if (err) {
30118
+ fail(err.message, "Check the app id, the field id (uip pm query info) and that the stage has a completed ingestion.");
30119
+ return;
30120
+ }
30121
+ OutputFormatter.success({
30122
+ Result: "Success",
30123
+ Code: "PmQueryPercentile",
30124
+ Data: result
30125
+ });
30126
+ });
30127
+ }
30128
+ function registerBodyQuery(queryCmd, spec) {
30129
+ const cmd = queryCmd.command(`${spec.name} <app-id>`).description(spec.summary).option("--body <json-file>", "Path to a JSON file with the request body").option("--body-json <json>", "Inline JSON request body").addOption(new Option("--stage <stage>", "App stage").choices(STAGES4).default("dev"));
30130
+ if (spec.withLimit) {
30131
+ cmd.option("--limit <n>", "Max rows to return (server clamps to 1..1000)");
30132
+ }
30133
+ if (spec.examples) {
30134
+ cmd.examples(spec.examples);
30135
+ }
30136
+ cmd.trackedAction(processContext, async (appId, options) => {
30137
+ const config = await loadConfigOrExit();
30138
+ if (!config)
30139
+ return;
30140
+ const [bodyErr, body] = await catchError(resolveJsonBody(options.body, options.bodyJson));
30141
+ if (bodyErr) {
30142
+ fail(bodyErr.message, "Pass the request body with --body <json-file> or --body-json <json>. Use 'uip pm query info' to discover field/metric ids.");
30143
+ return;
30144
+ }
30145
+ const query = options.limit === undefined ? "" : `?limit=${encodeURIComponent(options.limit)}`;
30146
+ const [apiErr, result] = await catchError(pmPost(config, `/query/${appId}/${options.stage}${spec.subpath}${query}`, body));
30147
+ if (apiErr) {
30148
+ fail(apiErr.message, "Check the app id (uip pm apps list), that the stage has a completed ingestion, and the request body shape.");
30149
+ return;
30150
+ }
30151
+ OutputFormatter.success({
30152
+ Result: "Success",
30153
+ Code: spec.code,
30154
+ Data: result
30155
+ });
30156
+ });
30157
+ }
30158
+ async function buildPercentileBody(options) {
30159
+ const values = options.values.split(",").map((s) => s.trim()).filter((s) => s.length > 0).map(Number);
30160
+ if (values.length === 0 || values.some((v) => !Number.isFinite(v))) {
30161
+ throw new Error(`Invalid --values '${options.values}': expected comma-separated numbers.`);
30162
+ }
30163
+ let filters = [];
30164
+ if (options.filters !== undefined || options.filtersJson !== undefined) {
30165
+ filters = await resolveJsonBody(options.filters, options.filtersJson, "filters");
30166
+ }
30167
+ return { field: options.field, values, filters };
30168
+ }
30169
+
29928
30170
  // src/commands/transformations.ts
29929
30171
  init_src();
29930
- var STAGES4 = ["dev", "published"];
30172
+ var STAGES5 = ["dev", "published"];
29931
30173
  var TRANSFORMATIONS_RUN_EXAMPLES = [
29932
30174
  {
29933
30175
  Description: "Rebuild a single dbt model and its dependents on dev",
@@ -29950,7 +30192,7 @@ var TRANSFORMATIONS_APPLY_EXAMPLES = [
29950
30192
  ];
29951
30193
  function registerTransformationsCommand(program2) {
29952
30194
  const transformationsCmd = program2.command("transformations").description("Work with the dbt SQL transformations of a process app");
29953
- transformationsCmd.command("list <app-id>").description("List the transformation files of a process app").addOption(new Option("--stage <stage>", "App stage to read from").choices(STAGES4).default("dev")).trackedAction(processContext, async (appId, options) => {
30195
+ transformationsCmd.command("list <app-id>").description("List the transformation files of a process app").addOption(new Option("--stage <stage>", "App stage to read from").choices(STAGES5).default("dev")).trackedAction(processContext, async (appId, options) => {
29954
30196
  const config = await loadConfigOrExit();
29955
30197
  if (!config)
29956
30198
  return;
@@ -29965,7 +30207,7 @@ function registerTransformationsCommand(program2) {
29965
30207
  Data: result
29966
30208
  });
29967
30209
  });
29968
- transformationsCmd.command("get <app-id> <path>").description("Get the content of a transformation file").addOption(new Option("--stage <stage>", "App stage").choices(STAGES4).default("dev")).option("--destination <local-file>", "Write content to this local file instead of the output envelope").trackedAction(processContext, async (appId, path3, options) => {
30210
+ transformationsCmd.command("get <app-id> <path>").description("Get the content of a transformation file").addOption(new Option("--stage <stage>", "App stage").choices(STAGES5).default("dev")).option("--destination <local-file>", "Write content to this local file instead of the output envelope").trackedAction(processContext, async (appId, path3, options) => {
29969
30211
  const config = await loadConfigOrExit();
29970
30212
  if (!config)
29971
30213
  return;
@@ -29991,7 +30233,7 @@ function registerTransformationsCommand(program2) {
29991
30233
  }
29992
30234
  });
29993
30235
  });
29994
- transformationsCmd.command("update <app-id> <path>").description("Update a transformation file from a local file (ETag-safe)").requiredOption("--file <local-file>", "Local file with the new content").addOption(new Option("--stage <stage>", "App stage").choices(STAGES4).default("dev")).trackedAction(processContext, async (appId, path3, options) => {
30236
+ transformationsCmd.command("update <app-id> <path>").description("Update a transformation file from a local file (ETag-safe)").requiredOption("--file <local-file>", "Local file with the new content").addOption(new Option("--stage <stage>", "App stage").choices(STAGES5).default("dev")).trackedAction(processContext, async (appId, path3, options) => {
29995
30237
  const config = await loadConfigOrExit();
29996
30238
  if (!config)
29997
30239
  return;
@@ -30024,7 +30266,7 @@ function registerTransformationsCommand(program2) {
30024
30266
  }
30025
30267
  });
30026
30268
  });
30027
- transformationsCmd.command("apply <app-id>").description("Re-run the full data transformation on already-ingested data " + "(unlike 'run', which builds only changed dev models)").addOption(new Option("--stage <stage>", "App stage").choices(STAGES4).default("dev")).examples(TRANSFORMATIONS_APPLY_EXAMPLES).trackedAction(processContext, async (appId, options) => {
30269
+ transformationsCmd.command("apply <app-id>").description("Re-run the full data transformation on already-ingested data " + "(unlike 'run', which builds only changed dev models)").addOption(new Option("--stage <stage>", "App stage").choices(STAGES5).default("dev")).examples(TRANSFORMATIONS_APPLY_EXAMPLES).trackedAction(processContext, async (appId, options) => {
30028
30270
  const config = await loadConfigOrExit();
30029
30271
  if (!config)
30030
30272
  return;
@@ -30095,6 +30337,7 @@ var registerCommands = async (program2) => {
30095
30337
  registerAppTypesCommand(program2);
30096
30338
  registerFilesCommand(program2);
30097
30339
  registerIngestionsCommand(program2);
30340
+ registerQueryCommand(program2);
30098
30341
  registerTransformationsCommand(program2);
30099
30342
  };
30100
30343
  export {
@@ -30102,4 +30345,4 @@ export {
30102
30345
  metadata
30103
30346
  };
30104
30347
 
30105
- //# debugId=874A63A3E252D2BB64756E2164756E21
30348
+ //# debugId=C78F4AB1729DCBF664756E2164756E21
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/pm-tool",
3
3
  "license": "MIT",
4
- "version": "1.198.0-preview.90",
4
+ "version": "1.199.0-preview.91",
5
5
  "description": "Process Mining — process apps, transformations, and data ingestion.",
6
6
  "private": false,
7
7
  "repository": {
@@ -26,5 +26,5 @@
26
26
  "files": [
27
27
  "dist"
28
28
  ],
29
- "gitHead": "7fa615fb10f91f98f796a038ea70569336611f42"
29
+ "gitHead": "f428cb1e61ba89ad18394b0c6106784055699f02"
30
30
  }