@uipath/common 1.204.0-preview.255 → 1.205.0-preview.256
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/classified-failure.d.ts +13 -1
- package/dist/entity-field-rules.d.ts +7 -0
- package/dist/entity-field-rules.js +122 -0
- package/dist/entity-name-rules.d.ts +12 -0
- package/dist/entity-name-rules.js +14 -10
- package/dist/exit-code.d.ts +7 -0
- package/dist/formatter.d.ts +2 -2
- package/dist/http-status.d.ts +7 -0
- package/dist/index.browser.d.ts +2 -0
- package/dist/index.browser.js +131 -12
- package/dist/index.d.ts +5 -0
- package/dist/index.js +265 -13
- package/dist/json-option.d.ts +21 -0
- package/dist/logger.d.ts +1 -1
- package/dist/option-aliases.d.ts +1 -0
- package/dist/option-groups.d.ts +7 -0
- package/dist/sdk-user-agent.js +4 -2
- package/dist/session-kind.d.ts +73 -0
- package/dist/session-kind.js +66 -0
- package/dist/shell-quote.d.ts +14 -0
- package/dist/telemetry/index.js +4 -2
- package/dist/telemetry/telemetry-dimensions.d.ts +4 -0
- package/dist/trackedAction.d.ts +6 -6
- package/dist/zip.d.ts +6 -0
- package/dist/zip.js +19 -2
- package/package.json +16 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type FailureOutput } from "./formatter";
|
|
1
|
+
import { type ErrorContext, type FailureOutput } from "./formatter";
|
|
2
2
|
/**
|
|
3
3
|
* Build the standard failure envelope for `error`, classified.
|
|
4
4
|
*
|
|
@@ -21,6 +21,18 @@ import { type FailureOutput } from "./formatter";
|
|
|
21
21
|
* ```
|
|
22
22
|
*/
|
|
23
23
|
export declare function classifiedFailure(message: string, error: unknown): Promise<FailureOutput>;
|
|
24
|
+
/**
|
|
25
|
+
* The failure envelope for an operation the connected environment does not
|
|
26
|
+
* offer: its service is not deployed there, or the feature behind it is off.
|
|
27
|
+
* Automation Suite ships without some Automation Cloud features, and passing
|
|
28
|
+
* the raw 404 or portal HTML through tells the caller nothing.
|
|
29
|
+
*
|
|
30
|
+
* `operation` names what the caller tried ("Tagged attachment upload") and
|
|
31
|
+
* becomes the standard Message, so every tool reports this the same way;
|
|
32
|
+
* `instructions` says what is missing and what to do instead. Emit it the
|
|
33
|
+
* same way as {@link classifiedFailure}, followed by the caller's own exit.
|
|
34
|
+
*/
|
|
35
|
+
export declare function notSupportedFailure(operation: string, instructions: string, context?: ErrorContext): FailureOutput;
|
|
24
36
|
/**
|
|
25
37
|
* Collapse whitespace and cap length so a platform's raw response body can be
|
|
26
38
|
* quoted inside `Instructions` without dumping an arbitrarily long payload.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ValidationError } from "./body-validators";
|
|
2
|
+
/** How many MULTILINE_MAX fields one entity may carry. A server limit, so it
|
|
3
|
+
* lives beside the other server rules: the tenant path checks it against the
|
|
4
|
+
* create body, and the packager checks it against the authored document —
|
|
5
|
+
* which is the whole entity, not one batch of edits. */
|
|
6
|
+
export declare const MAX_MULTILINE_MAX_FIELDS = 10;
|
|
7
|
+
export declare function findInvalidFieldConstraints(fields: unknown[]): ValidationError | null;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __returnValue = (v) => v;
|
|
3
|
+
function __exportSetter(name, newValue) {
|
|
4
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
5
|
+
}
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true,
|
|
11
|
+
configurable: true,
|
|
12
|
+
set: __exportSetter.bind(all, name)
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
16
|
+
|
|
17
|
+
// src/entity-field-rules.ts
|
|
18
|
+
var MAX_SAFE_NUMERIC_BOUND = 9007199254740991;
|
|
19
|
+
var LENGTH_LIMIT_RANGES = {
|
|
20
|
+
STRING: [1, 4000],
|
|
21
|
+
MULTILINE_TEXT: [1, 1e4],
|
|
22
|
+
MULTILINE_MAX: [1, 131072]
|
|
23
|
+
};
|
|
24
|
+
var MAX_MULTILINE_MAX_FIELDS = 10;
|
|
25
|
+
function isNumber(v) {
|
|
26
|
+
return typeof v === "number" && Number.isFinite(v);
|
|
27
|
+
}
|
|
28
|
+
function findInvalidFieldConstraints(fields) {
|
|
29
|
+
for (const f of fields) {
|
|
30
|
+
if (typeof f !== "object" || f === null)
|
|
31
|
+
continue;
|
|
32
|
+
const rec = f;
|
|
33
|
+
const type = rec.type;
|
|
34
|
+
if (typeof type !== "string")
|
|
35
|
+
continue;
|
|
36
|
+
const fieldName = typeof rec.name === "string" ? rec.name : "<field>";
|
|
37
|
+
if (rec.lengthLimit !== undefined) {
|
|
38
|
+
if (!isNumber(rec.lengthLimit) || !Number.isInteger(rec.lengthLimit)) {
|
|
39
|
+
return {
|
|
40
|
+
message: `Field '${fieldName}' 'lengthLimit' must be an integer`,
|
|
41
|
+
instructions: "Pass a positive integer within the type's range (STRING 1-4000, MULTILINE_TEXT 1-10000, MULTILINE_MAX 1-131072 UTF-16 bytes)."
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
const range = LENGTH_LIMIT_RANGES[type];
|
|
45
|
+
if (range === undefined) {
|
|
46
|
+
return {
|
|
47
|
+
message: `Field '${fieldName}' of type '${type}' does not accept 'lengthLimit'`,
|
|
48
|
+
instructions: "'lengthLimit' applies only to STRING, MULTILINE_TEXT, and MULTILINE_MAX. Remove it or change the field type."
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
const [min, max] = range;
|
|
52
|
+
if (rec.lengthLimit < min || rec.lengthLimit > max) {
|
|
53
|
+
return {
|
|
54
|
+
message: `Field '${fieldName}' 'lengthLimit' ${rec.lengthLimit} is outside the allowed range for type '${type}'`,
|
|
55
|
+
instructions: `'lengthLimit' on '${type}' must be between ${min} and ${max}. MULTILINE_MAX 'lengthLimit' is a UTF-16 byte budget (≈2 per char).`
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (rec.maxValue !== undefined || rec.minValue !== undefined) {
|
|
60
|
+
if (type !== "DECIMAL" && type !== "AUTO_NUMBER") {
|
|
61
|
+
const which = rec.maxValue !== undefined ? "maxValue" : "minValue";
|
|
62
|
+
return {
|
|
63
|
+
message: `Field '${fieldName}' of type '${type}' does not accept '${which}'`,
|
|
64
|
+
instructions: "'minValue' and 'maxValue' apply only to DECIMAL and AUTO_NUMBER. Remove them or change the field type."
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
if (rec.maxValue !== undefined && !isNumber(rec.maxValue)) {
|
|
68
|
+
return {
|
|
69
|
+
message: `Field '${fieldName}' 'maxValue' must be a number`,
|
|
70
|
+
instructions: "Pass a numeric value."
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
if (rec.minValue !== undefined && !isNumber(rec.minValue)) {
|
|
74
|
+
return {
|
|
75
|
+
message: `Field '${fieldName}' 'minValue' must be a number`,
|
|
76
|
+
instructions: "Pass a numeric value."
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
const maxValue = rec.maxValue;
|
|
80
|
+
if (maxValue !== undefined && (maxValue > MAX_SAFE_NUMERIC_BOUND || maxValue < -MAX_SAFE_NUMERIC_BOUND)) {
|
|
81
|
+
return {
|
|
82
|
+
message: `Field '${fieldName}' 'maxValue' ${rec.maxValue} is outside the supported numeric range`,
|
|
83
|
+
instructions: `Use a value between ${-MAX_SAFE_NUMERIC_BOUND} and ${MAX_SAFE_NUMERIC_BOUND}.`
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
const minValue = rec.minValue;
|
|
87
|
+
if (minValue !== undefined && (minValue > MAX_SAFE_NUMERIC_BOUND || minValue < -MAX_SAFE_NUMERIC_BOUND)) {
|
|
88
|
+
return {
|
|
89
|
+
message: `Field '${fieldName}' 'minValue' ${rec.minValue} is outside the supported numeric range`,
|
|
90
|
+
instructions: `Use a value between ${-MAX_SAFE_NUMERIC_BOUND} and ${MAX_SAFE_NUMERIC_BOUND}.`
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
if (rec.maxValue !== undefined && rec.minValue !== undefined && rec.minValue > rec.maxValue) {
|
|
94
|
+
return {
|
|
95
|
+
message: `Field '${fieldName}' 'minValue' (${rec.minValue}) must not exceed 'maxValue' (${rec.maxValue})`,
|
|
96
|
+
instructions: "Adjust the bounds so 'minValue <= maxValue', or drop one of the two."
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
if (rec.decimalPrecision !== undefined) {
|
|
101
|
+
if (type !== "DECIMAL" && type !== "AUTO_NUMBER") {
|
|
102
|
+
return {
|
|
103
|
+
message: `Field '${fieldName}' of type '${type}' does not accept 'decimalPrecision'`,
|
|
104
|
+
instructions: "'decimalPrecision' applies only to DECIMAL and AUTO_NUMBER. Remove it or change the field type."
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
if (!isNumber(rec.decimalPrecision) || !Number.isInteger(rec.decimalPrecision) || rec.decimalPrecision < 0 || rec.decimalPrecision > 10) {
|
|
108
|
+
return {
|
|
109
|
+
message: `Field '${fieldName}' 'decimalPrecision' ${rec.decimalPrecision} is invalid`,
|
|
110
|
+
instructions: "'decimalPrecision' must be an integer between 0 and 10 (0 for whole numbers, 2 for money)."
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
export {
|
|
118
|
+
MAX_MULTILINE_MAX_FIELDS,
|
|
119
|
+
findInvalidFieldConstraints
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
//# debugId=A0E2BD809660810564756E2164756E21
|
|
@@ -11,6 +11,18 @@ export type NameKind = "entity" | "field" | "choice set";
|
|
|
11
11
|
* callers must not run this over them.
|
|
12
12
|
*/
|
|
13
13
|
export declare function findReservedNameError(name: string, kind: NameKind): ValidationError | null;
|
|
14
|
+
/**
|
|
15
|
+
* Check only the *format* of an entity / field / choice-set name — the per-kind
|
|
16
|
+
* pattern, with no reserved-name or keyword check.
|
|
17
|
+
*
|
|
18
|
+
* Split out from {@link validateName} because the two authors report differently:
|
|
19
|
+
* `uip df entities create` wants one error for a bad name, while `solution pack`
|
|
20
|
+
* emits a distinct diagnostic code per rule (`ENTITY_NAME_INVALID` vs
|
|
21
|
+
* `NAME_RESERVED`) and so has to run the halves separately. Exporting the format
|
|
22
|
+
* half keeps the patterns here — a second copy is how entity and field names
|
|
23
|
+
* drifted apart before, since only entity names may contain underscores.
|
|
24
|
+
*/
|
|
25
|
+
export declare function validateNameFormat(name: string, kind: NameKind): ValidationError | null;
|
|
14
26
|
/**
|
|
15
27
|
* Check an entity / field / choice-set name against the server's format,
|
|
16
28
|
* reserved-name, and reserved-keyword rules.
|
|
@@ -235,23 +235,27 @@ function findReservedNameError(name, kind) {
|
|
|
235
235
|
}
|
|
236
236
|
return null;
|
|
237
237
|
}
|
|
238
|
+
function validateNameFormat(name, kind) {
|
|
239
|
+
const pattern = kind === "field" ? FIELD_NAME_PATTERN : ENTITY_NAME_PATTERN;
|
|
240
|
+
if (pattern.test(name)) {
|
|
241
|
+
return null;
|
|
242
|
+
}
|
|
243
|
+
return {
|
|
244
|
+
message: `Invalid ${kind} name '${name}'`,
|
|
245
|
+
instructions: kind === "field" ? "Field names must start with a letter, contain only letters and digits (no underscores), and be 3-100 characters long." : "Names must start with a letter, contain only letters, digits, and underscores, and be 3-100 characters long."
|
|
246
|
+
};
|
|
247
|
+
}
|
|
238
248
|
function validateName(name, kind) {
|
|
239
249
|
const reserved = findReservedNameError(name, kind);
|
|
240
250
|
if (reserved) {
|
|
241
251
|
return reserved;
|
|
242
252
|
}
|
|
243
|
-
|
|
244
|
-
if (!pattern.test(name)) {
|
|
245
|
-
return {
|
|
246
|
-
message: `Invalid ${kind} name '${name}'`,
|
|
247
|
-
instructions: kind === "field" ? "Field names must start with a letter, contain only letters and digits (no underscores), and be 3-100 characters long." : "Names must start with a letter, contain only letters, digits, and underscores, and be 3-100 characters long."
|
|
248
|
-
};
|
|
249
|
-
}
|
|
250
|
-
return null;
|
|
253
|
+
return validateNameFormat(name, kind);
|
|
251
254
|
}
|
|
252
255
|
export {
|
|
253
256
|
findReservedNameError,
|
|
254
|
-
validateName
|
|
257
|
+
validateName,
|
|
258
|
+
validateNameFormat
|
|
255
259
|
};
|
|
256
260
|
|
|
257
|
-
//# debugId=
|
|
261
|
+
//# debugId=93EDBB4CC50B9D8164756E2164756E21
|
package/dist/exit-code.d.ts
CHANGED
|
@@ -38,5 +38,12 @@ export declare function getExitCode(): number;
|
|
|
38
38
|
* the MCP bridge): without this, a failing run's `1` leaks into the next run's
|
|
39
39
|
* success path. Not for command code — a command that wants to exit clean says
|
|
40
40
|
* so with `context.exit(0)`.
|
|
41
|
+
*
|
|
42
|
+
* Cleared to `0`, not `undefined`. Bun ignores `process.exitCode = undefined`
|
|
43
|
+
* (1.3.14: the field keeps its old value), so a reset written that way reset
|
|
44
|
+
* nothing when the host ran under Bun, and a `registry get` miss (exit 1) was
|
|
45
|
+
* reported on the next command's success. `0` is the same answer to every
|
|
46
|
+
* reader — {@link getExitCode} already said 0 for unset, and a process exits
|
|
47
|
+
* 0 either way — and both runtimes honour it.
|
|
41
48
|
*/
|
|
42
49
|
export declare function resetExitCode(): void;
|
package/dist/formatter.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export type TableRowStyle = "red" | "dim";
|
|
|
11
11
|
export type TableRowStyleFn = (row: Record<string, unknown>) => TableRowStyle | undefined;
|
|
12
12
|
export type ResultType = "Success" | "Failure" | "ConfigError" | "AuthenticationError" | "ValidationError" | "TimeoutError";
|
|
13
13
|
export type FailureResultType = Exclude<ResultType, "Success">;
|
|
14
|
-
export declare const CLI_ERROR_CODES: readonly ["invalid_argument", "authentication_required", "permission_denied", "local_permission_denied", "not_found", "rate_limited", "network_error", "timeout", "server_error", "method_not_allowed", "configuration_error", "unknown_error"];
|
|
14
|
+
export declare const CLI_ERROR_CODES: readonly ["invalid_argument", "authentication_required", "permission_denied", "local_permission_denied", "not_found", "rate_limited", "network_error", "timeout", "server_error", "method_not_allowed", "not_supported", "configuration_error", "execution_failed", "unknown_error"];
|
|
15
15
|
export type CliErrorCode = (typeof CLI_ERROR_CODES)[number];
|
|
16
16
|
export declare const RETRY_HINTS: readonly ["RetryWillNotFix", "RetryLater", "RetryAfter1Second", "RetryAfter10Seconds", "RetryAfter30Seconds", "RetryAfter60Seconds"];
|
|
17
17
|
export type RetryHint = (typeof RETRY_HINTS)[number];
|
|
@@ -49,7 +49,7 @@ export declare const RESULTS: {
|
|
|
49
49
|
readonly ConfigError: "ConfigError";
|
|
50
50
|
readonly AuthenticationError: "AuthenticationError";
|
|
51
51
|
readonly ValidationError: "ValidationError";
|
|
52
|
-
/**
|
|
52
|
+
/** A wait the caller bounded with --timeout ran out (e.g. `tm testsets clone`); exit 4. */
|
|
53
53
|
readonly TimeoutError: "TimeoutError";
|
|
54
54
|
};
|
|
55
55
|
/**
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The HTTP status an SDK error carries — from the `Response` a generated
|
|
3
|
+
* client attaches, or from the error's own `status` — and `undefined` when it
|
|
4
|
+
* carries none (a transport failure, a thrown string). Lets a caller tell one
|
|
5
|
+
* status, such as a 404 "no such record", from every other failure.
|
|
6
|
+
*/
|
|
7
|
+
export declare function httpStatusOf(error: unknown): number | undefined;
|
package/dist/index.browser.d.ts
CHANGED
|
@@ -6,12 +6,14 @@ export * from "./completer";
|
|
|
6
6
|
export { installConsoleGuard, restoreConsole } from "./console-guard";
|
|
7
7
|
export * from "./constants";
|
|
8
8
|
export * from "./content-hash";
|
|
9
|
+
export * from "./entity-field-rules";
|
|
9
10
|
export * from "./entity-name-rules";
|
|
10
11
|
export * from "./env-reference";
|
|
11
12
|
export * from "./error-handler";
|
|
12
13
|
export * from "./error-instructions";
|
|
13
14
|
export * from "./exit-code";
|
|
14
15
|
export * from "./guid";
|
|
16
|
+
export * from "./http-status";
|
|
15
17
|
export * from "./logger";
|
|
16
18
|
export * from "./mime-types";
|
|
17
19
|
export * from "./option-validators";
|
package/dist/index.browser.js
CHANGED
|
@@ -21479,6 +21479,106 @@ async function hashContent(content) {
|
|
|
21479
21479
|
}
|
|
21480
21480
|
throw new Error("Unable to compute SHA-256 hash in this environment.");
|
|
21481
21481
|
}
|
|
21482
|
+
// src/entity-field-rules.ts
|
|
21483
|
+
var MAX_SAFE_NUMERIC_BOUND = 9007199254740991;
|
|
21484
|
+
var LENGTH_LIMIT_RANGES = {
|
|
21485
|
+
STRING: [1, 4000],
|
|
21486
|
+
MULTILINE_TEXT: [1, 1e4],
|
|
21487
|
+
MULTILINE_MAX: [1, 131072]
|
|
21488
|
+
};
|
|
21489
|
+
var MAX_MULTILINE_MAX_FIELDS = 10;
|
|
21490
|
+
function isNumber2(v) {
|
|
21491
|
+
return typeof v === "number" && Number.isFinite(v);
|
|
21492
|
+
}
|
|
21493
|
+
function findInvalidFieldConstraints(fields) {
|
|
21494
|
+
for (const f of fields) {
|
|
21495
|
+
if (typeof f !== "object" || f === null)
|
|
21496
|
+
continue;
|
|
21497
|
+
const rec = f;
|
|
21498
|
+
const type = rec.type;
|
|
21499
|
+
if (typeof type !== "string")
|
|
21500
|
+
continue;
|
|
21501
|
+
const fieldName = typeof rec.name === "string" ? rec.name : "<field>";
|
|
21502
|
+
if (rec.lengthLimit !== undefined) {
|
|
21503
|
+
if (!isNumber2(rec.lengthLimit) || !Number.isInteger(rec.lengthLimit)) {
|
|
21504
|
+
return {
|
|
21505
|
+
message: `Field '${fieldName}' 'lengthLimit' must be an integer`,
|
|
21506
|
+
instructions: "Pass a positive integer within the type's range (STRING 1-4000, MULTILINE_TEXT 1-10000, MULTILINE_MAX 1-131072 UTF-16 bytes)."
|
|
21507
|
+
};
|
|
21508
|
+
}
|
|
21509
|
+
const range = LENGTH_LIMIT_RANGES[type];
|
|
21510
|
+
if (range === undefined) {
|
|
21511
|
+
return {
|
|
21512
|
+
message: `Field '${fieldName}' of type '${type}' does not accept 'lengthLimit'`,
|
|
21513
|
+
instructions: "'lengthLimit' applies only to STRING, MULTILINE_TEXT, and MULTILINE_MAX. Remove it or change the field type."
|
|
21514
|
+
};
|
|
21515
|
+
}
|
|
21516
|
+
const [min, max] = range;
|
|
21517
|
+
if (rec.lengthLimit < min || rec.lengthLimit > max) {
|
|
21518
|
+
return {
|
|
21519
|
+
message: `Field '${fieldName}' 'lengthLimit' ${rec.lengthLimit} is outside the allowed range for type '${type}'`,
|
|
21520
|
+
instructions: `'lengthLimit' on '${type}' must be between ${min} and ${max}. MULTILINE_MAX 'lengthLimit' is a UTF-16 byte budget (≈2 per char).`
|
|
21521
|
+
};
|
|
21522
|
+
}
|
|
21523
|
+
}
|
|
21524
|
+
if (rec.maxValue !== undefined || rec.minValue !== undefined) {
|
|
21525
|
+
if (type !== "DECIMAL" && type !== "AUTO_NUMBER") {
|
|
21526
|
+
const which = rec.maxValue !== undefined ? "maxValue" : "minValue";
|
|
21527
|
+
return {
|
|
21528
|
+
message: `Field '${fieldName}' of type '${type}' does not accept '${which}'`,
|
|
21529
|
+
instructions: "'minValue' and 'maxValue' apply only to DECIMAL and AUTO_NUMBER. Remove them or change the field type."
|
|
21530
|
+
};
|
|
21531
|
+
}
|
|
21532
|
+
if (rec.maxValue !== undefined && !isNumber2(rec.maxValue)) {
|
|
21533
|
+
return {
|
|
21534
|
+
message: `Field '${fieldName}' 'maxValue' must be a number`,
|
|
21535
|
+
instructions: "Pass a numeric value."
|
|
21536
|
+
};
|
|
21537
|
+
}
|
|
21538
|
+
if (rec.minValue !== undefined && !isNumber2(rec.minValue)) {
|
|
21539
|
+
return {
|
|
21540
|
+
message: `Field '${fieldName}' 'minValue' must be a number`,
|
|
21541
|
+
instructions: "Pass a numeric value."
|
|
21542
|
+
};
|
|
21543
|
+
}
|
|
21544
|
+
const maxValue = rec.maxValue;
|
|
21545
|
+
if (maxValue !== undefined && (maxValue > MAX_SAFE_NUMERIC_BOUND || maxValue < -MAX_SAFE_NUMERIC_BOUND)) {
|
|
21546
|
+
return {
|
|
21547
|
+
message: `Field '${fieldName}' 'maxValue' ${rec.maxValue} is outside the supported numeric range`,
|
|
21548
|
+
instructions: `Use a value between ${-MAX_SAFE_NUMERIC_BOUND} and ${MAX_SAFE_NUMERIC_BOUND}.`
|
|
21549
|
+
};
|
|
21550
|
+
}
|
|
21551
|
+
const minValue = rec.minValue;
|
|
21552
|
+
if (minValue !== undefined && (minValue > MAX_SAFE_NUMERIC_BOUND || minValue < -MAX_SAFE_NUMERIC_BOUND)) {
|
|
21553
|
+
return {
|
|
21554
|
+
message: `Field '${fieldName}' 'minValue' ${rec.minValue} is outside the supported numeric range`,
|
|
21555
|
+
instructions: `Use a value between ${-MAX_SAFE_NUMERIC_BOUND} and ${MAX_SAFE_NUMERIC_BOUND}.`
|
|
21556
|
+
};
|
|
21557
|
+
}
|
|
21558
|
+
if (rec.maxValue !== undefined && rec.minValue !== undefined && rec.minValue > rec.maxValue) {
|
|
21559
|
+
return {
|
|
21560
|
+
message: `Field '${fieldName}' 'minValue' (${rec.minValue}) must not exceed 'maxValue' (${rec.maxValue})`,
|
|
21561
|
+
instructions: "Adjust the bounds so 'minValue <= maxValue', or drop one of the two."
|
|
21562
|
+
};
|
|
21563
|
+
}
|
|
21564
|
+
}
|
|
21565
|
+
if (rec.decimalPrecision !== undefined) {
|
|
21566
|
+
if (type !== "DECIMAL" && type !== "AUTO_NUMBER") {
|
|
21567
|
+
return {
|
|
21568
|
+
message: `Field '${fieldName}' of type '${type}' does not accept 'decimalPrecision'`,
|
|
21569
|
+
instructions: "'decimalPrecision' applies only to DECIMAL and AUTO_NUMBER. Remove it or change the field type."
|
|
21570
|
+
};
|
|
21571
|
+
}
|
|
21572
|
+
if (!isNumber2(rec.decimalPrecision) || !Number.isInteger(rec.decimalPrecision) || rec.decimalPrecision < 0 || rec.decimalPrecision > 10) {
|
|
21573
|
+
return {
|
|
21574
|
+
message: `Field '${fieldName}' 'decimalPrecision' ${rec.decimalPrecision} is invalid`,
|
|
21575
|
+
instructions: "'decimalPrecision' must be an integer between 0 and 10 (0 for whole numbers, 2 for money)."
|
|
21576
|
+
};
|
|
21577
|
+
}
|
|
21578
|
+
}
|
|
21579
|
+
}
|
|
21580
|
+
return null;
|
|
21581
|
+
}
|
|
21482
21582
|
// src/entity-name-rules.ts
|
|
21483
21583
|
var RESERVED_SQL_KEYWORDS_LOWER = new Set(["group", "order"]);
|
|
21484
21584
|
var ENTITY_NAME_PATTERN = /^[a-zA-Z][a-zA-Z0-9_]{2,99}$/;
|
|
@@ -21700,19 +21800,22 @@ function findReservedNameError(name, kind) {
|
|
|
21700
21800
|
}
|
|
21701
21801
|
return null;
|
|
21702
21802
|
}
|
|
21803
|
+
function validateNameFormat(name, kind) {
|
|
21804
|
+
const pattern = kind === "field" ? FIELD_NAME_PATTERN : ENTITY_NAME_PATTERN;
|
|
21805
|
+
if (pattern.test(name)) {
|
|
21806
|
+
return null;
|
|
21807
|
+
}
|
|
21808
|
+
return {
|
|
21809
|
+
message: `Invalid ${kind} name '${name}'`,
|
|
21810
|
+
instructions: kind === "field" ? "Field names must start with a letter, contain only letters and digits (no underscores), and be 3-100 characters long." : "Names must start with a letter, contain only letters, digits, and underscores, and be 3-100 characters long."
|
|
21811
|
+
};
|
|
21812
|
+
}
|
|
21703
21813
|
function validateName(name, kind) {
|
|
21704
21814
|
const reserved = findReservedNameError(name, kind);
|
|
21705
21815
|
if (reserved) {
|
|
21706
21816
|
return reserved;
|
|
21707
21817
|
}
|
|
21708
|
-
|
|
21709
|
-
if (!pattern.test(name)) {
|
|
21710
|
-
return {
|
|
21711
|
-
message: `Invalid ${kind} name '${name}'`,
|
|
21712
|
-
instructions: kind === "field" ? "Field names must start with a letter, contain only letters and digits (no underscores), and be 3-100 characters long." : "Names must start with a letter, contain only letters, digits, and underscores, and be 3-100 characters long."
|
|
21713
|
-
};
|
|
21714
|
-
}
|
|
21715
|
-
return null;
|
|
21818
|
+
return validateNameFormat(name, kind);
|
|
21716
21819
|
}
|
|
21717
21820
|
// src/env-reference.ts
|
|
21718
21821
|
function resolveEnvReference(value) {
|
|
@@ -22261,13 +22364,23 @@ function getExitCode() {
|
|
|
22261
22364
|
return typeof code2 === "number" ? code2 : 0;
|
|
22262
22365
|
}
|
|
22263
22366
|
function resetExitCode() {
|
|
22264
|
-
process.exitCode =
|
|
22367
|
+
process.exitCode = 0;
|
|
22265
22368
|
}
|
|
22266
22369
|
// src/guid.ts
|
|
22267
22370
|
var GUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
22268
22371
|
function isGuid(value) {
|
|
22269
22372
|
return GUID_REGEX.test(value);
|
|
22270
22373
|
}
|
|
22374
|
+
// src/http-status.ts
|
|
22375
|
+
function httpStatusOf(error) {
|
|
22376
|
+
if (!error || typeof error !== "object") {
|
|
22377
|
+
return;
|
|
22378
|
+
}
|
|
22379
|
+
if ("response" in error && error.response && typeof error.response === "object" && "status" in error.response && typeof error.response.status === "number") {
|
|
22380
|
+
return error.response.status;
|
|
22381
|
+
}
|
|
22382
|
+
return "status" in error && typeof error.status === "number" ? error.status : undefined;
|
|
22383
|
+
}
|
|
22271
22384
|
// src/logger.ts
|
|
22272
22385
|
import { getFileSystem } from "@uipath/filesystem";
|
|
22273
22386
|
var logFilePathSlot = singleton("logFilePath");
|
|
@@ -22284,7 +22397,7 @@ var LogLevel;
|
|
|
22284
22397
|
LogLevel2[LogLevel2["WARN"] = 2] = "WARN";
|
|
22285
22398
|
LogLevel2[LogLevel2["ERROR"] = 3] = "ERROR";
|
|
22286
22399
|
})(LogLevel ||= {});
|
|
22287
|
-
var DEFAULT_LOG_LEVEL =
|
|
22400
|
+
var DEFAULT_LOG_LEVEL = 2 /* WARN */;
|
|
22288
22401
|
|
|
22289
22402
|
class SimpleLogger {
|
|
22290
22403
|
__brand = "SimpleLogger";
|
|
@@ -23227,7 +23340,9 @@ var ErrorDimensions = {
|
|
|
23227
23340
|
Result: "Result",
|
|
23228
23341
|
ErrorCode: "ErrorCode",
|
|
23229
23342
|
Retry: "Retry",
|
|
23230
|
-
ErrorMessage: "ErrorMessage"
|
|
23343
|
+
ErrorMessage: "ErrorMessage",
|
|
23344
|
+
HttpStatus: "HttpStatus",
|
|
23345
|
+
UpstreamErrorCode: "UpstreamErrorCode"
|
|
23231
23346
|
};
|
|
23232
23347
|
var AuthDimensions = {
|
|
23233
23348
|
AuthenticationMethod: "AuthenticationMethod",
|
|
@@ -24619,6 +24734,7 @@ export {
|
|
|
24619
24734
|
ErrorDimensions,
|
|
24620
24735
|
ID_DIMENSIONS,
|
|
24621
24736
|
LogLevel,
|
|
24737
|
+
MAX_MULTILINE_MAX_FIELDS,
|
|
24622
24738
|
MIME_TYPES_BY_EXTENSION,
|
|
24623
24739
|
MIN_INTERVAL_MS,
|
|
24624
24740
|
OCTET_STREAM,
|
|
@@ -24663,6 +24779,7 @@ export {
|
|
|
24663
24779
|
extractErrorMessage,
|
|
24664
24780
|
extractErrorMessageSync,
|
|
24665
24781
|
extractFormatFromArgs,
|
|
24782
|
+
findInvalidFieldConstraints,
|
|
24666
24783
|
findReservedNameError,
|
|
24667
24784
|
formatErrorChain,
|
|
24668
24785
|
formatTimingReport,
|
|
@@ -24682,6 +24799,7 @@ export {
|
|
|
24682
24799
|
getTelemetrySessionId,
|
|
24683
24800
|
getTelemetrySessionSource,
|
|
24684
24801
|
hashContent,
|
|
24802
|
+
httpStatusOf,
|
|
24685
24803
|
installConsoleGuard,
|
|
24686
24804
|
installSdkCodingAgentHeader,
|
|
24687
24805
|
installSdkUserAgentHeader,
|
|
@@ -24741,7 +24859,8 @@ export {
|
|
|
24741
24859
|
timingsEnabled,
|
|
24742
24860
|
timingsFile,
|
|
24743
24861
|
validateName,
|
|
24862
|
+
validateNameFormat,
|
|
24744
24863
|
withCompleter
|
|
24745
24864
|
};
|
|
24746
24865
|
|
|
24747
|
-
//# debugId=
|
|
24866
|
+
//# debugId=6B8A0FBDD282F8C764756E2164756E21
|
package/dist/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export * from "./confirmation";
|
|
|
11
11
|
export { installConsoleGuard, restoreConsole } from "./console-guard";
|
|
12
12
|
export * from "./constants";
|
|
13
13
|
export * from "./content-hash";
|
|
14
|
+
export * from "./entity-field-rules";
|
|
14
15
|
export * from "./entity-name-rules";
|
|
15
16
|
export * from "./env-reference";
|
|
16
17
|
export * from "./error-handler";
|
|
@@ -19,10 +20,13 @@ export * from "./exit-code";
|
|
|
19
20
|
export * from "./formatter";
|
|
20
21
|
export * from "./guid";
|
|
21
22
|
export * from "./host-global-options";
|
|
23
|
+
export * from "./http-status";
|
|
22
24
|
export * from "./interactivity-context";
|
|
25
|
+
export * from "./json-option";
|
|
23
26
|
export * from "./logger";
|
|
24
27
|
export * from "./mime-types";
|
|
25
28
|
export * from "./option-aliases";
|
|
29
|
+
export * from "./option-groups";
|
|
26
30
|
export * from "./option-validators";
|
|
27
31
|
export * from "./orchestrator-urls";
|
|
28
32
|
export * from "./output-codecs";
|
|
@@ -36,6 +40,7 @@ export * from "./preview";
|
|
|
36
40
|
export * from "./registry";
|
|
37
41
|
export * from "./screen-logger";
|
|
38
42
|
export * from "./sdk-user-agent";
|
|
43
|
+
export * from "./shell-quote";
|
|
39
44
|
export * from "./singleton";
|
|
40
45
|
export * from "./solution-project-types";
|
|
41
46
|
export * from "./stdin";
|