@uipath/data-fabric-tool 1.201.0 → 1.202.0-preview.136
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/{getMachineId-bsd-wfkxpxjv.js → getMachineId-bsd-67w37xtj.js} +5 -5
- package/dist/{getMachineId-darwin-9asn4zy6.js → getMachineId-darwin-4g3xfpfp.js} +5 -5
- package/dist/{getMachineId-linux-62t6m027.js → getMachineId-linux-a4p6fb9w.js} +4 -4
- package/dist/{getMachineId-unsupported-dfrzeqc3.js → getMachineId-unsupported-77w362eh.js} +4 -4
- package/dist/{getMachineId-win-zgvrp5q3.js → getMachineId-win-9cfxg9c8.js} +5 -5
- package/dist/{index-2fj08e7n.js → index-gpd94m28.js} +27 -27
- package/dist/{index-w03qc9m8.js → index-sby22td6.js} +4 -4
- package/dist/index.js +4 -7
- package/dist/{js-yaml-4ypbq2tt.js → js-yaml-88tdqrtd.js} +27 -19
- package/dist/{tool-0v6na3yp.js → packager-tool-1de529jm.js} +9 -7
- package/dist/{tool-h1k9mjs9.js → packager-tool-2czkpqb0.js} +3 -3
- package/dist/{tool-r6rhp5ep.js → packager-tool-bndhpxxj.js} +46 -46
- package/dist/{tool-91jjmaaz.js → packager-tool-r3p26srq.js} +2124 -1228
- package/dist/packager-tool.js +2568 -0
- package/dist/tool.js +6 -9
- package/package.json +4 -3
- package/src/packager-tool.spec.ts +29 -0
- package/src/packager-tool.ts +10 -0
- package/src/utils/validate.ts +11 -273
- package/tests/choice-sets-lifecycle.e2e.test.ts +2 -1
- package/tests/entities-lifecycle.e2e.test.ts +2 -1
- package/tests/entity-project-packaging.e2e.test.ts +549 -0
- package/tests/files-management.e2e.test.ts +2 -1
- package/dist/browser-strategy-yccf8mtd.js +0 -99
- package/dist/node-strategy-12qfy0nv.js +0 -348
- package/dist/tool-5arsyj36.js +0 -11
- package/dist/tool-7eva0peq.js +0 -265
- package/dist/tool-9qecd4wb.js +0 -14
package/dist/tool.js
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
metadata,
|
|
3
3
|
registerCommands
|
|
4
|
-
} from "./tool-
|
|
5
|
-
import"./tool-
|
|
6
|
-
import"./tool-
|
|
7
|
-
import"./tool-5arsyj36.js";
|
|
8
|
-
import"./tool-r6rhp5ep.js";
|
|
9
|
-
import"./tool-0v6na3yp.js";
|
|
4
|
+
} from "./packager-tool-r3p26srq.js";
|
|
5
|
+
import"./packager-tool-bndhpxxj.js";
|
|
6
|
+
import"./packager-tool-1de529jm.js";
|
|
10
7
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
metadata,
|
|
9
|
+
registerCommands
|
|
13
10
|
};
|
|
14
11
|
|
|
15
|
-
//# debugId=
|
|
12
|
+
//# debugId=6CE61C21DAD27F3464756E2164756E21
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/data-fabric-tool",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.202.0-preview.136",
|
|
5
5
|
"description": "Manage Data Fabric entities and records.",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -9,10 +9,11 @@
|
|
|
9
9
|
"type": "module",
|
|
10
10
|
"main": "./dist/tool.js",
|
|
11
11
|
"exports": {
|
|
12
|
-
".": "./dist/tool.js"
|
|
12
|
+
".": "./dist/tool.js",
|
|
13
|
+
"./packager-tool": "./dist/packager-tool.js"
|
|
13
14
|
},
|
|
14
15
|
"bin": {
|
|
15
16
|
"data-fabric-tool": "./dist/index.js"
|
|
16
17
|
},
|
|
17
|
-
"gitHead": "
|
|
18
|
+
"gitHead": "f6270de2c7c04f4c43b2f5187b0c3d3c314c2610"
|
|
18
19
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from "vitest";
|
|
2
|
+
|
|
3
|
+
const { mockRegister } = vi.hoisted(() => ({ mockRegister: vi.fn() }));
|
|
4
|
+
|
|
5
|
+
vi.mock("@uipath/solutionpackager-tool-core", () => ({
|
|
6
|
+
toolsFactoryRepository: { registerProjectToolFactory: mockRegister },
|
|
7
|
+
}));
|
|
8
|
+
vi.mock("@uipath/packager-tool-datafabric", () => ({
|
|
9
|
+
EntityToolFactory: class EntityToolFactory {},
|
|
10
|
+
}));
|
|
11
|
+
|
|
12
|
+
describe("data-fabric-tool packager entry", () => {
|
|
13
|
+
it("registers nothing at module load", async () => {
|
|
14
|
+
await import("./packager-tool");
|
|
15
|
+
|
|
16
|
+
expect(mockRegister).not.toHaveBeenCalled();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it("registers the Entity tool factory when called", async () => {
|
|
20
|
+
const { registerPackagerFactories } = await import("./packager-tool");
|
|
21
|
+
|
|
22
|
+
registerPackagerFactories();
|
|
23
|
+
|
|
24
|
+
const registered = mockRegister.mock.calls.map(
|
|
25
|
+
([factory]) => factory.constructor.name,
|
|
26
|
+
);
|
|
27
|
+
expect(registered).toEqual(["EntityToolFactory"]);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Registration module for the solution packer: importing this file, via the
|
|
2
|
+
// "./packager-tool" export, is what puts Entity's factory into the registry.
|
|
3
|
+
// The library stays side-effect-free — this file is the side effect, like
|
|
4
|
+
// maestro-tool's packager-tool.ts is for Flow.
|
|
5
|
+
import { EntityToolFactory } from "@uipath/packager-tool-datafabric";
|
|
6
|
+
import { toolsFactoryRepository } from "@uipath/solutionpackager-tool-core";
|
|
7
|
+
|
|
8
|
+
export function registerPackagerFactories(): void {
|
|
9
|
+
toolsFactoryRepository.registerProjectToolFactory(new EntityToolFactory());
|
|
10
|
+
}
|
package/src/utils/validate.ts
CHANGED
|
@@ -16,9 +16,17 @@
|
|
|
16
16
|
* value-create leaves behind).
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
import {
|
|
20
|
+
type NameKind,
|
|
21
|
+
type ValidationError,
|
|
22
|
+
validateName,
|
|
23
|
+
} from "@uipath/common";
|
|
24
|
+
|
|
25
|
+
export type { ValidationError };
|
|
26
|
+
// The platform name rules (reserved field names, C#/VB keywords) live in
|
|
27
|
+
// @uipath/common so `solution pack` applies the same list.
|
|
28
|
+
// Re-exported here so this module stays the one import for df command validation.
|
|
29
|
+
export { type NameKind, validateName };
|
|
22
30
|
|
|
23
31
|
// Types the SDK enum still exposes but that render broken in the Data Fabric UI.
|
|
24
32
|
// The server accepts them and `entities create` returns Success; the column then
|
|
@@ -41,281 +49,11 @@ const UI_BROKEN_SUBSTITUTIONS: Record<string, string> = {
|
|
|
41
49
|
DATETIME: "DATETIME_WITH_TZ",
|
|
42
50
|
};
|
|
43
51
|
|
|
44
|
-
// System-generated columns present on every entity — reusing these names errors.
|
|
45
|
-
// Mirrors backend `Constants.AllSystemFields` (StorageManager Common/Constants.cs).
|
|
46
|
-
const RESERVED_FIELD_NAMES_LOWER = new Set([
|
|
47
|
-
"id",
|
|
48
|
-
"createdby",
|
|
49
|
-
"createtime",
|
|
50
|
-
"updatedby",
|
|
51
|
-
"updatetime",
|
|
52
|
-
"recordowner",
|
|
53
|
-
"version",
|
|
54
|
-
]);
|
|
55
|
-
|
|
56
|
-
// C# and VB reserved words the server rejects with `RESERVED_LANGUAGE_KEYWORDS`.
|
|
57
|
-
// The backend calls `CodeDomProvider.IsValidIdentifier` for both C# and VB
|
|
58
|
-
// (EntityValidationHelper.cs), so the CLI union is case-insensitive.
|
|
59
|
-
const RESERVED_KEYWORDS_LOWER = new Set([
|
|
60
|
-
// C# reserved keywords
|
|
61
|
-
"abstract",
|
|
62
|
-
"as",
|
|
63
|
-
"base",
|
|
64
|
-
"bool",
|
|
65
|
-
"break",
|
|
66
|
-
"byte",
|
|
67
|
-
"case",
|
|
68
|
-
"catch",
|
|
69
|
-
"char",
|
|
70
|
-
"checked",
|
|
71
|
-
"class",
|
|
72
|
-
"const",
|
|
73
|
-
"continue",
|
|
74
|
-
"decimal",
|
|
75
|
-
"default",
|
|
76
|
-
"delegate",
|
|
77
|
-
"do",
|
|
78
|
-
"double",
|
|
79
|
-
"else",
|
|
80
|
-
"enum",
|
|
81
|
-
"event",
|
|
82
|
-
"explicit",
|
|
83
|
-
"extern",
|
|
84
|
-
"false",
|
|
85
|
-
"finally",
|
|
86
|
-
"fixed",
|
|
87
|
-
"float",
|
|
88
|
-
"for",
|
|
89
|
-
"foreach",
|
|
90
|
-
"goto",
|
|
91
|
-
"if",
|
|
92
|
-
"implicit",
|
|
93
|
-
"in",
|
|
94
|
-
"int",
|
|
95
|
-
"interface",
|
|
96
|
-
"internal",
|
|
97
|
-
"is",
|
|
98
|
-
"lock",
|
|
99
|
-
"long",
|
|
100
|
-
"namespace",
|
|
101
|
-
"new",
|
|
102
|
-
"null",
|
|
103
|
-
"object",
|
|
104
|
-
"operator",
|
|
105
|
-
"out",
|
|
106
|
-
"override",
|
|
107
|
-
"params",
|
|
108
|
-
"private",
|
|
109
|
-
"protected",
|
|
110
|
-
"public",
|
|
111
|
-
"readonly",
|
|
112
|
-
"ref",
|
|
113
|
-
"return",
|
|
114
|
-
"sbyte",
|
|
115
|
-
"sealed",
|
|
116
|
-
"short",
|
|
117
|
-
"sizeof",
|
|
118
|
-
"stackalloc",
|
|
119
|
-
"static",
|
|
120
|
-
"string",
|
|
121
|
-
"struct",
|
|
122
|
-
"switch",
|
|
123
|
-
"this",
|
|
124
|
-
"throw",
|
|
125
|
-
"true",
|
|
126
|
-
"try",
|
|
127
|
-
"typeof",
|
|
128
|
-
"uint",
|
|
129
|
-
"ulong",
|
|
130
|
-
"unchecked",
|
|
131
|
-
"unsafe",
|
|
132
|
-
"ushort",
|
|
133
|
-
"using",
|
|
134
|
-
"virtual",
|
|
135
|
-
"void",
|
|
136
|
-
"volatile",
|
|
137
|
-
"while",
|
|
138
|
-
// VB reserved keywords (unique to VB — C# overlaps deduped by Set)
|
|
139
|
-
"addhandler",
|
|
140
|
-
"addressof",
|
|
141
|
-
"alias",
|
|
142
|
-
"and",
|
|
143
|
-
"andalso",
|
|
144
|
-
"boolean",
|
|
145
|
-
"byref",
|
|
146
|
-
"byval",
|
|
147
|
-
"call",
|
|
148
|
-
"cbool",
|
|
149
|
-
"cbyte",
|
|
150
|
-
"cchar",
|
|
151
|
-
"cdate",
|
|
152
|
-
"cdbl",
|
|
153
|
-
"cdec",
|
|
154
|
-
"cint",
|
|
155
|
-
"clng",
|
|
156
|
-
"cobj",
|
|
157
|
-
"csbyte",
|
|
158
|
-
"cshort",
|
|
159
|
-
"csng",
|
|
160
|
-
"cstr",
|
|
161
|
-
"ctype",
|
|
162
|
-
"cuint",
|
|
163
|
-
"culng",
|
|
164
|
-
"cushort",
|
|
165
|
-
"date",
|
|
166
|
-
"declare",
|
|
167
|
-
"dim",
|
|
168
|
-
"directcast",
|
|
169
|
-
"each",
|
|
170
|
-
"elseif",
|
|
171
|
-
"end",
|
|
172
|
-
"endif",
|
|
173
|
-
"erase",
|
|
174
|
-
"error",
|
|
175
|
-
"exit",
|
|
176
|
-
"friend",
|
|
177
|
-
"function",
|
|
178
|
-
"get",
|
|
179
|
-
"gettype",
|
|
180
|
-
"getxmlnamespace",
|
|
181
|
-
"global",
|
|
182
|
-
"gosub",
|
|
183
|
-
"goto",
|
|
184
|
-
"handles",
|
|
185
|
-
"implements",
|
|
186
|
-
"imports",
|
|
187
|
-
"inherits",
|
|
188
|
-
"integer",
|
|
189
|
-
"isnot",
|
|
190
|
-
"let",
|
|
191
|
-
"lib",
|
|
192
|
-
"like",
|
|
193
|
-
"loop",
|
|
194
|
-
"me",
|
|
195
|
-
"mod",
|
|
196
|
-
"module",
|
|
197
|
-
"mustinherit",
|
|
198
|
-
"mustoverride",
|
|
199
|
-
"mybase",
|
|
200
|
-
"myclass",
|
|
201
|
-
"narrowing",
|
|
202
|
-
"next",
|
|
203
|
-
"not",
|
|
204
|
-
"nothing",
|
|
205
|
-
"notinheritable",
|
|
206
|
-
"notoverridable",
|
|
207
|
-
"of",
|
|
208
|
-
"on",
|
|
209
|
-
"option",
|
|
210
|
-
"optional",
|
|
211
|
-
"or",
|
|
212
|
-
"orelse",
|
|
213
|
-
"overloads",
|
|
214
|
-
"overridable",
|
|
215
|
-
"overrides",
|
|
216
|
-
"paramarray",
|
|
217
|
-
"partial",
|
|
218
|
-
"property",
|
|
219
|
-
"raiseevent",
|
|
220
|
-
"redim",
|
|
221
|
-
"rem",
|
|
222
|
-
"removehandler",
|
|
223
|
-
"resume",
|
|
224
|
-
"select",
|
|
225
|
-
"set",
|
|
226
|
-
"shadows",
|
|
227
|
-
"shared",
|
|
228
|
-
"single",
|
|
229
|
-
"step",
|
|
230
|
-
"stop",
|
|
231
|
-
"structure",
|
|
232
|
-
"sub",
|
|
233
|
-
"synclock",
|
|
234
|
-
"then",
|
|
235
|
-
"to",
|
|
236
|
-
"trycast",
|
|
237
|
-
"uinteger",
|
|
238
|
-
"ushort",
|
|
239
|
-
"variant",
|
|
240
|
-
"wend",
|
|
241
|
-
"when",
|
|
242
|
-
"widening",
|
|
243
|
-
"with",
|
|
244
|
-
"withevents",
|
|
245
|
-
"writeonly",
|
|
246
|
-
"xor",
|
|
247
|
-
]);
|
|
248
|
-
|
|
249
|
-
// SQL words confirmed to be rejected by Data Fabric for entity and field
|
|
250
|
-
// names. Similar-looking words such as Status, Key, and Type are accepted, so
|
|
251
|
-
// keep this list limited to names verified against the service.
|
|
252
|
-
const RESERVED_SQL_KEYWORDS_LOWER = new Set(["group", "order"]);
|
|
253
|
-
|
|
254
|
-
const ENTITY_NAME_PATTERN = /^[a-zA-Z][a-zA-Z0-9_]{2,99}$/;
|
|
255
|
-
const FIELD_NAME_PATTERN = /^[a-zA-Z][a-zA-Z0-9]{2,99}$/;
|
|
256
|
-
|
|
257
52
|
const MAX_DISPLAY_NAME_LENGTH = 128;
|
|
258
53
|
const MAX_DESCRIPTION_LENGTH = 512;
|
|
259
54
|
const MAX_MULTILINE_MAX_FIELDS = 10;
|
|
260
55
|
const MAX_SAFE_NUMERIC_BOUND = 9_007_199_254_740_991;
|
|
261
56
|
|
|
262
|
-
export type NameKind = "entity" | "field" | "choice set";
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
* Check an entity / field / choice-set name against the server's format,
|
|
266
|
-
* reserved-name, and reserved-keyword rules.
|
|
267
|
-
*/
|
|
268
|
-
export function validateName(
|
|
269
|
-
name: string,
|
|
270
|
-
kind: NameKind,
|
|
271
|
-
): ValidationError | null {
|
|
272
|
-
// Reserved / keyword checks fire before the format check so short reserved
|
|
273
|
-
// names like `Id`, `If`, `New` get the actionable message instead of the
|
|
274
|
-
// generic "too short" one.
|
|
275
|
-
if (
|
|
276
|
-
kind === "field" &&
|
|
277
|
-
RESERVED_FIELD_NAMES_LOWER.has(name.toLowerCase())
|
|
278
|
-
) {
|
|
279
|
-
return {
|
|
280
|
-
message: `Field name '${name}' is reserved`,
|
|
281
|
-
instructions:
|
|
282
|
-
"The following field names are reserved by the platform (case-insensitive): Id, CreatedBy, CreateTime, UpdatedBy, UpdateTime, RecordOwner, Version. Pick a different name.",
|
|
283
|
-
};
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
if (RESERVED_KEYWORDS_LOWER.has(name.toLowerCase())) {
|
|
287
|
-
return {
|
|
288
|
-
message: `${kind === "entity" ? "Entity" : kind === "field" ? "Field" : "Choice set"} name '${name}' is a reserved C# or VB keyword`,
|
|
289
|
-
instructions:
|
|
290
|
-
"Reserved keywords are rejected with RESERVED_LANGUAGE_KEYWORDS. Pick a domain-specific rename, for example 'Case' -> 'WorkItem', 'Class' -> 'Category', 'New' -> 'IsNew'.",
|
|
291
|
-
};
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
if (
|
|
295
|
-
kind === "entity" &&
|
|
296
|
-
RESERVED_SQL_KEYWORDS_LOWER.has(name.toLowerCase())
|
|
297
|
-
) {
|
|
298
|
-
return {
|
|
299
|
-
message: `Entity name '${name}' is a reserved SQL keyword`,
|
|
300
|
-
instructions:
|
|
301
|
-
"The platform rejects 'Order' and 'Group' as entity names. Pick a domain-specific name such as 'PurchaseOrder' or 'TeamGroup'.",
|
|
302
|
-
};
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
const pattern = kind === "field" ? FIELD_NAME_PATTERN : ENTITY_NAME_PATTERN;
|
|
306
|
-
if (!pattern.test(name)) {
|
|
307
|
-
return {
|
|
308
|
-
message: `Invalid ${kind} name '${name}'`,
|
|
309
|
-
instructions:
|
|
310
|
-
kind === "field"
|
|
311
|
-
? "Field names must start with a letter, contain only letters and digits (no underscores), and be 3-100 characters long."
|
|
312
|
-
: "Names must start with a letter, contain only letters, digits, and underscores, and be 3-100 characters long.",
|
|
313
|
-
};
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
return null;
|
|
317
|
-
}
|
|
318
|
-
|
|
319
57
|
/**
|
|
320
58
|
* Scan a list of field definitions for names that fail validation. Returns
|
|
321
59
|
* the first failure; callers should surface it and let the user fix the body
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
readManifest,
|
|
11
11
|
SETUP_TIMEOUT,
|
|
12
12
|
} from "../../../tests/e2e-shared/helpers";
|
|
13
|
+
import { e2eResourceName } from "../../../tests/e2e-shared/tenant-cleanup";
|
|
13
14
|
|
|
14
15
|
const manifest = readManifest<E2EManifest>(MANIFEST_PATH);
|
|
15
16
|
const { tempDir } = manifest.sharedInstall;
|
|
@@ -110,7 +111,7 @@ let scratchFolderKey: string | undefined;
|
|
|
110
111
|
// collide with orphans a prior failed run left behind.
|
|
111
112
|
const RUN_ID = `${process.pid}_${Date.now()}`;
|
|
112
113
|
const scratchBaseName = `E2eDfCs${RUN_ID}`;
|
|
113
|
-
const scratchFolderName =
|
|
114
|
+
const scratchFolderName = e2eResourceName("e2e-df-choice-sets-folder");
|
|
114
115
|
|
|
115
116
|
describe("df choice-sets — choice sets lifecycle", () => {
|
|
116
117
|
beforeAll(() => {
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
readManifest,
|
|
11
11
|
SETUP_TIMEOUT,
|
|
12
12
|
} from "../../../tests/e2e-shared/helpers";
|
|
13
|
+
import { e2eResourceName } from "../../../tests/e2e-shared/tenant-cleanup";
|
|
13
14
|
|
|
14
15
|
const manifest = readManifest<E2EManifest>(MANIFEST_PATH);
|
|
15
16
|
const { tempDir } = manifest.sharedInstall;
|
|
@@ -116,7 +117,7 @@ let folderScopedEntityId: string | undefined;
|
|
|
116
117
|
const RUN_ID = `${process.pid}_${Date.now()}`;
|
|
117
118
|
const scratchName = `E2eDfEntities${RUN_ID}`;
|
|
118
119
|
const folderScopedEntityName = `E2eDfEntitiesFolder${RUN_ID}`;
|
|
119
|
-
const scratchFolderName =
|
|
120
|
+
const scratchFolderName = e2eResourceName("e2e-df-entities-folder");
|
|
120
121
|
|
|
121
122
|
describe("df entities — entities lifecycle", () => {
|
|
122
123
|
beforeAll(() => {
|