@uipath/uipath-typescript 1.0.0-beta.13 → 1.0.0-beta.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uipath/uipath-typescript",
3
- "version": "1.0.0-beta.13",
3
+ "version": "1.0.0-beta.15",
4
4
  "description": "UiPath TypeScript SDK",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -12,14 +12,19 @@
12
12
  "agentic-ai"
13
13
  ],
14
14
  "type": "module",
15
- "main": "./dist/index.js",
16
- "module": "./dist/index.esm.js",
15
+ "main": "./dist/index.cjs",
16
+ "module": "./dist/index.mjs",
17
17
  "types": "./dist/index.d.ts",
18
18
  "exports": {
19
19
  ".": {
20
- "import": "./dist/index.esm.js",
21
- "require": "./dist/index.js",
22
- "types": "./dist/index.d.ts"
20
+ "import": {
21
+ "types": "./dist/index.d.mts",
22
+ "default": "./dist/index.mjs"
23
+ },
24
+ "require": {
25
+ "types": "./dist/index.d.cts",
26
+ "default": "./dist/index.cjs"
27
+ }
23
28
  }
24
29
  },
25
30
  "files": [
@@ -28,38 +33,29 @@
28
33
  ],
29
34
  "scripts": {
30
35
  "build": "rollup -c",
36
+ "build:watch": "rollup -c -w",
31
37
  "clean": "rimraf dist && rimraf node_modules && rimraf package-lock.json",
32
38
  "docs:api": "typedoc"
33
39
  },
34
40
  "dependencies": {
35
41
  "@opentelemetry/sdk-logs": "^0.204.0",
36
42
  "axios": "^1.12.0",
37
- "eventemitter3": "^5.0.1",
38
- "file-type": "^21.0.0",
39
- "mime-types": "^3.0.1",
40
- "uuid": "^9.0.1",
41
- "ws": "^8.16.0",
42
- "zod": "^3.22.4",
43
- "typedoc": "^0.28.13",
44
- "typedoc-plugin-markdown": "^4.8.1",
45
- "rimraf": "^6.0.1"
43
+ "zod": "^3.22.4"
46
44
  },
47
45
  "devDependencies": {
48
46
  "@rollup/plugin-commonjs": "^25.0.0",
49
47
  "@rollup/plugin-json": "^6.0.0",
50
48
  "@rollup/plugin-node-resolve": "^15.2.0",
51
49
  "@rollup/plugin-typescript": "^11.1.0",
52
- "@types/jest": "^29.5.14",
53
- "@types/mime-types": "^3.0.1",
54
50
  "@types/node": "^20.11.19",
55
51
  "@types/uuid": "^9.0.8",
56
- "@types/ws": "^8.5.10",
57
52
  "builtin-modules": "^3.3.0",
58
53
  "dotenv": "^17.2.0",
59
- "jest": "^29.7.0",
60
- "rollup": "^4.0.0",
54
+ "rimraf": "^6.0.1",
55
+ "rollup": "^4.53.2",
61
56
  "rollup-plugin-dts": "^6.1.0",
62
- "ts-jest": "^29.4.0",
57
+ "typedoc": "^0.28.13",
58
+ "typedoc-plugin-markdown": "^4.8.1",
63
59
  "typescript": "^5.3.3"
64
60
  },
