Sign In

@uipath/access-policy-sdk

Package Overview
Dependencies
Maintainers
17
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
This package has malicious versions linked to the ongoing "Mini Shai-Hulud" supply chain attack.

Affected versions:

0.3.1
View campaign page

@uipath/access-policy-sdk

SDK for the UiPath Access Policy API — policy management and compliance evaluation.

latest
Source
npmnpm
Version
0.3.0
Version published
Weekly downloads
12
-86.81%
Maintainers
17
Weekly downloads
 
Created
Source

@uipath/access-policy-sdk

TypeScript SDK for the UiPath Access Policy platform. Wraps two services:

ServicePurposeURL prefix
PAP — Policy Administration PointManage policy definitions (CRUD){baseUrl}/{orgId}/pap_
PDP — Policy Decision PointEvaluate a request against active policies{baseUrl}/{orgId}/pdp_

The API surface is generated from swagger/swagger_policy_engine.json via openapi-generator (typescript-fetch). Generated code lives in generated/ and must not be edited by hand — regenerate after updating the swagger.

Install

bun add @uipath/access-policy-sdk

Usage

Two factory functions authenticate with @uipath/auth and return a configured API instance:

import {
    createPapApiClient,
    createPdpApiClient,
    PolicyManagementApi,
    PolicyEvaluationApi,
} from "@uipath/access-policy-sdk";

// List policies via PAP
const pap = await createPapApiClient(PolicyManagementApi);
const { items } = await pap.apiPoliciesGet({ top: 20, skip: 0 });

// Evaluate a request via PDP
const pdp = await createPdpApiClient(PolicyEvaluationApi);
const result = await pdp.apiPolicyEvaluateTenantTenantIdPost({
    tenantId: "<tenant-uuid>",
    policyEvaluationApiRequestDto: {
        organizationId: "<org-uuid>",
        resourceType: "Agent",
        resourceIdentifier: "<uuid>",
    },
});

Both factories call getLoginStatusAsync() under the hood — the caller must be logged in (uip login) with an organization context. Throw on missing credentials.

Options

interface CreateApiClientOptions {
    tenant?: string;          // reserved for future multi-tenant use
    loginValidity?: number;   // minutes of token validity to ensure before the call
}

Scripts

bun run generate   # Regenerate generated/ from swagger/
bun run build      # Bundle to dist/ (esm + .d.ts)
bun run lint       # Biome check

Regeneration

bun run generate shells out to @openapitools/openapi-generator-cli, which requires Java 17+. If your system default is older:

JAVA_HOME=/opt/homebrew/opt/openjdk@17 PATH=$JAVA_HOME/bin:$PATH bun run generate

After regeneration:

  • Inspect any new enums in generated/src/models/ — add overrides in src/types.ts only if they render as NUMBER_0 style.
  • Bump the package version.
  • Update swagger/swagger_policy_engine.json via git diff to confirm the source change is intentional.

Structure

src/
  index.ts            Re-exports generated APIs + factories
  client-factory.ts   createPapApiClient, createPdpApiClient
  scripts/
    generate-sdk.ts   Regen script (wraps openapi-generator-cli)
generated/            100% generated — do not edit
  src/apis/           PolicyManagementApi, PolicyEvaluationApi, VersionApi
  src/models/         DTOs + enums
  src/runtime.ts      Configuration, BaseAPI
swagger/
  swagger_policy_engine.json   Source of truth for generation

Keywords

uipath

FAQs

Package last updated on 11 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts