@composio/client 2.0.0-rc.17 → 2.0.0-rc.19
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 +136 -40
- package/dist/{api-key-revocation-lc3308Ao.mjs → api-key-revocation-DMCgun-A.mjs} +1 -1
- package/dist/{auth-DkGiEaxg.mjs → auth-D-U9Aq8C.mjs} +1 -1
- package/dist/{auth-configs-DbxqGahP.mjs → auth-configs-DAG5mMeH.mjs} +1 -1
- package/dist/{clanker-fK9cAkTz.mjs → clanker-Yomp86hJ.mjs} +1 -1
- package/dist/{cli-K1MskpaR.mjs → cli-zihiw3aI.mjs} +4 -5
- package/dist/{connected-accounts-Bfl7_SY_.mjs → connected-accounts-Bd4AbWoH.mjs} +1 -1
- package/dist/{consumer-5o2zMQwr.mjs → consumer-Bk0cyIii.mjs} +6 -7
- package/dist/{custom-8rs-sHnb.mjs → custom-Ce8G2c11.mjs} +1 -1
- package/dist/{custom-wEkSiPHn.mjs → custom-DWT3cCog.mjs} +1 -1
- package/dist/effect.d.mts +29 -42
- package/dist/effect.mjs +217 -192
- package/dist/{error-D9cG225M.mjs → error-Bw7_G2NZ.mjs} +1 -1
- package/dist/{files-BPKJXlpc.mjs → files-DRp_J4zH.mjs} +1 -1
- package/dist/{files-BjPFzRnM.mjs → files-ZxEVlE_y.mjs} +1 -1
- package/dist/{generate-DDHNgbPS.mjs → generate-Du9XUrlx.mjs} +1 -1
- package/dist/{generated-deprecated-inputs--L5LHDO_.mjs → generated-deprecated-inputs-Dy_lBver.mjs} +2 -2
- package/dist/{generated-operations-D1e__yar.mjs → generated-operations-Dv7pAKDT.mjs} +354 -226
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +104 -154
- package/dist/{keyring-Dkm6DQIp.mjs → keyring-CgOIS5x7.mjs} +1 -1
- package/dist/{link-BBU-J5L_.mjs → link-CW1ts4pm.mjs} +1 -1
- package/dist/{logs-CuuysWk1.mjs → logs-DFdH5DoT.mjs} +3 -3
- package/dist/{manage-B1R7I3ZM.mjs → manage-CeB03gO8.mjs} +1 -1
- package/dist/{mcp-C3beSy48.mjs → mcp-DNRMWWum.mjs} +3 -3
- package/dist/{org-B13XOuKh.mjs → org-HuYaKgVf.mjs} +6 -6
- package/dist/{owner-BAr5uwk3.mjs → owner-I9fXmIO_.mjs} +1 -1
- package/dist/{pagination-rules-uMUdPq_7.mjs → pagination-rules-CMnBwktJ.mjs} +1 -1
- package/dist/pagination.mjs +1 -1
- package/dist/{project-CDm8tjUw.mjs → project-CxQ2H8UB.mjs} +1 -1
- package/dist/{project-DF5KclHm.mjs → project-DcV01umC.mjs} +4 -7
- package/dist/{project-BbCgXD83.mjs → project-Dwblmpw8.mjs} +1 -1
- package/dist/{project-C30H_5b6.mjs → project-FuP5k9R1.mjs} +1 -1
- package/dist/{realtime-6LigMh83.mjs → realtime-F_sGuTd8.mjs} +1 -1
- package/dist/resources/api-key-revocation.d.mts +1 -1
- package/dist/resources/api-key-revocation.mjs +1 -1
- package/dist/resources/auth/auth.d.mts +1 -1
- package/dist/resources/auth/auth.mjs +1 -1
- package/dist/resources/auth/index.d.mts +1 -1
- package/dist/resources/auth/index.mjs +2 -2
- package/dist/resources/auth/session.d.mts +1 -1
- package/dist/resources/auth/session.mjs +1 -1
- package/dist/resources/auth-configs.d.mts +1 -1
- package/dist/resources/auth-configs.mjs +1 -1
- package/dist/resources/auth.d.mts +1 -1
- package/dist/resources/auth.mjs +2 -2
- package/dist/resources/cli/cli.d.mts +1 -1
- package/dist/resources/cli/cli.mjs +1 -1
- package/dist/resources/cli/index.d.mts +1 -1
- package/dist/resources/cli/index.mjs +2 -2
- package/dist/resources/cli/realtime.d.mts +1 -1
- package/dist/resources/cli/realtime.mjs +1 -1
- package/dist/resources/cli.d.mts +1 -1
- package/dist/resources/cli.mjs +2 -2
- package/dist/resources/connected-accounts.d.mts +1 -1
- package/dist/resources/connected-accounts.mjs +1 -1
- package/dist/resources/custom.d.mts +1 -1
- package/dist/resources/custom.mjs +1 -1
- package/dist/resources/files.d.mts +1 -1
- package/dist/resources/files.mjs +1 -1
- package/dist/resources/index.d.mts +1 -1
- package/dist/resources/index.mjs +13 -13
- package/dist/resources/keyring.d.mts +1 -1
- package/dist/resources/keyring.mjs +1 -1
- package/dist/resources/link.d.mts +1 -1
- package/dist/resources/link.mjs +1 -1
- package/dist/resources/logs/index.d.mts +1 -1
- package/dist/resources/logs/index.mjs +3 -3
- package/dist/resources/logs/logs.d.mts +1 -1
- package/dist/resources/logs/logs.mjs +1 -1
- package/dist/resources/logs/tools.d.mts +1 -1
- package/dist/resources/logs/tools.mjs +1 -1
- package/dist/resources/logs/triggers.d.mts +1 -1
- package/dist/resources/logs/triggers.mjs +1 -1
- package/dist/resources/logs.d.mts +1 -1
- package/dist/resources/logs.mjs +3 -3
- package/dist/resources/mcp/custom.d.mts +1 -1
- package/dist/resources/mcp/custom.mjs +1 -1
- package/dist/resources/mcp/generate.d.mts +1 -1
- package/dist/resources/mcp/generate.mjs +1 -1
- package/dist/resources/mcp/index.d.mts +1 -1
- package/dist/resources/mcp/index.mjs +3 -3
- package/dist/resources/mcp/mcp.d.mts +1 -1
- package/dist/resources/mcp/mcp.mjs +1 -1
- package/dist/resources/mcp.d.mts +1 -1
- package/dist/resources/mcp.mjs +3 -3
- package/dist/resources/org/clanker.d.mts +1 -1
- package/dist/resources/org/clanker.mjs +1 -1
- package/dist/resources/org/consumer/consumer.d.mts +1 -1
- package/dist/resources/org/consumer/consumer.mjs +1 -1
- package/dist/resources/org/consumer/index.d.mts +1 -1
- package/dist/resources/org/consumer/index.mjs +2 -2
- package/dist/resources/org/consumer/project.d.mts +1 -1
- package/dist/resources/org/consumer/project.mjs +1 -1
- package/dist/resources/org/consumer.d.mts +1 -1
- package/dist/resources/org/consumer.mjs +2 -2
- package/dist/resources/org/index.d.mts +1 -1
- package/dist/resources/org/index.mjs +6 -6
- package/dist/resources/org/org.d.mts +1 -1
- package/dist/resources/org/org.mjs +1 -1
- package/dist/resources/org/owner/index.d.mts +1 -1
- package/dist/resources/org/owner/index.mjs +2 -2
- package/dist/resources/org/owner/owner.d.mts +1 -1
- package/dist/resources/org/owner/owner.mjs +1 -1
- package/dist/resources/org/owner/project.d.mts +1 -1
- package/dist/resources/org/owner/project.mjs +1 -1
- package/dist/resources/org/owner.d.mts +1 -1
- package/dist/resources/org/owner.mjs +2 -2
- package/dist/resources/org/project.d.mts +1 -1
- package/dist/resources/org/project.mjs +1 -1
- package/dist/resources/org/usage.d.mts +1 -1
- package/dist/resources/org/usage.mjs +1 -1
- package/dist/resources/org.d.mts +1 -1
- package/dist/resources/org.mjs +6 -6
- package/dist/resources/project/index.d.mts +1 -1
- package/dist/resources/project/index.mjs +1 -1
- package/dist/resources/project/project.d.mts +1 -1
- package/dist/resources/project/project.mjs +1 -1
- package/dist/resources/project/usage.d.mts +1 -1
- package/dist/resources/project/usage.mjs +1 -1
- package/dist/resources/project.d.mts +1 -1
- package/dist/resources/project.mjs +1 -1
- package/dist/resources/session-configs.d.mts +1 -1
- package/dist/resources/session-configs.mjs +1 -1
- package/dist/resources/tool-router/index.d.mts +1 -1
- package/dist/resources/tool-router/index.mjs +2 -2
- package/dist/resources/tool-router/session/files.d.mts +1 -1
- package/dist/resources/tool-router/session/files.mjs +1 -1
- package/dist/resources/tool-router/session/index.d.mts +1 -1
- package/dist/resources/tool-router/session/index.mjs +2 -2
- package/dist/resources/tool-router/session/session.d.mts +1 -1
- package/dist/resources/tool-router/session/session.mjs +1 -1
- package/dist/resources/tool-router/session.d.mts +1 -1
- package/dist/resources/tool-router/session.mjs +2 -2
- package/dist/resources/tool-router/tool-router.d.mts +1 -1
- package/dist/resources/tool-router/tool-router.mjs +1 -1
- package/dist/resources/tool-router.d.mts +1 -1
- package/dist/resources/tool-router.mjs +2 -2
- package/dist/resources/toolkits.d.mts +1 -1
- package/dist/resources/toolkits.mjs +1 -1
- package/dist/resources/tools.d.mts +1 -1
- package/dist/resources/tools.mjs +1 -1
- package/dist/resources/trigger-instances/index.d.mts +1 -1
- package/dist/resources/trigger-instances/index.mjs +2 -2
- package/dist/resources/trigger-instances/manage.d.mts +1 -1
- package/dist/resources/trigger-instances/manage.mjs +1 -1
- package/dist/resources/trigger-instances/trigger-instances.d.mts +1 -1
- package/dist/resources/trigger-instances/trigger-instances.mjs +1 -1
- package/dist/resources/trigger-instances.d.mts +1 -1
- package/dist/resources/trigger-instances.mjs +2 -2
- package/dist/resources/triggers-types.d.mts +1 -1
- package/dist/resources/triggers-types.mjs +1 -1
- package/dist/resources/webhook-endpoints.d.mts +1 -1
- package/dist/resources/webhook-endpoints.mjs +1 -1
- package/dist/resources/webhook-subscriptions.d.mts +1 -1
- package/dist/resources/webhook-subscriptions.mjs +1 -1
- package/dist/{session-Dm8WtF4I.mjs → session-B-ifOjVv.mjs} +1 -1
- package/dist/{session-DEfDnHZZ.mjs → session-CpwJh7Hn.mjs} +2 -2
- package/dist/{session-configs-nA6TL_i4.d.mts → session-configs-BLy_O6bX.d.mts} +131 -134
- package/dist/{tool-router-6l_dREjC.mjs → tool-router-jNsaldKV.mjs} +1 -1
- package/dist/{toolkits-Mn_uLV98.mjs → toolkits-DK4My9FW.mjs} +1 -1
- package/dist/{tools-z-PjBsf7.mjs → tools-DNkimllW.mjs} +1 -1
- package/dist/{tools-btk0mzFP.mjs → tools-Gun_2We6.mjs} +1 -1
- package/dist/{trigger-instances-PQaObQQy.mjs → trigger-instances-vvKswQSW.mjs} +2 -2
- package/dist/{triggers-y0mi0XzT.mjs → triggers-CfrGxKIo.mjs} +1 -1
- package/dist/{triggers-types-KoRbT0k5.mjs → triggers-types-DYW2Mr8z.mjs} +1 -1
- package/dist/{usage-DvjkSmpI.mjs → usage-YIBYNpVF.mjs} +1 -1
- package/dist/{usage-B2Z947BK.mjs → usage-vt9HmnNf.mjs} +1 -1
- package/dist/version-DB98yI2B.d.mts +4 -0
- package/dist/{webhook-endpoints-kf4Jj2Mz.mjs → webhook-endpoints-HqLteVW6.mjs} +1 -1
- package/dist/{webhook-subscriptions-DcYN8qo1.mjs → webhook-subscriptions-CXhNXIOM.mjs} +1 -1
- package/package.json +2 -2
- package/dist/version-DUxhnnPj.d.mts +0 -4
package/README.md
CHANGED
|
@@ -6,17 +6,58 @@ This repo is the successor to the Stainless-generated [`@composio/client`](https
|
|
|
6
6
|
|
|
7
7
|
## Usage
|
|
8
8
|
|
|
9
|
-
The package root is the
|
|
9
|
+
The package root is the Promise client: `new Composio({ auth })`, the Stainless type names, and throwing `APIPromise` semantics (shipped via UXE-163/UXE-164).
|
|
10
10
|
|
|
11
11
|
```ts
|
|
12
|
-
import Composio from '@composio/client'
|
|
12
|
+
import Composio, { Auth } from '@composio/client'
|
|
13
13
|
|
|
14
|
-
const composio = new Composio({
|
|
14
|
+
const composio = new Composio({ auth: Auth.project(process.env.COMPOSIO_API_KEY!) })
|
|
15
15
|
|
|
16
16
|
const session = await composio.toolRouter.session.create({ user_id: 'user_123' })
|
|
17
17
|
console.log(session.session_id, session.mcp.url)
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
+
### Authentication and scope
|
|
21
|
+
|
|
22
|
+
`auth` is required and says how every request authenticates. A request carries at most one Composio
|
|
23
|
+
credential.
|
|
24
|
+
|
|
25
|
+
| `auth` | Sends |
|
|
26
|
+
| --- | --- |
|
|
27
|
+
| `Auth.project(key)` | `x-api-key` on every request to the API origin |
|
|
28
|
+
| `Auth.user(key)` | `x-user-api-key` on every request to the API origin |
|
|
29
|
+
| `Auth.organization(key)` | `x-org-api-key` on every request to the API origin |
|
|
30
|
+
| `Auth.auto({ project, user, organization })` | one of the keys given, chosen per operation: the project key wherever the operation accepts it, otherwise the first scheme it declares that a key is given for. This is how releases before rc.18 chose |
|
|
31
|
+
| `Auth.none()` | no credential. The credential header names are then ordinary headers, for a client used as a transport for schemes it does not model |
|
|
32
|
+
|
|
33
|
+
A fixed mode never consults the operation table. A key may be a function that returns one (or a
|
|
34
|
+
promise of one): it is called once per call, after the call starts, and its key is reused across
|
|
35
|
+
retries and same-origin redirects. It is not called for a call that starts off the API origin.
|
|
36
|
+
`client.authMode` reads the mode back; the client never returns a credential it was given as a
|
|
37
|
+
function.
|
|
38
|
+
|
|
39
|
+
`scope` names the organization and project the client addresses, sent as `x-org-id` and
|
|
40
|
+
`x-project-id` on requests to the API origin: `{ organizationId }`, `{ projectId }`, or both.
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
const composio = new Composio({
|
|
44
|
+
auth: Auth.user(() => vault.read('composio-user-key')),
|
|
45
|
+
scope: { organizationId: 'org_123', projectId: 'pr_456' },
|
|
46
|
+
})
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
A header name is reserved while something is configured to write it: the three credential names
|
|
50
|
+
while `auth` is not `none`, `x-org-id` and `x-project-id` while `scope` is set, and the identity
|
|
51
|
+
names as [below](#identify-the-calling-product). `defaultHeaders` and `COMPOSIO_CUSTOM_HEADERS` that
|
|
52
|
+
name a reserved header fail construction, and a call's `headers` that name one fail the call before
|
|
53
|
+
anything is sent. A client that needs another credential or scope derives one:
|
|
54
|
+
`composio.withOptions({ auth: Auth.project(key) })`. `withOptions` re-runs every construction check.
|
|
55
|
+
|
|
56
|
+
Three operations declare a credential or scope id as a header parameter
|
|
57
|
+
(`org.consumer.project.resolve`, `org.consumer.listConnectedToolkits`, `cli.createCodactFailure`).
|
|
58
|
+
Their signatures are unchanged: the value replaces the configured credential for that call, and an
|
|
59
|
+
`x-org-id` that disagrees with the configured `scope` fails the call.
|
|
60
|
+
|
|
20
61
|
### Pagination
|
|
21
62
|
|
|
22
63
|
Use the `@composio/client/pagination` subpath to traverse list operations that return the standard
|
|
@@ -65,28 +106,30 @@ cursor ends traversal. When a response omits `next_cursor` but numeric `current_
|
|
|
65
106
|
returning partial results; provide a custom adapter for that response shape. Requests are sequential
|
|
66
107
|
and inherit the normal client retry/backoff path, but this is not proactive/shared rate-limit pacing.
|
|
67
108
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
applications that load configuration themselves:
|
|
109
|
+
The constructor reads nothing from the process. `Composio.fromEnv` is the one reader of the
|
|
110
|
+
environment, and it reads the mapping it is handed:
|
|
71
111
|
|
|
72
112
|
```ts
|
|
73
|
-
const composio = Composio.fromEnv(
|
|
113
|
+
const composio = Composio.fromEnv(process.env, { baseURL: 'https://staging-backend.composio.dev' })
|
|
74
114
|
```
|
|
75
115
|
|
|
76
|
-
`fromEnv`
|
|
77
|
-
`
|
|
78
|
-
`
|
|
79
|
-
not
|
|
116
|
+
`fromEnv` reads `COMPOSIO_API_KEY`, `COMPOSIO_USER_API_KEY` and `COMPOSIO_ORG_API_KEY` into `auth`
|
|
117
|
+
(one set: that fixed mode; several: `Auth.auto`; none: `Auth.none()`), and `COMPOSIO_BASE_URL`,
|
|
118
|
+
`COMPOSIO_ALLOW_INSECURE_HTTP=1`, `COMPOSIO_CUSTOM_HEADERS` (as `defaultHeaders`) and
|
|
119
|
+
`COMPOSIO_LOG_LEVEL`. It does not read `COMPOSIO_ORG_ID` or `COMPOSIO_PROJECT_ID`: `scope` is always
|
|
120
|
+
an argument. An override replaces the whole field it names, so `{ auth: Auth.none() }` means none
|
|
121
|
+
whatever the mapping holds. Derived clients created with `withOptions()` keep using the resolved
|
|
122
|
+
snapshot.
|
|
80
123
|
|
|
81
124
|
Inject a `Transport` when an application or test needs to own HTTP dispatch. The transport receives
|
|
82
125
|
a complete `Request`; retries, credential-safe redirects, timeouts, and response parsing stay in the
|
|
83
126
|
client:
|
|
84
127
|
|
|
85
128
|
```ts
|
|
86
|
-
import Composio, { createFetchTransport } from '@composio/client'
|
|
129
|
+
import Composio, { Auth, createFetchTransport } from '@composio/client'
|
|
87
130
|
|
|
88
131
|
const transport = createFetchTransport({ fetch: instrumentedFetch })
|
|
89
|
-
const composio = new Composio({ apiKey, transport })
|
|
132
|
+
const composio = new Composio({ auth: Auth.project(apiKey), transport })
|
|
90
133
|
```
|
|
91
134
|
|
|
92
135
|
Without a `transport`, the client resolves `globalThis.fetch` when a request is sent, so late
|
|
@@ -133,13 +176,10 @@ subpaths never import it and load without it.
|
|
|
133
176
|
```ts
|
|
134
177
|
import { Effect, Layer } from 'effect'
|
|
135
178
|
import * as FetchHttpClient from 'effect/http/FetchHttpClient'
|
|
136
|
-
import { ComposioClient, layer, layerConfig
|
|
137
|
-
|
|
138
|
-
// Explicit options, over a fetch-backed `HttpClient` the layer brings with it.
|
|
139
|
-
const live = layerFetch({ apiKey: 'your-api-key' })
|
|
179
|
+
import { Auth, ComposioClient, layer, layerConfig } from '@composio/client/effect'
|
|
140
180
|
|
|
141
|
-
// Explicit options, over the `HttpClient` the application provides.
|
|
142
|
-
const
|
|
181
|
+
// Explicit options, over the `HttpClient` the application provides; here a fetch-backed one.
|
|
182
|
+
const live = layer({ auth: Auth.project('your-api-key') }).pipe(Layer.provide(FetchHttpClient.layer))
|
|
143
183
|
|
|
144
184
|
// Options read from the `COMPOSIO_*` settings.
|
|
145
185
|
const fromConfig = layerConfig().pipe(Layer.provide(FetchHttpClient.layer))
|
|
@@ -156,15 +196,24 @@ const slug: Promise<string> = Effect.runPromise(program.pipe(Effect.provide(live
|
|
|
156
196
|
`make(options, httpClient)` builds the same client synchronously from an `HttpClient` you already
|
|
157
197
|
hold, and throws where the layers fail.
|
|
158
198
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
`
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
`
|
|
167
|
-
|
|
199
|
+
`auth` and `scope` mean what they mean on the root client (see
|
|
200
|
+
[Authentication and scope](#authentication-and-scope)), and `Auth` is exported from
|
|
201
|
+
`@composio/client/effect` too. A key may also be a `Redacted<string>`, or a function returning a
|
|
202
|
+
string or a `Redacted<string>`. There is no `withOptions`: a client is a value, and a caller that
|
|
203
|
+
needs another credential calls `make` again with the same `HttpClient`.
|
|
204
|
+
|
|
205
|
+
Only `layerConfig` reads the environment. It reads `COMPOSIO_API_KEY`, `COMPOSIO_USER_API_KEY` and
|
|
206
|
+
`COMPOSIO_ORG_API_KEY` into `auth` by the rule `Composio.fromEnv` applies, each key `Redacted`
|
|
207
|
+
throughout, and `COMPOSIO_BASE_URL` and `COMPOSIO_ALLOW_INSECURE_HTTP=1`, through Effect's `Config`,
|
|
208
|
+
so the `ConfigProvider` in context decides where they come from; by default that is the process
|
|
209
|
+
environment. An option passed to `layerConfig` replaces the setting it names, so
|
|
210
|
+
`layerConfig({ auth: Auth.none() })` means none whatever is configured. `make` and `layer` read
|
|
211
|
+
nothing.
|
|
212
|
+
|
|
213
|
+
Construction fails with a `ConfigurationError` when a credentialed origin is not HTTPS (loopback and
|
|
214
|
+
`allowInsecureHTTP` excepted, as on the root client), when a key or a header option is refused, or
|
|
215
|
+
when `decode: true` is given without `schemas`. A credential provider that fails, or returns
|
|
216
|
+
something a header cannot carry, fails the call with a `ConfigurationError` before anything is sent.
|
|
168
217
|
|
|
169
218
|
The resources are plain objects of functions, not classes, so a method can be passed around without
|
|
170
219
|
binding. One thing on the root client has no counterpart here: the resources that hold no operation
|
|
@@ -287,7 +336,7 @@ import { make } from '@composio/client/effect'
|
|
|
287
336
|
import { schemaLoaders } from '@composio/client/effect/schemas'
|
|
288
337
|
|
|
289
338
|
const checkedCategories = (httpClient: HttpClient.HttpClient) => {
|
|
290
|
-
const composio = make({
|
|
339
|
+
const composio = make({ auth: Auth.project('your-api-key'), schemas: schemaLoaders }, httpClient)
|
|
291
340
|
return composio.toolkits.retrieveCategories({ decode: true }).pipe(
|
|
292
341
|
Effect.catchTag('@composio/client/DecodeError', (error) =>
|
|
293
342
|
Effect.logError(`${error.operation}: ${JSON.stringify(error.issues)}`).pipe(Effect.as(null)),
|
|
@@ -345,10 +394,10 @@ top of the span itself.
|
|
|
345
394
|
|
|
346
395
|
### Credentials and redaction
|
|
347
396
|
|
|
348
|
-
A request carries one credential header, chosen
|
|
349
|
-
`x-user-api-key` or `x-org-api-key`. The client holds
|
|
350
|
-
three header names to Effect's redaction list for its requests, so spans and renderings
|
|
351
|
-
show `<redacted>`; Effect's own list knows only `x-api-key`.
|
|
397
|
+
A request carries at most one credential header, chosen by `auth` as on the root client:
|
|
398
|
+
`x-api-key`, `x-user-api-key` or `x-org-api-key`. The client holds every key as a `Redacted` value
|
|
399
|
+
and adds all three header names to Effect's redaction list for its requests, so spans and renderings
|
|
400
|
+
of a request show `<redacted>`; Effect's own list knows only `x-api-key`.
|
|
352
401
|
|
|
353
402
|
No error the client produces holds the request, the transport's error or a credential value. One
|
|
354
403
|
caveat: `APIConnectionError.description` is the transport's own message text, copied. A transport
|
|
@@ -369,10 +418,16 @@ the credential check does not see them, and they are not withdrawn on a cross-or
|
|
|
369
418
|
|
|
370
419
|
### Deprecation notices
|
|
371
420
|
|
|
372
|
-
|
|
373
|
-
`
|
|
374
|
-
|
|
375
|
-
|
|
421
|
+
A deprecated input, or a response carrying `Deprecation`, `Sunset` and `Link` headers, is reported
|
|
422
|
+
through `Effect.logWarning`, once per operation and notice for each client. The application's
|
|
423
|
+
`Logger` and `References.MinimumLogLevel` decide what becomes of it; there is no client option.
|
|
424
|
+
`isDeprecationNotice` recognises a notice, so a logger can drop or route the notices alone:
|
|
425
|
+
|
|
426
|
+
```ts
|
|
427
|
+
import { isDeprecationNotice } from '@composio/client/effect'
|
|
428
|
+
|
|
429
|
+
const quiet = Logger.make((options) => (isDeprecationNotice(options) ? undefined : base.log(options)))
|
|
430
|
+
```
|
|
376
431
|
|
|
377
432
|
### Raw methods
|
|
378
433
|
|
|
@@ -439,7 +494,7 @@ and `./effect` take the same option:
|
|
|
439
494
|
|
|
440
495
|
```ts
|
|
441
496
|
const composio = new Composio({
|
|
442
|
-
apiKey,
|
|
497
|
+
auth: Auth.project(apiKey),
|
|
443
498
|
identity: { product: '@composio/core', version: '0.9.0', source: 'TYPESCRIPT_SDK', framework: 'openai' },
|
|
444
499
|
})
|
|
445
500
|
```
|
|
@@ -471,13 +526,13 @@ configured origin:
|
|
|
471
526
|
|
|
472
527
|
```ts
|
|
473
528
|
const composio = new Composio({
|
|
474
|
-
apiKey,
|
|
529
|
+
auth: Auth.project(apiKey),
|
|
475
530
|
baseURL: 'http://host.docker.internal:9900',
|
|
476
531
|
allowInsecureHTTP: true,
|
|
477
532
|
})
|
|
478
533
|
```
|
|
479
534
|
|
|
480
|
-
The equivalent environment configuration is:
|
|
535
|
+
The equivalent environment configuration, for `Composio.fromEnv`, is:
|
|
481
536
|
|
|
482
537
|
```sh
|
|
483
538
|
COMPOSIO_BASE_URL=http://host.docker.internal:9900 \
|
|
@@ -488,6 +543,47 @@ The opt-in records the resolved scheme, hostname, and port. Mutating `baseURL` c
|
|
|
488
543
|
and `withOptions({ baseURL: ... })` requires `allowInsecureHTTP: true` again when the origin
|
|
489
544
|
changes. Redirects to another origin remain credential-free.
|
|
490
545
|
|
|
546
|
+
### Removed in 2.0.0-rc.19
|
|
547
|
+
|
|
548
|
+
The two option removals are declared entries in `packages/codegen/assignability-ledger.json`. The
|
|
549
|
+
other rows are class members the type check does not pin, listed so an upgrade can find them.
|
|
550
|
+
|
|
551
|
+
| Removed | Migration |
|
|
552
|
+
| --- | --- |
|
|
553
|
+
| `environment: 'production' \| 'staging' \| 'local'` (root `ClientOptions`) | `baseURL: 'https://staging-backend.composio.dev'` or `'http://localhost:9900'`; omitting it means production |
|
|
554
|
+
| `Logger` (exported interface) | `logger` takes a `Console`-shaped object (`Pick<Console, 'debug' \| 'info' \| 'warn' \| 'error'>`) and defaults to `console`. An adapter that forwards to another logger is the same four methods |
|
|
555
|
+
| `client.apiKey`, `userApiKey`, `orgApiKey` (read-only since rc.18) | Keep your own copy of the key; `client.authMode` says which mode is configured |
|
|
556
|
+
| `client.logger` | None: the sink is the client's own. Pass a different one to `withOptions({ logger })` |
|
|
557
|
+
| Assigning `client.baseURL`, `maxRetries`, `timeout` or `logLevel` | `withOptions({ ... })`, which re-runs every validation. The four stay readable; `logLevel` reads the effective level (`'warn'` by default) |
|
|
558
|
+
| `deprecationNotices: 'warn' \| 'off'` (`./effect` `ComposioClientOptions`) | The application's `Logger` and `References.MinimumLogLevel`; a logger that drops records matching `isDeprecationNotice` is `'off'` |
|
|
559
|
+
| `layerFetch(options)` (`./effect`) | `layer(options).pipe(Layer.provide(FetchHttpClient.layer))` |
|
|
560
|
+
|
|
561
|
+
Python removes `default_query` and the `api_key`, `user_api_key` and `org_api_key` reads, and makes
|
|
562
|
+
`base_url`, `max_retries` and `timeout` read-only; `environment=` stays. See
|
|
563
|
+
[`python/README.md`](./python/README.md).
|
|
564
|
+
|
|
565
|
+
### Removed in 2.0.0-rc.18
|
|
566
|
+
|
|
567
|
+
Each removal is a declared entry in `packages/codegen/assignability-ledger.json`. The other rows are
|
|
568
|
+
behaviour the type check cannot see, listed so an upgrade can find them.
|
|
569
|
+
|
|
570
|
+
| Removed | Migration |
|
|
571
|
+
| --- | --- |
|
|
572
|
+
| `apiKey` (root `ClientOptions` and `./effect` `ComposioClientOptions`) | `auth: Auth.project(key)` |
|
|
573
|
+
| `userApiKey` | `auth: Auth.user(key)`, which sends the user key on every request. The old per-operation selection is `Auth.auto({ project, user, organization })` |
|
|
574
|
+
| `orgApiKey` | `auth: Auth.organization(key)`, or `Auth.auto({ ... })` |
|
|
575
|
+
| `apiKey: null` plus a credential in `defaultHeaders` | the `auth` that credential is. While `auth` is not `none`, `defaultHeaders`, `COMPOSIO_CUSTOM_HEADERS` and a call's `headers` cannot name `x-api-key`, `x-user-api-key` or `x-org-api-key` |
|
|
576
|
+
| `x-api-key` overriding the credential for one call | a second client: `withOptions({ auth: Auth.project(key) })` on the root, `make({ ...options, auth: Auth.project(key) }, httpClient)` on `./effect` |
|
|
577
|
+
| `x-org-id`, `x-project-id` in `defaultHeaders` | `scope: { organizationId, projectId }`, which reserves both names. Without `scope` they are still ordinary headers |
|
|
578
|
+
| the constructor reading `COMPOSIO_*` from the process | `Composio.fromEnv(process.env, overrides)`; nothing else reads the environment. `new Composio()` with no options is gone with it |
|
|
579
|
+
| `layerConfig({ apiKey: null })` | `layerConfig({ auth: Auth.none() })`; an override replaces the whole `auth` |
|
|
580
|
+
| `layer()`, `layerFetch()` with no options | pass the options, `auth` included |
|
|
581
|
+
| assigning `client.apiKey`, `userApiKey` or `orgApiKey` | `withOptions({ auth })`. The three fields stayed readable until rc.19; keep your own copy of a key you need |
|
|
582
|
+
| `Credential` on `./effect` accepting `null` | `Auth.none()`. It now also accepts a function that returns a key |
|
|
583
|
+
|
|
584
|
+
Python makes the same change: `auth=ProjectAuth(key)` (and `UserAuth`, `OrganizationAuth`,
|
|
585
|
+
`AutoAuth`, `NoAuth`) and `scope=Scope(...)`, see [`python/README.md`](./python/README.md).
|
|
586
|
+
|
|
491
587
|
### Changed in 2.0.0-rc.17
|
|
492
588
|
|
|
493
589
|
`defaultHeaders`, `COMPOSIO_CUSTOM_HEADERS` and per-call `headers` refuse the library headers
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as generatedOperation, y as withOperation } from "./generated-operations-Dv7pAKDT.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/compat/resources/api-key-revocation.ts
|
|
4
4
|
const OP_CREATE = generatedOperation("apiKeyRevocation.create");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as path, n as generatedOperation, y as withOperation } from "./generated-operations-Dv7pAKDT.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/compat/resources/auth-configs.ts
|
|
4
4
|
const OP_CREATE = generatedOperation("authConfigs.create");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as generatedOperation, y as withOperation } from "./generated-operations-Dv7pAKDT.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/compat/resources/org/clanker.ts
|
|
4
4
|
const OP_CREATE_CLAIM = generatedOperation("org.clanker.createClaim");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as Realtime } from "./realtime-
|
|
1
|
+
import { n as generatedOperation, y as withOperation } from "./generated-operations-Dv7pAKDT.mjs";
|
|
2
|
+
import { t as Realtime } from "./realtime-F_sGuTd8.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/compat/resources/cli/cli.ts
|
|
5
5
|
const OP_CREATE_CODACT_FAILURE = generatedOperation("cli.createCodactFailure");
|
|
@@ -22,9 +22,8 @@ var Cli = class {
|
|
|
22
22
|
const { "x-user-api-key": xUserApiKey, ...body } = params;
|
|
23
23
|
return this.#client.post("/api/v3.1/cli/codact_failures", withOperation(OP_CREATE_CODACT_FAILURE, {
|
|
24
24
|
body,
|
|
25
|
-
...options
|
|
26
|
-
|
|
27
|
-
}));
|
|
25
|
+
...options
|
|
26
|
+
}, { "x-user-api-key": xUserApiKey }));
|
|
28
27
|
}
|
|
29
28
|
createSession(body = {}, options) {
|
|
30
29
|
return this.#client.post("/api/v3.1/cli/create-session", withOperation(OP_CREATE_SESSION, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as path, n as generatedOperation, y as withOperation } from "./generated-operations-Dv7pAKDT.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/compat/resources/connected-accounts.ts
|
|
4
4
|
const OP_CREATE = generatedOperation("connectedAccounts.create");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as Project } from "./project-
|
|
1
|
+
import { n as generatedOperation, y as withOperation } from "./generated-operations-Dv7pAKDT.mjs";
|
|
2
|
+
import { t as Project } from "./project-DcV01umC.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/compat/resources/org/consumer/consumer.ts
|
|
5
5
|
const OP_LIST_CONNECTED_TOOLKITS = generatedOperation("org.consumer.listConnectedToolkits");
|
|
@@ -20,11 +20,10 @@ var Consumer = class {
|
|
|
20
20
|
const { "x-user-api-key": xUserApiKey, "x-org-id": xOrgId, ...query } = params;
|
|
21
21
|
return this.#client.get("/api/v3.1/org/consumer/connected_toolkits", withOperation(OP_LIST_CONNECTED_TOOLKITS, {
|
|
22
22
|
query,
|
|
23
|
-
...options
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}, options?.headers])
|
|
23
|
+
...options
|
|
24
|
+
}, {
|
|
25
|
+
"x-user-api-key": xUserApiKey,
|
|
26
|
+
"x-org-id": xOrgId
|
|
28
27
|
}));
|
|
29
28
|
}
|
|
30
29
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as path, n as generatedOperation, y as withOperation } from "./generated-operations-Dv7pAKDT.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/compat/resources/custom.ts
|
|
4
4
|
const OP_DELETE_TOOLKIT = generatedOperation("custom.deleteToolkit");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as generatedOperation, y as withOperation } from "./generated-operations-Dv7pAKDT.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/compat/resources/mcp/custom.ts
|
|
4
4
|
const OP_CREATE = generatedOperation("mcp.custom.create");
|
package/dist/effect.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import { t as VERSION } from "./version-
|
|
3
|
-
import { Context, Effect, Layer, Redacted, Stream } from "effect";
|
|
1
|
+
import { $ as ProjectRetrieveResponse, $n as ToolkitRetrieveMultiParams, $r as SessionDeleteResponse, $t as McpCreateInstanceResponse, Ai as AutoCredentials, An as TriggersTypeListResponse, B as ConsumerListConnectedToolkitsResponse, Bn as AuthConfigListResponse, Br as ToolRetrieveParams, C as SessionRetrieveInfoResponse, Ci as FileListParams, Cn as TriggerInstanceUpsertResponse, Cr as ConnectedAccountUpdateStatusParams, Ct as UsageRetrieveParams, Di as AuthConstructors, Dn as ManageUpdateParams, Dr as FileCreatePresignedURLResponse, Dt as LogCreateToolExecutionParams, E as OrgListResponse, En as ManageDeleteResponse, Er as FileCreatePresignedURLParams, Et as UsageRetrieveSummaryResponse, Fn as AuthConfigCreateParams, Fr as ToolListParams, Gn as AuthConfigUpdateStatusResponse, Gt as CliGetSessionParams, H as ProjectResolveParams, Hn as AuthConfigUpdateParams, Hr as ToolRetrieveRequiredScopesResponse, Ht as CliCreateCodactFailureResponse, I as ProjectListParams$1, Ii as APIErrorBody, In as AuthConfigCreateResponse, Ir as ToolListResponse, It as TriggerListParams, J as ProjectDeleteParams, Jn as ToolkitListResponse, Jr as SessionAttachResponse, Jt as RealtimeAuthParams, K as ProjectCreateParams, Kt as CliGetSessionResponse, L as ProjectListResponse$1, Ln as AuthConfigDeleteParams, Lr as ToolProxyParams, Lt as TriggerListResponse, M as UsageRetrieveResponse$1, Mi as Scope, Mn as TriggersTypeRetrieveParams, Mr as ToolExecuteResponse, Mt as ToolListParams$1, N as UsageRetrieveSummaryParams$1, Nn as TriggersTypeRetrieveResponse, Nr as ToolGetInputParams, Nt as ToolListResponse$1, O as ClankerCreateClaimParams, On as ManageUpdateResponse, Or as FileListParams$1, Ot as LogCreateToolExecutionResponse, P as UsageRetrieveSummaryResponse$1, Pr as ToolGetInputResponse, Pt as ToolRetrieveResponse$1, Q as ProjectRegenerateAPIKeyResponse, Qi as HeadersLike, Qn as ToolkitRetrieveChangelogResponse, Qr as SessionCreateResponse, Qt as McpCreateInstanceParams, Rn as AuthConfigDeleteResponse, Rr as ToolProxyResponse, Rt as TriggerRetrieveResponse, Si as FileDeleteResponse, Sn as TriggerInstanceUpsertParams, Sr as ConnectedAccountRevokeResponse, T as OrgListParams, Tt as UsageRetrieveSummaryParams, U as ProjectResolveResponse, Un as AuthConfigUpdateResponse, Ur as ToolRetrieveResponse, Ut as CliCreateSessionParams, Vn as AuthConfigRetrieveResponse, Vr as ToolRetrieveRequiredScopesParams, Vt as CliCreateCodactFailureParams, Wn as AuthConfigUpdateStatusParams, Wt as CliCreateSessionResponse, X as ProjectListParams, Xn as ToolkitRecommendScopesResponse, Xr as SessionConfigHistoryResponse, Xt as RealtimeCredentialsResponse, Y as ProjectDeleteResponse, Yn as ToolkitRecommendScopesParams, Yr as SessionConfigHistoryParams, Yt as RealtimeAuthResponse, Z as ProjectListResponse, Zi as ClientIdentity, Zn as ToolkitRetrieveCategoriesResponse, Zr as SessionCreateParams, _ as CustomUpsertResponse, _i as FileCreateDownloadURLParams, _r as ConnectedAccountPatchParams, _t as WebhookSubscriptionRotateSecretResponse, ai as SessionLinkResponse, an as McpListInstancesParams, at as WebhookEndpointReplaceResponse, b as ApiKeyRevocationCreateResponse, bi as FileCreateUploadURLResponse, bn as TriggerInstanceListActiveParams, br as ConnectedAccountRefreshResponse, ci as SessionProxyExecuteParams, cn as McpListResponse, cr as LinkCreateResponse, ct as WebhookEndpointUpdateResponse, di as SessionSearchParams, dn as McpRetrieveResponse, dr as ConnectedAccountCreateParams, dt as WebhookSubscriptionCreateResponse, ei as SessionExecuteMetaParams, en as McpCreateParams, er as ToolkitRetrieveMultiResponse, et as WebhookEndpointCreateParams, f as CustomDeleteToolkitParams, fi as SessionSearchResponse, fn as McpUpdateParams, fr as ConnectedAccountCreateResponse, ft as WebhookSubscriptionDeleteResponse, g as CustomUpsertParams, gi as SessionToolsResponse, gn as GenerateURLResponse, gr as ConnectedAccountListResponse, gt as WebhookSubscriptionRetrieveResponse, h as CustomSyncResponse, hi as SessionToolsParams, hn as GenerateURLParams, hr as ConnectedAccountListParams, ht as WebhookSubscriptionListResponse, i as SessionConfigsRetrieveResponse, ii as SessionLinkParams, in as McpDeleteResponse, ir as ToolkitRetrieveScopesGrantContextResponse, it as WebhookEndpointReplaceParams, j as UsageRetrieveParams$1, jn as TriggersTypeRetrieveEnumResponse, jr as ToolExecuteParams, jt as ToolListFieldsResponse, k as ClankerCreateClaimResponse, ki as AuthOf, kn as TriggersTypeListParams, kr as FileListResponse$1, kt as LogRetrieveToolExecutionResponse, li as SessionProxyExecuteResponse, ln as McpRetrieveAppParams, lr as ConnectedAccountCompleteAuthParams, m as CustomSyncParams, mi as SessionToolkitsResponse, mr as ConnectedAccountDeleteResponse, mt as WebhookSubscriptionListParams, n as SessionConfigsListParams, ni as SessionExecuteParams, nn as McpDeleteInstanceParams, nr as ToolkitRetrieveResponse, nt as WebhookEndpointListParams, oi as SessionPatchParams, on as McpListInstancesResponse, ot as WebhookEndpointRetrieveResponse, p as CustomDeleteToolkitResponse, pi as SessionToolkitsParams, pn as McpUpdateResponse, pr as ConnectedAccountDeleteParams, pt as WebhookSubscriptionListEventTypesResponse, q as ProjectCreateResponse, qn as ToolkitListParams, qr as SessionAttachParams, r as SessionConfigsListResponse, ri as SessionExecuteResponse, rn as McpDeleteInstanceResponse, rr as ToolkitRetrieveScopesGrantContextParams, rt as WebhookEndpointListResponse, si as SessionPatchResponse, sn as McpListParams, sr as LinkCreateParams, st as WebhookEndpointUpdateParams, ti as SessionExecuteMetaResponse, tn as McpCreateResponse, tr as ToolkitRetrieveParams, tt as WebhookEndpointCreateResponse, u as KeyringListTransferKeysResponse, ui as SessionRetrieveResponse, un as McpRetrieveAppResponse, ur as ConnectedAccountCompleteAuthResponse, ut as WebhookSubscriptionCreateParams, vi as FileCreateDownloadURLResponse, vn as CustomCreateParams, vr as ConnectedAccountPatchResponse, vt as WebhookSubscriptionUpdateParams, wi as FileListResponse, wr as ConnectedAccountUpdateStatusResponse, wt as UsageRetrieveResponse, xi as FileDeleteParams, xn as TriggerInstanceListActiveResponse, xr as ConnectedAccountRetrieveResponse, y as ApiKeyRevocationCreateParams, yi as FileCreateUploadURLParams, yn as CustomCreateResponse, yr as ConnectedAccountRefreshParams, yt as WebhookSubscriptionUpdateResponse, z as ConsumerListConnectedToolkitsParams, zn as AuthConfigListParams, zr as ToolRetrieveEnumResponse } from "./session-configs-BLy_O6bX.mjs";
|
|
2
|
+
import { t as VERSION } from "./version-DB98yI2B.mjs";
|
|
3
|
+
import { Context, Effect, Layer, Logger, Predicate, Redacted, Stream } from "effect";
|
|
4
4
|
import * as HttpClient from "effect/http/HttpClient";
|
|
5
5
|
import * as Schema from "effect/Schema";
|
|
6
6
|
//#region src/effect/errors.d.ts
|
|
@@ -130,6 +130,13 @@ declare const isAPIError: (value: unknown) => value is APIStatusError;
|
|
|
130
130
|
/** Whether a value is any error this surface produces. Structural, like {@link isAPIError}. */
|
|
131
131
|
declare const isComposioError: (value: unknown) => value is ComposioError;
|
|
132
132
|
//#endregion
|
|
133
|
+
//#region src/effect/credentials.d.ts
|
|
134
|
+
type Key = string | Redacted.Redacted<string>;
|
|
135
|
+
type Provider = () => Key | PromiseLike<Key>;
|
|
136
|
+
/** A string or `Redacted` key, or a function returning one, called once per call. */
|
|
137
|
+
type Credential = Key | Provider;
|
|
138
|
+
type Auth$2 = AuthOf<Credential>;
|
|
139
|
+
//#endregion
|
|
133
140
|
//#region src/effect/decode.d.ts
|
|
134
141
|
/**
|
|
135
142
|
* What a client decodes with: an operation's public chain (`toolkits.list`) →
|
|
@@ -138,14 +145,6 @@ declare const isComposioError: (value: unknown) => value is ComposioError;
|
|
|
138
145
|
*/
|
|
139
146
|
type SchemaLoaders = Readonly<Record<string, () => Promise<Schema.Codec<unknown>>>>;
|
|
140
147
|
//#endregion
|
|
141
|
-
//#region src/effect/deprecation.d.ts
|
|
142
|
-
/**
|
|
143
|
-
* Whether the client reports deprecations: `'warn'` logs each distinct notice
|
|
144
|
-
* once per operation, `'off'` logs none — the counterpart of the compat
|
|
145
|
-
* client's `logLevel: 'off'`.
|
|
146
|
-
*/
|
|
147
|
-
type DeprecationNotices = 'warn' | 'off';
|
|
148
|
-
//#endregion
|
|
149
148
|
//#region src/effect/request.d.ts
|
|
150
149
|
/**
|
|
151
150
|
* What the client's own requests add to a trace:
|
|
@@ -573,7 +572,7 @@ interface Session {
|
|
|
573
572
|
//#endregion
|
|
574
573
|
//#region src/effect/generated/resources/auth/auth.d.ts
|
|
575
574
|
/** `client.auth` on the Effect surface. */
|
|
576
|
-
interface Auth {
|
|
575
|
+
interface Auth$1 {
|
|
577
576
|
readonly session: Session;
|
|
578
577
|
}
|
|
579
578
|
//#endregion
|
|
@@ -627,7 +626,7 @@ interface ClientResources {
|
|
|
627
626
|
readonly webhookSubscriptions: WebhookSubscriptions;
|
|
628
627
|
readonly webhookEndpoints: WebhookEndpoints;
|
|
629
628
|
readonly org: Org;
|
|
630
|
-
readonly auth: Auth;
|
|
629
|
+
readonly auth: Auth$1;
|
|
631
630
|
readonly apiKeyRevocation: ApiKeyRevocation;
|
|
632
631
|
readonly custom: Custom;
|
|
633
632
|
readonly keyring: Keyring;
|
|
@@ -635,15 +634,13 @@ interface ClientResources {
|
|
|
635
634
|
}
|
|
636
635
|
//#endregion
|
|
637
636
|
//#region src/effect/client.d.ts
|
|
638
|
-
|
|
639
|
-
|
|
637
|
+
type Auth = Auth$2;
|
|
638
|
+
declare const Auth: AuthConstructors<Credential>;
|
|
640
639
|
interface ClientSettings {
|
|
641
|
-
/**
|
|
642
|
-
readonly
|
|
643
|
-
/**
|
|
644
|
-
readonly
|
|
645
|
-
/** Organization API key (`OrgApiKeyAuth`, `x-org-api-key`), sent where an operation asks for it. */
|
|
646
|
-
readonly orgApiKey?: Credential;
|
|
640
|
+
/** `Auth.project(key)`, `Auth.user(key)`, `Auth.organization(key)`, `Auth.auto({ ... })` or `Auth.none()`. */
|
|
641
|
+
readonly auth: Auth;
|
|
642
|
+
/** Sent as `x-org-id` and `x-project-id`. */
|
|
643
|
+
readonly scope?: Scope | undefined;
|
|
647
644
|
/** The API origin. Defaults to `https://backend.composio.dev`. */
|
|
648
645
|
readonly baseURL?: string | undefined;
|
|
649
646
|
/**
|
|
@@ -677,11 +674,6 @@ interface ClientSettings {
|
|
|
677
674
|
* Defaults to one minute.
|
|
678
675
|
*/
|
|
679
676
|
readonly timeout?: number | undefined;
|
|
680
|
-
/**
|
|
681
|
-
* Whether deprecation notices are logged, through Effect's logger at the
|
|
682
|
-
* warning level. Defaults to `'warn'`.
|
|
683
|
-
*/
|
|
684
|
-
readonly deprecationNotices?: DeprecationNotices | undefined;
|
|
685
677
|
/**
|
|
686
678
|
* What the client's own requests add to a trace: `'off'` for nothing,
|
|
687
679
|
* `'span'` for a client span around each request, `'propagate'` for the span
|
|
@@ -699,7 +691,7 @@ interface ClientSettings {
|
|
|
699
691
|
* ```ts
|
|
700
692
|
* import { schemaLoaders } from '@composio/client/effect/schemas'
|
|
701
693
|
*
|
|
702
|
-
* make({
|
|
694
|
+
* make({ auth: Auth.project(key), decode: true, schemas: schemaLoaders }, httpClient)
|
|
703
695
|
* ```
|
|
704
696
|
*/
|
|
705
697
|
type DecodingOptions = {
|
|
@@ -749,21 +741,16 @@ declare const make: (options: ComposioClientOptions, httpClient: HttpClient.Http
|
|
|
749
741
|
* Provides the client from explicit options and the `HttpClient` in context.
|
|
750
742
|
* Reads no environment variable.
|
|
751
743
|
*/
|
|
752
|
-
declare const layer: (options
|
|
753
|
-
/**
|
|
754
|
-
* {@link layer} over a fetch-backed `HttpClient`, for an application that has
|
|
755
|
-
* no transport of its own to supply. `fetch` is the platform's, or whatever
|
|
756
|
-
* the `FetchHttpClient.Fetch` reference in context names.
|
|
757
|
-
*/
|
|
758
|
-
declare const layerFetch: (options?: ComposioClientOptions) => Layer.Layer<ComposioClient, ConfigurationError>;
|
|
744
|
+
declare const layer: (options: ComposioClientOptions) => Layer.Layer<ComposioClient, ConfigurationError, HttpClient.HttpClient>;
|
|
759
745
|
/**
|
|
760
|
-
* Provides the client from the `COMPOSIO_*` settings
|
|
761
|
-
* `
|
|
762
|
-
*
|
|
763
|
-
* context, which is the process environment unless the application says
|
|
764
|
-
* otherwise. An option given here wins over its setting; `null` for a
|
|
765
|
-
* credential means "none", whatever is configured.
|
|
746
|
+
* Provides the client from the `COMPOSIO_*` settings through the
|
|
747
|
+
* `ConfigProvider` in context, by `Composio.fromEnv`'s rules. Each override
|
|
748
|
+
* replaces the setting it names.
|
|
766
749
|
*/
|
|
767
|
-
declare const layerConfig: (
|
|
750
|
+
declare const layerConfig: (overrides?: Partial<ClientSettings> & DecodingOptions) => Layer.Layer<ComposioClient, ConfigurationError, HttpClient.HttpClient>;
|
|
751
|
+
//#endregion
|
|
752
|
+
//#region src/effect/deprecation.d.ts
|
|
753
|
+
/** Whether a log record is one of this client's deprecation notices, for a `Logger` that drops or routes them. */
|
|
754
|
+
declare const isDeprecationNotice: Predicate.Predicate<Logger.Options<unknown>>;
|
|
768
755
|
//#endregion
|
|
769
|
-
export { APIConnectionError, APIConnectionTimeoutError, APIError, type APIErrorBody, type APIErrorFields, type APIStatusError, AuthenticationError, BadRequestError, type ClientIdentity, ComposioClient, type ComposioClientOptions, type ComposioClientShape, type ComposioError, ConfigurationError, ConflictError, type Credential, DecodeError, type DecodeIssue, type
|
|
756
|
+
export { APIConnectionError, APIConnectionTimeoutError, APIError, type APIErrorBody, type APIErrorFields, type APIStatusError, Auth, AuthenticationError, type AutoCredentials, BadRequestError, type ClientIdentity, ComposioClient, type ComposioClientOptions, type ComposioClientShape, type ComposioError, ConfigurationError, ConflictError, type Credential, DecodeError, type DecodeIssue, type HeadersLike, InternalServerError, NotFoundError, PermissionDeniedError, RateLimitError, type RawBodyRequestOptions, type RawRequestOptions, type RequestOptions, type SchemaLoaders, type Scope, type Tracing, UnprocessableEntityError, VERSION, isAPIError, isComposioError, isDeprecationNotice, layer, layerConfig, make };
|