@uipath/uipath-typescript 1.3.11 → 1.4.1
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/agent-memory/index.cjs +1772 -0
- package/dist/agent-memory/index.d.ts +588 -0
- package/dist/agent-memory/index.mjs +1770 -0
- package/dist/agents/index.cjs +1995 -0
- package/dist/agents/index.d.ts +961 -0
- package/dist/agents/index.mjs +1993 -0
- package/dist/assets/index.cjs +171 -39
- package/dist/assets/index.d.ts +84 -5
- package/dist/assets/index.mjs +171 -39
- package/dist/attachments/index.cjs +53 -15
- package/dist/attachments/index.d.ts +1 -0
- package/dist/attachments/index.mjs +53 -15
- package/dist/buckets/index.cjs +151 -130
- package/dist/buckets/index.d.ts +198 -84
- package/dist/buckets/index.mjs +151 -130
- package/dist/cases/index.cjs +220 -23
- package/dist/cases/index.d.ts +148 -10
- package/dist/cases/index.mjs +220 -24
- package/dist/conversational-agent/index.cjs +140 -66
- package/dist/conversational-agent/index.d.ts +190 -122
- package/dist/conversational-agent/index.mjs +140 -66
- package/dist/core/index.cjs +445 -108
- package/dist/core/index.d.ts +15 -0
- package/dist/core/index.mjs +445 -108
- package/dist/entities/index.cjs +365 -102
- package/dist/entities/index.d.ts +446 -114
- package/dist/entities/index.mjs +365 -102
- package/dist/feedback/index.cjs +53 -15
- package/dist/feedback/index.d.ts +1 -0
- package/dist/feedback/index.mjs +53 -15
- package/dist/governance/index.cjs +1789 -0
- package/dist/governance/index.d.ts +598 -0
- package/dist/governance/index.mjs +1787 -0
- package/dist/index.cjs +1453 -444
- package/dist/index.d.ts +4150 -1742
- package/dist/index.mjs +1452 -445
- package/dist/index.umd.js +5035 -4009
- package/dist/jobs/index.cjs +53 -15
- package/dist/jobs/index.d.ts +1 -0
- package/dist/jobs/index.mjs +53 -15
- package/dist/maestro-processes/index.cjs +189 -27
- package/dist/maestro-processes/index.d.ts +131 -9
- package/dist/maestro-processes/index.mjs +189 -27
- package/dist/orchestrator-du-module/index.cjs +1788 -0
- package/dist/orchestrator-du-module/index.d.ts +757 -0
- package/dist/orchestrator-du-module/index.mjs +1785 -0
- package/dist/processes/index.cjs +53 -15
- package/dist/processes/index.d.ts +1 -0
- package/dist/processes/index.mjs +53 -15
- package/dist/queues/index.cjs +53 -15
- package/dist/queues/index.d.ts +1 -0
- package/dist/queues/index.mjs +53 -15
- package/dist/tasks/index.cjs +116 -19
- package/dist/tasks/index.d.ts +110 -4
- package/dist/tasks/index.mjs +117 -20
- package/dist/traces/index.cjs +340 -15
- package/dist/traces/index.d.ts +483 -2
- package/dist/traces/index.mjs +339 -16
- package/package.json +42 -2
|
@@ -0,0 +1,757 @@
|
|
|
1
|
+
import { IUiPath } from '../core/index';
|
|
2
|
+
|
|
3
|
+
declare enum ComparisonOperator {
|
|
4
|
+
Equals = "Equals",
|
|
5
|
+
NotEquals = "NotEquals",
|
|
6
|
+
Greater = "Greater",
|
|
7
|
+
Less = "Less",
|
|
8
|
+
GreaterOrEqual = "GreaterOrEqual",
|
|
9
|
+
LessOrEqual = "LessOrEqual"
|
|
10
|
+
}
|
|
11
|
+
declare enum Criticality {
|
|
12
|
+
Must = "Must",
|
|
13
|
+
Should = "Should"
|
|
14
|
+
}
|
|
15
|
+
declare enum FieldType {
|
|
16
|
+
Text = "Text",
|
|
17
|
+
Number = "Number",
|
|
18
|
+
Date = "Date",
|
|
19
|
+
Name = "Name",
|
|
20
|
+
Address = "Address",
|
|
21
|
+
Keyword = "Keyword",
|
|
22
|
+
Set = "Set",
|
|
23
|
+
Boolean = "Boolean",
|
|
24
|
+
Table = "Table",
|
|
25
|
+
Internal = "Internal",
|
|
26
|
+
FieldGroup = "FieldGroup",
|
|
27
|
+
MonetaryQuantity = "MonetaryQuantity"
|
|
28
|
+
}
|
|
29
|
+
declare enum LogicalOperator {
|
|
30
|
+
AND = "AND",
|
|
31
|
+
OR = "OR"
|
|
32
|
+
}
|
|
33
|
+
declare enum RuleType {
|
|
34
|
+
Mandatory = "Mandatory",
|
|
35
|
+
PossibleValues = "PossibleValues",
|
|
36
|
+
Regex = "Regex",
|
|
37
|
+
StartsWith = "StartsWith",
|
|
38
|
+
EndsWith = "EndsWith",
|
|
39
|
+
FixedLength = "FixedLength",
|
|
40
|
+
IsNumeric = "IsNumeric",
|
|
41
|
+
IsDate = "IsDate",
|
|
42
|
+
IsEmail = "IsEmail",
|
|
43
|
+
Contains = "Contains",
|
|
44
|
+
Expression = "Expression",
|
|
45
|
+
TableExpression = "TableExpression",
|
|
46
|
+
IsEmpty = "IsEmpty"
|
|
47
|
+
}
|
|
48
|
+
interface DataSource {
|
|
49
|
+
ResourceId?: string | null;
|
|
50
|
+
ElementFieldId?: string | null;
|
|
51
|
+
}
|
|
52
|
+
interface DocumentGroup {
|
|
53
|
+
Name?: string | null;
|
|
54
|
+
Categories?: string[] | null;
|
|
55
|
+
}
|
|
56
|
+
interface DocumentTaxonomy {
|
|
57
|
+
DataContractVersion?: string | null;
|
|
58
|
+
DocumentTypes?: DocumentTypeEntity[] | null;
|
|
59
|
+
Groups?: DocumentGroup[] | null;
|
|
60
|
+
SupportedLanguages?: LanguageInfo[] | null;
|
|
61
|
+
ReportAsExceptionSettings?: ReportAsExceptionSettings;
|
|
62
|
+
}
|
|
63
|
+
interface DocumentTypeEntity {
|
|
64
|
+
DocumentTypeId?: string | null;
|
|
65
|
+
Group?: string | null;
|
|
66
|
+
Category?: string | null;
|
|
67
|
+
Name?: string | null;
|
|
68
|
+
OptionalUniqueIdentifier?: string | null;
|
|
69
|
+
TypeField?: TypeField;
|
|
70
|
+
Fields?: Field[] | null;
|
|
71
|
+
Metadata?: MetadataEntry[] | null;
|
|
72
|
+
}
|
|
73
|
+
interface ExceptionReasonOption {
|
|
74
|
+
ExceptionReason?: string | null;
|
|
75
|
+
}
|
|
76
|
+
interface Field {
|
|
77
|
+
FieldId?: string | null;
|
|
78
|
+
FieldName?: string | null;
|
|
79
|
+
IsMultiValue?: boolean;
|
|
80
|
+
Type?: FieldType;
|
|
81
|
+
DeriveFieldsFormat?: string | null;
|
|
82
|
+
Components?: Field[] | null;
|
|
83
|
+
SetValues?: string[] | null;
|
|
84
|
+
Metadata?: MetadataEntry[] | null;
|
|
85
|
+
RuleSet?: RuleSet;
|
|
86
|
+
DefaultValue?: string | null;
|
|
87
|
+
DataSource?: DataSource;
|
|
88
|
+
}
|
|
89
|
+
interface LanguageInfo {
|
|
90
|
+
Name?: string | null;
|
|
91
|
+
Code?: string | null;
|
|
92
|
+
}
|
|
93
|
+
interface MetadataEntry {
|
|
94
|
+
Key?: string | null;
|
|
95
|
+
Value?: string | null;
|
|
96
|
+
}
|
|
97
|
+
interface ReportAsExceptionSettings {
|
|
98
|
+
ExceptionReasonOptions?: ExceptionReasonOption[] | null;
|
|
99
|
+
}
|
|
100
|
+
interface Rule {
|
|
101
|
+
Name?: string | null;
|
|
102
|
+
Type?: RuleType;
|
|
103
|
+
LogicalOperator?: LogicalOperator;
|
|
104
|
+
ComparisonOperator?: ComparisonOperator;
|
|
105
|
+
Expression?: string | null;
|
|
106
|
+
SetValues?: string[] | null;
|
|
107
|
+
}
|
|
108
|
+
interface RuleSet {
|
|
109
|
+
Criticality?: Criticality;
|
|
110
|
+
Rules?: Rule[] | null;
|
|
111
|
+
}
|
|
112
|
+
interface TypeField {
|
|
113
|
+
FieldId?: string | null;
|
|
114
|
+
FieldName?: string | null;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
interface FieldValue {
|
|
118
|
+
Value?: string | null;
|
|
119
|
+
DerivedValue?: string | null;
|
|
120
|
+
}
|
|
121
|
+
interface FieldValueResult {
|
|
122
|
+
Value?: FieldValue;
|
|
123
|
+
IsValid?: boolean;
|
|
124
|
+
Rules?: RuleResult[] | null;
|
|
125
|
+
}
|
|
126
|
+
interface RuleResult {
|
|
127
|
+
Rule?: Rule;
|
|
128
|
+
IsValid?: boolean;
|
|
129
|
+
}
|
|
130
|
+
interface RuleSetResult {
|
|
131
|
+
FieldId?: string | null;
|
|
132
|
+
FieldType?: FieldType;
|
|
133
|
+
Criticality?: Criticality;
|
|
134
|
+
IsValid?: boolean;
|
|
135
|
+
Results?: FieldValueResult[] | null;
|
|
136
|
+
BrokenRules?: Rule[] | null;
|
|
137
|
+
RowIndex?: number | null;
|
|
138
|
+
TableFieldId?: string | null;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
declare enum TextType {
|
|
142
|
+
Unknown = "Unknown",
|
|
143
|
+
Text = "Text",
|
|
144
|
+
Checkbox = "Checkbox",
|
|
145
|
+
Handwriting = "Handwriting",
|
|
146
|
+
Barcode = "Barcode",
|
|
147
|
+
QRcode = "QRcode",
|
|
148
|
+
Stamp = "Stamp",
|
|
149
|
+
Logo = "Logo",
|
|
150
|
+
Circle = "Circle",
|
|
151
|
+
Underline = "Underline",
|
|
152
|
+
Cut = "Cut"
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
declare enum ResultsDataSource {
|
|
156
|
+
Automatic = "Automatic",
|
|
157
|
+
Manual = "Manual",
|
|
158
|
+
ManuallyChanged = "ManuallyChanged",
|
|
159
|
+
Defaulted = "Defaulted",
|
|
160
|
+
External = "External"
|
|
161
|
+
}
|
|
162
|
+
interface ExtractionResult {
|
|
163
|
+
DocumentId?: string | null;
|
|
164
|
+
ResultsVersion?: number;
|
|
165
|
+
ResultsDocument?: ResultsDocument;
|
|
166
|
+
ExtractorPayloads?: ExtractorPayload[] | null;
|
|
167
|
+
BusinessRulesResults?: RuleSetResult[] | null;
|
|
168
|
+
}
|
|
169
|
+
interface ExtractorPayload {
|
|
170
|
+
Id?: string | null;
|
|
171
|
+
Payload?: string | null;
|
|
172
|
+
SavedPayloadId?: string | null;
|
|
173
|
+
TaxonomySchemaMapping?: string | null;
|
|
174
|
+
}
|
|
175
|
+
interface ResultsContentReference {
|
|
176
|
+
TextStartIndex?: number;
|
|
177
|
+
TextLength?: number;
|
|
178
|
+
Tokens?: ResultsValueTokens[] | null;
|
|
179
|
+
}
|
|
180
|
+
interface ResultsDataPoint {
|
|
181
|
+
FieldId?: string | null;
|
|
182
|
+
FieldName?: string | null;
|
|
183
|
+
FieldType?: FieldType;
|
|
184
|
+
IsMissing?: boolean;
|
|
185
|
+
DataSource?: ResultsDataSource;
|
|
186
|
+
Values?: ResultsValue[] | null;
|
|
187
|
+
DataVersion?: number;
|
|
188
|
+
OperatorConfirmed?: boolean;
|
|
189
|
+
ValidatorNotes?: string | null;
|
|
190
|
+
ValidatorNotesInfo?: string | null;
|
|
191
|
+
}
|
|
192
|
+
interface ResultsDerivedField {
|
|
193
|
+
FieldId?: string | null;
|
|
194
|
+
Value?: string | null;
|
|
195
|
+
}
|
|
196
|
+
interface ResultsDocument {
|
|
197
|
+
Bounds?: ResultsDocumentBounds;
|
|
198
|
+
Language?: string | null;
|
|
199
|
+
DocumentGroup?: string | null;
|
|
200
|
+
DocumentCategory?: string | null;
|
|
201
|
+
DocumentTypeId?: string | null;
|
|
202
|
+
DocumentTypeName?: string | null;
|
|
203
|
+
DocumentTypeDataVersion?: number;
|
|
204
|
+
DataVersion?: number;
|
|
205
|
+
DocumentTypeSource?: ResultsDataSource;
|
|
206
|
+
DocumentTypeField?: ResultsValue;
|
|
207
|
+
Fields?: ResultsDataPoint[] | null;
|
|
208
|
+
Tables?: ResultsTable[] | null;
|
|
209
|
+
}
|
|
210
|
+
interface ResultsDocumentBounds {
|
|
211
|
+
PageCount?: number;
|
|
212
|
+
PageRange?: string | null;
|
|
213
|
+
}
|
|
214
|
+
interface ResultsTable {
|
|
215
|
+
FieldId?: string | null;
|
|
216
|
+
FieldName?: string | null;
|
|
217
|
+
IsMissing?: boolean;
|
|
218
|
+
DataSource?: ResultsDataSource;
|
|
219
|
+
DataVersion?: number;
|
|
220
|
+
OperatorConfirmed?: boolean;
|
|
221
|
+
Values?: ResultsTableValue[] | null;
|
|
222
|
+
ValidatorNotes?: string | null;
|
|
223
|
+
ValidatorNotesInfo?: string | null;
|
|
224
|
+
}
|
|
225
|
+
interface ResultsTableCell {
|
|
226
|
+
RowIndex?: number;
|
|
227
|
+
ColumnIndex?: number;
|
|
228
|
+
IsHeader?: boolean;
|
|
229
|
+
IsMissing?: boolean;
|
|
230
|
+
OperatorConfirmed?: boolean;
|
|
231
|
+
DataSource?: ResultsDataSource;
|
|
232
|
+
DataVersion?: number;
|
|
233
|
+
Values?: ResultsValue[] | null;
|
|
234
|
+
}
|
|
235
|
+
interface ResultsTableColumnInfo {
|
|
236
|
+
FieldId?: string | null;
|
|
237
|
+
FieldName?: string | null;
|
|
238
|
+
FieldType?: FieldType;
|
|
239
|
+
}
|
|
240
|
+
interface ResultsTableValue {
|
|
241
|
+
OperatorConfirmed?: boolean;
|
|
242
|
+
Confidence?: number;
|
|
243
|
+
OcrConfidence?: number;
|
|
244
|
+
Cells?: ResultsTableCell[] | null;
|
|
245
|
+
ColumnInfo?: ResultsTableColumnInfo[] | null;
|
|
246
|
+
NumberOfRows?: number;
|
|
247
|
+
ValidatorNotes?: string | null;
|
|
248
|
+
ValidatorNotesInfo?: string | null;
|
|
249
|
+
}
|
|
250
|
+
interface ResultsValue {
|
|
251
|
+
Components?: ResultsDataPoint[] | null;
|
|
252
|
+
Value?: string | null;
|
|
253
|
+
UnformattedValue?: string | null;
|
|
254
|
+
Reference?: ResultsContentReference;
|
|
255
|
+
DerivedFields?: ResultsDerivedField[] | null;
|
|
256
|
+
Confidence?: number;
|
|
257
|
+
OperatorConfirmed?: boolean;
|
|
258
|
+
OcrConfidence?: number;
|
|
259
|
+
TextType?: TextType;
|
|
260
|
+
ValidatorNotes?: string | null;
|
|
261
|
+
ValidatorNotesInfo?: string | null;
|
|
262
|
+
}
|
|
263
|
+
interface ResultsValueTokens {
|
|
264
|
+
TextStartIndex?: number;
|
|
265
|
+
TextLength?: number;
|
|
266
|
+
Page?: number;
|
|
267
|
+
PageWidth?: number;
|
|
268
|
+
PageHeight?: number;
|
|
269
|
+
Boxes?: number[][] | null;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
interface BaseOptions {
|
|
273
|
+
expand?: string;
|
|
274
|
+
select?: string;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Options that scope a name-based lookup (e.g. `getByName`) to a folder.
|
|
278
|
+
* Provide one of `folderId`, `folderKey`, or `folderPath`. When more than
|
|
279
|
+
* one is supplied, all are forwarded; the server applies precedence
|
|
280
|
+
* `folderPath` > `folderKey` > `folderId`.
|
|
281
|
+
*/
|
|
282
|
+
interface FolderScopedOptions extends BaseOptions {
|
|
283
|
+
/** Numeric folder ID. */
|
|
284
|
+
folderId?: number;
|
|
285
|
+
/** Folder key (GUID-formatted string). */
|
|
286
|
+
folderKey?: string;
|
|
287
|
+
/** Slash-delimited folder path, e.g. `'Shared/Finance'`. */
|
|
288
|
+
folderPath?: string;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Echoed payload returned alongside an exception-report submission.
|
|
293
|
+
*/
|
|
294
|
+
interface ExceptionReportSubmitResult {
|
|
295
|
+
/** Document identifier the exception was reported against. */
|
|
296
|
+
DocumentId: string | null;
|
|
297
|
+
/** Reason captured for the exception. */
|
|
298
|
+
Reason: string | null;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Response returned by `submitExceptionReport()`.
|
|
302
|
+
*/
|
|
303
|
+
interface SubmitExceptionReportResponse {
|
|
304
|
+
/** Echo of the submitted exception report. */
|
|
305
|
+
SubmitResult?: ExceptionReportSubmitResult;
|
|
306
|
+
/** Whether the submission was accepted by the server. */
|
|
307
|
+
IsSuccessful: boolean;
|
|
308
|
+
/** Server-supplied error message when {@link SubmitExceptionReportResponse.IsSuccessful} is `false`; empty string on success. */
|
|
309
|
+
ErrorMessage: string | null;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Options for `submitExceptionReport()`.
|
|
313
|
+
*/
|
|
314
|
+
interface SubmitExceptionReportOptions extends FolderScopedOptions {
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Request body for processing extracted document data against a taxonomy.
|
|
318
|
+
*
|
|
319
|
+
* Combines the automatic extraction output with any validator-supplied edits so the
|
|
320
|
+
* server can compute the merged extraction result.
|
|
321
|
+
*/
|
|
322
|
+
interface ProcessExtractedDataRequest {
|
|
323
|
+
/** Extraction result produced by the automatic extractor. */
|
|
324
|
+
AutomaticExtractedResults: ExtractionResult;
|
|
325
|
+
/** Extraction result after human validation/edits. */
|
|
326
|
+
ValidatedExtractedResults: ExtractionResult;
|
|
327
|
+
/** Document taxonomy describing the schema both results conform to. */
|
|
328
|
+
Taxonomy: DocumentTaxonomy;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Options for `processExtractedData()`.
|
|
332
|
+
*/
|
|
333
|
+
interface ProcessExtractedDataOptions extends FolderScopedOptions {
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Service for the Orchestrator Document Understanding module.
|
|
338
|
+
*
|
|
339
|
+
* Exposes the validation-flow endpoints used by Document Understanding apps to
|
|
340
|
+
* submit exception reports against a task and to process extracted data against
|
|
341
|
+
* a taxonomy. [UiPath Document Understanding Guide](https://docs.uipath.com/document-understanding/automation-cloud/latest)
|
|
342
|
+
*
|
|
343
|
+
* ### Usage
|
|
344
|
+
*
|
|
345
|
+
* Prerequisites: Initialize the SDK first - see [Getting Started](/uipath-typescript/getting-started/#import-initialize)
|
|
346
|
+
*
|
|
347
|
+
* ```typescript
|
|
348
|
+
* import { OrchestratorDuModule } from '@uipath/uipath-typescript/orchestrator-du-module';
|
|
349
|
+
*
|
|
350
|
+
* const orchestratorDuModule = new OrchestratorDuModule(sdk);
|
|
351
|
+
* ```
|
|
352
|
+
*/
|
|
353
|
+
interface OrchestratorDuModuleServiceModel {
|
|
354
|
+
/**
|
|
355
|
+
* Submits an exception report for a Document Understanding validation task.
|
|
356
|
+
*
|
|
357
|
+
* Records that the document under validation cannot be processed normally and captures
|
|
358
|
+
* a reason. The server echoes the submitted payload and signals acceptance via
|
|
359
|
+
* {@link SubmitExceptionReportResponse.IsSuccessful}.
|
|
360
|
+
*
|
|
361
|
+
* @param taskId - Identifier of the validation task the exception applies to.
|
|
362
|
+
* @param documentId - Identifier of the document the exception applies to.
|
|
363
|
+
* @param reason - Free-text reason the document is being reported as an exception.
|
|
364
|
+
* @returns Promise resolving to a {@link SubmitExceptionReportResponse} containing the echoed payload and success status.
|
|
365
|
+
*
|
|
366
|
+
* @example
|
|
367
|
+
* ```typescript
|
|
368
|
+
* import { Tasks, TaskType } from '@uipath/uipath-typescript/tasks';
|
|
369
|
+
*
|
|
370
|
+
* const tasks = new Tasks(sdk);
|
|
371
|
+
*
|
|
372
|
+
* // Fetch the Document Validation task to get its documentId
|
|
373
|
+
* const dvTask = await tasks.getById(<taskId>, { taskType: TaskType.DocumentValidation }, <folderId>);
|
|
374
|
+
* const documentId = dvTask.data?.documentId as string;
|
|
375
|
+
*
|
|
376
|
+
* // Submit an exception report for the validation task
|
|
377
|
+
* const result = await orchestratorDuModule.submitExceptionReport(<taskId>, documentId, '<reason>');
|
|
378
|
+
*
|
|
379
|
+
* if (result.IsSuccessful) {
|
|
380
|
+
* console.log('Exception recorded for', result.SubmitResult?.DocumentId);
|
|
381
|
+
* }
|
|
382
|
+
* ```
|
|
383
|
+
* @internal
|
|
384
|
+
*/
|
|
385
|
+
submitExceptionReport(taskId: number, documentId: string, reason: string, options: SubmitExceptionReportOptions): Promise<SubmitExceptionReportResponse>;
|
|
386
|
+
/**
|
|
387
|
+
* Processes automatically extracted data against validator-edited data and a taxonomy.
|
|
388
|
+
*
|
|
389
|
+
* Sends the automatic extraction result, the validated extraction result, and the
|
|
390
|
+
* document taxonomy to the server, which merges and normalizes the inputs and returns
|
|
391
|
+
* the resulting {@link ExtractionResult}.
|
|
392
|
+
*
|
|
393
|
+
* @param request - Automatic and validated extraction results plus the document taxonomy.
|
|
394
|
+
* @returns Promise resolving to the merged {@link ExtractionResult}.
|
|
395
|
+
*
|
|
396
|
+
* @example
|
|
397
|
+
* ```typescript
|
|
398
|
+
* // Merge automatic and validator-edited extraction results against a taxonomy
|
|
399
|
+
* const result = await orchestratorDuModule.processExtractedData({
|
|
400
|
+
* AutomaticExtractedResults: <automaticExtractionResult>,
|
|
401
|
+
* ValidatedExtractedResults: <validatedData>,
|
|
402
|
+
* Taxonomy: <taxonomy>,
|
|
403
|
+
* });
|
|
404
|
+
*
|
|
405
|
+
* console.log(result.DocumentId, result.ResultsDocument?.DocumentTypeName);
|
|
406
|
+
* ```
|
|
407
|
+
* @internal
|
|
408
|
+
*/
|
|
409
|
+
processExtractedData(request: ProcessExtractedDataRequest, options: ProcessExtractedDataOptions): Promise<ExtractionResult>;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* Simplified universal pagination cursor
|
|
414
|
+
* Used to fetch next/previous pages
|
|
415
|
+
*/
|
|
416
|
+
interface PaginationCursor {
|
|
417
|
+
/** Opaque string containing all information needed to fetch next page */
|
|
418
|
+
value: string;
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Discriminated union for pagination methods - ensures cursor and jumpToPage are mutually exclusive
|
|
422
|
+
*/
|
|
423
|
+
type PaginationMethodUnion = {
|
|
424
|
+
cursor?: PaginationCursor;
|
|
425
|
+
jumpToPage?: never;
|
|
426
|
+
} | {
|
|
427
|
+
cursor?: never;
|
|
428
|
+
jumpToPage?: number;
|
|
429
|
+
} | {
|
|
430
|
+
cursor?: never;
|
|
431
|
+
jumpToPage?: never;
|
|
432
|
+
};
|
|
433
|
+
/**
|
|
434
|
+
* Pagination options. Users cannot specify both cursor and jumpToPage.
|
|
435
|
+
*/
|
|
436
|
+
type PaginationOptions = {
|
|
437
|
+
/** Size of the page to fetch (items per page) */
|
|
438
|
+
pageSize?: number;
|
|
439
|
+
} & PaginationMethodUnion;
|
|
440
|
+
/**
|
|
441
|
+
* Paginated response containing items and navigation information
|
|
442
|
+
*/
|
|
443
|
+
interface PaginatedResponse<T> {
|
|
444
|
+
/** The items in the current page */
|
|
445
|
+
items: T[];
|
|
446
|
+
/** Total count of items across all pages (if available) */
|
|
447
|
+
totalCount?: number;
|
|
448
|
+
/** Whether more pages are available */
|
|
449
|
+
hasNextPage: boolean;
|
|
450
|
+
/** Cursor to fetch the next page (if available) */
|
|
451
|
+
nextCursor?: PaginationCursor;
|
|
452
|
+
/** Cursor to fetch the previous page (if available) */
|
|
453
|
+
previousCursor?: PaginationCursor;
|
|
454
|
+
/** Current page number (1-based, if available) */
|
|
455
|
+
currentPage?: number;
|
|
456
|
+
/** Total number of pages (if available) */
|
|
457
|
+
totalPages?: number;
|
|
458
|
+
/** Whether this pagination type supports jumping to arbitrary pages */
|
|
459
|
+
supportsPageJump: boolean;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Pagination types supported by the SDK
|
|
464
|
+
*/
|
|
465
|
+
declare enum PaginationType {
|
|
466
|
+
OFFSET = "offset",
|
|
467
|
+
TOKEN = "token"
|
|
468
|
+
}
|
|
469
|
+
/**
|
|
470
|
+
* Interface for service access methods needed by pagination helpers
|
|
471
|
+
*/
|
|
472
|
+
interface PaginationServiceAccess {
|
|
473
|
+
get<T>(path: string, options?: any): Promise<{
|
|
474
|
+
data: T;
|
|
475
|
+
}>;
|
|
476
|
+
post<T>(path: string, body?: any, options?: any): Promise<{
|
|
477
|
+
data: T;
|
|
478
|
+
}>;
|
|
479
|
+
requestWithPagination<T>(method: string, path: string, paginationOptions: PaginationOptions, options: RequestWithPaginationOptions): Promise<PaginatedResponse<T>>;
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* Field names for extracting data from paginated responses.
|
|
483
|
+
*/
|
|
484
|
+
interface PaginationFieldNames {
|
|
485
|
+
itemsField?: string;
|
|
486
|
+
totalCountField?: string;
|
|
487
|
+
continuationTokenField?: string;
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* Options for the requestWithPagination method in BaseService.
|
|
491
|
+
*/
|
|
492
|
+
interface RequestWithPaginationOptions extends RequestSpec {
|
|
493
|
+
pagination: PaginationFieldNames & {
|
|
494
|
+
paginationType: PaginationType;
|
|
495
|
+
paginationParams?: {
|
|
496
|
+
pageSizeParam?: string;
|
|
497
|
+
offsetParam?: string;
|
|
498
|
+
tokenParam?: string;
|
|
499
|
+
countParam?: string;
|
|
500
|
+
convertToSkip?: boolean;
|
|
501
|
+
zeroBased?: boolean;
|
|
502
|
+
};
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* HTTP methods supported by the API client
|
|
508
|
+
*/
|
|
509
|
+
type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'OPTIONS';
|
|
510
|
+
/**
|
|
511
|
+
* Supported response types for API requests
|
|
512
|
+
*/
|
|
513
|
+
type ResponseType = 'json' | 'text' | 'blob' | 'arraybuffer' | 'stream';
|
|
514
|
+
/**
|
|
515
|
+
* Query parameters type with support for arrays and nested objects
|
|
516
|
+
*/
|
|
517
|
+
type QueryParams = Record<string, string | number | boolean | Array<string | number | boolean> | null | undefined>;
|
|
518
|
+
/**
|
|
519
|
+
* Standard HTTP headers type
|
|
520
|
+
*/
|
|
521
|
+
type Headers = Record<string, string>;
|
|
522
|
+
/**
|
|
523
|
+
* Options for request retries
|
|
524
|
+
*/
|
|
525
|
+
interface RetryOptions {
|
|
526
|
+
/** Maximum number of retry attempts */
|
|
527
|
+
maxRetries?: number;
|
|
528
|
+
/** Base delay between retries in milliseconds */
|
|
529
|
+
retryDelay?: number;
|
|
530
|
+
/** Whether to use exponential backoff */
|
|
531
|
+
useExponentialBackoff?: boolean;
|
|
532
|
+
/** Status codes that should trigger a retry */
|
|
533
|
+
retryableStatusCodes?: number[];
|
|
534
|
+
}
|
|
535
|
+
/**
|
|
536
|
+
* Options for request timeouts
|
|
537
|
+
*/
|
|
538
|
+
interface TimeoutOptions {
|
|
539
|
+
/** Request timeout in milliseconds */
|
|
540
|
+
timeout?: number;
|
|
541
|
+
/** Whether to abort the request on timeout */
|
|
542
|
+
abortOnTimeout?: boolean;
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* Options for request body transformation
|
|
546
|
+
*/
|
|
547
|
+
interface BodyOptions {
|
|
548
|
+
/** Whether to stringify the body */
|
|
549
|
+
stringify?: boolean;
|
|
550
|
+
/** Content type override */
|
|
551
|
+
contentType?: string;
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
554
|
+
* Pagination metadata for API requests
|
|
555
|
+
*/
|
|
556
|
+
interface PaginationMetadata {
|
|
557
|
+
/** Type of pagination used by the API endpoint */
|
|
558
|
+
paginationType: PaginationType;
|
|
559
|
+
/** Response field containing items array (defaults to 'value') */
|
|
560
|
+
itemsField?: string;
|
|
561
|
+
/** Response field containing total count (defaults to '@odata.count') */
|
|
562
|
+
totalCountField?: string;
|
|
563
|
+
/** Response field containing continuation token (defaults to 'continuationToken') */
|
|
564
|
+
continuationTokenField?: string;
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* Base interface for all API requests
|
|
568
|
+
*/
|
|
569
|
+
interface RequestSpec {
|
|
570
|
+
/** HTTP method for the request */
|
|
571
|
+
method?: HttpMethod;
|
|
572
|
+
/** URL endpoint for the request */
|
|
573
|
+
url?: string;
|
|
574
|
+
/** Query parameters to be appended to the URL */
|
|
575
|
+
params?: QueryParams;
|
|
576
|
+
/** HTTP headers to include with the request */
|
|
577
|
+
headers?: Headers;
|
|
578
|
+
/** Raw body content (takes precedence over data) */
|
|
579
|
+
body?: unknown;
|
|
580
|
+
/** Expected response type */
|
|
581
|
+
responseType?: ResponseType;
|
|
582
|
+
/** Request timeout options */
|
|
583
|
+
timeoutOptions?: TimeoutOptions;
|
|
584
|
+
/** Retry behavior options */
|
|
585
|
+
retryOptions?: RetryOptions;
|
|
586
|
+
/** Body transformation options */
|
|
587
|
+
bodyOptions?: BodyOptions;
|
|
588
|
+
/** AbortSignal for cancelling the request */
|
|
589
|
+
signal?: AbortSignal;
|
|
590
|
+
/** Pagination metadata for the request */
|
|
591
|
+
pagination?: PaginationMetadata;
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
interface ApiResponse<T> {
|
|
595
|
+
data: T;
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* Base class for all UiPath SDK services.
|
|
599
|
+
*
|
|
600
|
+
* Provides common functionality for authentication, configuration, and API communication.
|
|
601
|
+
* All service classes extend this base to inherit dependency injection and HTTP client access.
|
|
602
|
+
*
|
|
603
|
+
* This class implements the dependency injection pattern where services receive a configured
|
|
604
|
+
* UiPath instance. The ApiClient is created internally and handles all HTTP operations
|
|
605
|
+
* including authentication token management.
|
|
606
|
+
*
|
|
607
|
+
* @remarks
|
|
608
|
+
* Service classes should extend this base and call `super(uiPath)` in their constructor.
|
|
609
|
+
* Protected HTTP methods (get, post, put, patch, delete) are available to all subclasses.
|
|
610
|
+
*
|
|
611
|
+
*/
|
|
612
|
+
declare class BaseService {
|
|
613
|
+
#private;
|
|
614
|
+
/**
|
|
615
|
+
* SDK configuration (read-only). Available to subclasses so they can
|
|
616
|
+
* fall back to init-time defaults like `folderKey`.
|
|
617
|
+
*/
|
|
618
|
+
protected readonly config: {
|
|
619
|
+
folderKey?: string;
|
|
620
|
+
};
|
|
621
|
+
/**
|
|
622
|
+
* Creates a base service instance with dependency injection.
|
|
623
|
+
*
|
|
624
|
+
* Extracts configuration, execution context, and token manager from the UiPath instance
|
|
625
|
+
* to initialize an authenticated API client. The ApiClient handles all HTTP operations
|
|
626
|
+
* and token management internally.
|
|
627
|
+
*
|
|
628
|
+
* @param instance - UiPath SDK instance providing authentication and configuration.
|
|
629
|
+
* Services receive this via dependency injection in the modular pattern.
|
|
630
|
+
* @param headers - Optional default headers to include in every request (e.g. `x-uipath-external-user-id` for
|
|
631
|
+
* CAS external-app auth)
|
|
632
|
+
*
|
|
633
|
+
* @example
|
|
634
|
+
* ```typescript
|
|
635
|
+
* // Services automatically call this via super()
|
|
636
|
+
* export class EntityService extends BaseService {
|
|
637
|
+
* constructor(instance: IUiPath) {
|
|
638
|
+
* super(instance); // Initializes the internal ApiClient
|
|
639
|
+
* }
|
|
640
|
+
* }
|
|
641
|
+
*
|
|
642
|
+
* // Usage in modular pattern
|
|
643
|
+
* import { UiPath } from '@uipath/uipath-typescript/core';
|
|
644
|
+
* import { Entities } from '@uipath/uipath-typescript/entities';
|
|
645
|
+
*
|
|
646
|
+
* const sdk = new UiPath(config);
|
|
647
|
+
* await sdk.initialize();
|
|
648
|
+
* const entities = new Entities(sdk);
|
|
649
|
+
* ```
|
|
650
|
+
*/
|
|
651
|
+
constructor(instance: IUiPath, headers?: Record<string, string>);
|
|
652
|
+
/**
|
|
653
|
+
* Gets a valid authentication token, refreshing if necessary.
|
|
654
|
+
* Use this when you need to manually add Authorization headers (e.g., direct uploads).
|
|
655
|
+
*
|
|
656
|
+
* @returns Promise resolving to a valid access token string
|
|
657
|
+
* @throws AuthenticationError if no token is available or refresh fails
|
|
658
|
+
*/
|
|
659
|
+
protected getValidAuthToken(): Promise<string>;
|
|
660
|
+
/**
|
|
661
|
+
* Creates a service accessor for pagination helpers
|
|
662
|
+
* This allows pagination helpers to access protected methods without making them public
|
|
663
|
+
*/
|
|
664
|
+
protected createPaginationServiceAccess(): PaginationServiceAccess;
|
|
665
|
+
protected request<T>(method: string, path: string, options?: RequestSpec): Promise<ApiResponse<T>>;
|
|
666
|
+
protected requestWithSpec<T>(spec: RequestSpec): Promise<ApiResponse<T>>;
|
|
667
|
+
protected get<T>(path: string, options?: RequestSpec): Promise<ApiResponse<T>>;
|
|
668
|
+
protected post<T>(path: string, data?: unknown, options?: RequestSpec): Promise<ApiResponse<T>>;
|
|
669
|
+
protected put<T>(path: string, data?: unknown, options?: RequestSpec): Promise<ApiResponse<T>>;
|
|
670
|
+
protected patch<T>(path: string, data?: unknown, options?: RequestSpec): Promise<ApiResponse<T>>;
|
|
671
|
+
protected delete<T>(path: string, options?: RequestSpec): Promise<ApiResponse<T>>;
|
|
672
|
+
/**
|
|
673
|
+
* Execute a request with cursor-based pagination
|
|
674
|
+
*/
|
|
675
|
+
protected requestWithPagination<T>(method: string, path: string, paginationOptions: PaginationOptions, options: RequestWithPaginationOptions): Promise<PaginatedResponse<T>>;
|
|
676
|
+
/**
|
|
677
|
+
* Validates and prepares pagination parameters from options
|
|
678
|
+
*/
|
|
679
|
+
private validateAndPreparePaginationParams;
|
|
680
|
+
/**
|
|
681
|
+
* Prepares request parameters for pagination based on pagination type
|
|
682
|
+
*/
|
|
683
|
+
private preparePaginationRequestParams;
|
|
684
|
+
/**
|
|
685
|
+
* Creates a paginated response from API response
|
|
686
|
+
*/
|
|
687
|
+
private createPaginatedResponseFromResponse;
|
|
688
|
+
/**
|
|
689
|
+
* Determines if there are more pages based on pagination type and metadata
|
|
690
|
+
*/
|
|
691
|
+
private determineHasMorePages;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
/**
|
|
695
|
+
* Service for the Orchestrator Document Understanding module.
|
|
696
|
+
*/
|
|
697
|
+
declare class OrchestratorDuModuleService extends BaseService implements OrchestratorDuModuleServiceModel {
|
|
698
|
+
/**
|
|
699
|
+
* Submits an exception report for a Document Understanding validation task.
|
|
700
|
+
*
|
|
701
|
+
* Records that the document under validation cannot be processed normally and captures
|
|
702
|
+
* a reason. The server echoes the submitted payload and signals acceptance via
|
|
703
|
+
* {@link SubmitExceptionReportResponse.IsSuccessful}.
|
|
704
|
+
*
|
|
705
|
+
* @param taskId - Identifier of the validation task the exception applies to.
|
|
706
|
+
* @param documentId - Identifier of the document the exception applies to.
|
|
707
|
+
* @param reason - Free-text reason the document is being reported as an exception.
|
|
708
|
+
* @returns Promise resolving to a {@link SubmitExceptionReportResponse} containing the echoed payload and success status.
|
|
709
|
+
*
|
|
710
|
+
* @example
|
|
711
|
+
* ```typescript
|
|
712
|
+
* import { Tasks, TaskType } from '@uipath/uipath-typescript/tasks';
|
|
713
|
+
*
|
|
714
|
+
* const tasks = new Tasks(sdk);
|
|
715
|
+
*
|
|
716
|
+
* // Fetch the Document Validation task to get its documentId
|
|
717
|
+
* const dvTask = await tasks.getById(<taskId>, { taskType: TaskType.DocumentValidation }, <folderId>);
|
|
718
|
+
* const documentId = dvTask.data?.documentId as string;
|
|
719
|
+
*
|
|
720
|
+
* // Submit an exception report for the validation task
|
|
721
|
+
* const result = await orchestratorDuModule.submitExceptionReport(<taskId>, documentId, '<reason>');
|
|
722
|
+
*
|
|
723
|
+
* if (result.IsSuccessful) {
|
|
724
|
+
* console.log('Exception recorded for', result.SubmitResult?.DocumentId);
|
|
725
|
+
* }
|
|
726
|
+
* ```
|
|
727
|
+
* @internal
|
|
728
|
+
*/
|
|
729
|
+
submitExceptionReport(taskId: number, documentId: string, reason: string, options: SubmitExceptionReportOptions): Promise<SubmitExceptionReportResponse>;
|
|
730
|
+
/**
|
|
731
|
+
* Processes automatically extracted data against validator-edited data and a taxonomy.
|
|
732
|
+
*
|
|
733
|
+
* Sends the automatic extraction result, the validated extraction result, and the
|
|
734
|
+
* document taxonomy to the server, which merges and normalizes the inputs and returns
|
|
735
|
+
* the resulting {@link ExtractionResult}.
|
|
736
|
+
*
|
|
737
|
+
* @param request - Automatic and validated extraction results plus the document taxonomy.
|
|
738
|
+
* @returns Promise resolving to the merged {@link ExtractionResult}.
|
|
739
|
+
*
|
|
740
|
+
* @example
|
|
741
|
+
* ```typescript
|
|
742
|
+
* // Merge automatic and validator-edited extraction results against a taxonomy
|
|
743
|
+
* const result = await orchestratorDuModule.processExtractedData({
|
|
744
|
+
* AutomaticExtractedResults: <automaticExtractionResult>,
|
|
745
|
+
* ValidatedExtractedResults: <validatedData>,
|
|
746
|
+
* Taxonomy: <taxonomy>,
|
|
747
|
+
* });
|
|
748
|
+
*
|
|
749
|
+
* console.log(result.DocumentId, result.ResultsDocument?.DocumentTypeName);
|
|
750
|
+
* ```
|
|
751
|
+
* @internal
|
|
752
|
+
*/
|
|
753
|
+
processExtractedData(request: ProcessExtractedDataRequest, options: ProcessExtractedDataOptions): Promise<ExtractionResult>;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
export { OrchestratorDuModuleService as OrchestratorDuModule, OrchestratorDuModuleService };
|
|
757
|
+
export type { ExceptionReportSubmitResult, OrchestratorDuModuleServiceModel, ProcessExtractedDataOptions, ProcessExtractedDataRequest, SubmitExceptionReportOptions, SubmitExceptionReportResponse };
|