@uipath/integrationservice-sdk 0.1.5

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.
Files changed (3) hide show
  1. package/README.md +233 -0
  2. package/dist/index.js +45549 -0
  3. package/package.json +45 -0
package/README.md ADDED
@@ -0,0 +1,233 @@
1
+ # Integration Service SDK
2
+
3
+ TypeScript SDK for UiPath Integration Service APIs.
4
+
5
+ ## Overview
6
+
7
+ The Integration Service SDK provides a strongly-typed TypeScript client for interacting with UiPath Integration Service APIs. It handles authentication, HTTP requests, and type conversions automatically.
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ bun install @uipath/integrationservice-sdk
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ### Using createApiClient (Recommended)
18
+
19
+ The easiest way to create a client. It reads login state from `@uipath/auth` automatically:
20
+
21
+ ```typescript
22
+ import { createApiClient } from "@uipath/integrationservice-sdk";
23
+
24
+ const client = await createApiClient();
25
+
26
+ // Or with a specific tenant
27
+ const client = await createApiClient({ tenant: "my-tenant" });
28
+ ```
29
+
30
+ ### Manual Setup
31
+
32
+ If you need full control over the configuration:
33
+
34
+ ```typescript
35
+ import { IntegrationServiceClient } from "@uipath/integrationservice-sdk";
36
+
37
+ const client = new IntegrationServiceClient({
38
+ baseUrl: "https://cloud.uipath.com",
39
+ accessToken: "your-access-token",
40
+ organizationId: "your-org-id",
41
+ tenantName: "your-tenant",
42
+ });
43
+ ```
44
+
45
+ ### List Connectors
46
+
47
+ ```typescript
48
+ const connectors = await client.listConnectors();
49
+
50
+ connectors.forEach(connector => {
51
+ logger.info(`- ${connector.name} (${connector.key})`);
52
+ });
53
+ ```
54
+
55
+ ### Get Connector by Key
56
+
57
+ ```typescript
58
+ const connector = await client.getConnectorByKey("uipath-salesforce-sfdc");
59
+ ```
60
+
61
+ ### List Connections
62
+
63
+ ```typescript
64
+ // List all connections for a connector
65
+ const connections = await client.listConnections("uipath-salesforce-sfdc");
66
+
67
+ // List connections in specific folder
68
+ const folderConnections = await client.listConnections(
69
+ "uipath-salesforce-sfdc",
70
+ "my-folder-key"
71
+ );
72
+ ```
73
+
74
+ ### Create Connection (OAuth Flow)
75
+
76
+ ```typescript
77
+ // Step 1: Initiate connection creation
78
+ const createResponse = await client.createConnection("uipath-doist-todoist");
79
+
80
+ // Step 2: Open createResponse.authUrl in browser for user to authenticate
81
+
82
+ // Step 3: Poll session status
83
+ let status = await client.getSessionStatus(createResponse.sessionId);
84
+
85
+ while (status.status === "pending") {
86
+ await new Promise(resolve => setTimeout(resolve, 5000));
87
+ status = await client.getSessionStatus(createResponse.sessionId);
88
+ }
89
+
90
+ if (status.status === "success") {
91
+ // Connection created
92
+ }
93
+ ```
94
+
95
+ ### List Objects
96
+
97
+ ```typescript
98
+ const objects = await client.listObjects(
99
+ "uipath-zoho-desk",
100
+ "connection-id-here"
101
+ );
102
+ ```
103
+
104
+ ### List Activities
105
+
106
+ ```typescript
107
+ const activities = await client.listActivities("uipath-zoho-desk");
108
+ ```
109
+
110
+ ### List Resources
111
+
112
+ ```typescript
113
+ // Without connection ID (elements endpoint)
114
+ const resources = await client.listResources("uipath-salesforce-sfdc");
115
+
116
+ // With connection ID (instances endpoint)
117
+ const resources = await client.listResources("uipath-salesforce-sfdc", "connection-id");
118
+ ```
119
+
120
+ ### Get Resource Metadata
121
+
122
+ ```typescript
123
+ // Without connection ID
124
+ const metadata = await client.getResourceMetadata("uipath-salesforce-sfdc", "Account");
125
+
126
+ // With connection ID
127
+ const metadata = await client.getResourceMetadata("uipath-salesforce-sfdc", "Account", "connection-id");
128
+ ```
129
+
130
+ ### Execute Operations
131
+
132
+ ```typescript
133
+ // GET operation (list records)
134
+ const tickets = await client.executeOperation("connection-id", "tickets", "GET");
135
+
136
+ // GET with query parameters
137
+ const filtered = await client.executeOperation(
138
+ "connection-id",
139
+ "tickets",
140
+ "GET",
141
+ undefined,
142
+ { limit: "10", offset: "0" }
143
+ );
144
+
145
+ // POST operation (create record)
146
+ const newTicket = await client.executeOperation(
147
+ "connection-id",
148
+ "tickets",
149
+ "POST",
150
+ { subject: "New Support Ticket", priority: "high" }
151
+ );
152
+
153
+ // PATCH operation (update record)
154
+ await client.executeOperation(
155
+ "connection-id",
156
+ "tickets",
157
+ "PATCH",
158
+ { id: "123", status: "closed" }
159
+ );
160
+
161
+ // DELETE operation
162
+ await client.executeOperation(
163
+ "connection-id",
164
+ "tickets",
165
+ "DELETE",
166
+ undefined,
167
+ { id: "123" }
168
+ );
169
+ ```
170
+
171
+ ---
172
+
173
+ ## API Reference
174
+
175
+ ### createApiClient(options?)
176
+
177
+ Factory function that creates an `IntegrationServiceClient` using the current login session from `@uipath/auth`.
178
+
179
+ ```typescript
180
+ import { createApiClient } from "@uipath/integrationservice-sdk";
181
+
182
+ const client = await createApiClient({ tenant: "my-tenant" });
183
+ ```
184
+
185
+ **Options:**
186
+ - `tenant` - Optional tenant name override. Falls back to the tenant from login session.
187
+
188
+ **Throws:** Error if not logged in or tenant is not available.
189
+
190
+ ---
191
+
192
+ ### IntegrationServiceClient
193
+
194
+ #### Constructor
195
+
196
+ ```typescript
197
+ constructor(config: IntegrationServiceConfig)
198
+ ```
199
+
200
+ **Parameters:**
201
+ - `config.baseUrl` - UiPath base URL (e.g., "https://cloud.uipath.com")
202
+ - `config.accessToken` - OAuth access token
203
+ - `config.organizationId` - Organization/Account ID
204
+ - `config.tenantName` - Tenant name
205
+
206
+ #### Methods
207
+
208
+ | Method | Description |
209
+ |--------|-------------|
210
+ | `listConnectors()` | List all available connectors |
211
+ | `getConnectorByKey(key)` | Get a specific connector by key |
212
+ | `listConnections(connectorKey, folderKey?)` | List connections for a connector |
213
+ | `createConnection(connectorKey)` | Initiate OAuth connection creation |
214
+ | `getSessionStatus(sessionId)` | Get OAuth session status |
215
+ | `listObjects(connectorKey, connectionId)` | List objects for a connection |
216
+ | `listActivities(connectorKey)` | List activities for a connector |
217
+ | `listResources(connectorKey, connectionId?)` | List resources (with/without connection) |
218
+ | `getResourceMetadata(connectorKey, objectName, connectionId?)` | Get resource field metadata |
219
+ | `executeOperation(connectionId, objectName, httpMethod?, body?, queryParams?)` | Execute an operation on a resource |
220
+
221
+ ---
222
+
223
+ ## Related Packages
224
+
225
+ - `@uipath/integrationservice-tool` - CLI tool using this SDK
226
+ - `@uipath/orchestrator-sdk` - Orchestrator API SDK
227
+ - `@uipath/solution-sdk` - Solution API SDK
228
+
229
+ ---
230
+
231
+ ## License
232
+
233
+ Copyright (c) UiPath. All rights reserved.