65
61
  "repository": {
@@ -69,4 +65,4 @@
69
65
  "workspaces": [
70
66
  "packages/*"
71
67
  ]
72
- }
68
+ }
package/Readme.md DELETED
@@ -1,260 +0,0 @@
1
- # UiPath TypeScript SDK
2
-
3
- [View Full API Reference ↗](https://uipath.github.io/uipath-typescript/getting-started/)
4
-
5
- A comprehensive TypeScript SDK for interacting with UiPath Platform services.
6
-
7
- ## Installation
8
-
9
- ```bash
10
- npm install @uipath/uipath-typescript
11
- # or
12
- yarn add @uipath/uipath-typescript
13
- # or
14
- pnpm add @uipath/uipath-typescript
15
- ```
16
-
17
-
18
- ## Quick Start
19
-
20
- ```typescript
21
- import { UiPath } from '@uipath/uipath-typescript';
22
-
23
- // Initialize the SDK
24
- const sdk = new UiPath({
25
- baseUrl: 'https://cloud.uipath.com',
26
- orgName: 'your-organization',
27
- tenantName: 'your-tenant',
28
- secret: 'your-secret' //PAT Token or Bearer Token
29
- });
30
-
31
- // Use the services
32
- const processes = await sdk.maestro.processes.getAll();
33
- const tasks = await sdk.tasks.getAll();
34
- ```
35
-
36
- ## Authentication
37
-
38
- The SDK supports two authentication methods:
39
-
40
- ### 1. Secret-based Authentication
41
- ```typescript
42
- const sdk = new UiPath({
43
- baseUrl: 'https://cloud.uipath.com',
44
- orgName: 'your-organization',
45
- tenantName: 'your-tenant',
46
- secret: 'your-secret' //PAT Token or Bearer Token
47
- });
48
- ```
49
-
50
- For OAuth, first create a non confidential [External App](https://docs.uipath.com/automation-cloud/automation-cloud/latest/admin-guide/managing-external-applications) with the required scopes and provide the clientId, redirectUri, and scope here.
51
-
52
- ### 2. OAuth Authentication
53
- ```typescript
54
- const sdk = new UiPath({
55
- baseUrl: 'https://cloud.uipath.com',
56
- orgName: 'your-organization',
57
- tenantName: 'your-tenant',
58
- clientId: 'your-client-id',
59
- redirectUri: 'your-redirect-uri',
60
- scope: 'your-scopes'
61
- });
62
-
63
- // IMPORTANT: OAuth requires calling initialize()
64
- await sdk.initialize();
65
- ```
66
-
67
- ## SDK Initialization - The initialize() Method
68
-
69
- ### When to Use initialize()
70
-
71
- The `initialize()` method completes the authentication process for the SDK:
72
-
73
- - **Secret Authentication**: Auto-initializes when creating the SDK instance - **no need to call initialize()**
74
- - **OAuth Authentication**: **MUST call** `await sdk.initialize()` before using any SDK services
75
-
76
- ### Example: Secret Authentication (Auto-initialized)
77
- ```typescript
78
- const sdk = new UiPath({
79
- baseUrl: 'https://cloud.uipath.com',
80
- orgName: 'your-organization',
81
- tenantName: 'your-tenant',
82
- secret: 'your-secret' //PAT Token or Bearer Token
83
- });
84
-
85
- // Ready to use immediately - no initialize() needed
86
- const tasks = await sdk.tasks.getAll();
87
- ```
88
-
89
- ### Example: OAuth Authentication (Requires initialize)
90
- ```typescript
91
- const sdk = new UiPath({
92
- baseUrl: 'https://cloud.uipath.com',
93
- orgName: 'your-organization',
94
- tenantName: 'your-tenant',
95
- clientId: 'your-client-id',
96
- redirectUri: 'http://localhost:3000',
97
- scope: 'your-scopes'
98
- });
99
-
100
- // Must initialize before using services
101
- try {
102
- await sdk.initialize();
103
- console.log('SDK initialized successfully');
104
-
105
- // Now you can use the SDK
106
- const tasks = await sdk.tasks.getAll();
107
- } catch (error) {
108
- console.error('Failed to initialize SDK:', error);
109
- }
110
- ```
111
-
112
- ## Available Services
113
-
114
- The SDK provides access to the following services through a consistent API:
115
-
116
- - `sdk.maestro.processes` - Manage agentic maestro processes
117
- - `sdk.maestro.processes.instances` - Manage maestro process executions
118
- - `sdk.tasks` - Create and manage tasks
119
- - `sdk.entities` - Data Fabric entity operations
120
- - `sdk.processes` - Manage Orchestrator processes
121
- - `sdk.buckets` - Manage storage buckets in Orchestrator
122
- - `sdk.queues` - Manage Orchestrator queues
123
- - `sdk.assets` - Manage Orchestrator assets
124
-
125
-
126
- **Example usage**:
127
- ```typescript
128
- // Get all processes
129
- const bpmnProcesses = await sdk.maestro.processes.getAll();
130
-
131
- // Get a specific task
132
- const task = await sdk.tasks.getById('task-id');
133
-
134
- // Create a new entity
135
- const entity = await sdk.entities.create({...});
136
-
137
- // Get all buckets
138
- const buckets = await sdk.buckets.getAll();
139
-
140
- // Get a specific process and start it
141
- const process = await sdk.processes.getAll({
142
- filter: "name eq 'MyProcess'"
143
- });
144
- const job = await sdk.processes.start({
145
- processKey: process[0].key
146
- }, 'folder-id');
147
-
148
- // Get all queues
149
- const queues = await sdk.queues.getAll();
150
-
151
- // Get all assets
152
- const assets = await sdk.assets.getAll();
153
- //Get assets in a folder
154
- const assets = await sdk.assets.getAll({folderId: 'folder-id'});
155
- ```
156
-
157
- ## TypeScript Support
158
-
159
- The SDK is fully typed and exports all types for better developer experience and LLM-friendly coding:
160
-
161
- ```typescript
162
- import {
163
- UiPath,
164
- // Task types
165
- TaskCreateOptions,
166
- TaskPriority,
167
- TaskStatus,
168
-
169
- // Process types
170
- ProcessStartRequest,
171
- ProcessStartResponse,
172
- ProcessGetResponse,
173
-
174
- // Entity types
175
- EntityGetResponse,
176
- EntityInsertOptions,
177
-
178
- // Asset/Queue/Bucket types
179
- AssetGetResponse,
180
- QueueGetResponse,
181
- BucketGetResponse,
182
-
183
- // Maestro types
184
- ProcessInstanceGetResponse,
185
- MaestroProcessGetAllResponse
186
- } from '@uipath/uipath-typescript';
187
-
188
- // TypeScript will provide full intellisense
189
- const taskOptions: TaskCreateOptions = {
190
- title: 'Review Document',
191
- priority: TaskPriority.High
192
- };
193
-
194
- const task = await sdk.tasks.create(taskOptions);
195
- ```
196
-
197
- ## Error Handling
198
-
199
- The SDK provides comprehensive error handling with typed errors:
200
-
201
- ```typescript
202
- import { UiPathError } from '@uipath/uipath-typescript';
203
-
204
- try {
205
- const process = await sdk.maestro.processes.getById('invalid-id');
206
- } catch (error) {
207
- if (error instanceof UiPathError) {
208
- // Access common error properties
209
- console.log('Error Type:', error.type);
210
- console.log('Message:', error.message);
211
- console.log('Status Code:', error.statusCode);
212
- console.log('Request ID:', error.requestId);
213
- console.log('Timestamp:', error.timestamp);
214
- console.log('error stack trace:', error.stack);
215
-
216
- // Get detailed debug information including stack trace
217
- const debugInfo = error.getDebugInfo();
218
- }
219
- }
220
- ```
221
-
222
- ## Pagination
223
-
224
- The SDK provides built-in pagination support:
225
-
226
- ### Cursor-based Navigation
227
-
228
- ```typescript
229
- // Navigate through pages using cursors
230
- let currentPage = await sdk.assets.getAll({ pageSize: 10 }) as PaginatedResponse<AssetGetResponse>;
231
-
232
- while (currentPage.hasNextPage) {
233
- // Process current page items
234
- currentPage.items.forEach(item => console.log(item.name));
235
-
236
- // Get next page using cursor
237
- currentPage = await sdk.assets.getAll({
238
- cursor: currentPage.nextCursor
239
- }) as PaginatedResponse<AssetGetResponse>;
240
- }
241
- ```
242
-
243
- ### Page Jumping
244
-
245
- ```typescript
246
- // Jump directly to page 5 (when supported)
247
- const page5 = await sdk.assets.getAll({
248
- jumpToPage: 5,
249
- pageSize: 20
250
- });
251
-
252
- // Check if page jumping is supported
253
- if (page5.supportsPageJump) {
254
- console.log(`Currently on page ${page5.currentPage} of ${page5.totalPages}`);
255
- }
256
- ```
257
-
258
- ## Development
259
-
260
- Before submitting a pull request, please review our [Contribution Guidelines](https://uipath.github.io/uipath-typescript/CONTRIBUTING/).