Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/samples/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ Browse, filter, and clone the official `@uipath/uipath-typescript` sample apps.
{ "id": "agents", "label": "Agents", "accent": ["#7C5CFC", "#A78BFA"] },
{ "id": "dashboards", "label": "Dashboards", "accent": ["#0EA5A4", "#2DD4C4"] },
{ "id": "data-fabric", "label": "Data Fabric", "accent": ["#2563EB", "#5B8DEF"] },
{ "id": "dev-tools", "label": "Developer Tools", "accent": ["#475569", "#94A3B8"] },
{ "id": "document", "label": "Document / HITL", "accent": ["#0F9D6B", "#34D399"] },
{ "id": "process", "label": "Process Orchestration", "accent": ["#DB2777", "#F472B6"] }
],
Expand All @@ -138,7 +139,8 @@ Browse, filter, and clone the official `@uipath/uipath-typescript` sample apps.
{ "id": "action-app-with-document", "title": "Action App — Bundled Document", "description": "Coded Action App for loan-application review. Reviewers assess applicant details, view a bundled sample PDF, and complete the task with an Approve or Reject decision.", "category": "action-apps", "framework": "React", "tags": ["Action Center","Coded Action App","Documents"], "path": "samples/coded-action-apps/action-app-with-document", "preview": null },
{ "id": "action-app-with-file-attachment-document", "title": "Action App — File Attachment", "description": "Coded Action App for loan-application review with direct file attachments. Preview and download a directly attached PDF, as opposed to referencing files from Storage Buckets.", "category": "action-apps", "framework": "React", "tags": ["Action Center","Coded Action App","File Attachments","Documents"], "path": "samples/coded-action-apps/action-app-with-file-attachment-document", "preview": null },
{ "id": "action-app-with-image", "title": "Action App — Image", "description": "Coded Action App for loan-application review. Reviewers assess applicant details, view a bundled loan-application image, and complete the task with an Approve or Reject decision.", "category": "action-apps", "framework": "React", "tags": ["Action Center","Coded Action App","Images"], "path": "samples/coded-action-apps/action-app-with-image", "preview": null },
{ "id": "action-app-with-storage-bucket-document", "title": "Action App — Storage Bucket Document", "description": "Coded Action App for loan-application review that loads its document from a Storage Bucket by bucket name and file path, as opposed to receiving a direct file attachment.", "category": "action-apps", "framework": "React", "tags": ["Action Center","Coded Action App","Storage Buckets","Documents"], "path": "samples/coded-action-apps/action-app-with-storage-bucket-document", "preview": null }
{ "id": "action-app-with-storage-bucket-document", "title": "Action App — Storage Bucket Document", "description": "Coded Action App for loan-application review that loads its document from a Storage Bucket by bucket name and file path, as opposed to receiving a direct file attachment.", "category": "action-apps", "framework": "React", "tags": ["Action Center","Coded Action App","Storage Buckets","Documents"], "path": "samples/coded-action-apps/action-app-with-storage-bucket-document", "preview": null },
{ "id": "sdk-playground", "title": "SDK Playground", "description": "Swagger-style explorer for the SDK. Pick any published SDK version, browse every service and method it exposes via auto-generated manifests, fill parameters in a generated form, and run calls live with platform-injected or custom credentials.", "category": "dev-tools", "framework": "React", "tags": ["Playground","API Explorer","Versioning","Coded App"], "path": "samples/sdk-playground", "preview": "samples/sdk-playground/screenshots/preview.gif" }
]
}
</script>
Expand Down
5 changes: 5 additions & 0 deletions samples/sdk-playground/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
dist
.env
.env.*
*.local
1 change: 1 addition & 0 deletions samples/sdk-playground/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@uipath:registry=https://registry.npmjs.org/
42 changes: 42 additions & 0 deletions samples/sdk-playground/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# UiPath SDK Playground

A Swagger-style explorer for the UiPath TypeScript SDK, built as a coded app. Pick an SDK version, browse every service and method that version exposes, fill in parameters through a generated form, and run the call live — against either the platform-injected connection or custom credentials.

## Features

- **Version-aware method catalog** — six SDK versions installed side by side (latest patch of every minor line, `1.0.0` → `1.5.5`). A build-time script extracts each version's services, methods, parameters, enums, and JSDoc from its published `.d.ts` files, so the catalog can never drift from what the version actually ships.
- **Live execution** — each version is code-split into its own lazy chunk; the browser downloads and instantiates only the selected version. Switching versions rebuilds the SDK client from scratch.
- **Connection modes**
- *Platform default*: `new UiPath()` reads the meta tags UiPath Apps injects when this is deployed as a coded app — no configuration needed.
- *PAT*: org, tenant, base URL, and a personal access token, for local development or cross-tenant testing.
- *OAuth*: a Non-Confidential External Application's App ID (client ID), redirect URI, and scopes. Sign-in runs the SDK's PKCE flow via the UiPath identity server; needed for endpoints that reject PAT auth. The registered redirect URI must match the field value exactly (`http://localhost:5173` for local dev).
- **Generated forms** — enums become dropdowns, `Date` params become date pickers, object params get a JSON editor with a shape hint, and the SDK's own `@example` JSDoc is shown inline.
- **Copy as TypeScript** — every configured call can be copied as a runnable snippet (credentials always masked).
- **Bound-method discovery** — responses that carry SDK-attached entity methods (e.g. `task.assign()`) list them next to the JSON output.

## Getting started

```bash
npm install
npm run dev # generates manifests, then starts Vite
```

`npm run build` regenerates manifests, typechecks, and produces `dist/` for deployment as a coded app.

## Adding or removing an SDK version

1. Add/remove the alias in `package.json`:
```json
"sdk-v1_6_0": "npm:@uipath/uipath-typescript@1.6.0"
```
2. `npm install && npm run manifests`

The generator (`scripts/generate-manifests.mjs`) discovers aliases automatically, emits `src/manifests/<version>.json`, and rewrites the lazy-import registry (`src/sdk/registry.gen.ts`). Nothing else to touch.

## Security notes

- The personal access token is held **in memory only** — never persisted to localStorage/sessionStorage, never logged, never embedded in generated code snippets. Reload the tab and it's gone.
- OAuth mode persists only **public identifiers** (App ID, org/tenant, scopes, redirect URI) to sessionStorage so the connection survives the sign-in redirect — never tokens or secrets. Token storage and the PKCE exchange are handled by the SDK itself.
- Changing credentials, org/tenant, or SDK version always disposes the old SDK client and builds a fresh one, so a token obtained for one tenant is never reused against another.
- All calls execute in the browser with the entered token's permissions — server-side authorization applies exactly as it would for any SDK consumer.
- Do not hardcode credentials or tenant identifiers in `index.html` or commit `.env` files (ignored via `.gitignore`).
18 changes: 18 additions & 0 deletions samples/sdk-playground/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!--
When deployed as a UiPath coded app, the platform injects configuration
meta tags (uipath:org-name, uipath:tenant-name, uipath:folder-key) here.
The "Platform default" connection mode reads them via `new UiPath()`.
Do NOT hardcode credentials or tenant identifiers in this file.
-->
<title>UiPath SDK Playground</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading
Loading