@uipath/uipath-typescript 1.0.0-beta.17 → 1.0.0
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/README.md +98 -40
- package/dist/assets/index.cjs +2090 -0
- package/dist/assets/index.d.ts +513 -0
- package/dist/assets/index.mjs +2087 -0
- package/dist/buckets/index.cjs +2364 -0
- package/dist/buckets/index.d.ts +819 -0
- package/dist/buckets/index.mjs +2361 -0
- package/dist/cases/index.cjs +3493 -0
- package/dist/cases/index.d.ts +1397 -0
- package/dist/cases/index.mjs +3487 -0
- package/dist/core/index.cjs +5267 -0
- package/dist/core/index.d.ts +406 -0
- package/dist/core/index.mjs +5241 -0
- package/dist/entities/index.cjs +2749 -0
- package/dist/entities/index.d.ts +1513 -0
- package/dist/entities/index.mjs +2743 -0
- package/dist/index.cjs +3611 -3176
- package/dist/index.d.ts +1049 -540
- package/dist/index.mjs +3611 -3176
- package/dist/index.umd.js +8492 -11899
- package/dist/maestro-processes/index.cjs +2609 -0
- package/dist/maestro-processes/index.d.ts +1127 -0
- package/dist/maestro-processes/index.mjs +2600 -0
- package/dist/processes/index.cjs +2233 -0
- package/dist/processes/index.d.ts +800 -0
- package/dist/processes/index.mjs +2230 -0
- package/dist/queues/index.cjs +2075 -0
- package/dist/queues/index.d.ts +504 -0
- package/dist/queues/index.mjs +2072 -0
- package/dist/tasks/index.cjs +2675 -0
- package/dist/tasks/index.d.ts +1122 -0
- package/dist/tasks/index.mjs +2671 -0
- package/package.json +100 -6
- package/dist/index.d.cts +0 -5376
- package/dist/index.d.mts +0 -5376
package/README.md
CHANGED
|
@@ -73,7 +73,9 @@ pnpm add @uipath/uipath-typescript
|
|
|
73
73
|
### Quick Start
|
|
74
74
|
|
|
75
75
|
```typescript
|
|
76
|
-
import { UiPath } from '@uipath/uipath-typescript';
|
|
76
|
+
import { UiPath } from '@uipath/uipath-typescript/core';
|
|
77
|
+
import { MaestroProcesses } from '@uipath/uipath-typescript/maestro-processes';
|
|
78
|
+
import { Tasks } from '@uipath/uipath-typescript/tasks';
|
|
77
79
|
|
|
78
80
|
// Initialize the SDK with OAuth
|
|
79
81
|
const sdk = new UiPath({
|
|
@@ -88,9 +90,13 @@ const sdk = new UiPath({
|
|
|
88
90
|
// Initialize OAuth flow
|
|
89
91
|
await sdk.initialize();
|
|
90
92
|
|
|
93
|
+
// Create service instances
|
|
94
|
+
const maestroProcesses = new MaestroProcesses(sdk);
|
|
95
|
+
const tasks = new Tasks(sdk);
|
|
96
|
+
|
|
91
97
|
// Use the services
|
|
92
|
-
const processes = await
|
|
93
|
-
const
|
|
98
|
+
const processes = await maestroProcesses.getAll();
|
|
99
|
+
const allTasks = await tasks.getAll();
|
|
94
100
|
```
|
|
95
101
|
|
|
96
102
|
<div align="right">
|
|
@@ -111,6 +117,8 @@ For OAuth, first create a non confidential [External App](https://docs.uipath.co
|
|
|
111
117
|
<summary><strong>1. OAuth Authentication (Recommended)</strong></summary>
|
|
112
118
|
|
|
113
119
|
```typescript
|
|
120
|
+
import { UiPath } from '@uipath/uipath-typescript/core';
|
|
121
|
+
|
|
114
122
|
const sdk = new UiPath({
|
|
115
123
|
baseUrl: 'https://cloud.uipath.com',
|
|
116
124
|
orgName: 'your-organization',
|
|
@@ -130,11 +138,13 @@ await sdk.initialize();
|
|
|
130
138
|
<summary><strong>2. Secret-based Authentication</strong></summary>
|
|
131
139
|
|
|
132
140
|
```typescript
|
|
141
|
+
import { UiPath } from '@uipath/uipath-typescript/core';
|
|
142
|
+
|
|
133
143
|
const sdk = new UiPath({
|
|
134
144
|
baseUrl: 'https://cloud.uipath.com',
|
|
135
145
|
orgName: 'your-organization',
|
|
136
146
|
tenantName: 'your-tenant',
|
|
137
|
-
secret: 'your-secret' //PAT Token or Bearer Token
|
|
147
|
+
secret: 'your-secret' //PAT Token or Bearer Token
|
|
138
148
|
});
|
|
139
149
|
```
|
|
140
150
|
|
|
@@ -152,19 +162,26 @@ The `initialize()` method completes the authentication process for the SDK:
|
|
|
152
162
|
|
|
153
163
|
#### Example: Secret Authentication (Auto-initialized)
|
|
154
164
|
```typescript
|
|
165
|
+
import { UiPath } from '@uipath/uipath-typescript/core';
|
|
166
|
+
import { Tasks } from '@uipath/uipath-typescript/tasks';
|
|
167
|
+
|
|
155
168
|
const sdk = new UiPath({
|
|
156
169
|
baseUrl: 'https://cloud.uipath.com',
|
|
157
170
|
orgName: 'your-organization',
|
|
158
171
|
tenantName: 'your-tenant',
|
|
159
|
-
secret: 'your-secret' //PAT Token or Bearer Token
|
|
172
|
+
secret: 'your-secret' //PAT Token or Bearer Token
|
|
160
173
|
});
|
|
161
174
|
|
|
162
175
|
// Ready to use immediately - no initialize() needed
|
|
163
|
-
const tasks =
|
|
176
|
+
const tasks = new Tasks(sdk);
|
|
177
|
+
const allTasks = await tasks.getAll();
|
|
164
178
|
```
|
|
165
179
|
|
|
166
180
|
#### Example: OAuth Authentication (Requires initialize)
|
|
167
181
|
```typescript
|
|
182
|
+
import { UiPath } from '@uipath/uipath-typescript/core';
|
|
183
|
+
import { Tasks } from '@uipath/uipath-typescript/tasks';
|
|
184
|
+
|
|
168
185
|
const sdk = new UiPath({
|
|
169
186
|
baseUrl: 'https://cloud.uipath.com',
|
|
170
187
|
orgName: 'your-organization',
|
|
@@ -178,9 +195,10 @@ const sdk = new UiPath({
|
|
|
178
195
|
try {
|
|
179
196
|
await sdk.initialize();
|
|
180
197
|
console.log('SDK initialized successfully');
|
|
181
|
-
|
|
198
|
+
|
|
182
199
|
// Now you can use the SDK
|
|
183
|
-
const tasks =
|
|
200
|
+
const tasks = new Tasks(sdk);
|
|
201
|
+
const allTasks = await tasks.getAll();
|
|
184
202
|
} catch (error) {
|
|
185
203
|
console.error('Failed to initialize SDK:', error);
|
|
186
204
|
}
|
|
@@ -195,6 +213,8 @@ try {
|
|
|
195
213
|
|
|
196
214
|
#### Auto-login on App Load
|
|
197
215
|
```typescript
|
|
216
|
+
import { UiPath } from '@uipath/uipath-typescript/core';
|
|
217
|
+
|
|
198
218
|
useEffect(() => {
|
|
199
219
|
const initSDK = async () => {
|
|
200
220
|
const sdk = new UiPath({...oauthConfig});
|
|
@@ -237,108 +257,129 @@ useEffect(() => {
|
|
|
237
257
|
|
|
238
258
|
## Usage
|
|
239
259
|
|
|
240
|
-
The SDK provides access to the following services through
|
|
260
|
+
The SDK provides access to the following services through modular imports:
|
|
241
261
|
|
|
242
|
-
- `
|
|
243
|
-
- `
|
|
244
|
-
- `
|
|
245
|
-
- `
|
|
246
|
-
- `
|
|
247
|
-
- `
|
|
248
|
-
- `
|
|
249
|
-
- `
|
|
250
|
-
- `
|
|
251
|
-
- `
|
|
262
|
+
- `MaestroProcesses` from `@uipath/uipath-typescript/maestro-processes` - Manage agentic maestro processes
|
|
263
|
+
- `ProcessInstances` from `@uipath/uipath-typescript/maestro-processes` - Manage maestro process executions
|
|
264
|
+
- `Cases` from `@uipath/uipath-typescript/cases` - Manage maestro case management processes
|
|
265
|
+
- `CaseInstances` from `@uipath/uipath-typescript/cases` - Manage maestro case executions
|
|
266
|
+
- `Tasks` from `@uipath/uipath-typescript/tasks` - Create and manage tasks
|
|
267
|
+
- `Entities` from `@uipath/uipath-typescript/entities` - Data Fabric entity operations
|
|
268
|
+
- `Processes` from `@uipath/uipath-typescript/processes` - Manage Orchestrator processes
|
|
269
|
+
- `Buckets` from `@uipath/uipath-typescript/buckets` - Manage storage buckets in Orchestrator
|
|
270
|
+
- `Queues` from `@uipath/uipath-typescript/queues` - Manage Orchestrator queues
|
|
271
|
+
- `Assets` from `@uipath/uipath-typescript/assets` - Manage Orchestrator assets
|
|
252
272
|
|
|
253
273
|
<details>
|
|
254
274
|
<summary><strong>View Example Usage</strong></summary>
|
|
255
275
|
|
|
256
276
|
```typescript
|
|
277
|
+
import { UiPath } from '@uipath/uipath-typescript/core';
|
|
278
|
+
import { MaestroProcesses, ProcessInstances } from '@uipath/uipath-typescript/maestro-processes';
|
|
279
|
+
import { Cases, CaseInstances } from '@uipath/uipath-typescript/cases';
|
|
280
|
+
import { Tasks, TaskType } from '@uipath/uipath-typescript/tasks';
|
|
281
|
+
import { Processes } from '@uipath/uipath-typescript/processes';
|
|
282
|
+
import { Buckets } from '@uipath/uipath-typescript/buckets';
|
|
283
|
+
import { Entities } from '@uipath/uipath-typescript/entities';
|
|
284
|
+
|
|
285
|
+
// Initialize SDK
|
|
286
|
+
const sdk = new UiPath({ /* config */ });
|
|
287
|
+
|
|
288
|
+
// Create service instances
|
|
289
|
+
const maestroProcesses = new MaestroProcesses(sdk);
|
|
290
|
+
const processInstances = new ProcessInstances(sdk);
|
|
291
|
+
const cases = new Cases(sdk);
|
|
292
|
+
const caseInstances = new CaseInstances(sdk);
|
|
293
|
+
const tasks = new Tasks(sdk);
|
|
294
|
+
const processes = new Processes(sdk);
|
|
295
|
+
const buckets = new Buckets(sdk);
|
|
296
|
+
const entities = new Entities(sdk);
|
|
297
|
+
|
|
257
298
|
// Maestro - Get processes and their instances
|
|
258
|
-
const
|
|
259
|
-
const instances = await
|
|
299
|
+
const allProcesses = await maestroProcesses.getAll();
|
|
300
|
+
const instances = await processInstances.getAll({
|
|
260
301
|
processKey: 'my-process',
|
|
261
302
|
pageSize: 10
|
|
262
303
|
});
|
|
263
304
|
|
|
264
305
|
// Control Process Instances
|
|
265
|
-
await
|
|
266
|
-
await
|
|
267
|
-
await
|
|
306
|
+
await processInstances.pause(instanceId, 'folder-key');
|
|
307
|
+
await processInstances.resume(instanceId, 'folder-key');
|
|
308
|
+
await processInstances.cancel(instanceId, 'folder-key', {
|
|
268
309
|
comment: 'Cancelled due to error'
|
|
269
310
|
});
|
|
270
311
|
|
|
271
312
|
// Maestro Case Instances
|
|
272
|
-
const caseInstance = await
|
|
273
|
-
const stages = await
|
|
313
|
+
const caseInstance = await caseInstances.getById(instanceId, 'folder-key');
|
|
314
|
+
const stages = await caseInstances.getStages(instanceId, 'folder-key');
|
|
274
315
|
|
|
275
316
|
// Control Case Instances
|
|
276
|
-
await
|
|
317
|
+
await caseInstances.close(instanceId, 'folder-key', {
|
|
277
318
|
comment: 'Case resolved successfully'
|
|
278
319
|
});
|
|
279
320
|
|
|
280
321
|
// Orchestrator Processes - Start a process
|
|
281
|
-
const result = await
|
|
322
|
+
const result = await processes.start({
|
|
282
323
|
processKey: 'MyProcess_Key',
|
|
283
324
|
}, folderId);
|
|
284
325
|
|
|
285
326
|
// Tasks - Create, assign, and complete
|
|
286
|
-
const task = await
|
|
327
|
+
const task = await tasks.create({
|
|
287
328
|
title: 'Review Invoice',
|
|
288
329
|
priority: 'High'
|
|
289
330
|
}, folderId);
|
|
290
331
|
|
|
291
|
-
await
|
|
332
|
+
await tasks.assign({
|
|
292
333
|
taskId: task.id,
|
|
293
334
|
userNameOrEmail: 'user@company.com'
|
|
294
335
|
}, folderId);
|
|
295
336
|
|
|
296
|
-
await
|
|
337
|
+
await tasks.complete(TaskType.App, {
|
|
297
338
|
taskId: task.id,
|
|
298
339
|
data: {},
|
|
299
340
|
action: 'submit'
|
|
300
341
|
}, folderId);
|
|
301
342
|
|
|
302
343
|
// Buckets - File operations
|
|
303
|
-
const bucket = await
|
|
304
|
-
const fileMetadata = await
|
|
344
|
+
const bucket = await buckets.getById(bucketId, folderId);
|
|
345
|
+
const fileMetadata = await buckets.getFileMetaData(bucketId, folderId, {
|
|
305
346
|
prefix: '/invoices/'
|
|
306
347
|
});
|
|
307
348
|
|
|
308
349
|
// Upload file
|
|
309
|
-
await
|
|
350
|
+
await buckets.uploadFile({
|
|
310
351
|
bucketId: bucketId,
|
|
311
352
|
folderId: folderId,
|
|
312
353
|
prefix: '/folder1'
|
|
313
354
|
});
|
|
314
355
|
|
|
315
356
|
// Get download URL
|
|
316
|
-
const downloadUrl = await
|
|
357
|
+
const downloadUrl = await buckets.getReadUri({
|
|
317
358
|
bucketId: bucketId,
|
|
318
359
|
folderId: folderId,
|
|
319
360
|
path: '/folder/file.pdf'
|
|
320
361
|
});
|
|
321
362
|
|
|
322
363
|
// Data Fabric Entities - CRUD operations
|
|
323
|
-
const entity = await
|
|
324
|
-
const records = await
|
|
364
|
+
const entity = await entities.getById('entity-uuid');
|
|
365
|
+
const records = await entities.getAllRecords('entity-uuid', {
|
|
325
366
|
pageSize: 100,
|
|
326
367
|
expansionLevel: 1
|
|
327
368
|
});
|
|
328
369
|
|
|
329
370
|
// Insert records
|
|
330
|
-
await
|
|
371
|
+
await entities.insertRecordsById('entity-uuid', [
|
|
331
372
|
{ name: 'John Doe', email: 'john@company.com', status: 'Active' },
|
|
332
373
|
{ name: 'Jane Smith', email: 'jane@company.com', status: 'Active' }
|
|
333
374
|
]);
|
|
334
375
|
|
|
335
376
|
// Update records
|
|
336
|
-
await
|
|
377
|
+
await entities.updateRecordsById('entity-uuid', [
|
|
337
378
|
{ Id: 'record-id-1', status: 'Inactive' }
|
|
338
379
|
]);
|
|
339
380
|
|
|
340
381
|
// Delete records
|
|
341
|
-
await
|
|
382
|
+
await entities.deleteRecordsById('entity-uuid', ['record-id-1', 'record-id-2']);
|
|
342
383
|
```
|
|
343
384
|
|
|
344
385
|
</details>
|
|
@@ -365,6 +406,23 @@ Check out the [`/samples`](./samples) folder to see sample applications built us
|
|
|
365
406
|
|
|
366
407
|
Before submitting a pull request, please review our [Contribution Guidelines](https://uipath.github.io/uipath-typescript/CONTRIBUTING/).
|
|
367
408
|
|
|
409
|
+
### Running Documentation Locally
|
|
410
|
+
|
|
411
|
+
To build and serve the documentation locally using MkDocs:
|
|
412
|
+
|
|
413
|
+
**Prerequisites:**
|
|
414
|
+
- Python
|
|
415
|
+
- Node.js 18.x or higher
|
|
416
|
+
- npm 8.x or higher
|
|
417
|
+
|
|
418
|
+
**Steps:**
|
|
419
|
+
```bash
|
|
420
|
+
pip3 install -r docs/requirements.txt
|
|
421
|
+
npm run docs:api
|
|
422
|
+
mkdocs build
|
|
423
|
+
mkdocs serve
|
|
424
|
+
```
|
|
425
|
+
|
|
368
426
|
<div align="right">
|
|
369
427
|
|
|
370
428
|
[↑ Back to top](#uipath-typescript-sdk)
|