Skip to content

Commit 393b74d

Browse files
feat(integration-service): add Elements service [JAR-IS-3]
Adds the Integration Service Elements service (objects, activities, object metadata, and event-object reads at both connector and connection- instance scope) exposed via the @uipath/uipath-typescript/is-elements subpath. Includes ELEMENT_ENDPOINTS constants, unit tests, OAuth scope docs, and mkdocs nav. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent c4bfefb commit 393b74d

12 files changed

Lines changed: 1157 additions & 2 deletions

File tree

docs/oauth-scopes.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,20 @@ This page lists the specific OAuth scopes required in external app for each SDK
2020
| `ping()` | `ConnectionService` or `ConnectionServiceUser` |
2121
| `reauthenticate()` | `ConnectionService` |
2222

23+
## Integration Service — Elements
24+
25+
| Method | OAuth Scope |
26+
|--------|-------------|
27+
| `getObjects()` | `ConnectionService` or `ConnectionServiceUser` |
28+
| `getActivities()` | `ConnectionService` or `ConnectionServiceUser` |
29+
| `getObjectMetadata()` | `ConnectionService` or `ConnectionServiceUser` |
30+
| `getEventObjects()` | `ConnectionService` or `ConnectionServiceUser` |
31+
| `getEventObjectMetadata()` | `ConnectionService` or `ConnectionServiceUser` |
32+
| `getInstanceObjects()` | `ConnectionService` or `ConnectionServiceUser` |
33+
| `getInstanceObjectMetadata()` | `ConnectionService` or `ConnectionServiceUser` |
34+
| `getInstanceEventObjects()` | `ConnectionService` or `ConnectionServiceUser` |
35+
| `getInstanceEventObjectMetadata()` | `ConnectionService` or `ConnectionServiceUser` |
36+
2337
## Assets
2438

2539
| Method | OAuth Scope |

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ nav:
202202
- Integration Service:
203203
- Connectors: api/interfaces/ConnectorsServiceModel.md
204204
- Connections: api/interfaces/ConnectionsServiceModel.md
205+
- Elements: api/interfaces/ElementsServiceModel.md
205206
- Maestro:
206207
- Processes: api/interfaces/MaestroProcessesServiceModel.md
207208
- Process Instances: api/interfaces/ProcessInstancesServiceModel.md

