@uipath/data-fabric-tool 1.201.0-preview.115 → 1.201.0-preview.121

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/tool.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  metadata,
3
3
  registerCommands
4
- } from "./tool-cyfkvxhw.js";
4
+ } from "./tool-4g47skgm.js";
5
5
  import"./tool-9qecd4wb.js";
6
6
  import"./tool-7eva0peq.js";
7
7
  import"./tool-5arsyj36.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@uipath/data-fabric-tool",
3
3
  "license": "MIT",
4
- "version": "1.201.0-preview.115",
4
+ "version": "1.201.0-preview.121",
5
5
  "description": "Manage Data Fabric entities and records.",
6
6
  "type": "module",
7
7
  "main": "./dist/tool.js",
@@ -14,5 +14,5 @@
14
14
  "publishConfig": {
15
15
  "registry": "https://registry.npmjs.org/"
16
16
  },
17
- "gitHead": "f1086b73654d7728cb71f280588b3e0c77d535fc"
17
+ "gitHead": "c70ccfc0b12e637441d67df1d212b71d7784b5f8"
18
18
  }
@@ -7,21 +7,16 @@ import {
7
7
  processContext,
8
8
  RESULTS,
9
9
  } from "@uipath/common";
10
+ import type {
11
+ DataFabricDirectoryAssignOptions,
12
+ DataFabricDirectoryListOptions,
13
+ } from "@uipath/uipath-typescript";
14
+ import { DataFabricDirectoryEntityTypeName } from "@uipath/uipath-typescript";
10
15
  import { type Command, Option } from "commander";
11
16
  import { fail, requireDestructiveConfirmation } from "../utils/output";
12
17
  import { connectOrFail } from "../utils/sdk-client";
13
18
 
14
- // The directory/role support types (enums, option/response aliases) are missing
15
- // from the SDK's export barrel: the main entry exports no DataFabric symbols, and
16
- // the /entities subpath exports only the two service classes, not these types. So
17
- // derive the principal-type input from the client's method signature instead of
18
- // importing it. Fix belongs in @uipath/uipath-typescript (export these types).
19
- type DataFabricClient = NonNullable<Awaited<ReturnType<typeof connectOrFail>>>;
20
- type PrincipalTypeInput = Parameters<
21
- DataFabricClient["entities"]["directory"]["assignRoles"]
22
- >[1];
23
-
24
- const PRINCIPAL_TYPES = ["User", "Group", "Application"] as const;
19
+ const PRINCIPAL_TYPES = Object.values(DataFabricDirectoryEntityTypeName);
25
20
 
26
21
  interface ListOptions {
27
22
  tenant?: string;
@@ -104,11 +99,13 @@ const DIRECTORY_REVOKE_ROLES_EXAMPLES: CommandExample[] = [
104
99
  },
105
100
  ];
106
101
 
107
- const parsePrincipalType = (value: string): PrincipalTypeInput | null => {
102
+ const parsePrincipalType = (
103
+ value: string,
104
+ ): DataFabricDirectoryEntityTypeName | null => {
108
105
  const match = PRINCIPAL_TYPES.find(
109
106
  (t) => t.toLowerCase() === value.toLowerCase(),
110
107
  );
111
- return match !== undefined ? (match as PrincipalTypeInput) : null;
108
+ return match ?? null;
112
109
  };
113
110
 
114
111
  const parseRoleIds = (value: string): string[] =>
@@ -175,8 +172,9 @@ export const registerDirectoryCommand = (program: Command) => {
175
172
  const sdk = await connectOrFail(options.tenant);
176
173
  if (!sdk) return;
177
174
 
175
+ const listOptions: DataFabricDirectoryListOptions = { skip, top };
178
176
  const [listError, result] = await catchError(
179
- sdk.entities.directory.list({ skip, top }),
177
+ sdk.entities.directory.list(listOptions),
180
178
  );
181
179
 
182
180
  if (listError) {
@@ -239,19 +237,20 @@ export const registerDirectoryCommand = (program: Command) => {
239
237
  const sdk = await connectOrFail(options.tenant);
240
238
  if (!sdk) return;
241
239
 
240
+ const assignOptions: DataFabricDirectoryAssignOptions = {
241
+ ...(options.replace === true && {
242
+ preserveExisting: false,
243
+ }),
244
+ ...(options.uiAccess === false && {
245
+ uiEnabled: false,
246
+ }),
247
+ };
242
248
  const [assignError, result] = await catchError(
243
249
  sdk.entities.directory.assignRoles(
244
250
  principalIds,
245
251
  principalType,
246
252
  roleIds,
247
- {
248
- ...(options.replace === true && {
249
- preserveExisting: false,
250
- }),
251
- ...(options.uiAccess === false && {
252
- uiEnabled: false,
253
- }),
254
- },
253
+ assignOptions,
255
254
  ),
256
255
  );
257
256