@uipath/common 0.9.1 → 1.0.0
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/command-help.d.ts +2 -22
- package/dist/constants.d.ts +0 -2
- package/dist/error-handler.d.ts +1 -0
- package/dist/formatter.d.ts +26 -0
- package/dist/guid.d.ts +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1131 -1000
- package/dist/option-validators.d.ts +2 -0
- package/dist/orchestrator-urls.d.ts +65 -0
- package/dist/output-format-context.d.ts +11 -0
- package/package.json +5 -5
|
@@ -31,3 +31,5 @@ export declare function parseBoundedInt(raw: string, optionName: string, bounds:
|
|
|
31
31
|
min: number;
|
|
32
32
|
max: number;
|
|
33
33
|
}): number;
|
|
34
|
+
export declare function parsePositiveInteger(raw: string): number | undefined;
|
|
35
|
+
export declare function parseNonNegativeInteger(raw: string): number | undefined;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical Orchestrator / Action Center URL builders.
|
|
3
|
+
*
|
|
4
|
+
* Centralizes construction of `{baseUrl}/{org}/{tenant}/orchestrator_…` and
|
|
5
|
+
* `{baseUrl}/{org}/{tenant}/actions_/current-task/tasks/{taskId}` URLs so
|
|
6
|
+
* every CLI / SDK caller goes through one helper that:
|
|
7
|
+
*
|
|
8
|
+
* 1. **Requires the tenant slug** at the type level *and* validates it at
|
|
9
|
+
* runtime (rejects `""` / whitespace). This is the contract from
|
|
10
|
+
* [MST-9322](https://uipath.atlassian.net/browse/MST-9322): a URL like
|
|
11
|
+
* `/popoc/orchestrator_/actions/inbox/<taskKey>` (missing the tenant)
|
|
12
|
+
* is misclassified by the portal-UI as "Orchestrator not enabled" —
|
|
13
|
+
* no helper in this codebase should ever be able to produce one.
|
|
14
|
+
* 2. URL-encodes the `org`, `tenant`, and `taskKey/taskId` segments
|
|
15
|
+
* consistently — no callsite needs to remember to call
|
|
16
|
+
* `encodeURIComponent` itself for these.
|
|
17
|
+
* 3. Normalizes a base URL with a trailing slash so the caller can pass
|
|
18
|
+
* either form without producing `//`.
|
|
19
|
+
*
|
|
20
|
+
* The `path` argument on {@link buildOrchestratorUrl} is left as a string
|
|
21
|
+
* **without** automatic encoding so callers can include OData filter syntax
|
|
22
|
+
* and existing URL-encoded query strings; this matches the existing inline
|
|
23
|
+
* pattern used in `solution-tool/src/services/apps-binding-sync.ts`.
|
|
24
|
+
*
|
|
25
|
+
* For the Studio Web URL pattern (`/{org}/studio_/...`) — which has no
|
|
26
|
+
* tenant segment by design — see `packages/maestro-sdk` instead. That
|
|
27
|
+
* surface is structurally different and out of scope here.
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* Build a canonical Orchestrator URL of the form
|
|
31
|
+
* `{baseUrl}/{org}/{tenant}/orchestrator_{path}`.
|
|
32
|
+
*
|
|
33
|
+
* @param baseUrl e.g. `https://alpha.uipath.com` (with or without trailing slash)
|
|
34
|
+
* @param org Organization name or ID — segment after the host.
|
|
35
|
+
* @param tenant Tenant **name** (not ID). Required, non-empty.
|
|
36
|
+
* Empty/whitespace throws — see MST-9322.
|
|
37
|
+
* @param path Path appended verbatim after `orchestrator_`. By convention
|
|
38
|
+
* starts with `/` (e.g. `/odata/Processes`); query strings
|
|
39
|
+
* (`?q=…`) are also accepted. Not encoded — caller controls
|
|
40
|
+
* path-internal encoding (e.g. OData escapes).
|
|
41
|
+
*/
|
|
42
|
+
export declare function buildOrchestratorUrl(baseUrl: string, org: string, tenant: string, path: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* Build the Action Center *inbox* deep-link URL —
|
|
45
|
+
* `{baseUrl}/{org}/{tenant}/orchestrator_/actions/inbox/{taskKey}`.
|
|
46
|
+
*
|
|
47
|
+
* This is the form that MST-9322 specifically called out as broken when
|
|
48
|
+
* the tenant slug is missing. Any code surfacing an Action Center task
|
|
49
|
+
* link should go through this helper.
|
|
50
|
+
*/
|
|
51
|
+
export declare function buildActionCenterInboxUrl(baseUrl: string, org: string, tenant: string, taskKey: string): string;
|
|
52
|
+
/**
|
|
53
|
+
* Build the Action Center standalone task URL —
|
|
54
|
+
* `{baseUrl}/{org}/{tenant}/actions_/current-task/tasks/{taskId}`.
|
|
55
|
+
*
|
|
56
|
+
* This form (under `actions_/`, not `orchestrator_/`) is what Coded Action
|
|
57
|
+
* Apps and the Action Center portal use for direct task navigation. Same
|
|
58
|
+
* tenant-required contract as {@link buildActionCenterInboxUrl}.
|
|
59
|
+
*
|
|
60
|
+
* Orchestrator task IDs are positive integers — `0` (and the string `"0"`)
|
|
61
|
+
* are sentinel/uninitialized values, never real task IDs, and are
|
|
62
|
+
* rejected here so callers fail fast rather than producing a navigable
|
|
63
|
+
* URL that lands on the wrong task.
|
|
64
|
+
*/
|
|
65
|
+
export declare function buildActionCenterTaskUrl(baseUrl: string, org: string, tenant: string, taskId: string | number): string;
|
|
@@ -16,6 +16,17 @@ export declare function setOutputFormat(format: OutputFormat): void;
|
|
|
16
16
|
* Get the current output format, defaulting to "json" if not set.
|
|
17
17
|
*/
|
|
18
18
|
export declare function getOutputFormat(): OutputFormat;
|
|
19
|
+
/**
|
|
20
|
+
* Record whether `--output` was passed explicitly. Lets command handlers
|
|
21
|
+
* distinguish "user asked for json" from "json by default" without
|
|
22
|
+
* re-scanning argv themselves.
|
|
23
|
+
*/
|
|
24
|
+
export declare function setOutputFormatExplicit(explicit: boolean): void;
|
|
25
|
+
/**
|
|
26
|
+
* True when `--output` was passed explicitly on the command line.
|
|
27
|
+
* Defaults to false (i.e. resolved value is the default).
|
|
28
|
+
*/
|
|
29
|
+
export declare function getOutputFormatExplicit(): boolean;
|
|
19
30
|
/**
|
|
20
31
|
* Set the process-wide output filter expression.
|
|
21
32
|
* Called once at CLI startup after parsing the global --output-filter option.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/common",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Common infrastructure needed by uip tools.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@jmespath-community/jmespath": "^1.3.0",
|
|
42
42
|
"@types/js-yaml": "^4.0.9",
|
|
43
|
-
"@types/node": "^25.5.
|
|
44
|
-
"@uipath/filesystem": "0.
|
|
43
|
+
"@types/node": "^25.5.2",
|
|
44
|
+
"@uipath/filesystem": "1.0.0",
|
|
45
45
|
"commander": "^14.0.3",
|
|
46
46
|
"js-yaml": "^4.1.0",
|
|
47
47
|
"jsonpath-plus": "^10.4.0",
|
|
48
|
-
"typescript": "^
|
|
48
|
+
"typescript": "^6.0.2"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "d982977e86057fd9d0846c955595c64865aeecab"
|
|
51
51
|
}
|