package.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,16 @@
226226
"default": "./dist/is-connectors/index.cjs"
227227
}
228228
},
229+
"./is-elements": {
230+
"import": {
231+
"types": "./dist/is-elements/index.d.ts",
232+
"default": "./dist/is-elements/index.mjs"
233+
},
234+
"require": {
235+
"types": "./dist/is-elements/index.d.ts",
236+
"default": "./dist/is-elements/index.cjs"
237+
}
238+
},
229239
"./is-connections": {
230240
"import": {
231241
"types": "./dist/is-connections/index.d.ts",

rollup.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,11 @@ const serviceEntries = [
234234
input: 'src/services/integration-service/connectors/index.ts',
235235
output: 'is-connectors/index'
236236
},
237+
{
238+
name: 'is-elements',
239+
input: 'src/services/integration-service/elements/index.ts',
240+
output: 'is-elements/index'
241+
},
237242
{
238243
name: 'is-connections',
239244
input: 'src/services/integration-service/connections/index.ts',
Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
/**
2+
* Integration Service — Elements models
3+
*
4+
* Read-only catalog/metadata APIs — no entity binding.
5+
*/
6+
7+
import {
8+
ElementObject,
9+
ElementActivity,
10+
ElementObjectMetadataResponse,
11+
ElementEventObject,
12+
ElementEventObjectMetadataResponse,
13+
ElementObjectsGetOptions,
14+
ElementActivitiesGetOptions,
15+
ElementObjectMetadataGetOptions,
16+
ElementEventObjectsGetOptions,
17+
ElementEventObjectMetadataGetOptions,
18+
} from './elements.types';
19+
20+
/**
21+
* Service for inspecting connector elements (objects, activities, trigger events,
22+
* field schemas) on UiPath Integration Service.
23+
*
24+
* The Elements API powers design-time tooling — every connector exposes a
25+
* catalog of *objects* (resources like `contacts`, `messages`), *activities*
26+
* (curated operations like `Send Email`), and *event objects* (trigger sources
27+
* like `New Message`). Each can be inspected statically (connector-only) or
28+
* scoped to a connection instance (which enriches the response with custom
29+
* fields discovered from the live system).
30+
*
31+
* ### Usage
32+
*
33+
* Prerequisites: Initialize the SDK first - see [Getting Started](/uipath-typescript/getting-started/#import-initialize)
34+
*
35+
* ```typescript
36+
* import { Elements } from '@uipath/uipath-typescript/is-elements';
37+
*
38+
* const elements = new Elements(sdk);
39+
* const objects = await elements.getObjects('uipath-slack');
40+
* ```
41+
*/
42+
export interface ElementsServiceModel {
43+
/**
44+
* List objects (resources) exposed by a connector.
45+
*
46+
* @param elementKey - Connector key (e.g. `uipath-slack`)
47+
* @param options - Filtering options (type, subtype, hasEvents, hasBulk)
48+
* @returns Promise resolving to an array of {@link ElementObject}
49+
* @example
50+
* ```typescript
51+
* import { Elements } from '@uipath/uipath-typescript/is-elements';
52+
*
53+
* const elements = new Elements(sdk);
54+
*
55+
* const objects = await elements.getObjects('uipath-slack');
56+
* for (const obj of objects) {
57+
* console.log(`${obj.name} — ${obj.displayName}`);
58+
* }
59+
* ```
60+
*
61+
* @example
62+
* ```typescript
63+
* // Only objects that support events
64+
* const eventCapable = await elements.getObjects('uipath-slack', { hasEvents: true });
65+
* ```
66+
*/
67+
getObjects(elementKey: string, options?: ElementObjectsGetOptions): Promise<ElementObject[]>;
68+
69+
/**
70+
* List curated activities exposed by a connector.
71+
*
72+
* @param elementKey - Connector key
73+
* @param options - Optional `version` to pin to a specific connector schema
74+
* @returns Promise resolving to an array of {@link ElementActivity}
75+
* @example
76+
* ```typescript
77+
* const activities = await elements.getActivities('uipath-slack');
78+
* for (const activity of activities) {
79+
* console.log(`${activity.name}: ${activity.operation} on ${activity.objectName}`);
80+
* }
81+
* ```
82+
*/
83+
getActivities(elementKey: string, options?: ElementActivitiesGetOptions): Promise<ElementActivity[]>;
84+
85+
/**
86+
* Get metadata for a single connector object (field schema, supported methods,
87+
* parameters). Connection-independent — returns the standard schema only.
88+
*
89+
* @param elementKey - Connector key
90+
* @param objectName - Object name (e.g. `messages`)
91+
* @param options - Optional `version`, `hydrateParameters`, `includeParentArray`
92+
* @returns Promise resolving to an {@link ElementObjectMetadataResponse}
93+
* @example
94+
* ```typescript
95+
* const meta = await elements.getObjectMetadata('uipath-slack', 'messages');
96+
* console.log(`Fields: ${Object.keys(meta.fields ?? {}).length}`);
97+
* ```
98+
*/
99+
getObjectMetadata(
100+
elementKey: string,
101+
objectName: string,
102+
options?: ElementObjectMetadataGetOptions,
103+
): Promise<ElementObjectMetadataResponse>;
104+
105+
/**
106+
* List event objects (trigger sources) for a connector's event operation.
107+
*
108+
* @param elementKey - Connector key
109+
* @param operationName - Event operation name (e.g. `INDEX_COMPLETED`)
110+
* @param options - Optional `version`
111+
* @returns Promise resolving to an array of {@link ElementEventObject}
112+
* @example
113+
* ```typescript
114+
* const events = await elements.getEventObjects('uipath-slack', 'NEW_MESSAGE');
115+
* ```
116+
*/
117+
getEventObjects(
118+
elementKey: string,
119+
operationName: string,
120+
options?: ElementEventObjectsGetOptions,
121+
): Promise<ElementEventObject[]>;
122+
123+
/**
124+
* Get metadata for a single event object.
125+
*
126+
* @param elementKey - Connector key
127+
* @param operationName - Event operation name
128+
* @param objectName - Event object name
129+
* @param options - Optional `version`, `allFields`, `includeParentArray`
130+
* @returns Promise resolving to an {@link ElementEventObjectMetadataResponse}
131+
* @example
132+
* ```typescript
133+
* const meta = await elements.getEventObjectMetadata(
134+
* 'uipath-slack',
135+
* 'NEW_MESSAGE',
136+
* 'channels',
137+
* );
138+
* ```
139+
*/
140+
getEventObjectMetadata(
141+
elementKey: string,
142+
operationName: string,
143+
objectName: string,
144+
options?: ElementEventObjectMetadataGetOptions,
145+
): Promise<ElementEventObjectMetadataResponse>;
146+
147+
/**
148+
* List objects exposed by a connection instance (includes connector custom
149+
* fields discovered from the live system).
150+
*
151+
* @param connectionId - Connection GUID
152+
* @param elementKey - Connector key
153+
* @param options - Filtering options
154+
* @returns Promise resolving to an array of {@link ElementObject}
155+
* @example
156+
* ```typescript
157+
* const objects = await elements.getInstanceObjects('<connectionId>', 'uipath-slack');
158+
* ```
159+
*/
160+
getInstanceObjects(
161+
connectionId: string,
162+
elementKey: string,
163+
options?: ElementObjectsGetOptions,
164+
): Promise<ElementObject[]>;
165+
166+
/**
167+
* Get instance-scoped metadata for a single object — includes connector
168+
* custom fields discovered from the live system.
169+
*
170+
* @param connectionId - Connection GUID
171+
* @param elementKey - Connector key
172+
* @param objectName - Object name
173+
* @param options - Optional `version`, `hydrateParameters`, `includeParentArray`
174+
* @returns Promise resolving to an {@link ElementObjectMetadataResponse}
175+
* @example
176+
* ```typescript
177+
* const meta = await elements.getInstanceObjectMetadata(
178+
* '<connectionId>',
179+
* 'uipath-salesforce',
180+
* 'Account',
181+
* );
182+
* ```
183+
*/
184+
getInstanceObjectMetadata(
185+
connectionId: string,
186+
elementKey: string,
187+
objectName: string,
188+
options?: ElementObjectMetadataGetOptions,
189+
): Promise<ElementObjectMetadataResponse>;
190+
191+
/**
192+
* List event objects for a connection instance.
193+
*
194+
* @param connectionId - Connection GUID
195+
* @param elementKey - Connector key
196+
* @param operationName - Event operation name
197+
* @param options - Optional `version`
198+
* @returns Promise resolving to an array of {@link ElementEventObject}
199+
* @example
200+
* ```typescript
201+
* const events = await elements.getInstanceEventObjects(
202+
* '<connectionId>',
203+
* 'uipath-slack',
204+
* 'NEW_MESSAGE',
205+
* );
206+
* ```
207+
*/
208+
getInstanceEventObjects(
209+
connectionId: string,
210+
elementKey: string,
211+
operationName: string,
212+
options?: ElementEventObjectsGetOptions,
213+
): Promise<ElementEventObject[]>;
214+
215+
/**
216+
* Get instance-scoped metadata for a single event object.
217+
*
218+
* @param connectionId - Connection GUID
219+
* @param elementKey - Connector key
220+
* @param operationName - Event operation name
221+
* @param objectName - Event object name
222+
* @param options - Optional `version`, `allFields`, `includeParentArray`
223+
* @returns Promise resolving to an {@link ElementEventObjectMetadataResponse}
224+
* @example
225+
* ```typescript
226+
* const meta = await elements.getInstanceEventObjectMetadata(
227+
* '<connectionId>',
228+
* 'uipath-slack',
229+
* 'NEW_MESSAGE',
230+
* 'channels',
231+
* );
232+
* ```
233+
*/
234+
getInstanceEventObjectMetadata(
235+
connectionId: string,
236+
elementKey: string,
237+
operationName: string,
238+
objectName: string,
239+
options?: ElementEventObjectMetadataGetOptions,
240+
): Promise<ElementEventObjectMetadataResponse>;
241+
}

0 commit comments

Comments
 (0)