@composio/core 0.1.12-alpha.11 → 0.1.12-alpha.12
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/dist/index.cjs +704 -218
- package/dist/index.d.cts +483 -94
- package/dist/index.d.ts +483 -94
- package/dist/index.js +700 -215
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import ComposioClient from '@composio/client';
|
|
2
2
|
import { z, ZodObject, ZodString, ZodNumber, ZodBoolean, ZodOptional } from 'zod';
|
|
3
3
|
import { ToolProxyParams, ToolProxyResponse, ToolRetrieveEnumResponse, ToolGetInputParams, ToolGetInputResponse } from '@composio/client/resources/tools';
|
|
4
|
-
import {
|
|
5
|
-
import { TriggerInstanceListActiveParams, TriggerInstanceUpsertParams, TriggerInstanceUpsertResponse, TriggerInstanceRemoveUpsertResponse, TriggerInstanceUpdateStatusParams, TriggersTypeListParams, TriggersTypeListResponse, TriggersTypeRetrieveResponse, TriggersTypeRetrieveEnumResponse } from '@composio/client/resources/index';
|
|
4
|
+
import { TriggersTypeListParams, TriggersTypeListResponse, TriggersTypeRetrieveResponse, TriggersTypeRetrieveEnumResponse } from '@composio/client/resources/index';
|
|
6
5
|
import { AuthConfigUpdateResponse, AuthConfigDeleteResponse, AuthConfigUpdateStatusResponse } from '@composio/client/resources/auth-configs';
|
|
7
6
|
import { ConnectedAccountRetrieveResponse as ConnectedAccountRetrieveResponse$1, ConnectedAccountListResponse as ConnectedAccountListResponse$1, ConnectedAccountDeleteResponse, ConnectedAccountRefreshResponse, ConnectedAccountUpdateStatusParams, ConnectedAccountUpdateStatusResponse } from '@composio/client/resources/connected-accounts';
|
|
8
7
|
import { OpenAI } from 'openai';
|
|
@@ -18,8 +17,50 @@ declare const ToolSchema: z.ZodObject<{
|
|
|
18
17
|
slug: z.ZodString;
|
|
19
18
|
name: z.ZodString;
|
|
20
19
|
description: z.ZodOptional<z.ZodString>;
|
|
21
|
-
inputParameters: z.ZodOptional<z.
|
|
22
|
-
|
|
20
|
+
inputParameters: z.ZodOptional<z.ZodObject<{
|
|
21
|
+
type: z.ZodLiteral<"object">;
|
|
22
|
+
properties: z.ZodRecord<z.ZodString, z.ZodType<unknown, z.ZodTypeDef, unknown>>;
|
|
23
|
+
required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
24
|
+
title: z.ZodOptional<z.ZodString>;
|
|
25
|
+
description: z.ZodOptional<z.ZodString>;
|
|
26
|
+
additionalProperties: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
type: "object";
|
|
29
|
+
properties: Record<string, unknown>;
|
|
30
|
+
description?: string | undefined;
|
|
31
|
+
title?: string | undefined;
|
|
32
|
+
required?: string[] | undefined;
|
|
33
|
+
additionalProperties?: boolean | undefined;
|
|
34
|
+
}, {
|
|
35
|
+
type: "object";
|
|
36
|
+
properties: Record<string, unknown>;
|
|
37
|
+
description?: string | undefined;
|
|
38
|
+
title?: string | undefined;
|
|
39
|
+
required?: string[] | undefined;
|
|
40
|
+
additionalProperties?: boolean | undefined;
|
|
41
|
+
}>>;
|
|
42
|
+
outputParameters: z.ZodOptional<z.ZodObject<{
|
|
43
|
+
type: z.ZodLiteral<"object">;
|
|
44
|
+
properties: z.ZodRecord<z.ZodString, z.ZodType<unknown, z.ZodTypeDef, unknown>>;
|
|
45
|
+
required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
46
|
+
title: z.ZodOptional<z.ZodString>;
|
|
47
|
+
description: z.ZodOptional<z.ZodString>;
|
|
48
|
+
additionalProperties: z.ZodOptional<z.ZodBoolean>;
|
|
49
|
+
}, "strip", z.ZodTypeAny, {
|
|
50
|
+
type: "object";
|
|
51
|
+
properties: Record<string, unknown>;
|
|
52
|
+
description?: string | undefined;
|
|
53
|
+
title?: string | undefined;
|
|
54
|
+
required?: string[] | undefined;
|
|
55
|
+
additionalProperties?: boolean | undefined;
|
|
56
|
+
}, {
|
|
57
|
+
type: "object";
|
|
58
|
+
properties: Record<string, unknown>;
|
|
59
|
+
description?: string | undefined;
|
|
60
|
+
title?: string | undefined;
|
|
61
|
+
required?: string[] | undefined;
|
|
62
|
+
additionalProperties?: boolean | undefined;
|
|
63
|
+
}>>;
|
|
23
64
|
tags: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
24
65
|
toolkit: z.ZodOptional<z.ZodObject<{
|
|
25
66
|
slug: z.ZodString;
|
|
@@ -40,8 +81,22 @@ declare const ToolSchema: z.ZodObject<{
|
|
|
40
81
|
name: string;
|
|
41
82
|
tags: string[];
|
|
42
83
|
description?: string | undefined;
|
|
43
|
-
inputParameters?:
|
|
44
|
-
|
|
84
|
+
inputParameters?: {
|
|
85
|
+
type: "object";
|
|
86
|
+
properties: Record<string, unknown>;
|
|
87
|
+
description?: string | undefined;
|
|
88
|
+
title?: string | undefined;
|
|
89
|
+
required?: string[] | undefined;
|
|
90
|
+
additionalProperties?: boolean | undefined;
|
|
91
|
+
} | undefined;
|
|
92
|
+
outputParameters?: {
|
|
93
|
+
type: "object";
|
|
94
|
+
properties: Record<string, unknown>;
|
|
95
|
+
description?: string | undefined;
|
|
96
|
+
title?: string | undefined;
|
|
97
|
+
required?: string[] | undefined;
|
|
98
|
+
additionalProperties?: boolean | undefined;
|
|
99
|
+
} | undefined;
|
|
45
100
|
toolkit?: {
|
|
46
101
|
slug: string;
|
|
47
102
|
name: string;
|
|
@@ -52,8 +107,22 @@ declare const ToolSchema: z.ZodObject<{
|
|
|
52
107
|
slug: string;
|
|
53
108
|
name: string;
|
|
54
109
|
description?: string | undefined;
|
|
55
|
-
inputParameters?:
|
|
56
|
-
|
|
110
|
+
inputParameters?: {
|
|
111
|
+
type: "object";
|
|
112
|
+
properties: Record<string, unknown>;
|
|
113
|
+
description?: string | undefined;
|
|
114
|
+
title?: string | undefined;
|
|
115
|
+
required?: string[] | undefined;
|
|
116
|
+
additionalProperties?: boolean | undefined;
|
|
117
|
+
} | undefined;
|
|
118
|
+
outputParameters?: {
|
|
119
|
+
type: "object";
|
|
120
|
+
properties: Record<string, unknown>;
|
|
121
|
+
description?: string | undefined;
|
|
122
|
+
title?: string | undefined;
|
|
123
|
+
required?: string[] | undefined;
|
|
124
|
+
additionalProperties?: boolean | undefined;
|
|
125
|
+
} | undefined;
|
|
57
126
|
tags?: string[] | undefined;
|
|
58
127
|
toolkit?: {
|
|
59
128
|
slug: string;
|
|
@@ -73,22 +142,22 @@ type ToolList = Array<Tool>;
|
|
|
73
142
|
declare const ToolListParamsSchema: z.ZodObject<{
|
|
74
143
|
tools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
75
144
|
cursor: z.ZodOptional<z.ZodString>;
|
|
76
|
-
important: z.ZodOptional<z.
|
|
77
|
-
limit: z.ZodOptional<z.
|
|
145
|
+
important: z.ZodOptional<z.ZodBoolean>;
|
|
146
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
78
147
|
search: z.ZodOptional<z.ZodString>;
|
|
79
148
|
toolkits: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
80
149
|
}, "strip", z.ZodTypeAny, {
|
|
81
150
|
tools?: string[] | undefined;
|
|
82
151
|
cursor?: string | undefined;
|
|
83
|
-
important?:
|
|
84
|
-
limit?:
|
|
152
|
+
important?: boolean | undefined;
|
|
153
|
+
limit?: number | undefined;
|
|
85
154
|
search?: string | undefined;
|
|
86
155
|
toolkits?: string[] | undefined;
|
|
87
156
|
}, {
|
|
88
157
|
tools?: string[] | undefined;
|
|
89
158
|
cursor?: string | undefined;
|
|
90
|
-
important?:
|
|
91
|
-
limit?:
|
|
159
|
+
important?: boolean | undefined;
|
|
160
|
+
limit?: number | undefined;
|
|
92
161
|
search?: string | undefined;
|
|
93
162
|
toolkits?: string[] | undefined;
|
|
94
163
|
}>;
|
|
@@ -302,7 +371,7 @@ declare abstract class BaseProvider {
|
|
|
302
371
|
_setExecuteToolFn(executeToolFn: GlobalExecuteToolFn): void;
|
|
303
372
|
/**
|
|
304
373
|
* @public
|
|
305
|
-
*
|
|
374
|
+
* Global function to execute a tool.
|
|
306
375
|
* This function is used by provider providers to implement helper functions to execute tools.
|
|
307
376
|
* This is a 1:1 mapping of the `execute` method in the `Tools` class.
|
|
308
377
|
* @param {string} toolSlug - The slug of the tool to execute.
|
|
@@ -1536,12 +1605,11 @@ type ToolkitRetrieveCategoriesResponse = z.infer<typeof ToolkitRetrieveCategorie
|
|
|
1536
1605
|
* Connected Account create parameters
|
|
1537
1606
|
*/
|
|
1538
1607
|
declare const ConnectedAccountStatuses: {
|
|
1539
|
-
readonly
|
|
1540
|
-
readonly INACTIVE: "INACTIVE";
|
|
1541
|
-
readonly DELETED: "DELETED";
|
|
1608
|
+
readonly INITIALIZING: "INITIALIZING";
|
|
1542
1609
|
readonly INITIATED: "INITIATED";
|
|
1543
|
-
readonly
|
|
1610
|
+
readonly ACTIVE: "ACTIVE";
|
|
1544
1611
|
readonly FAILED: "FAILED";
|
|
1612
|
+
readonly EXPIRED: "EXPIRED";
|
|
1545
1613
|
};
|
|
1546
1614
|
type ConnectedAccountStatus = (typeof ConnectedAccountStatuses)[keyof typeof ConnectedAccountStatuses];
|
|
1547
1615
|
type CreateConnectedAccountOptions = z.infer<typeof CreateConnectedAccountOptionsSchema>;
|
|
@@ -1577,7 +1645,7 @@ declare const ConnectedAccountRetrieveResponseSchema: z.ZodObject<{
|
|
|
1577
1645
|
userId: z.ZodString;
|
|
1578
1646
|
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1579
1647
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1580
|
-
status: z.ZodEnum<["
|
|
1648
|
+
status: z.ZodEnum<["INITIALIZING", "INITIATED", "ACTIVE", "FAILED", "EXPIRED"]>;
|
|
1581
1649
|
statusReason: z.ZodNullable<z.ZodString>;
|
|
1582
1650
|
toolkit: z.ZodObject<{
|
|
1583
1651
|
slug: z.ZodString;
|
|
@@ -1591,7 +1659,7 @@ declare const ConnectedAccountRetrieveResponseSchema: z.ZodObject<{
|
|
|
1591
1659
|
createdAt: z.ZodString;
|
|
1592
1660
|
updatedAt: z.ZodString;
|
|
1593
1661
|
}, "strip", z.ZodTypeAny, {
|
|
1594
|
-
status: "
|
|
1662
|
+
status: "INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED";
|
|
1595
1663
|
toolkit: {
|
|
1596
1664
|
slug: string;
|
|
1597
1665
|
};
|
|
@@ -1611,7 +1679,7 @@ declare const ConnectedAccountRetrieveResponseSchema: z.ZodObject<{
|
|
|
1611
1679
|
params?: Record<string, unknown> | undefined;
|
|
1612
1680
|
testRequestEndpoint?: string | undefined;
|
|
1613
1681
|
}, {
|
|
1614
|
-
status: "
|
|
1682
|
+
status: "INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED";
|
|
1615
1683
|
toolkit: {
|
|
1616
1684
|
slug: string;
|
|
1617
1685
|
};
|
|
@@ -1638,7 +1706,7 @@ declare const ConnectedAccountListParamsSchema: z.ZodObject<{
|
|
|
1638
1706
|
labels: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
1639
1707
|
limit: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
1640
1708
|
orderBy: z.ZodOptional<z.ZodEnum<["created_at", "updated_at"]>>;
|
|
1641
|
-
statuses: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<["
|
|
1709
|
+
statuses: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<["INITIALIZING", "INITIATED", "ACTIVE", "FAILED", "EXPIRED"]>, "many">>>;
|
|
1642
1710
|
toolkitSlugs: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
1643
1711
|
userIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
1644
1712
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -1647,7 +1715,7 @@ declare const ConnectedAccountListParamsSchema: z.ZodObject<{
|
|
|
1647
1715
|
authConfigIds?: string[] | null | undefined;
|
|
1648
1716
|
labels?: string[] | null | undefined;
|
|
1649
1717
|
orderBy?: "created_at" | "updated_at" | undefined;
|
|
1650
|
-
statuses?: ("
|
|
1718
|
+
statuses?: ("INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED")[] | null | undefined;
|
|
1651
1719
|
toolkitSlugs?: string[] | null | undefined;
|
|
1652
1720
|
userIds?: string[] | null | undefined;
|
|
1653
1721
|
}, {
|
|
@@ -1656,7 +1724,7 @@ declare const ConnectedAccountListParamsSchema: z.ZodObject<{
|
|
|
1656
1724
|
authConfigIds?: string[] | null | undefined;
|
|
1657
1725
|
labels?: string[] | null | undefined;
|
|
1658
1726
|
orderBy?: "created_at" | "updated_at" | undefined;
|
|
1659
|
-
statuses?: ("
|
|
1727
|
+
statuses?: ("INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED")[] | null | undefined;
|
|
1660
1728
|
toolkitSlugs?: string[] | null | undefined;
|
|
1661
1729
|
userIds?: string[] | null | undefined;
|
|
1662
1730
|
}>;
|
|
@@ -1683,7 +1751,7 @@ declare const ConnectedAccountListResponseSchema: z.ZodObject<{
|
|
|
1683
1751
|
userId: z.ZodString;
|
|
1684
1752
|
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
1685
1753
|
params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
1686
|
-
status: z.ZodEnum<["
|
|
1754
|
+
status: z.ZodEnum<["INITIALIZING", "INITIATED", "ACTIVE", "FAILED", "EXPIRED"]>;
|
|
1687
1755
|
statusReason: z.ZodNullable<z.ZodString>;
|
|
1688
1756
|
toolkit: z.ZodObject<{
|
|
1689
1757
|
slug: z.ZodString;
|
|
@@ -1697,7 +1765,7 @@ declare const ConnectedAccountListResponseSchema: z.ZodObject<{
|
|
|
1697
1765
|
createdAt: z.ZodString;
|
|
1698
1766
|
updatedAt: z.ZodString;
|
|
1699
1767
|
}, "strip", z.ZodTypeAny, {
|
|
1700
|
-
status: "
|
|
1768
|
+
status: "INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED";
|
|
1701
1769
|
toolkit: {
|
|
1702
1770
|
slug: string;
|
|
1703
1771
|
};
|
|
@@ -1717,7 +1785,7 @@ declare const ConnectedAccountListResponseSchema: z.ZodObject<{
|
|
|
1717
1785
|
params?: Record<string, unknown> | undefined;
|
|
1718
1786
|
testRequestEndpoint?: string | undefined;
|
|
1719
1787
|
}, {
|
|
1720
|
-
status: "
|
|
1788
|
+
status: "INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED";
|
|
1721
1789
|
toolkit: {
|
|
1722
1790
|
slug: string;
|
|
1723
1791
|
};
|
|
@@ -1741,7 +1809,7 @@ declare const ConnectedAccountListResponseSchema: z.ZodObject<{
|
|
|
1741
1809
|
totalPages: z.ZodNumber;
|
|
1742
1810
|
}, "strip", z.ZodTypeAny, {
|
|
1743
1811
|
items: {
|
|
1744
|
-
status: "
|
|
1812
|
+
status: "INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED";
|
|
1745
1813
|
toolkit: {
|
|
1746
1814
|
slug: string;
|
|
1747
1815
|
};
|
|
@@ -1765,7 +1833,7 @@ declare const ConnectedAccountListResponseSchema: z.ZodObject<{
|
|
|
1765
1833
|
totalPages: number;
|
|
1766
1834
|
}, {
|
|
1767
1835
|
items: {
|
|
1768
|
-
status: "
|
|
1836
|
+
status: "INITIALIZING" | "INITIATED" | "ACTIVE" | "FAILED" | "EXPIRED";
|
|
1769
1837
|
toolkit: {
|
|
1770
1838
|
slug: string;
|
|
1771
1839
|
};
|
|
@@ -1844,6 +1912,15 @@ declare class ConnectionRequest {
|
|
|
1844
1912
|
* ```
|
|
1845
1913
|
*/
|
|
1846
1914
|
waitForConnection(timeout?: number): Promise<ConnectedAccountRetrieveResponse>;
|
|
1915
|
+
/**
|
|
1916
|
+
* Returns a JSON-serializable representation of the connection request
|
|
1917
|
+
* Excludes the private client property to avoid cyclic reference issues
|
|
1918
|
+
*/
|
|
1919
|
+
toJSON(): Record<string, unknown>;
|
|
1920
|
+
/**
|
|
1921
|
+
* Returns a string representation of the connection request
|
|
1922
|
+
*/
|
|
1923
|
+
toString(): string;
|
|
1847
1924
|
}
|
|
1848
1925
|
|
|
1849
1926
|
/**
|
|
@@ -1951,53 +2028,275 @@ declare class Toolkits {
|
|
|
1951
2028
|
authorize(userId: string, toolkitSlug: string): Promise<ConnectionRequest>;
|
|
1952
2029
|
}
|
|
1953
2030
|
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
appName: z.ZodOptional<z.ZodString>;
|
|
2031
|
+
declare const TriggerSubscribeParamSchema: z.ZodObject<{
|
|
2032
|
+
toolkits: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1957
2033
|
triggerId: z.ZodOptional<z.ZodString>;
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
2034
|
+
connectedAccountId: z.ZodOptional<z.ZodString>;
|
|
2035
|
+
authConfigId: z.ZodOptional<z.ZodString>;
|
|
2036
|
+
triggerSlug: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1961
2037
|
triggerData: z.ZodOptional<z.ZodString>;
|
|
1962
|
-
|
|
2038
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
1963
2039
|
}, "strip", z.ZodTypeAny, {
|
|
1964
|
-
|
|
2040
|
+
toolkits?: string[] | undefined;
|
|
2041
|
+
connectedAccountId?: string | undefined;
|
|
2042
|
+
userId?: string | undefined;
|
|
1965
2043
|
triggerId?: string | undefined;
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
triggerName?: string | undefined;
|
|
2044
|
+
authConfigId?: string | undefined;
|
|
2045
|
+
triggerSlug?: string[] | undefined;
|
|
1969
2046
|
triggerData?: string | undefined;
|
|
1970
|
-
entityId?: string | undefined;
|
|
1971
2047
|
}, {
|
|
1972
|
-
|
|
2048
|
+
toolkits?: string[] | undefined;
|
|
2049
|
+
connectedAccountId?: string | undefined;
|
|
2050
|
+
userId?: string | undefined;
|
|
1973
2051
|
triggerId?: string | undefined;
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
triggerName?: string | undefined;
|
|
2052
|
+
authConfigId?: string | undefined;
|
|
2053
|
+
triggerSlug?: string[] | undefined;
|
|
1977
2054
|
triggerData?: string | undefined;
|
|
1978
|
-
entityId?: string | undefined;
|
|
1979
2055
|
}>;
|
|
1980
|
-
type TriggerSubscribeParams = z.infer<typeof
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
2056
|
+
type TriggerSubscribeParams = z.infer<typeof TriggerSubscribeParamSchema>;
|
|
2057
|
+
declare const TriggerInstanceListActiveParamsSchema: z.ZodObject<{
|
|
2058
|
+
authConfigIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
2059
|
+
connectedAccountIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
2060
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
2061
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
2062
|
+
showDisabled: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
2063
|
+
triggerIds: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
2064
|
+
triggerNames: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
|
|
2065
|
+
}, "strip", z.ZodTypeAny, {
|
|
2066
|
+
limit?: number | undefined;
|
|
2067
|
+
authConfigIds?: string[] | null | undefined;
|
|
2068
|
+
connectedAccountIds?: string[] | null | undefined;
|
|
2069
|
+
page?: number | undefined;
|
|
2070
|
+
showDisabled?: boolean | null | undefined;
|
|
2071
|
+
triggerIds?: string[] | null | undefined;
|
|
2072
|
+
triggerNames?: string[] | null | undefined;
|
|
2073
|
+
}, {
|
|
2074
|
+
limit?: number | undefined;
|
|
2075
|
+
authConfigIds?: string[] | null | undefined;
|
|
2076
|
+
connectedAccountIds?: string[] | null | undefined;
|
|
2077
|
+
page?: number | undefined;
|
|
2078
|
+
showDisabled?: boolean | null | undefined;
|
|
2079
|
+
triggerIds?: string[] | null | undefined;
|
|
2080
|
+
triggerNames?: string[] | null | undefined;
|
|
2081
|
+
}>;
|
|
2082
|
+
type TriggerInstanceListActiveParams = z.infer<typeof TriggerInstanceListActiveParamsSchema>;
|
|
2083
|
+
declare const TriggerInstanceListActiveResponseSchema: z.ZodObject<{
|
|
2084
|
+
items: z.ZodArray<z.ZodObject<{
|
|
2085
|
+
id: z.ZodString;
|
|
2086
|
+
connectedAccountId: z.ZodString;
|
|
2087
|
+
disabledAt: z.ZodNullable<z.ZodString>;
|
|
2088
|
+
state: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
2089
|
+
triggerConfig: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
2090
|
+
triggerName: z.ZodString;
|
|
2091
|
+
updatedAt: z.ZodString;
|
|
2092
|
+
triggerData: z.ZodOptional<z.ZodString>;
|
|
2093
|
+
uuid: z.ZodOptional<z.ZodString>;
|
|
2094
|
+
}, "strip", z.ZodTypeAny, {
|
|
2095
|
+
connectedAccountId: string;
|
|
2096
|
+
updatedAt: string;
|
|
2097
|
+
id: string;
|
|
2098
|
+
disabledAt: string | null;
|
|
2099
|
+
state: Record<string, unknown>;
|
|
2100
|
+
triggerConfig: Record<string, unknown>;
|
|
2101
|
+
triggerName: string;
|
|
2102
|
+
uuid?: string | undefined;
|
|
2103
|
+
triggerData?: string | undefined;
|
|
2104
|
+
}, {
|
|
2105
|
+
connectedAccountId: string;
|
|
2106
|
+
updatedAt: string;
|
|
1988
2107
|
id: string;
|
|
1989
|
-
|
|
2108
|
+
disabledAt: string | null;
|
|
2109
|
+
state: Record<string, unknown>;
|
|
2110
|
+
triggerConfig: Record<string, unknown>;
|
|
1990
2111
|
triggerName: string;
|
|
1991
|
-
|
|
2112
|
+
uuid?: string | undefined;
|
|
2113
|
+
triggerData?: string | undefined;
|
|
2114
|
+
}>, "many">;
|
|
2115
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
2116
|
+
totalPages: z.ZodNumber;
|
|
2117
|
+
}, "strip", z.ZodTypeAny, {
|
|
2118
|
+
items: {
|
|
2119
|
+
connectedAccountId: string;
|
|
2120
|
+
updatedAt: string;
|
|
2121
|
+
id: string;
|
|
2122
|
+
disabledAt: string | null;
|
|
2123
|
+
state: Record<string, unknown>;
|
|
1992
2124
|
triggerConfig: Record<string, unknown>;
|
|
1993
|
-
|
|
2125
|
+
triggerName: string;
|
|
2126
|
+
uuid?: string | undefined;
|
|
2127
|
+
triggerData?: string | undefined;
|
|
2128
|
+
}[];
|
|
2129
|
+
nextCursor: string | null;
|
|
2130
|
+
totalPages: number;
|
|
2131
|
+
}, {
|
|
2132
|
+
items: {
|
|
2133
|
+
connectedAccountId: string;
|
|
2134
|
+
updatedAt: string;
|
|
2135
|
+
id: string;
|
|
2136
|
+
disabledAt: string | null;
|
|
2137
|
+
state: Record<string, unknown>;
|
|
2138
|
+
triggerConfig: Record<string, unknown>;
|
|
2139
|
+
triggerName: string;
|
|
2140
|
+
uuid?: string | undefined;
|
|
2141
|
+
triggerData?: string | undefined;
|
|
2142
|
+
}[];
|
|
2143
|
+
nextCursor: string | null;
|
|
2144
|
+
totalPages: number;
|
|
2145
|
+
}>;
|
|
2146
|
+
type TriggerInstanceListActiveResponse = z.infer<typeof TriggerInstanceListActiveResponseSchema>;
|
|
2147
|
+
declare const TriggerInstanceUpsertParamsSchema: z.ZodObject<{
|
|
2148
|
+
connectedAccountId: z.ZodOptional<z.ZodString>;
|
|
2149
|
+
triggerConfig: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2150
|
+
}, "strip", z.ZodTypeAny, {
|
|
2151
|
+
connectedAccountId?: string | undefined;
|
|
2152
|
+
triggerConfig?: Record<string, unknown> | undefined;
|
|
2153
|
+
}, {
|
|
2154
|
+
connectedAccountId?: string | undefined;
|
|
2155
|
+
triggerConfig?: Record<string, unknown> | undefined;
|
|
2156
|
+
}>;
|
|
2157
|
+
type TriggerInstanceUpsertParams = z.infer<typeof TriggerInstanceUpsertParamsSchema>;
|
|
2158
|
+
declare const TriggerInstanceUpsertResponseSchema: z.ZodObject<{
|
|
2159
|
+
triggerId: z.ZodString;
|
|
2160
|
+
}, "strip", z.ZodTypeAny, {
|
|
2161
|
+
triggerId: string;
|
|
2162
|
+
}, {
|
|
2163
|
+
triggerId: string;
|
|
2164
|
+
}>;
|
|
2165
|
+
type TriggerInstanceUpsertResponse = z.infer<typeof TriggerInstanceUpsertResponseSchema>;
|
|
2166
|
+
declare const TriggerInstanceManageUpdateParamsSchema: z.ZodObject<{
|
|
2167
|
+
status: z.ZodEnum<["enable", "disable"]>;
|
|
2168
|
+
}, "strip", z.ZodTypeAny, {
|
|
2169
|
+
status: "enable" | "disable";
|
|
2170
|
+
}, {
|
|
2171
|
+
status: "enable" | "disable";
|
|
2172
|
+
}>;
|
|
2173
|
+
type TriggerInstanceManageUpdateParams = z.infer<typeof TriggerInstanceManageUpdateParamsSchema>;
|
|
2174
|
+
declare const TriggerInstanceManageUpdateResponseSchema: z.ZodObject<{
|
|
2175
|
+
status: z.ZodEnum<["success"]>;
|
|
2176
|
+
}, "strip", z.ZodTypeAny, {
|
|
2177
|
+
status: "success";
|
|
2178
|
+
}, {
|
|
2179
|
+
status: "success";
|
|
2180
|
+
}>;
|
|
2181
|
+
type TriggerInstanceManageUpdateResponse = z.infer<typeof TriggerInstanceManageUpdateResponseSchema>;
|
|
2182
|
+
declare const TriggerInstanceManageDeleteResponseSchema: z.ZodObject<{
|
|
2183
|
+
triggerId: z.ZodString;
|
|
2184
|
+
}, "strip", z.ZodTypeAny, {
|
|
2185
|
+
triggerId: string;
|
|
2186
|
+
}, {
|
|
2187
|
+
triggerId: string;
|
|
2188
|
+
}>;
|
|
2189
|
+
type TriggerInstanceManageDeleteResponse = z.infer<typeof TriggerInstanceManageDeleteResponseSchema>;
|
|
2190
|
+
declare const IncomingTriggerPayloadSchema: z.ZodObject<{
|
|
2191
|
+
id: z.ZodString;
|
|
2192
|
+
triggerSlug: z.ZodString;
|
|
2193
|
+
toolkitSlug: z.ZodString;
|
|
2194
|
+
userId: z.ZodString;
|
|
2195
|
+
payload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2196
|
+
originalPayload: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
2197
|
+
metadata: z.ZodObject<{
|
|
2198
|
+
id: z.ZodString;
|
|
2199
|
+
toolkitSlug: z.ZodString;
|
|
2200
|
+
triggerSlug: z.ZodString;
|
|
2201
|
+
triggerData: z.ZodOptional<z.ZodString>;
|
|
2202
|
+
triggerConfig: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
2203
|
+
connectedAccount: z.ZodObject<{
|
|
2204
|
+
id: z.ZodString;
|
|
2205
|
+
uuid: z.ZodString;
|
|
2206
|
+
authConfigId: z.ZodString;
|
|
2207
|
+
authConfigUUID: z.ZodString;
|
|
2208
|
+
userId: z.ZodString;
|
|
2209
|
+
status: z.ZodEnum<["ACTIVE", "INACTIVE"]>;
|
|
2210
|
+
}, "strip", z.ZodTypeAny, {
|
|
2211
|
+
status: "ACTIVE" | "INACTIVE";
|
|
2212
|
+
userId: string;
|
|
2213
|
+
id: string;
|
|
2214
|
+
uuid: string;
|
|
2215
|
+
authConfigId: string;
|
|
2216
|
+
authConfigUUID: string;
|
|
2217
|
+
}, {
|
|
2218
|
+
status: "ACTIVE" | "INACTIVE";
|
|
2219
|
+
userId: string;
|
|
2220
|
+
id: string;
|
|
2221
|
+
uuid: string;
|
|
2222
|
+
authConfigId: string;
|
|
2223
|
+
authConfigUUID: string;
|
|
2224
|
+
}>;
|
|
2225
|
+
}, "strip", z.ZodTypeAny, {
|
|
2226
|
+
toolkitSlug: string;
|
|
2227
|
+
id: string;
|
|
2228
|
+
triggerSlug: string;
|
|
2229
|
+
triggerConfig: Record<string, unknown>;
|
|
2230
|
+
connectedAccount: {
|
|
2231
|
+
status: "ACTIVE" | "INACTIVE";
|
|
2232
|
+
userId: string;
|
|
2233
|
+
id: string;
|
|
2234
|
+
uuid: string;
|
|
2235
|
+
authConfigId: string;
|
|
2236
|
+
authConfigUUID: string;
|
|
2237
|
+
};
|
|
2238
|
+
triggerData?: string | undefined;
|
|
2239
|
+
}, {
|
|
2240
|
+
toolkitSlug: string;
|
|
2241
|
+
id: string;
|
|
2242
|
+
triggerSlug: string;
|
|
2243
|
+
triggerConfig: Record<string, unknown>;
|
|
2244
|
+
connectedAccount: {
|
|
2245
|
+
status: "ACTIVE" | "INACTIVE";
|
|
2246
|
+
userId: string;
|
|
1994
2247
|
id: string;
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
2248
|
+
uuid: string;
|
|
2249
|
+
authConfigId: string;
|
|
2250
|
+
authConfigUUID: string;
|
|
1998
2251
|
};
|
|
2252
|
+
triggerData?: string | undefined;
|
|
2253
|
+
}>;
|
|
2254
|
+
}, "strip", z.ZodTypeAny, {
|
|
2255
|
+
userId: string;
|
|
2256
|
+
toolkitSlug: string;
|
|
2257
|
+
id: string;
|
|
2258
|
+
triggerSlug: string;
|
|
2259
|
+
metadata: {
|
|
2260
|
+
toolkitSlug: string;
|
|
2261
|
+
id: string;
|
|
2262
|
+
triggerSlug: string;
|
|
2263
|
+
triggerConfig: Record<string, unknown>;
|
|
2264
|
+
connectedAccount: {
|
|
2265
|
+
status: "ACTIVE" | "INACTIVE";
|
|
2266
|
+
userId: string;
|
|
2267
|
+
id: string;
|
|
2268
|
+
uuid: string;
|
|
2269
|
+
authConfigId: string;
|
|
2270
|
+
authConfigUUID: string;
|
|
2271
|
+
};
|
|
2272
|
+
triggerData?: string | undefined;
|
|
1999
2273
|
};
|
|
2000
|
-
|
|
2274
|
+
payload?: Record<string, unknown> | undefined;
|
|
2275
|
+
originalPayload?: Record<string, unknown> | undefined;
|
|
2276
|
+
}, {
|
|
2277
|
+
userId: string;
|
|
2278
|
+
toolkitSlug: string;
|
|
2279
|
+
id: string;
|
|
2280
|
+
triggerSlug: string;
|
|
2281
|
+
metadata: {
|
|
2282
|
+
toolkitSlug: string;
|
|
2283
|
+
id: string;
|
|
2284
|
+
triggerSlug: string;
|
|
2285
|
+
triggerConfig: Record<string, unknown>;
|
|
2286
|
+
connectedAccount: {
|
|
2287
|
+
status: "ACTIVE" | "INACTIVE";
|
|
2288
|
+
userId: string;
|
|
2289
|
+
id: string;
|
|
2290
|
+
uuid: string;
|
|
2291
|
+
authConfigId: string;
|
|
2292
|
+
authConfigUUID: string;
|
|
2293
|
+
};
|
|
2294
|
+
triggerData?: string | undefined;
|
|
2295
|
+
};
|
|
2296
|
+
payload?: Record<string, unknown> | undefined;
|
|
2297
|
+
originalPayload?: Record<string, unknown> | undefined;
|
|
2298
|
+
}>;
|
|
2299
|
+
type IncomingTriggerPayload = z.infer<typeof IncomingTriggerPayloadSchema>;
|
|
2001
2300
|
|
|
2002
2301
|
/**
|
|
2003
2302
|
* Trigger (Instance) class
|
|
@@ -2006,12 +2305,33 @@ type TriggerData = {
|
|
|
2006
2305
|
*/
|
|
2007
2306
|
declare class Triggers {
|
|
2008
2307
|
private client;
|
|
2308
|
+
private pusherService;
|
|
2009
2309
|
constructor(client: ComposioClient);
|
|
2310
|
+
/**
|
|
2311
|
+
* Parse the trigger instance list active item
|
|
2312
|
+
*
|
|
2313
|
+
* @param response - The response from the composio client
|
|
2314
|
+
* @returns The parsed trigger instance list active item
|
|
2315
|
+
*/
|
|
2316
|
+
private parseTriggerInstanceListActiveItem;
|
|
2010
2317
|
/**
|
|
2011
2318
|
* Fetch list of all the active triggers
|
|
2012
|
-
*
|
|
2319
|
+
*
|
|
2320
|
+
* @param {TriggerInstanceListActiveParams} query - The query parameters to filter the trigger instances
|
|
2321
|
+
* @returns {Promise<TriggerInstanceListActiveResponse>} List of trigger instances
|
|
2322
|
+
*
|
|
2323
|
+
* @throws {ValidationError} If the parameters are invalid
|
|
2324
|
+
* @throws {Error} If the client is not authenticated
|
|
2325
|
+
*
|
|
2326
|
+
* @example
|
|
2327
|
+
* ```ts
|
|
2328
|
+
* const triggers = await triggers.listActive({
|
|
2329
|
+
* authConfigIds: ['123'],
|
|
2330
|
+
* connectedAccountIds: ['456'],
|
|
2331
|
+
* });
|
|
2332
|
+
* ```
|
|
2013
2333
|
*/
|
|
2014
|
-
|
|
2334
|
+
listActive(query?: TriggerInstanceListActiveParams): Promise<TriggerInstanceListActiveResponse>;
|
|
2015
2335
|
/**
|
|
2016
2336
|
* Create a new trigger instance
|
|
2017
2337
|
*
|
|
@@ -2019,47 +2339,36 @@ declare class Triggers {
|
|
|
2019
2339
|
* @param {TriggerInstanceUpsertParams} body - The parameters to create the trigger instance
|
|
2020
2340
|
* @returns {Promise<TriggerInstanceUpsertResponse>} The created trigger instance
|
|
2021
2341
|
*/
|
|
2022
|
-
create(slug: string, body: TriggerInstanceUpsertParams
|
|
2342
|
+
create(slug: string, body: TriggerInstanceUpsertParams): Promise<TriggerInstanceUpsertResponse>;
|
|
2023
2343
|
/**
|
|
2024
2344
|
* Update an existing trigger instance
|
|
2025
2345
|
*
|
|
2026
2346
|
* @param {string} slug - The slug of the trigger instance
|
|
2027
|
-
* @param {
|
|
2347
|
+
* @param {TriggerInstanceManageUpdateParams} body - The parameters to create the trigger instance
|
|
2028
2348
|
* @returns {Promise<TriggerInstanceUpsertResponse>} The updated trigger instance
|
|
2029
2349
|
*/
|
|
2030
|
-
update(slug: string, body:
|
|
2350
|
+
update(slug: string, body: TriggerInstanceManageUpdateParams): Promise<TriggerInstanceManageUpdateResponse>;
|
|
2031
2351
|
/**
|
|
2032
2352
|
* Delete a trigger instance
|
|
2033
2353
|
*
|
|
2034
|
-
* @param {string}
|
|
2354
|
+
* @param {string} triggerId - The slug of the trigger instance
|
|
2035
2355
|
* @returns
|
|
2036
2356
|
*/
|
|
2037
|
-
delete(
|
|
2038
|
-
/**
|
|
2039
|
-
* Update the status of a trigger
|
|
2040
|
-
*
|
|
2041
|
-
* @param {TriggerStatusEnum} status - The new status of the trigger
|
|
2042
|
-
* @param {TriggerInstanceUpdateStatusParams} params - The parameters to update the trigger instance
|
|
2043
|
-
* @param {RequestOptions} options - Request options
|
|
2044
|
-
* @returns {Promise<TriggerInstanceUpsertResponse>} The updated trigger instance
|
|
2045
|
-
*/
|
|
2046
|
-
updateStatus(status: TriggerStatusEnum, params: TriggerInstanceUpdateStatusParams, options?: RequestOptions): Promise<ComposioClient.TriggerInstances.TriggerInstanceUpdateStatusResponse>;
|
|
2357
|
+
delete(triggerId: string): Promise<TriggerInstanceManageDeleteResponse>;
|
|
2047
2358
|
/**
|
|
2048
2359
|
* Disable a trigger instance
|
|
2049
2360
|
*
|
|
2050
|
-
* @param {string}
|
|
2051
|
-
* @param {RequestOptions options - Request options
|
|
2361
|
+
* @param {string} triggerId - The id of the trigger instance
|
|
2052
2362
|
* @returns {Promise<TriggerInstanceUpsertResponse>} The updated trigger instance
|
|
2053
2363
|
*/
|
|
2054
|
-
disable(
|
|
2364
|
+
disable(triggerId: string): Promise<ComposioClient.TriggerInstances.Manage.ManageUpdateResponse>;
|
|
2055
2365
|
/**
|
|
2056
2366
|
* Enable a trigger instance
|
|
2057
2367
|
*
|
|
2058
|
-
* @param {string}
|
|
2059
|
-
* @param {RequestOptions options - Request options
|
|
2368
|
+
* @param {string} triggerId - The id of the trigger instance
|
|
2060
2369
|
* @returns {Promise<TriggerInstanceUpsertResponse>} The updated trigger instance
|
|
2061
2370
|
*/
|
|
2062
|
-
enable(
|
|
2371
|
+
enable(triggerId: string): Promise<ComposioClient.TriggerInstances.Manage.ManageUpdateResponse>;
|
|
2063
2372
|
/**
|
|
2064
2373
|
* @TODO Learn about trigger types
|
|
2065
2374
|
*/
|
|
@@ -2070,7 +2379,7 @@ declare class Triggers {
|
|
|
2070
2379
|
* @param {RequestOptions} options - Request options
|
|
2071
2380
|
* @returns {Promise<TriggersTypeListResponse>} The list of trigger types
|
|
2072
2381
|
*/
|
|
2073
|
-
listTypes(query?: TriggersTypeListParams
|
|
2382
|
+
listTypes(query?: TriggersTypeListParams): Promise<TriggersTypeListResponse>;
|
|
2074
2383
|
/**
|
|
2075
2384
|
* Retrieve a trigger type by its slug
|
|
2076
2385
|
*
|
|
@@ -2078,7 +2387,7 @@ declare class Triggers {
|
|
|
2078
2387
|
* @param {RequestOptions} options - request options
|
|
2079
2388
|
* @returns {Promise<TriggersTypeRetrieveResponse>} The trigger type object
|
|
2080
2389
|
*/
|
|
2081
|
-
getType(slug: string
|
|
2390
|
+
getType(slug: string): Promise<TriggersTypeRetrieveResponse>;
|
|
2082
2391
|
/**
|
|
2083
2392
|
* Fetches the list of all the available trigger enums
|
|
2084
2393
|
*
|
|
@@ -2086,8 +2395,36 @@ declare class Triggers {
|
|
|
2086
2395
|
* @param options
|
|
2087
2396
|
* @returns
|
|
2088
2397
|
*/
|
|
2089
|
-
listEnum(
|
|
2090
|
-
|
|
2398
|
+
listEnum(): Promise<TriggersTypeRetrieveEnumResponse>;
|
|
2399
|
+
/**
|
|
2400
|
+
* Subscribe to all the triggers
|
|
2401
|
+
*
|
|
2402
|
+
* @param fn - The function to call when a trigger is received
|
|
2403
|
+
* @param filters - The filters to apply to the triggers
|
|
2404
|
+
*
|
|
2405
|
+
* @example
|
|
2406
|
+
* ```ts
|
|
2407
|
+
*
|
|
2408
|
+
* triggers.subscribe((data) => {
|
|
2409
|
+
* console.log(data);
|
|
2410
|
+
* }, );
|
|
2411
|
+
* ```
|
|
2412
|
+
*/
|
|
2413
|
+
subscribe(fn: (_data: IncomingTriggerPayload) => void, filters?: TriggerSubscribeParams): Promise<void>;
|
|
2414
|
+
/**
|
|
2415
|
+
* Unsubscribe from all the triggers
|
|
2416
|
+
*
|
|
2417
|
+
* @returns {Promise<void>}
|
|
2418
|
+
*
|
|
2419
|
+
* @example
|
|
2420
|
+
* ```ts
|
|
2421
|
+
* composio.trigger.subscribe((data) => {
|
|
2422
|
+
* console.log(data);
|
|
2423
|
+
* });
|
|
2424
|
+
*
|
|
2425
|
+
* await triggers.unsubscribe();
|
|
2426
|
+
* ```
|
|
2427
|
+
*/
|
|
2091
2428
|
unsubscribe(): Promise<void>;
|
|
2092
2429
|
}
|
|
2093
2430
|
|
|
@@ -2296,7 +2633,7 @@ declare const AuthConfigListResponseSchema: z.ZodObject<{
|
|
|
2296
2633
|
createdBy?: string | undefined;
|
|
2297
2634
|
lastUpdatedAt?: string | undefined;
|
|
2298
2635
|
}>, "many">;
|
|
2299
|
-
nextCursor: z.
|
|
2636
|
+
nextCursor: z.ZodNullable<z.ZodString>;
|
|
2300
2637
|
totalPages: z.ZodNumber;
|
|
2301
2638
|
}, "strip", z.ZodTypeAny, {
|
|
2302
2639
|
items: {
|
|
@@ -2317,8 +2654,8 @@ declare const AuthConfigListResponseSchema: z.ZodObject<{
|
|
|
2317
2654
|
createdBy?: string | undefined;
|
|
2318
2655
|
lastUpdatedAt?: string | undefined;
|
|
2319
2656
|
}[];
|
|
2657
|
+
nextCursor: string | null;
|
|
2320
2658
|
totalPages: number;
|
|
2321
|
-
nextCursor?: string | undefined;
|
|
2322
2659
|
}, {
|
|
2323
2660
|
items: {
|
|
2324
2661
|
name: string;
|
|
@@ -2338,8 +2675,8 @@ declare const AuthConfigListResponseSchema: z.ZodObject<{
|
|
|
2338
2675
|
createdBy?: string | undefined;
|
|
2339
2676
|
lastUpdatedAt?: string | undefined;
|
|
2340
2677
|
}[];
|
|
2678
|
+
nextCursor: string | null;
|
|
2341
2679
|
totalPages: number;
|
|
2342
|
-
nextCursor?: string | undefined;
|
|
2343
2680
|
}>;
|
|
2344
2681
|
type AuthConfigListResponse = z.infer<typeof AuthConfigListResponseSchema>;
|
|
2345
2682
|
declare const AuthConfigUpdateParamsSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
@@ -2814,7 +3151,7 @@ declare class OpenAIProvider extends BaseNonAgenticProvider<OpenAiToolCollection
|
|
|
2814
3151
|
* @param {string} userId - The user id.
|
|
2815
3152
|
* @returns {Promise<string[]>} The results of the tool call.
|
|
2816
3153
|
*/
|
|
2817
|
-
|
|
3154
|
+
handleToolCalls(userId: string, chatCompletion: OpenAI.ChatCompletion, options?: ExecuteToolFnOptions, modifiers?: ExecuteToolModifiers): Promise<string[]>;
|
|
2818
3155
|
/**
|
|
2819
3156
|
* Handles all the tool calls from the assistant.
|
|
2820
3157
|
*
|
|
@@ -2909,7 +3246,50 @@ declare class ComposioProvider extends BaseNonAgenticProvider<Array<CustomTool>,
|
|
|
2909
3246
|
wrapTools(tools: Tool[]): CustomTool[];
|
|
2910
3247
|
}
|
|
2911
3248
|
|
|
2912
|
-
|
|
3249
|
+
/**
|
|
3250
|
+
* Convert a JSON schema to a Zod schema
|
|
3251
|
+
* @param jsonSchema - The JSON schema to convert
|
|
3252
|
+
* @returns The Zod schema
|
|
3253
|
+
*
|
|
3254
|
+
* @example
|
|
3255
|
+
* ```ts
|
|
3256
|
+
* const zodSchema = jsonSchemaToZodSchema({
|
|
3257
|
+
* type: 'object',
|
|
3258
|
+
* properties: {
|
|
3259
|
+
* name: { type: 'string' },
|
|
3260
|
+
* },
|
|
3261
|
+
* });
|
|
3262
|
+
*
|
|
3263
|
+
* console.log(zodSchema);
|
|
3264
|
+
* ```
|
|
3265
|
+
*/
|
|
3266
|
+
declare function jsonSchemaToZodSchema(jsonSchema: Record<string, unknown>): z.ZodObject<Record<string, z.ZodTypeAny>>;
|
|
3267
|
+
|
|
3268
|
+
declare const LOG_LEVELS: {
|
|
3269
|
+
readonly silent: -1;
|
|
3270
|
+
readonly error: 0;
|
|
3271
|
+
readonly warn: 1;
|
|
3272
|
+
readonly info: 2;
|
|
3273
|
+
readonly debug: 3;
|
|
3274
|
+
};
|
|
3275
|
+
type LogLevel = keyof typeof LOG_LEVELS;
|
|
3276
|
+
interface LoggerOptions {
|
|
3277
|
+
level?: LogLevel;
|
|
3278
|
+
includeTimestamp?: boolean;
|
|
3279
|
+
}
|
|
3280
|
+
declare class Logger {
|
|
3281
|
+
private readonly level;
|
|
3282
|
+
private readonly includeTimestamp;
|
|
3283
|
+
private readonly console;
|
|
3284
|
+
constructor(options?: LoggerOptions);
|
|
3285
|
+
private formatMessage;
|
|
3286
|
+
private shouldLog;
|
|
3287
|
+
error(...args: unknown[]): void;
|
|
3288
|
+
warn(...args: unknown[]): void;
|
|
3289
|
+
info(...args: unknown[]): void;
|
|
3290
|
+
debug(...args: unknown[]): void;
|
|
3291
|
+
}
|
|
3292
|
+
declare const logger: Logger;
|
|
2913
3293
|
|
|
2914
3294
|
/**
|
|
2915
3295
|
* Options for error handling
|
|
@@ -2961,6 +3341,15 @@ declare class ComposioError extends Error {
|
|
|
2961
3341
|
* @private
|
|
2962
3342
|
*/
|
|
2963
3343
|
private definePropertyIfExists;
|
|
3344
|
+
/**
|
|
3345
|
+
* Helper method to combine stack traces when wrapping errors
|
|
3346
|
+
* This ensures the full call chain is preserved
|
|
3347
|
+
* @param originalStack The stack of the error being wrapped
|
|
3348
|
+
* @param currentStack The stack of the wrapper error
|
|
3349
|
+
* @returns Combined stack trace
|
|
3350
|
+
* @private
|
|
3351
|
+
*/
|
|
3352
|
+
private static combineStackTraces;
|
|
2964
3353
|
/**
|
|
2965
3354
|
* Extract and normalize error data for formatting
|
|
2966
3355
|
* @param includeStack Whether to include stack trace information
|
|
@@ -3097,4 +3486,4 @@ declare class ComposioNoAPIKeyError extends ComposioError {
|
|
|
3097
3486
|
constructor(message?: string, options?: Omit<ComposioErrorOptions, 'code' | 'statusCode'>);
|
|
3098
3487
|
}
|
|
3099
3488
|
|
|
3100
|
-
export { type AgenticToolOptions, AuthConfigErrorCodes, type AuthConfigType, AuthConfigTypes, type AuthSchemeType, AuthSchemeTypes, BaseAgenticProvider, type BaseComposioProvider, BaseNonAgenticProvider, BaseTelemetryTransport, Composio, ComposioAuthConfigNotFoundError, ComposioConnectedAccountNotFoundError, ComposioCustomToolsNotInitializedError, ComposioError, type ComposioErrorOptions, ComposioGlobalExecuteToolFnNotSetError, ComposioInvalidExecuteFunctionError, ComposioInvalidModifierError, ComposioNoAPIKeyError, ComposioProvider, ComposioProviderNotDefinedError, ComposioToolExecutionError, ComposioToolNotFoundError, ComposioToolkitFetchError, ComposioToolkitNotFoundError, ConnectedAccountErrorCodes, ConnectionRequestErrorCodes, ConnectionRequestFailedError, ConnectionRequestTimeoutError, ConsoleTelemetryTransport, type ErrorHandleOptions, type ExecuteMetadata, type ExecuteToolFn, type ExecuteToolFnOptions, type ExecuteToolModifiers, OpenAIProvider, type Provider, SDKErrorCodes, type Tool, ToolErrorCodes, type ToolExecuteParams, type ToolListParams, ToolListParamsSchema, type ToolOptions, ToolkitErrorCodes, type TransformToolSchemaModifier, ValidationError, ValidationErrorCodes, type afterExecuteModifier, type beforeExecuteModifier,
|
|
3489
|
+
export { type AgenticToolOptions, AuthConfigErrorCodes, type AuthConfigType, AuthConfigTypes, type AuthSchemeType, AuthSchemeTypes, BaseAgenticProvider, type BaseComposioProvider, BaseNonAgenticProvider, BaseTelemetryTransport, Composio, ComposioAuthConfigNotFoundError, ComposioConnectedAccountNotFoundError, ComposioCustomToolsNotInitializedError, ComposioError, type ComposioErrorOptions, ComposioGlobalExecuteToolFnNotSetError, ComposioInvalidExecuteFunctionError, ComposioInvalidModifierError, ComposioNoAPIKeyError, ComposioProvider, ComposioProviderNotDefinedError, ComposioToolExecutionError, ComposioToolNotFoundError, ComposioToolkitFetchError, ComposioToolkitNotFoundError, ConnectedAccountErrorCodes, ConnectionRequestErrorCodes, ConnectionRequestFailedError, ConnectionRequestTimeoutError, ConsoleTelemetryTransport, type ErrorHandleOptions, type ExecuteMetadata, type ExecuteToolFn, type ExecuteToolFnOptions, type ExecuteToolModifiers, OpenAIProvider, type Provider, SDKErrorCodes, type Tool, ToolErrorCodes, type ToolExecuteParams, type ToolListParams, ToolListParamsSchema, type ToolOptions, ToolkitErrorCodes, type TransformToolSchemaModifier, ValidationError, ValidationErrorCodes, type afterExecuteModifier, type beforeExecuteModifier, jsonSchemaToZodSchema, logger };
|