@composio/client 2.0.0-rc.1 → 2.0.0-rc.11
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 +108 -2
- package/dist/{api-key-revocation-BZL5FAx7.mjs → api-key-revocation-Dh-KSokR.mjs} +4 -3
- package/dist/{auth-CEq4JqWm.mjs → auth-Drov-jN8.mjs} +1 -1
- package/dist/{auth-configs-CyksMqNB.mjs → auth-configs-yM05-r6r.mjs} +18 -11
- package/dist/{clanker-4wByThQJ.mjs → clanker-BYmc69WC.mjs} +4 -3
- package/dist/cli-Ce8RT7yp.mjs +45 -0
- package/dist/{connected-accounts-B-qN_yLT.mjs → connected-accounts-D__sOoNZ.mjs} +31 -15
- package/dist/{consumer-DWlaGBmh.mjs → consumer-DTh50Hih.mjs} +8 -8
- package/dist/{custom-BQWoONFY.mjs → custom-CdC-6Y_i.mjs} +5 -3
- package/dist/custom-nlGufiDz.mjs +88 -0
- package/dist/error-DLB1uKM3.mjs +109 -0
- package/dist/{files-B-UnEejx.mjs → files-DROCPzLP.mjs} +7 -5
- package/dist/{files-CNZ-ttVS.mjs → files-RJPIH6iE.mjs} +13 -9
- package/dist/{generate-DSqfJENZ.mjs → generate-mU4b3zJf.mjs} +5 -3
- package/dist/{request-DwPfYYNF.mjs → generated-operations-CWhusMPU.mjs} +1266 -157
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +312 -827
- package/dist/keyring-BzkcB1gu.mjs +17 -0
- package/dist/{link-CukKZMxs.mjs → link-CfIyH3nF.mjs} +4 -3
- package/dist/{logs-B87z4hq7.mjs → logs-D2wxXYiO.mjs} +8 -6
- package/dist/{manage-By-b66OH.mjs → manage-Vc3jdRr_.mjs} +7 -5
- package/dist/mcp-DEe7xU7G.mjs +91 -0
- package/dist/{org-BSq_z6fP.mjs → org-CYsl9O1u.mjs} +9 -8
- package/dist/{owner-BDkEFEVF.mjs → owner-DmQb3AF5.mjs} +1 -1
- package/dist/pagination.d.mts +56 -0
- package/dist/pagination.mjs +50 -0
- package/dist/{project-D-c0Zrrl.mjs → project-BVBWJzHm.mjs} +1 -1
- package/dist/{project-_s0fWHut.mjs → project-D-_r3H1_.mjs} +7 -7
- package/dist/project-DvSCDA9B.mjs +47 -0
- package/dist/{project-Cj-NKnWZ.mjs → project-OSigfIdr.mjs} +4 -3
- package/dist/realtime-Dsk1QGAl.mjs +28 -0
- 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 +2 -0
- package/dist/resources/custom.mjs +3 -0
- 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 +2 -0
- package/dist/resources/keyring.mjs +3 -0
- 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 +2 -0
- package/dist/resources/session-configs.mjs +24 -0
- 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-Do3wHYNe.mjs → session-BUYbl8BA.mjs} +39 -26
- package/dist/{session-DNm4GFO-.mjs → session-DfISYrbs.mjs} +3 -2
- package/dist/{client-CK6bm7nf.d.mts → session-configs-CipRvstF.d.mts} +5450 -1009
- package/dist/{tool-router-5OfsPkJ_.mjs → tool-router-DJQ12uhs.mjs} +1 -1
- package/dist/toolkits-CbdyRtvr.mjs +62 -0
- package/dist/tools-DiH6dAto.mjs +69 -0
- package/dist/tools-a29E_8La.mjs +33 -0
- package/dist/{trigger-instances-lkKWqHgd.mjs → trigger-instances-Bg0n7X-d.mjs} +8 -6
- package/dist/{triggers-DNx9yjbS.mjs → triggers-BoSFNGss.mjs} +6 -4
- package/dist/triggers-types-BPtTEwUA.mjs +34 -0
- package/dist/{usage-CKyu9RzD.mjs → usage-CHVyZ3tm.mjs} +7 -5
- package/dist/{usage-Cv9VNy5H.mjs → usage-Cs10eWCd.mjs} +7 -5
- package/dist/{webhook-endpoints-DIyg3YlR.mjs → webhook-endpoints-B4lZc5YC.mjs} +15 -10
- package/dist/webhook-subscriptions-DJTSJd6K.mjs +55 -0
- package/package.json +21 -6
- package/dist/cli-Bi4_ORQO.mjs +0 -45
- package/dist/mcp-B0wla_93.mjs +0 -73
- package/dist/project-C0h91WGF.mjs +0 -42
- package/dist/realtime-BcHoYszT.mjs +0 -26
- package/dist/toolkits-CcE90C2S.mjs +0 -43
- package/dist/tools-B5uEInC8.mjs +0 -30
- package/dist/tools-CdVgfSpk.mjs +0 -63
- package/dist/triggers-types-MjEcrPbH.mjs +0 -31
- package/dist/webhook-subscriptions-B7AgTACq.mjs +0 -48
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { c as withOperation, n as generatedOperation } from "./generated-operations-CWhusMPU.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/compat/resources/keyring.ts
|
|
4
|
+
const OP_LIST_TRANSFER_KEYS = generatedOperation("keyring.listTransferKeys");
|
|
5
|
+
/** OpenAPI resource for `keyring`. */
|
|
6
|
+
var Keyring = class {
|
|
7
|
+
#client;
|
|
8
|
+
constructor(client) {
|
|
9
|
+
this.#client = client;
|
|
10
|
+
}
|
|
11
|
+
listTransferKeys(options) {
|
|
12
|
+
return this.#client.get("/api/v3.1/keyring/transfer_keys", withOperation(OP_LIST_TRANSFER_KEYS, { ...options }));
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { Keyring as t };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as withOperation, n as generatedOperation } from "./generated-operations-CWhusMPU.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/compat/resources/link.ts
|
|
4
|
+
const OP_CREATE = generatedOperation("link.create");
|
|
4
5
|
/**
|
|
5
6
|
* Stainless-shaped `client.link` resource: the 1-method connected-account
|
|
6
7
|
* link surface of `@composio/client` (`POST /connected_accounts/link`).
|
|
@@ -11,10 +12,10 @@ var Link = class {
|
|
|
11
12
|
this.#client = client;
|
|
12
13
|
}
|
|
13
14
|
create(body, options) {
|
|
14
|
-
return this.#client.post(
|
|
15
|
+
return this.#client.post("/api/v3.1/connected_accounts/link", withOperation(OP_CREATE, {
|
|
15
16
|
body,
|
|
16
17
|
...options
|
|
17
|
-
});
|
|
18
|
+
}));
|
|
18
19
|
}
|
|
19
20
|
};
|
|
20
21
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as Triggers } from "./triggers-
|
|
3
|
-
import { t as Tools } from "./tools-
|
|
1
|
+
import { a as path, c as withOperation, n as generatedOperation } from "./generated-operations-CWhusMPU.mjs";
|
|
2
|
+
import { t as Triggers } from "./triggers-BoSFNGss.mjs";
|
|
3
|
+
import { t as Tools } from "./tools-a29E_8La.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/compat/resources/logs/logs.ts
|
|
6
|
+
const OP_CREATE_TOOL_EXECUTION = generatedOperation("logs.createToolExecution");
|
|
7
|
+
const OP_RETRIEVE_TOOL_EXECUTION = generatedOperation("logs.retrieveToolExecution");
|
|
6
8
|
/**
|
|
7
9
|
* Stainless-shaped `client.logs` resource: a method-less container in the
|
|
8
10
|
* published Stainless client (the `triggers` and `tools` log sub-resources)
|
|
@@ -20,13 +22,13 @@ var Logs = class {
|
|
|
20
22
|
this.tools = new Tools(client);
|
|
21
23
|
}
|
|
22
24
|
createToolExecution(body = {}, options) {
|
|
23
|
-
return this.#client.post(
|
|
25
|
+
return this.#client.post("/api/v3.1/logs/tool_execution", withOperation(OP_CREATE_TOOL_EXECUTION, {
|
|
24
26
|
body,
|
|
25
27
|
...options
|
|
26
|
-
});
|
|
28
|
+
}));
|
|
27
29
|
}
|
|
28
30
|
retrieveToolExecution(id, options) {
|
|
29
|
-
return this.#client.get(path`/api/v3.1/logs/tool_execution/${id}`, { ...options });
|
|
31
|
+
return this.#client.get(path`/api/v3.1/logs/tool_execution/${id}`, withOperation(OP_RETRIEVE_TOOL_EXECUTION, { ...options }));
|
|
30
32
|
}
|
|
31
33
|
};
|
|
32
34
|
Logs.Triggers = Triggers;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as path, c as withOperation, n as generatedOperation } from "./generated-operations-CWhusMPU.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/compat/resources/trigger-instances/manage.ts
|
|
4
|
+
const OP_UPDATE = generatedOperation("triggerInstances.manage.update");
|
|
5
|
+
const OP_DELETE = generatedOperation("triggerInstances.manage.delete");
|
|
4
6
|
/**
|
|
5
7
|
* Stainless-shaped `client.triggerInstances.manage` resource: the 2-method
|
|
6
8
|
* trigger-instance management sub-surface of `@composio/client`
|
|
@@ -11,14 +13,14 @@ var Manage = class {
|
|
|
11
13
|
constructor(client) {
|
|
12
14
|
this.#client = client;
|
|
13
15
|
}
|
|
14
|
-
update(triggerID, body, options) {
|
|
15
|
-
return this.#client.patch(path`/api/v3.1/trigger_instances/manage/${triggerID}`, {
|
|
16
|
+
update(triggerID, body = {}, options) {
|
|
17
|
+
return this.#client.patch(path`/api/v3.1/trigger_instances/manage/${triggerID}`, withOperation(OP_UPDATE, {
|
|
16
18
|
body,
|
|
17
19
|
...options
|
|
18
|
-
});
|
|
20
|
+
}));
|
|
19
21
|
}
|
|
20
22
|
delete(triggerID, options) {
|
|
21
|
-
return this.#client.delete(path`/api/v3.1/trigger_instances/manage/${triggerID}`, { ...options });
|
|
23
|
+
return this.#client.delete(path`/api/v3.1/trigger_instances/manage/${triggerID}`, withOperation(OP_DELETE, { ...options }));
|
|
22
24
|
}
|
|
23
25
|
};
|
|
24
26
|
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { a as path, c as withOperation, n as generatedOperation } from "./generated-operations-CWhusMPU.mjs";
|
|
2
|
+
import { t as Custom } from "./custom-CdC-6Y_i.mjs";
|
|
3
|
+
import { t as Generate } from "./generate-mU4b3zJf.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/compat/resources/mcp/mcp.ts
|
|
6
|
+
const OP_CREATE = generatedOperation("mcp.create");
|
|
7
|
+
const OP_RETRIEVE = generatedOperation("mcp.retrieve");
|
|
8
|
+
const OP_UPDATE = generatedOperation("mcp.update");
|
|
9
|
+
const OP_LIST = generatedOperation("mcp.list");
|
|
10
|
+
const OP_DELETE = generatedOperation("mcp.delete");
|
|
11
|
+
const OP_CREATE_INSTANCE = generatedOperation("mcp.createInstance");
|
|
12
|
+
const OP_DELETE_INSTANCE = generatedOperation("mcp.deleteInstance");
|
|
13
|
+
const OP_LIST_INSTANCES = generatedOperation("mcp.listInstances");
|
|
14
|
+
const OP_RETRIEVE_APP = generatedOperation("mcp.retrieveApp");
|
|
15
|
+
/**
|
|
16
|
+
* Stainless-shaped `client.mcp` resource: the 6-method published surface of
|
|
17
|
+
* `@composio/client` (create/retrieve/update/list/delete/retrieveApp) plus the
|
|
18
|
+
* spec-surface `/mcp/servers/{serverId}/instances` trio (listInstances/
|
|
19
|
+
* createInstance/deleteInstance), never published by Stainless — wayfinder
|
|
20
|
+
* ticket 29. Dispatched through the handwritten kernel.
|
|
21
|
+
*/
|
|
22
|
+
var Mcp = class {
|
|
23
|
+
custom;
|
|
24
|
+
generate;
|
|
25
|
+
#client;
|
|
26
|
+
constructor(client) {
|
|
27
|
+
this.#client = client;
|
|
28
|
+
this.custom = new Custom(client);
|
|
29
|
+
this.generate = new Generate(client);
|
|
30
|
+
}
|
|
31
|
+
/** @deprecated Deprecated in the input OpenAPI schema. */
|
|
32
|
+
create(body, options) {
|
|
33
|
+
return this.#client.post("/api/v3.1/mcp/servers", withOperation(OP_CREATE, {
|
|
34
|
+
body,
|
|
35
|
+
...options
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
/** @deprecated Deprecated in the input OpenAPI schema. */
|
|
39
|
+
retrieve(id, options) {
|
|
40
|
+
return this.#client.get(path`/api/v3.1/mcp/${id}`, withOperation(OP_RETRIEVE, { ...options }));
|
|
41
|
+
}
|
|
42
|
+
/** @deprecated Deprecated in the input OpenAPI schema. */
|
|
43
|
+
update(id, body = {}, options) {
|
|
44
|
+
return this.#client.patch(path`/api/v3.1/mcp/${id}`, withOperation(OP_UPDATE, {
|
|
45
|
+
body,
|
|
46
|
+
...options
|
|
47
|
+
}));
|
|
48
|
+
}
|
|
49
|
+
/** @deprecated Deprecated in the input OpenAPI schema. */
|
|
50
|
+
list(query = {}, options) {
|
|
51
|
+
return this.#client.get("/api/v3.1/mcp/servers", withOperation(OP_LIST, {
|
|
52
|
+
query,
|
|
53
|
+
...options
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
/** @deprecated Deprecated in the input OpenAPI schema. */
|
|
57
|
+
delete(id, options) {
|
|
58
|
+
return this.#client.delete(path`/api/v3.1/mcp/${id}`, withOperation(OP_DELETE, { ...options }));
|
|
59
|
+
}
|
|
60
|
+
/** @deprecated Deprecated in the input OpenAPI schema. */
|
|
61
|
+
createInstance(serverID, body, options) {
|
|
62
|
+
return this.#client.post(path`/api/v3.1/mcp/servers/${serverID}/instances`, withOperation(OP_CREATE_INSTANCE, {
|
|
63
|
+
body,
|
|
64
|
+
...options
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
/** @deprecated Deprecated in the input OpenAPI schema. */
|
|
68
|
+
deleteInstance(instanceID, params, options) {
|
|
69
|
+
const { serverId } = params;
|
|
70
|
+
return this.#client.delete(path`/api/v3.1/mcp/servers/${serverId}/instances/${instanceID}`, withOperation(OP_DELETE_INSTANCE, { ...options }));
|
|
71
|
+
}
|
|
72
|
+
/** @deprecated Deprecated in the input OpenAPI schema. */
|
|
73
|
+
listInstances(serverID, query = {}, options) {
|
|
74
|
+
return this.#client.get(path`/api/v3.1/mcp/servers/${serverID}/instances`, withOperation(OP_LIST_INSTANCES, {
|
|
75
|
+
query,
|
|
76
|
+
...options
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
79
|
+
/** @deprecated Deprecated in the input OpenAPI schema. */
|
|
80
|
+
retrieveApp(appKey, query = {}, options) {
|
|
81
|
+
return this.#client.get(path`/api/v3.1/mcp/app/${appKey}`, withOperation(OP_RETRIEVE_APP, {
|
|
82
|
+
query,
|
|
83
|
+
...options
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
Mcp.Custom = Custom;
|
|
88
|
+
Mcp.Generate = Generate;
|
|
89
|
+
|
|
90
|
+
//#endregion
|
|
91
|
+
export { Mcp as t };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as Clanker } from "./clanker-
|
|
3
|
-
import { t as Consumer } from "./consumer-
|
|
4
|
-
import { t as Owner } from "./owner-
|
|
5
|
-
import { t as Project } from "./project-
|
|
6
|
-
import { t as Usage } from "./usage-
|
|
1
|
+
import { c as withOperation, n as generatedOperation } from "./generated-operations-CWhusMPU.mjs";
|
|
2
|
+
import { t as Clanker } from "./clanker-BYmc69WC.mjs";
|
|
3
|
+
import { t as Consumer } from "./consumer-DTh50Hih.mjs";
|
|
4
|
+
import { t as Owner } from "./owner-DmQb3AF5.mjs";
|
|
5
|
+
import { t as Project } from "./project-OSigfIdr.mjs";
|
|
6
|
+
import { t as Usage } from "./usage-Cs10eWCd.mjs";
|
|
7
7
|
|
|
8
8
|
//#region src/compat/resources/org/org.ts
|
|
9
|
+
const OP_LIST = generatedOperation("org.list");
|
|
9
10
|
/**
|
|
10
11
|
* Spec-surface `client.org` resource: the 1-method org root of the v3.1 spec
|
|
11
12
|
* (`GET /org/list`) plus the owner/consumer/project/usage/clanker
|
|
@@ -28,10 +29,10 @@ var Org = class {
|
|
|
28
29
|
this.clanker = new Clanker(client);
|
|
29
30
|
}
|
|
30
31
|
list(query = {}, options) {
|
|
31
|
-
return this.#client.get(
|
|
32
|
+
return this.#client.get("/api/v3.1/org/list", withOperation(OP_LIST, {
|
|
32
33
|
query,
|
|
33
34
|
...options
|
|
34
|
-
});
|
|
35
|
+
}));
|
|
35
36
|
}
|
|
36
37
|
};
|
|
37
38
|
Org.Owner = Owner;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
//#region src/pagination.d.ts
|
|
2
|
+
/** A stable cursor value that can be compared across independently decoded pages. */
|
|
3
|
+
type PaginationCursor = string | number;
|
|
4
|
+
/** The position supplied to a paginated operation for one page request. */
|
|
5
|
+
interface PaginationRequest<Cursor extends PaginationCursor> {
|
|
6
|
+
/** The continuation from the preceding response, absent on the first page. */
|
|
7
|
+
readonly cursor: Cursor | undefined;
|
|
8
|
+
}
|
|
9
|
+
/** A standard Composio cursor page. */
|
|
10
|
+
interface CursorPage<Item> {
|
|
11
|
+
readonly items: ReadonlyArray<Item>;
|
|
12
|
+
readonly next_cursor?: string | null;
|
|
13
|
+
}
|
|
14
|
+
/** Extracts the item carried by a standard Composio cursor page. */
|
|
15
|
+
type CursorPageItem<Page> = Page extends CursorPage<infer Item> ? Item : never;
|
|
16
|
+
/** Fetches one page through a concrete SDK operation. */
|
|
17
|
+
type PageFetcher<Page, Cursor extends PaginationCursor> = (request: PaginationRequest<Cursor>) => PromiseLike<Page>;
|
|
18
|
+
/** Adapts an operation-specific response envelope to pagination. */
|
|
19
|
+
interface PaginationAdapter<Page, Item, Cursor extends PaginationCursor> {
|
|
20
|
+
/** Returns the items carried by one response page. */
|
|
21
|
+
readonly items: (page: Page) => ReadonlyArray<Item>;
|
|
22
|
+
/** Returns the continuation for the next request, or nullish at the end. */
|
|
23
|
+
readonly nextCursor: (page: Page) => Cursor | null | undefined;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A lazy traversal of one SDK operation.
|
|
27
|
+
*
|
|
28
|
+
* Each iterator starts a fresh traversal. Pages are requested sequentially and
|
|
29
|
+
* only on demand, so breaking out of iteration does not request another page.
|
|
30
|
+
* The supplied operation remains responsible for its query, page size, request
|
|
31
|
+
* options, cancellation, and normal client retry behavior.
|
|
32
|
+
*/
|
|
33
|
+
interface Pagination<Item, Page> extends AsyncIterable<Item> {
|
|
34
|
+
[Symbol.asyncIterator](): AsyncIterableIterator<Item>;
|
|
35
|
+
/** Iterates complete response pages without flattening their items. */
|
|
36
|
+
iterPages(): AsyncIterable<Page>;
|
|
37
|
+
/** Collects every item into memory. Prefer iteration for large collections. */
|
|
38
|
+
toArray(): Promise<Array<Item>>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Lazily traverses a standard Composio `items` / `next_cursor` operation.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* const tools = paginate(({ cursor }) =>
|
|
46
|
+
* client.tools.list({ ...filters, cursor, limit: 1000 }),
|
|
47
|
+
* )
|
|
48
|
+
*
|
|
49
|
+
* for await (const tool of tools) console.log(tool.slug)
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
declare function paginate<Page extends CursorPage<unknown>>(fetchPage: PageFetcher<Page, string>): Pagination<CursorPageItem<Page>, Page>;
|
|
53
|
+
/** Lazily traverses an operation with an operation-specific response envelope. */
|
|
54
|
+
declare function paginate<Page, Item, Cursor extends PaginationCursor>(fetchPage: PageFetcher<Page, Cursor>, adapter: PaginationAdapter<Page, Item, Cursor>): Pagination<Item, Page>;
|
|
55
|
+
//#endregion
|
|
56
|
+
export { CursorPage, CursorPageItem, PageFetcher, Pagination, PaginationAdapter, PaginationCursor, PaginationRequest, paginate };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { s as ComposioError } from "./error-DLB1uKM3.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/pagination.ts
|
|
4
|
+
var PaginationTraversal = class {
|
|
5
|
+
fetchPage;
|
|
6
|
+
adapter;
|
|
7
|
+
constructor(fetchPage, adapter) {
|
|
8
|
+
this.fetchPage = fetchPage;
|
|
9
|
+
this.adapter = adapter;
|
|
10
|
+
}
|
|
11
|
+
async *iterPages() {
|
|
12
|
+
let cursor;
|
|
13
|
+
const seenCursors = /* @__PURE__ */ new Set();
|
|
14
|
+
while (true) {
|
|
15
|
+
const page = await this.fetchPage({ cursor });
|
|
16
|
+
yield page;
|
|
17
|
+
const nextCursor = this.adapter.nextCursor(page);
|
|
18
|
+
if (nextCursor === null || nextCursor === void 0 || nextCursor === "") return;
|
|
19
|
+
if (seenCursors.has(nextCursor)) throw new ComposioError("Pagination cursor did not advance");
|
|
20
|
+
seenCursors.add(nextCursor);
|
|
21
|
+
cursor = nextCursor;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
/** Collects every item into memory. Prefer iteration for large collections. */
|
|
25
|
+
async toArray() {
|
|
26
|
+
const items = [];
|
|
27
|
+
for await (const item of this) items.push(item);
|
|
28
|
+
return items;
|
|
29
|
+
}
|
|
30
|
+
async *[Symbol.asyncIterator]() {
|
|
31
|
+
for await (const page of this.iterPages()) {
|
|
32
|
+
const items = this.adapter.items(page);
|
|
33
|
+
if (!Array.isArray(items)) throw new ComposioError("Pagination adapter items() must return an array");
|
|
34
|
+
yield* items;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
function paginate(fetchPage, adapter) {
|
|
39
|
+
return new PaginationTraversal(fetchPage, adapter ?? {
|
|
40
|
+
items: (page) => page.items,
|
|
41
|
+
nextCursor: (page) => {
|
|
42
|
+
const cursorPage = page;
|
|
43
|
+
if (!Object.prototype.hasOwnProperty.call(cursorPage, "next_cursor") && typeof cursorPage.current_page === "number" && typeof cursorPage.total_pages === "number" && cursorPage.current_page < cursorPage.total_pages) throw new ComposioError("Pagination response omitted next_cursor before its final page; provide a custom adapter");
|
|
44
|
+
return cursorPage.next_cursor;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
export { paginate };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as withOperation, m as mergeHeaders, n as generatedOperation } from "./generated-operations-CWhusMPU.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/compat/resources/org/consumer/project.ts
|
|
4
|
+
const OP_RESOLVE = generatedOperation("org.consumer.project.resolve");
|
|
4
5
|
/**
|
|
5
6
|
* Spec-surface `client.org.consumer.project` resource: the 1-method consumer
|
|
6
7
|
* project-resolution surface of the v3.1 spec
|
|
@@ -14,14 +15,13 @@ var Project = class {
|
|
|
14
15
|
}
|
|
15
16
|
resolve(params, options) {
|
|
16
17
|
const { "x-user-api-key": xUserApiKey, "x-org-id": xOrgId } = params;
|
|
17
|
-
return this.#client.post(
|
|
18
|
+
return this.#client.post("/api/v3.1/org/consumer/project/resolve", withOperation(OP_RESOLVE, {
|
|
18
19
|
...options,
|
|
19
|
-
headers: {
|
|
20
|
+
headers: mergeHeaders([{
|
|
20
21
|
...xUserApiKey != null ? { "x-user-api-key": xUserApiKey } : void 0,
|
|
21
|
-
...xOrgId != null ? { "x-org-id": xOrgId } : void 0
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
});
|
|
22
|
+
...xOrgId != null ? { "x-org-id": xOrgId } : void 0
|
|
23
|
+
}, options?.headers])
|
|
24
|
+
}));
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
27
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { a as path, c as withOperation, n as generatedOperation } from "./generated-operations-CWhusMPU.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/compat/resources/org/owner/project.ts
|
|
4
|
+
const OP_CREATE = generatedOperation("org.owner.project.create");
|
|
5
|
+
const OP_RETRIEVE = generatedOperation("org.owner.project.retrieve");
|
|
6
|
+
const OP_LIST = generatedOperation("org.owner.project.list");
|
|
7
|
+
const OP_DELETE = generatedOperation("org.owner.project.delete");
|
|
8
|
+
const OP_REGENERATE_APIKEY = generatedOperation("org.owner.project.regenerateAPIKey");
|
|
9
|
+
/**
|
|
10
|
+
* Spec-surface `client.org.owner.project` resource: the 5-method owner-scoped
|
|
11
|
+
* project surface of the v3.1 spec (create/list/retrieve/delete/
|
|
12
|
+
* regenerateAPIKey over `/org/owner/project/*`), never published by
|
|
13
|
+
* Stainless — wayfinder ticket 31.
|
|
14
|
+
*/
|
|
15
|
+
var Project = class {
|
|
16
|
+
#client;
|
|
17
|
+
constructor(client) {
|
|
18
|
+
this.#client = client;
|
|
19
|
+
}
|
|
20
|
+
create(body, options) {
|
|
21
|
+
return this.#client.post("/api/v3.1/org/owner/project/new", withOperation(OP_CREATE, {
|
|
22
|
+
body,
|
|
23
|
+
...options
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
retrieve(nanoID, options) {
|
|
27
|
+
return this.#client.get(path`/api/v3.1/org/owner/project/${nanoID}`, withOperation(OP_RETRIEVE, { ...options }));
|
|
28
|
+
}
|
|
29
|
+
list(query = {}, options) {
|
|
30
|
+
return this.#client.get("/api/v3.1/org/owner/project/list", withOperation(OP_LIST, {
|
|
31
|
+
query,
|
|
32
|
+
...options
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
delete(nanoID, query = {}, options) {
|
|
36
|
+
return this.#client.delete(path`/api/v3.1/org/owner/project/${nanoID}`, withOperation(OP_DELETE, {
|
|
37
|
+
query,
|
|
38
|
+
...options
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
regenerateAPIKey(nanoID, options) {
|
|
42
|
+
return this.#client.post(path`/api/v3.1/org/owner/project/${nanoID}/regenerate_api_key`, withOperation(OP_REGENERATE_APIKEY, { ...options }));
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
//#endregion
|
|
47
|
+
export { Project as t };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as withOperation, n as generatedOperation } from "./generated-operations-CWhusMPU.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/compat/resources/org/project.ts
|
|
4
|
+
const OP_LIST = generatedOperation("org.project.list");
|
|
4
5
|
/**
|
|
5
6
|
* Spec-surface `client.org.project` resource: the 1-method org-context
|
|
6
7
|
* project listing of the v3.1 spec (`GET /org/project/list` — deliberately
|
|
@@ -13,10 +14,10 @@ var Project = class {
|
|
|
13
14
|
this.#client = client;
|
|
14
15
|
}
|
|
15
16
|
list(query = {}, options) {
|
|
16
|
-
return this.#client.get(
|
|
17
|
+
return this.#client.get("/api/v3.1/org/project/list", withOperation(OP_LIST, {
|
|
17
18
|
query,
|
|
18
19
|
...options
|
|
19
|
-
});
|
|
20
|
+
}));
|
|
20
21
|
}
|
|
21
22
|
};
|
|
22
23
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { c as withOperation, n as generatedOperation } from "./generated-operations-CWhusMPU.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/compat/resources/cli/realtime.ts
|
|
4
|
+
const OP_AUTH = generatedOperation("cli.realtime.auth");
|
|
5
|
+
const OP_CREDENTIALS = generatedOperation("cli.realtime.credentials");
|
|
6
|
+
/**
|
|
7
|
+
* Stainless-shaped `client.cli.realtime` resource: the 2-method Pusher
|
|
8
|
+
* realtime sub-surface of `@composio/client` (auth/credentials on
|
|
9
|
+
* `/cli/realtime/*`).
|
|
10
|
+
*/
|
|
11
|
+
var Realtime = class {
|
|
12
|
+
#client;
|
|
13
|
+
constructor(client) {
|
|
14
|
+
this.#client = client;
|
|
15
|
+
}
|
|
16
|
+
auth(body, options) {
|
|
17
|
+
return this.#client.post("/api/v3.1/cli/realtime/auth", withOperation(OP_AUTH, {
|
|
18
|
+
body,
|
|
19
|
+
...options
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
credentials(options) {
|
|
23
|
+
return this.#client.get("/api/v3.1/cli/realtime/credentials", withOperation(OP_CREDENTIALS, { ...options }));
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
export { Realtime as t };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as ApiKeyRevocationCreateResponse, v as ApiKeyRevocation, y as ApiKeyRevocationCreateParams } from "../session-configs-CipRvstF.mjs";
|
|
2
2
|
export { ApiKeyRevocation, type ApiKeyRevocationCreateParams, type ApiKeyRevocationCreateResponse };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { x as Auth } from "../../session-configs-CipRvstF.mjs";
|
|
2
2
|
export { Auth };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as SessionRetrieveInfoResponse, S as Session, x as Auth } from "../../session-configs-CipRvstF.mjs";
|
|
2
2
|
export { Auth, Session, type SessionRetrieveInfoResponse };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as SessionRetrieveInfoResponse, S as Session } from "../../session-configs-CipRvstF.mjs";
|
|
2
2
|
export { Session, type SessionRetrieveInfoResponse };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Bn as AuthConfigListResponse, Fn as AuthConfigCreateParams, Gn as AuthConfigUpdateStatusResponse, Hn as AuthConfigUpdateParams, In as AuthConfigCreateResponse, Kn as AuthConfigs, Ln as AuthConfigDeleteParams, Rn as AuthConfigDeleteResponse, Un as AuthConfigUpdateResponse, Vn as AuthConfigRetrieveResponse, Wn as AuthConfigUpdateStatusParams, zn as AuthConfigListParams } from "../session-configs-CipRvstF.mjs";
|
|
2
2
|
export { type AuthConfigCreateParams, type AuthConfigCreateResponse, type AuthConfigDeleteParams, type AuthConfigDeleteResponse, type AuthConfigListParams, type AuthConfigListResponse, type AuthConfigRetrieveResponse, type AuthConfigUpdateParams, type AuthConfigUpdateResponse, type AuthConfigUpdateStatusParams, type AuthConfigUpdateStatusResponse, AuthConfigs };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as SessionRetrieveInfoResponse, S as Session, x as Auth } from "../session-configs-CipRvstF.mjs";
|
|
2
2
|
export { Auth, Session, type SessionRetrieveInfoResponse };
|
package/dist/resources/auth.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as Session } from "../session-
|
|
2
|
-
import { t as Auth } from "../auth-
|
|
1
|
+
import { t as Session } from "../session-DfISYrbs.mjs";
|
|
2
|
+
import { t as Auth } from "../auth-Drov-jN8.mjs";
|
|
3
3
|
import "./auth/index.mjs";
|
|
4
4
|
|
|
5
5
|
export { Auth, Session };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Bt as Cli, Gt as CliGetSessionParams, Ht as CliCreateCodactFailureResponse, Kt as CliGetSessionResponse, Ut as CliCreateSessionParams, Vt as CliCreateCodactFailureParams, Wt as CliCreateSessionResponse } from "../../session-configs-CipRvstF.mjs";
|
|
2
2
|
export { Cli, CliCreateCodactFailureParams, CliCreateCodactFailureResponse, CliCreateSessionParams, CliCreateSessionResponse, CliGetSessionParams, CliGetSessionResponse };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Bt as Cli, Gt as CliGetSessionParams, Ht as CliCreateCodactFailureResponse, Jt as RealtimeAuthParams, Kt as CliGetSessionResponse, Ut as CliCreateSessionParams, Vt as CliCreateCodactFailureParams, Wt as CliCreateSessionResponse, Xt as RealtimeCredentialsResponse, Yt as RealtimeAuthResponse, qt as Realtime } from "../../session-configs-CipRvstF.mjs";
|
|
2
2
|
export { Cli, type CliCreateCodactFailureParams, type CliCreateCodactFailureResponse, type CliCreateSessionParams, type CliCreateSessionResponse, type CliGetSessionParams, type CliGetSessionResponse, Realtime, type RealtimeAuthParams, type RealtimeAuthResponse, type RealtimeCredentialsResponse };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Jt as RealtimeAuthParams, Xt as RealtimeCredentialsResponse, Yt as RealtimeAuthResponse, qt as Realtime } from "../../session-configs-CipRvstF.mjs";
|
|
2
2
|
export { Realtime, RealtimeAuthParams, RealtimeAuthResponse, RealtimeCredentialsResponse };
|
package/dist/resources/cli.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Bt as Cli, Gt as CliGetSessionParams, Ht as CliCreateCodactFailureResponse, Jt as RealtimeAuthParams, Kt as CliGetSessionResponse, Ut as CliCreateSessionParams, Vt as CliCreateCodactFailureParams, Wt as CliCreateSessionResponse, Xt as RealtimeCredentialsResponse, Yt as RealtimeAuthResponse, qt as Realtime } from "../session-configs-CipRvstF.mjs";
|
|
2
2
|
export { Cli, type CliCreateCodactFailureParams, type CliCreateCodactFailureResponse, type CliCreateSessionParams, type CliCreateSessionResponse, type CliGetSessionParams, type CliGetSessionResponse, Realtime, type RealtimeAuthParams, type RealtimeAuthResponse, type RealtimeCredentialsResponse };
|
package/dist/resources/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as Realtime } from "../realtime-
|
|
2
|
-
import { t as Cli } from "../cli-
|
|
1
|
+
import { t as Realtime } from "../realtime-Dsk1QGAl.mjs";
|
|
2
|
+
import { t as Cli } from "../cli-Ce8RT7yp.mjs";
|
|
3
3
|
import "./cli/index.mjs";
|
|
4
4
|
|
|
5
5
|
export { Cli, Realtime };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ar as ConnectedAccountDeleteResponse, cr as ConnectedAccountPatchParams, dr as ConnectedAccountRefreshResponse, fr as ConnectedAccountRetrieveResponse, hr as ConnectedAccounts, ir as ConnectedAccountDeleteParams, lr as ConnectedAccountPatchResponse, mr as ConnectedAccountUpdateStatusResponse, nr as ConnectedAccountCreateParams, or as ConnectedAccountListParams, pr as ConnectedAccountUpdateStatusParams, rr as ConnectedAccountCreateResponse, sr as ConnectedAccountListResponse, ur as ConnectedAccountRefreshParams } from "../session-configs-CipRvstF.mjs";
|
|
2
2
|
export { type ConnectedAccountCreateParams, type ConnectedAccountCreateResponse, type ConnectedAccountDeleteParams, type ConnectedAccountDeleteResponse, type ConnectedAccountListParams, type ConnectedAccountListResponse, type ConnectedAccountPatchParams, type ConnectedAccountPatchResponse, type ConnectedAccountRefreshParams, type ConnectedAccountRefreshResponse, type ConnectedAccountRetrieveResponse, type ConnectedAccountUpdateStatusParams, type ConnectedAccountUpdateStatusResponse, ConnectedAccounts };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { _ as CustomUpsertResponse, f as Custom, g as CustomUpsertParams, h as CustomSyncResponse, m as CustomSyncParams, p as CustomDeleteToolkitResponse } from "../session-configs-CipRvstF.mjs";
|
|
2
|
+
export { Custom, type CustomDeleteToolkitResponse, type CustomSyncParams, type CustomSyncResponse, type CustomUpsertParams, type CustomUpsertResponse };
|