@composio/core 0.1.12-alpha.7 → 0.1.12-alpha.8
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 +20 -0
- package/dist/index.cjs +540 -142
- package/dist/index.d.cts +926 -124
- package/dist/index.d.ts +926 -124
- package/dist/index.js +540 -142
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -145,6 +145,26 @@ const connectionRequest = await composio.createConnectedAccount(
|
|
|
145
145
|
const connectedAccount = await connectionRequest.waitForConnection();
|
|
146
146
|
```
|
|
147
147
|
|
|
148
|
+
### Waiting for Connection Establishment
|
|
149
|
+
|
|
150
|
+
The `waitForConnection` method is available on both the `ConnectionRequest` and `ConnectedAccounts` classes. It allows you to poll for a connection to become active:
|
|
151
|
+
|
|
152
|
+
```typescript
|
|
153
|
+
// From a ConnectionRequest instance (returned by createConnectedAccount)
|
|
154
|
+
const connectedAccount = await connectionRequest.waitForConnection(120000); // 2 minute timeout
|
|
155
|
+
|
|
156
|
+
// From the ConnectedAccounts class (using a connected account ID)
|
|
157
|
+
const connectedAccount = await composio.connectedAccounts.waitForConnection('conn_abc123', 60000); // 1 minute timeout
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
The method continuously polls the Composio API until the connection:
|
|
161
|
+
|
|
162
|
+
- Becomes `ACTIVE` (returns the connected account)
|
|
163
|
+
- Enters a terminal state like `FAILED`, `EXPIRED`, or `DELETED` (throws an error)
|
|
164
|
+
- Exceeds the specified timeout (throws a timeout error)
|
|
165
|
+
|
|
166
|
+
If the connection does not complete within the provided timeout (default: 60 seconds), a `ConnectionRequestTimeoutError` is thrown.
|
|
167
|
+
|
|
148
168
|
### Managing Connected Accounts
|
|
149
169
|
|
|
150
170
|
```typescript
|