@uipath/packager-tool-datafabric 1.204.0 → 1.205.0-preview.258
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/canonical-path.d.ts +31 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.js +802 -58
- package/dist/init/entity-init-service.d.ts +7 -0
- package/dist/init.js +1243 -451
- package/dist/inline/inline-entity-service.d.ts +209 -0
- package/dist/inline.d.ts +8 -0
- package/dist/inline.js +3665 -0
- package/dist/missing-path.d.ts +19 -0
- package/dist/pack/constants.d.ts +3 -0
- package/dist/pack/verify-pair.d.ts +14 -1
- package/dist/resource/local-entities.d.ts +14 -0
- package/dist/resource/unified-resource-file.d.ts +21 -0
- package/dist/schema/author-field.d.ts +82 -0
- package/dist/schema/create-entity-skeleton.d.ts +21 -0
- package/dist/schema/solution-entity-names.d.ts +45 -0
- package/dist/schema/validate-entity.d.ts +12 -0
- package/dist/sort-names.d.ts +11 -0
- package/package.json +5 -4
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a filesystem error means the path is not there, as opposed to being
|
|
3
|
+
* there and unreadable (EACCES, EIO, ELOOP).
|
|
4
|
+
*
|
|
5
|
+
* The distinction is the whole point: a missing project or resource is a
|
|
6
|
+
* state a command can act on, while an unreadable one is not evidence of
|
|
7
|
+
* absence. Treating both as "missing" let an ownership scan miss a sibling it
|
|
8
|
+
* could not read, and a `--force` delete then removed a resource that sibling
|
|
9
|
+
* still declares. `PathNotFound` is the in-memory filesystem's spelling.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isMissingPathError(error: unknown): boolean;
|
|
12
|
+
/** A Node filesystem error (`EACCES`, `EIO`, `ENOSPC`, …): something the disk
|
|
13
|
+
* said, as opposed to content that failed to parse. */
|
|
14
|
+
export declare function isFilesystemError(error: unknown): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* The disk refusing a path that may well be there (EACCES, EIO, ELOOP): never
|
|
17
|
+
* evidence of absence, and never a parse problem.
|
|
18
|
+
*/
|
|
19
|
+
export declare function isUnreadablePathError(error: unknown): boolean;
|
package/dist/pack/constants.d.ts
CHANGED
|
@@ -15,4 +15,7 @@ export declare const PACK_DIAGNOSTIC_CODES: {
|
|
|
15
15
|
/** The project has entities but no parent solution, so their
|
|
16
16
|
* solution-relative resource pointers cannot resolve. */
|
|
17
17
|
readonly noParentSolution: "NO_PARENT_SOLUTION";
|
|
18
|
+
/** A directory between the project and its `.uipx` could not be read, so
|
|
19
|
+
* the owning solution — and the stubs' pointers — cannot be trusted. */
|
|
20
|
+
readonly solutionRootUnreadable: "SOLUTION_ROOT_UNREADABLE";
|
|
18
21
|
};
|
|
@@ -24,5 +24,18 @@ export type PairResult = {
|
|
|
24
24
|
* `Name` couples back to the stub. Reads only.
|
|
25
25
|
*/
|
|
26
26
|
export declare function verifyPair(stubFile: string, solutionDir: string, fs: IFileSystem): Promise<PairResult>;
|
|
27
|
-
/**
|
|
27
|
+
/**
|
|
28
|
+
* The owning solution dir, or undefined when outside any solution.
|
|
29
|
+
*
|
|
30
|
+
* An unreadable directory (EACCES, EIO) may be the real solution root, so a
|
|
31
|
+
* `.uipx` found ABOVE one is not trusted: the walk throws the read error
|
|
32
|
+
* rather than hand back an ancestor's solution for a mutating command to act
|
|
33
|
+
* on. With no `.uipx` above it, the walk ends as "outside any solution" as
|
|
34
|
+
* before — an unlistable `/home` (0711) must not turn every command run
|
|
35
|
+
* outside a solution into a raw EACCES. A code-less error (the browser's
|
|
36
|
+
* in-memory filesystem) reads as missing.
|
|
37
|
+
*
|
|
38
|
+
* @throws the read error in that one case. Earlier versions never threw and
|
|
39
|
+
* returned the ancestor instead — callers outside this package must handle it.
|
|
40
|
+
*/
|
|
28
41
|
export declare function findSolutionRoot(startDir: string, fs: IFileSystem): Promise<string | undefined>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IFileSystem, LocalEntityRef } from "@uipath/solutionpackager-tool-core";
|
|
2
|
+
/** The shape lives in the packager core, shared with the Flow packager that
|
|
3
|
+
* binds nodes to these. Re-exported so callers keep importing it from here. */
|
|
4
|
+
export type { LocalEntityRef };
|
|
5
|
+
/**
|
|
6
|
+
* The entities the solution enclosing `flowFilePath` authors locally, keyed by
|
|
7
|
+
* lower-cased name (names are solution-wide unique that way). Empty outside a
|
|
8
|
+
* solution. Referenced platform entities are skipped: not the solution's to
|
|
9
|
+
* wire.
|
|
10
|
+
*
|
|
11
|
+
* Here, beside the layout it reads, so any tool can hand it to the Flow pack
|
|
12
|
+
* gate without importing another tool (Hard Rule 19).
|
|
13
|
+
*/
|
|
14
|
+
export declare function readSolutionInlineEntities(fs: IFileSystem, flowFilePath: string): Promise<Map<string, LocalEntityRef>>;
|
|
@@ -36,6 +36,27 @@ export declare const ENTITY_RESOURCE_TYPE = "native";
|
|
|
36
36
|
export declare const ENTITY_RESOURCE_API_VERSION = "dataservice.uipath.com/v2";
|
|
37
37
|
export declare const ENTITY_RESOURCE_DOC_VERSION = "1.0.0";
|
|
38
38
|
export declare const SOLUTION_FOLDER = "solution_folder";
|
|
39
|
+
/**
|
|
40
|
+
* Directory segments under `resources/<SOLUTION_FOLDER>/` that home an entity
|
|
41
|
+
* definition.
|
|
42
|
+
*
|
|
43
|
+
* DERIVED from the kind and type above, never written out as its own literal:
|
|
44
|
+
* the resource tree is partitioned by `<kind>/<type>`, so a directory that
|
|
45
|
+
* disagrees with the `kind`/`type` inside the file it holds is a directory the
|
|
46
|
+
* platform will move. `resource-casing.ts` in solution-sdk recomputes this path
|
|
47
|
+
* from the resource's own fields through `lowerFirstChar` and relocates the
|
|
48
|
+
* file to match — and on a case-sensitive filesystem a stale case-variant left
|
|
49
|
+
* behind carries the same resource key, which fails the next load with "Node
|
|
50
|
+
* already added to the graph".
|
|
51
|
+
*
|
|
52
|
+
* So the casing is not a style choice. Server-sourced resources arrive
|
|
53
|
+
* capitalized (`Entity/Native`, and `NativeEntity` while that server bug was
|
|
54
|
+
* live) and are normalized down to this form; they are inputs, not the target.
|
|
55
|
+
* The VS Code extension keys its delete guard and name-collision scan off
|
|
56
|
+
* `ENTITY_RESOURCE_KIND` directly, so anything written elsewhere is invisible
|
|
57
|
+
* to both.
|
|
58
|
+
*/
|
|
59
|
+
export declare const ENTITY_RESOURCE_DIR = "entity/native";
|
|
39
60
|
/** Solution-root-relative path of an entity's resource file. One convention
|
|
40
61
|
* shared by scaffolding, the editor's pairing and pack. */
|
|
41
62
|
export declare function entityResourcePath(entityName: string): string;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build an authored {@link EntityField} from the same field-type vocabulary
|
|
3
|
+
* `uip df entities create` takes, so one payload shape serves both authors.
|
|
4
|
+
*
|
|
5
|
+
* Two vocabularies meet here. The CLI and the SDK speak
|
|
6
|
+
* `EntityFieldDataType` (`STRING`, `DECIMAL`, `BOOLEAN`, …) in camelCase API
|
|
7
|
+
* bodies; the authored document speaks entity-modeler's
|
|
8
|
+
* `(FieldDisplayType, SqlTypeName)` pairs in PascalCase. This module is the
|
|
9
|
+
* translation, and it is deliberately the only place that knows both — the
|
|
10
|
+
* shapes differ for the same reason `@uipath/common/entity-name-rules` is
|
|
11
|
+
* shape-agnostic.
|
|
12
|
+
*
|
|
13
|
+
* The emitted field mirrors what Studio Web's modeller writes for a custom
|
|
14
|
+
* field, nulls included, so an entity authored here and one authored there are
|
|
15
|
+
* the same document.
|
|
16
|
+
*/
|
|
17
|
+
import { type EntityField } from "@uipath/entity-modeler/schema";
|
|
18
|
+
/** A field as a caller describes it — the `addFields` entry shape, minus the
|
|
19
|
+
* keys only a relationship or choice-set field needs. */
|
|
20
|
+
export interface AuthoredFieldSpec {
|
|
21
|
+
name: string;
|
|
22
|
+
/** An `EntityFieldDataType` name. See {@link AUTHORABLE_FIELD_TYPES}. */
|
|
23
|
+
type: string;
|
|
24
|
+
displayName?: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
isRequired?: boolean;
|
|
27
|
+
isUnique?: boolean;
|
|
28
|
+
/** NVARCHAR / MULTILINE character cap; MULTILINE_MAX counts BYTES. */
|
|
29
|
+
lengthLimit?: number | null;
|
|
30
|
+
/** DECIMAL and AUTO_NUMBER only. */
|
|
31
|
+
decimalPrecision?: number | null;
|
|
32
|
+
maxValue?: number | null;
|
|
33
|
+
minValue?: number | null;
|
|
34
|
+
/**
|
|
35
|
+
* What this module writes is a STRING for every field type — a DECIMAL
|
|
36
|
+
* default is `"0"` and a BOOLEAN one is `"true"` — and a caller must
|
|
37
|
+
* supply it that way. Typed as `EntityField`'s own `DefaultValue`
|
|
38
|
+
* (`string | boolean | null`) because an update re-supplies the stored
|
|
39
|
+
* value, and a document written elsewhere may hold a boolean; that
|
|
40
|
+
* round-trips unchanged. Null clears it.
|
|
41
|
+
*/
|
|
42
|
+
defaultValue?: EntityField["DefaultValue"];
|
|
43
|
+
}
|
|
44
|
+
/** The field types an authored entity may declare, in the CLI's own
|
|
45
|
+
* vocabulary. Use for a `--type` choice list so help text and validation
|
|
46
|
+
* cannot drift from what this module can emit. */
|
|
47
|
+
export declare const AUTHORABLE_FIELD_TYPES: readonly string[];
|
|
48
|
+
/** Thrown for a spec this module cannot turn into a valid field. Carries no
|
|
49
|
+
* diagnostic code: these are caller mistakes caught before a document exists,
|
|
50
|
+
* not document defects, which are `validateEntity`'s job. */
|
|
51
|
+
export declare class AuthoredFieldError extends Error {
|
|
52
|
+
readonly instructions: string;
|
|
53
|
+
constructor(message: string, instructions: string);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* `defaultValue` was the one field property nothing type-checked, so
|
|
57
|
+
* `{"defaultValue":{"a":1}}` went into the document verbatim — past
|
|
58
|
+
* `validateEntity`, which judges names and type pairs, and past pack, to fail
|
|
59
|
+
* at deploy where the diagnosis is hardest.
|
|
60
|
+
*
|
|
61
|
+
* The check is "is it a string the field's type can hold", not "is it a
|
|
62
|
+
* boolean for BOOLEAN": this module writes text for every type, and Data
|
|
63
|
+
* Fabric round-trips a DECIMAL default as `"0"`. Typing
|
|
64
|
+
* it as the JS value would reject the document's own content on the next
|
|
65
|
+
* update, which is exactly how the AUTO_NUMBER/`decimalPrecision` rule went
|
|
66
|
+
* wrong.
|
|
67
|
+
*/
|
|
68
|
+
/** How `authorField` was reached, for the few checks that depend on whether a
|
|
69
|
+
* value is the caller's or the document's own. */
|
|
70
|
+
export interface AuthorFieldOptions {
|
|
71
|
+
/** False when `defaultValue` was inherited from the existing field rather
|
|
72
|
+
* than supplied. Its content is then not the caller's to answer for. */
|
|
73
|
+
defaultValueFromCaller?: boolean;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Turn a caller's field spec into an authored `EntityField`.
|
|
77
|
+
*
|
|
78
|
+
* Name rules are NOT checked here — `validateEntity` owns them, against the
|
|
79
|
+
* whole document, so a caller sees every problem at once rather than the first.
|
|
80
|
+
* Throws {@link AuthoredFieldError} only for a type this module cannot emit.
|
|
81
|
+
*/
|
|
82
|
+
export declare function authorField(spec: AuthoredFieldSpec, options?: AuthorFieldOptions): EntityField;
|
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
import { type EntityField, type EntityJSON } from "@uipath/entity-modeler/schema";
|
|
2
|
+
/**
|
|
3
|
+
* Data Fabric resolves this on actual resource creation. Same sentinel Studio
|
|
4
|
+
* Web writes (`UNASSIGNED_FOLDER_ID` in custom-render/data-service).
|
|
5
|
+
*
|
|
6
|
+
* It is also the only reliable way to tell an entity authored locally from one
|
|
7
|
+
* imported off a tenant by `uip solution resources add`. The two resource
|
|
8
|
+
* envelopes are otherwise identical — same `kind`, `type`, `isOverridable` and
|
|
9
|
+
* `folders` — and differ only here: the sentinel for an authored entity, a real
|
|
10
|
+
* folder GUID for an imported one.
|
|
11
|
+
*/
|
|
12
|
+
export declare const UNASSIGNED_FOLDER_ID = "99999999-9999-9999-9999-999999999999";
|
|
13
|
+
/** Was this entity authored locally, or does the solution merely reference a
|
|
14
|
+
* live platform entity? See {@link UNASSIGNED_FOLDER_ID}. */
|
|
15
|
+
export declare function isLocallyAuthored(entity: Pick<EntityJSON, "FolderId">): boolean;
|
|
2
16
|
/** The 5 canonical system fields, in Studio Web's order. Also the validator's
|
|
3
17
|
* source of truth for "unmodified system fields": every property here is
|
|
4
18
|
* compared, and properties absent here are not. */
|
|
@@ -11,3 +25,10 @@ export declare const SYSTEM_FIELD_TEMPLATES: readonly EntityField[];
|
|
|
11
25
|
* used as-is — validity is the validator's concern, not this factory's.
|
|
12
26
|
*/
|
|
13
27
|
export declare function createEntitySkeleton(name: string): EntityJSON;
|
|
28
|
+
/**
|
|
29
|
+
* An authored document is written under the name it was authored for. The
|
|
30
|
+
* resource path derives from the entity name alone, so one authored under
|
|
31
|
+
* another name would land as the wrong entity. Both write paths — adding to a
|
|
32
|
+
* project and scaffolding one — check it before they write.
|
|
33
|
+
*/
|
|
34
|
+
export declare function requireAuthoredName(authored: EntityJSON | undefined, entityName: string): void;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Entity names across a solution — the input `validateEntity` needs for its
|
|
3
|
+
* uniqueness rule, which only the host can supply.
|
|
4
|
+
*
|
|
5
|
+
* Shared because two callers need the same answer: `solution pack` validating
|
|
6
|
+
* every stub in a project, and the inline commands validating one entity a
|
|
7
|
+
* caller just edited. A second copy would let the two disagree about what
|
|
8
|
+
* counts as a sibling, and the uniqueness diagnostic would fire in pack but not
|
|
9
|
+
* in the command that was supposed to catch it first.
|
|
10
|
+
*/
|
|
11
|
+
import type { IFileSystem } from "@uipath/solutionpackager-tool-core";
|
|
12
|
+
/** An entity's siblings are every name in the solution except one occurrence of
|
|
13
|
+
* its own — names are solution-wide unique. */
|
|
14
|
+
export declare function withoutOneOccurrence(names: readonly string[], name: string): string[];
|
|
15
|
+
/** Every entity name in the solution, read from stub filenames one directory
|
|
16
|
+
* deep. Duplicates are kept so cross-project collisions surface. */
|
|
17
|
+
export declare function collectSolutionEntityNames(solutionDir: string, fs: IFileSystem): Promise<string[]>;
|
|
18
|
+
/** The sibling list for one entity, in one call — what a caller validating a
|
|
19
|
+
* single entity wants. */
|
|
20
|
+
export declare function siblingNamesFor(solutionDir: string, entityName: string, fs: IFileSystem): Promise<string[]>;
|
|
21
|
+
/** Where an entity was found, and how the filesystem spells it. */
|
|
22
|
+
export interface EntityOwner {
|
|
23
|
+
/** The project's directory NAME (not its path) — what the commands take. */
|
|
24
|
+
projectName: string;
|
|
25
|
+
/**
|
|
26
|
+
* The entity name as the STUB FILE spells it, which is not necessarily how
|
|
27
|
+
* the caller spelled it: the match below is case-insensitive, but every
|
|
28
|
+
* path built from the result is not. Handing back the caller's `product`
|
|
29
|
+
* for a `Product.entity` produces a `StubFileNameMismatch` on a
|
|
30
|
+
* case-insensitive filesystem and a missing file on a case-sensitive one.
|
|
31
|
+
*/
|
|
32
|
+
entityName: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Which project directory owns `entityName`, searched across the solution.
|
|
36
|
+
*
|
|
37
|
+
* Entity names are solution-wide unique — `inlineEntityAddAsync` and
|
|
38
|
+
* `entityInitAsync` both refuse a name another project holds — so this is a
|
|
39
|
+
* lookup, not a guess: it finds one project or none. That is what lets
|
|
40
|
+
* `--project-name` be optional on the verbs that address an existing entity.
|
|
41
|
+
*
|
|
42
|
+
* Empty when nothing owns the name; ambiguous only if the uniqueness guard was
|
|
43
|
+
* bypassed, in which case the caller should ask.
|
|
44
|
+
*/
|
|
45
|
+
export declare function findProjectsOwningEntity(solutionDir: string, entityName: string, fs: IFileSystem): Promise<EntityOwner[]>;
|
|
@@ -10,6 +10,9 @@ export declare const DIAGNOSTIC_CODES: {
|
|
|
10
10
|
readonly nameReserved: "NAME_RESERVED";
|
|
11
11
|
readonly systemFieldMissing: "SYSTEM_FIELD_MISSING";
|
|
12
12
|
readonly systemFieldModified: "SYSTEM_FIELD_MODIFIED";
|
|
13
|
+
readonly fieldsMalformed: "FIELDS_MALFORMED";
|
|
14
|
+
readonly tooManyMultilineMax: "TOO_MANY_MULTILINE_MAX";
|
|
15
|
+
readonly propertyTypeInvalid: "PROPERTY_TYPE_INVALID";
|
|
13
16
|
};
|
|
14
17
|
export type DiagnosticCode = (typeof DIAGNOSTIC_CODES)[keyof typeof DIAGNOSTIC_CODES];
|
|
15
18
|
export interface EntityDiagnostic {
|
|
@@ -30,3 +33,12 @@ export interface ValidateEntityContext {
|
|
|
30
33
|
* stopping at the first, and never throws.
|
|
31
34
|
*/
|
|
32
35
|
export declare function validateEntity(entity: EntityJSON, ctx: ValidateEntityContext): EntityDiagnostic[];
|
|
36
|
+
/**
|
|
37
|
+
* Whether a stored field is a system field — exactly as `@uipath/entity-modeler`
|
|
38
|
+
* decides it (`IsSystemField === true`, the row it locks read-only), plus the
|
|
39
|
+
* five canonical names Data Fabric adds to every entity. Strictly `true`: a
|
|
40
|
+
* hand-edited `"yes"` is truthy, and reading it as system exempted a custom
|
|
41
|
+
* field from every custom-field rule. Validation and editing share this so
|
|
42
|
+
* they cannot disagree.
|
|
43
|
+
*/
|
|
44
|
+
export declare function isSystemField(field: unknown): boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The comparator every name listing in this package sorts by.
|
|
3
|
+
*
|
|
4
|
+
* A bare `Array.prototype.sort()` compares UTF-16 code units, which is not
|
|
5
|
+
* what "alphabetical" means to the person reading an entity list or an error
|
|
6
|
+
* naming the types they may use. The locale is pinned rather than left to the
|
|
7
|
+
* runtime's default so the same solution lists in the same order on a
|
|
8
|
+
* developer's machine and on a CI runner — these strings reach command output
|
|
9
|
+
* that tests and diffs compare.
|
|
10
|
+
*/
|
|
11
|
+
export declare function byName(a: string, b: string): number;
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/packager-tool-datafabric",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.205.0-preview.258",
|
|
4
4
|
"description": "UiPath Data Fabric entity schema, validation and packaging library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./dist/index.js",
|
|
8
|
-
"./init": "./dist/init.js"
|
|
8
|
+
"./init": "./dist/init.js",
|
|
9
|
+
"./inline": "./dist/inline.js"
|
|
9
10
|
},
|
|
10
11
|
"repository": {
|
|
11
12
|
"type": "git",
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
"author": "UiPath",
|
|
23
24
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
24
25
|
"peerDependencies": {
|
|
25
|
-
"@uipath/solutionpackager-tool-core": "1.
|
|
26
|
+
"@uipath/solutionpackager-tool-core": "1.205.0"
|
|
26
27
|
},
|
|
27
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "8f629ee9fa89abf94f197436a60cb3b9620f8b27"
|
|
28
29
|
}
|