@composio/core 0.1.4-alpha.0 → 0.1.6-alpha.0
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 +46 -38
- package/dist/index.d.cts +4 -8
- package/dist/index.d.ts +4 -8
- package/dist/index.js +34 -26
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -71,7 +71,7 @@ var ToolListParamsSchema = import_zod.z.object({
|
|
|
71
71
|
important: import_zod.z.string().optional(),
|
|
72
72
|
limit: import_zod.z.string().optional(),
|
|
73
73
|
search: import_zod.z.string().optional(),
|
|
74
|
-
toolkits: import_zod.z.string().optional(),
|
|
74
|
+
toolkits: import_zod.z.array(import_zod.z.string()).optional(),
|
|
75
75
|
tools: import_zod.z.array(import_zod.z.string()).optional()
|
|
76
76
|
});
|
|
77
77
|
var CustomAuthParamsSchema = import_zod.z.object({
|
|
@@ -436,7 +436,7 @@ var Tools = class {
|
|
|
436
436
|
important: queryParams.data.important,
|
|
437
437
|
limit: queryParams.data.limit,
|
|
438
438
|
search: queryParams.data.search,
|
|
439
|
-
toolkit_slug: queryParams.data.toolkits,
|
|
439
|
+
toolkit_slug: queryParams.data.toolkits?.join(","),
|
|
440
440
|
tool_slugs: queryParams.data.tools?.join(",")
|
|
441
441
|
});
|
|
442
442
|
if (!tools) {
|
|
@@ -1181,7 +1181,6 @@ var ConnectedAccountAuthConfigSchema = import_zod3.z.object({
|
|
|
1181
1181
|
});
|
|
1182
1182
|
var ConnectedAccountRetrieveResponseSchema = import_zod3.z.object({
|
|
1183
1183
|
id: import_zod3.z.string(),
|
|
1184
|
-
uuid: import_zod3.z.string(),
|
|
1185
1184
|
authConfig: ConnectedAccountAuthConfigSchema,
|
|
1186
1185
|
userId: import_zod3.z.string(),
|
|
1187
1186
|
data: import_zod3.z.record(import_zod3.z.string(), import_zod3.z.unknown()),
|
|
@@ -1198,8 +1197,8 @@ var ConnectedAccountRetrieveResponseSchema = import_zod3.z.object({
|
|
|
1198
1197
|
});
|
|
1199
1198
|
|
|
1200
1199
|
// src/models/ConnectionRequest.ts
|
|
1200
|
+
var import_zod4 = require("zod");
|
|
1201
1201
|
var ConnectionRequest = class {
|
|
1202
|
-
FILE_NAME = "core/models/ConnectionRequest.ts";
|
|
1203
1202
|
client;
|
|
1204
1203
|
connectedAccountId;
|
|
1205
1204
|
connectedAccountStatus;
|
|
@@ -1214,23 +1213,31 @@ var ConnectionRequest = class {
|
|
|
1214
1213
|
* @returns
|
|
1215
1214
|
*/
|
|
1216
1215
|
async transformResponse(response) {
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1216
|
+
try {
|
|
1217
|
+
const parsedResponse = ConnectedAccountRetrieveResponseSchema.parse({
|
|
1218
|
+
...response,
|
|
1219
|
+
userId: response.user_id,
|
|
1220
|
+
// Add the missing userId property
|
|
1221
|
+
authConfig: {
|
|
1222
|
+
...response.auth_config,
|
|
1223
|
+
authScheme: response.auth_config.auth_scheme,
|
|
1224
|
+
isComposioManaged: response.auth_config.is_composio_managed,
|
|
1225
|
+
isDisabled: response.auth_config.is_disabled
|
|
1226
|
+
},
|
|
1227
|
+
statusReason: response.status_reason,
|
|
1228
|
+
isDisabled: response.is_disabled,
|
|
1229
|
+
createdAt: response.created_at,
|
|
1230
|
+
updatedAt: response.updated_at,
|
|
1231
|
+
testRequestEndpoint: response.test_request_endpoint
|
|
1232
|
+
});
|
|
1233
|
+
return parsedResponse;
|
|
1234
|
+
} catch (error) {
|
|
1235
|
+
logger_default.error("Error transforming response", error);
|
|
1236
|
+
if (error instanceof import_zod4.ZodError) {
|
|
1237
|
+
logger_default.error(JSON.stringify(error.errors, null, 2));
|
|
1238
|
+
}
|
|
1239
|
+
throw error;
|
|
1240
|
+
}
|
|
1234
1241
|
}
|
|
1235
1242
|
/**
|
|
1236
1243
|
* Wait for the connection to be established.
|
|
@@ -1351,14 +1358,13 @@ var ConnectedAccounts = class {
|
|
|
1351
1358
|
* @returns {Promise<ConnectionRequest>} Connection request object
|
|
1352
1359
|
*/
|
|
1353
1360
|
async createConnectedAccount(userId, authConfigId, options) {
|
|
1354
|
-
const { redirectUrl, data } = options;
|
|
1355
1361
|
const response = await this.create({
|
|
1356
1362
|
auth_config: {
|
|
1357
1363
|
id: authConfigId
|
|
1358
1364
|
},
|
|
1359
1365
|
connection: {
|
|
1360
|
-
data,
|
|
1361
|
-
redirect_uri: redirectUrl,
|
|
1366
|
+
data: options?.data,
|
|
1367
|
+
redirect_uri: options?.redirectUrl,
|
|
1362
1368
|
user_id: userId
|
|
1363
1369
|
}
|
|
1364
1370
|
});
|
|
@@ -1850,7 +1856,7 @@ var OpenAIToolset = class extends BaseNonAgenticToolset {
|
|
|
1850
1856
|
};
|
|
1851
1857
|
|
|
1852
1858
|
// package.json
|
|
1853
|
-
var version = "0.1.
|
|
1859
|
+
var version = "0.1.6-alpha.0";
|
|
1854
1860
|
|
|
1855
1861
|
// src/utils/uuid.ts
|
|
1856
1862
|
var import_uuid = require("uuid");
|
|
@@ -1914,7 +1920,9 @@ var Composio = class {
|
|
|
1914
1920
|
this.triggers = new Triggers(this.client);
|
|
1915
1921
|
this.authConfigs = new AuthConfigs(this.client);
|
|
1916
1922
|
this.connectedAccounts = new ConnectedAccounts(this.client);
|
|
1917
|
-
this.createConnectedAccount = this.connectedAccounts.createConnectedAccount
|
|
1923
|
+
this.createConnectedAccount = this.connectedAccounts.createConnectedAccount.bind(
|
|
1924
|
+
this.connectedAccounts
|
|
1925
|
+
);
|
|
1918
1926
|
if (this.config.allowTracking ?? true) {
|
|
1919
1927
|
this.initializeTelemetry(
|
|
1920
1928
|
{
|
|
@@ -1994,39 +2002,39 @@ var BaseTelemetryTransport = class {
|
|
|
1994
2002
|
};
|
|
1995
2003
|
|
|
1996
2004
|
// src/utils/jsonSchema.ts
|
|
1997
|
-
var
|
|
2005
|
+
var import_zod5 = require("zod");
|
|
1998
2006
|
function jsonSchemaPropertiesToTSTypes(value) {
|
|
1999
2007
|
if (!value.type) {
|
|
2000
|
-
return
|
|
2008
|
+
return import_zod5.z.object({});
|
|
2001
2009
|
}
|
|
2002
2010
|
let zodType;
|
|
2003
2011
|
switch (value.type) {
|
|
2004
2012
|
case "string":
|
|
2005
|
-
zodType =
|
|
2013
|
+
zodType = import_zod5.z.string().describe(
|
|
2006
2014
|
(value.description || "") + (value.examples ? `
|
|
2007
2015
|
Examples: ${value.examples.join(", ")}` : "")
|
|
2008
2016
|
);
|
|
2009
2017
|
break;
|
|
2010
2018
|
case "number":
|
|
2011
|
-
zodType =
|
|
2019
|
+
zodType = import_zod5.z.number().describe(
|
|
2012
2020
|
(value.description || "") + (value.examples ? `
|
|
2013
2021
|
Examples: ${value.examples.join(", ")}` : "")
|
|
2014
2022
|
);
|
|
2015
2023
|
break;
|
|
2016
2024
|
case "integer":
|
|
2017
|
-
zodType =
|
|
2025
|
+
zodType = import_zod5.z.number().int().describe(
|
|
2018
2026
|
(value.description || "") + (value.examples ? `
|
|
2019
2027
|
Examples: ${value.examples.join(", ")}` : "")
|
|
2020
2028
|
);
|
|
2021
2029
|
break;
|
|
2022
2030
|
case "boolean":
|
|
2023
|
-
zodType =
|
|
2031
|
+
zodType = import_zod5.z.boolean().describe(
|
|
2024
2032
|
(value.description || "") + (value.examples ? `
|
|
2025
2033
|
Examples: ${value.examples.join(", ")}` : "")
|
|
2026
2034
|
);
|
|
2027
2035
|
break;
|
|
2028
2036
|
case "array":
|
|
2029
|
-
zodType =
|
|
2037
|
+
zodType = import_zod5.z.array(
|
|
2030
2038
|
jsonSchemaPropertiesToTSTypes(
|
|
2031
2039
|
value.items
|
|
2032
2040
|
)
|
|
@@ -2042,7 +2050,7 @@ Examples: ${value.examples.join(", ")}` : "")
|
|
|
2042
2050
|
);
|
|
2043
2051
|
break;
|
|
2044
2052
|
case "null":
|
|
2045
|
-
zodType =
|
|
2053
|
+
zodType = import_zod5.z.null().describe(value.description || "");
|
|
2046
2054
|
break;
|
|
2047
2055
|
default:
|
|
2048
2056
|
throw new Error(`Unsupported JSON schema type: ${value.type}`);
|
|
@@ -2053,7 +2061,7 @@ function jsonSchemaToModel(jsonSchema) {
|
|
|
2053
2061
|
const properties = jsonSchema.properties;
|
|
2054
2062
|
const requiredFields = jsonSchema.required || [];
|
|
2055
2063
|
if (!properties) {
|
|
2056
|
-
return
|
|
2064
|
+
return import_zod5.z.object({});
|
|
2057
2065
|
}
|
|
2058
2066
|
const zodSchema = {};
|
|
2059
2067
|
for (const [key, _] of Object.entries(properties)) {
|
|
@@ -2065,7 +2073,7 @@ function jsonSchemaToModel(jsonSchema) {
|
|
|
2065
2073
|
schema
|
|
2066
2074
|
)
|
|
2067
2075
|
);
|
|
2068
|
-
zodType =
|
|
2076
|
+
zodType = import_zod5.z.union(anyOfTypes).describe(
|
|
2069
2077
|
(value.description || "") + (value.examples ? `
|
|
2070
2078
|
Examples: ${value.examples.join(", ")}` : "")
|
|
2071
2079
|
);
|
|
@@ -2075,7 +2083,7 @@ Examples: ${value.examples.join(", ")}` : "")
|
|
|
2075
2083
|
schema
|
|
2076
2084
|
)
|
|
2077
2085
|
);
|
|
2078
|
-
zodType =
|
|
2086
|
+
zodType = import_zod5.z.intersection(
|
|
2079
2087
|
allOfTypes[0],
|
|
2080
2088
|
allOfTypes.slice(1).reduce((acc, schema) => acc.and(schema), allOfTypes[0])
|
|
2081
2089
|
).describe(
|
|
@@ -2099,7 +2107,7 @@ Examples: ${value.examples.join(", ")}` : "")
|
|
|
2099
2107
|
zodSchema[key] = zodType.optional();
|
|
2100
2108
|
}
|
|
2101
2109
|
}
|
|
2102
|
-
return
|
|
2110
|
+
return import_zod5.z.object(zodSchema);
|
|
2103
2111
|
}
|
|
2104
2112
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2105
2113
|
0 && (module.exports = {
|
package/dist/index.d.cts
CHANGED
|
@@ -75,21 +75,21 @@ declare const ToolListParamsSchema: z.ZodObject<{
|
|
|
75
75
|
important: z.ZodOptional<z.ZodString>;
|
|
76
76
|
limit: z.ZodOptional<z.ZodString>;
|
|
77
77
|
search: z.ZodOptional<z.ZodString>;
|
|
78
|
-
toolkits: z.ZodOptional<z.ZodString
|
|
78
|
+
toolkits: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
79
79
|
tools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
80
80
|
}, "strip", z.ZodTypeAny, {
|
|
81
81
|
cursor?: string | undefined;
|
|
82
82
|
important?: string | undefined;
|
|
83
83
|
limit?: string | undefined;
|
|
84
84
|
search?: string | undefined;
|
|
85
|
-
toolkits?: string | undefined;
|
|
85
|
+
toolkits?: string[] | undefined;
|
|
86
86
|
tools?: string[] | undefined;
|
|
87
87
|
}, {
|
|
88
88
|
cursor?: string | undefined;
|
|
89
89
|
important?: string | undefined;
|
|
90
90
|
limit?: string | undefined;
|
|
91
91
|
search?: string | undefined;
|
|
92
|
-
toolkits?: string | undefined;
|
|
92
|
+
toolkits?: string[] | undefined;
|
|
93
93
|
tools?: string[] | undefined;
|
|
94
94
|
}>;
|
|
95
95
|
type ToolListParams = z.infer<typeof ToolListParamsSchema>;
|
|
@@ -1442,7 +1442,6 @@ declare const CreateConnectedAccountOptionsSchema: z.ZodObject<{
|
|
|
1442
1442
|
type CreateConnectedAccountOptionsSchema = z.infer<typeof CreateConnectedAccountOptionsSchema>;
|
|
1443
1443
|
declare const ConnectedAccountRetrieveResponseSchema: z.ZodObject<{
|
|
1444
1444
|
id: z.ZodString;
|
|
1445
|
-
uuid: z.ZodString;
|
|
1446
1445
|
authConfig: z.ZodObject<{
|
|
1447
1446
|
id: z.ZodString;
|
|
1448
1447
|
authScheme: z.ZodEnum<["OAUTH2", "OAUTH1", "OAUTH1A", "API_KEY", "BASIC", "BILLCOM_AUTH", "BEARER_TOKEN", "GOOGLE_SERVICE_ACCOUNT", "NO_AUTH", "BASIC_WITH_JWT", "COMPOSIO_LINK", "CALCOM_AUTH", "SNOWFLAKE"]>;
|
|
@@ -1493,7 +1492,6 @@ declare const ConnectedAccountRetrieveResponseSchema: z.ZodObject<{
|
|
|
1493
1492
|
isDisabled: boolean;
|
|
1494
1493
|
};
|
|
1495
1494
|
isDisabled: boolean;
|
|
1496
|
-
uuid: string;
|
|
1497
1495
|
statusReason: string | null;
|
|
1498
1496
|
testRequestEndpoint?: string | undefined;
|
|
1499
1497
|
}, {
|
|
@@ -1514,7 +1512,6 @@ declare const ConnectedAccountRetrieveResponseSchema: z.ZodObject<{
|
|
|
1514
1512
|
isDisabled: boolean;
|
|
1515
1513
|
};
|
|
1516
1514
|
isDisabled: boolean;
|
|
1517
|
-
uuid: string;
|
|
1518
1515
|
statusReason: string | null;
|
|
1519
1516
|
testRequestEndpoint?: string | undefined;
|
|
1520
1517
|
}>;
|
|
@@ -1529,7 +1526,6 @@ type ConnectedAccountRetrieveResponse = z.infer<typeof ConnectedAccountRetrieveR
|
|
|
1529
1526
|
*/
|
|
1530
1527
|
|
|
1531
1528
|
declare class ConnectionRequest {
|
|
1532
|
-
readonly FILE_NAME: string;
|
|
1533
1529
|
private client;
|
|
1534
1530
|
private connectedAccountId;
|
|
1535
1531
|
private connectedAccountStatus;
|
|
@@ -1630,7 +1626,7 @@ declare class ConnectedAccounts {
|
|
|
1630
1626
|
* @param {CreateConnectedAccountParams} data - Data for creating a new connected account
|
|
1631
1627
|
* @returns {Promise<ConnectionRequest>} Connection request object
|
|
1632
1628
|
*/
|
|
1633
|
-
createConnectedAccount(userId: string, authConfigId: string, options
|
|
1629
|
+
createConnectedAccount(userId: string, authConfigId: string, options?: CreateConnectedAccountOptions): Promise<ConnectionRequest>;
|
|
1634
1630
|
}
|
|
1635
1631
|
|
|
1636
1632
|
type AcceptableJSONValue = Record<string, unknown> | Array<Record<string, unknown>> | string | number | boolean | null | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -75,21 +75,21 @@ declare const ToolListParamsSchema: z.ZodObject<{
|
|
|
75
75
|
important: z.ZodOptional<z.ZodString>;
|
|
76
76
|
limit: z.ZodOptional<z.ZodString>;
|
|
77
77
|
search: z.ZodOptional<z.ZodString>;
|
|
78
|
-
toolkits: z.ZodOptional<z.ZodString
|
|
78
|
+
toolkits: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
79
79
|
tools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
80
80
|
}, "strip", z.ZodTypeAny, {
|
|
81
81
|
cursor?: string | undefined;
|
|
82
82
|
important?: string | undefined;
|
|
83
83
|
limit?: string | undefined;
|
|
84
84
|
search?: string | undefined;
|
|
85
|
-
toolkits?: string | undefined;
|
|
85
|
+
toolkits?: string[] | undefined;
|
|
86
86
|
tools?: string[] | undefined;
|
|
87
87
|
}, {
|
|
88
88
|
cursor?: string | undefined;
|
|
89
89
|
important?: string | undefined;
|
|
90
90
|
limit?: string | undefined;
|
|
91
91
|
search?: string | undefined;
|
|
92
|
-
toolkits?: string | undefined;
|
|
92
|
+
toolkits?: string[] | undefined;
|
|
93
93
|
tools?: string[] | undefined;
|
|
94
94
|
}>;
|
|
95
95
|
type ToolListParams = z.infer<typeof ToolListParamsSchema>;
|
|
@@ -1442,7 +1442,6 @@ declare const CreateConnectedAccountOptionsSchema: z.ZodObject<{
|
|
|
1442
1442
|
type CreateConnectedAccountOptionsSchema = z.infer<typeof CreateConnectedAccountOptionsSchema>;
|
|
1443
1443
|
declare const ConnectedAccountRetrieveResponseSchema: z.ZodObject<{
|
|
1444
1444
|
id: z.ZodString;
|
|
1445
|
-
uuid: z.ZodString;
|
|
1446
1445
|
authConfig: z.ZodObject<{
|
|
1447
1446
|
id: z.ZodString;
|
|
1448
1447
|
authScheme: z.ZodEnum<["OAUTH2", "OAUTH1", "OAUTH1A", "API_KEY", "BASIC", "BILLCOM_AUTH", "BEARER_TOKEN", "GOOGLE_SERVICE_ACCOUNT", "NO_AUTH", "BASIC_WITH_JWT", "COMPOSIO_LINK", "CALCOM_AUTH", "SNOWFLAKE"]>;
|
|
@@ -1493,7 +1492,6 @@ declare const ConnectedAccountRetrieveResponseSchema: z.ZodObject<{
|
|
|
1493
1492
|
isDisabled: boolean;
|
|
1494
1493
|
};
|
|
1495
1494
|
isDisabled: boolean;
|
|
1496
|
-
uuid: string;
|
|
1497
1495
|
statusReason: string | null;
|
|
1498
1496
|
testRequestEndpoint?: string | undefined;
|
|
1499
1497
|
}, {
|
|
@@ -1514,7 +1512,6 @@ declare const ConnectedAccountRetrieveResponseSchema: z.ZodObject<{
|
|
|
1514
1512
|
isDisabled: boolean;
|
|
1515
1513
|
};
|
|
1516
1514
|
isDisabled: boolean;
|
|
1517
|
-
uuid: string;
|
|
1518
1515
|
statusReason: string | null;
|
|
1519
1516
|
testRequestEndpoint?: string | undefined;
|
|
1520
1517
|
}>;
|
|
@@ -1529,7 +1526,6 @@ type ConnectedAccountRetrieveResponse = z.infer<typeof ConnectedAccountRetrieveR
|
|
|
1529
1526
|
*/
|
|
1530
1527
|
|
|
1531
1528
|
declare class ConnectionRequest {
|
|
1532
|
-
readonly FILE_NAME: string;
|
|
1533
1529
|
private client;
|
|
1534
1530
|
private connectedAccountId;
|
|
1535
1531
|
private connectedAccountStatus;
|
|
@@ -1630,7 +1626,7 @@ declare class ConnectedAccounts {
|
|
|
1630
1626
|
* @param {CreateConnectedAccountParams} data - Data for creating a new connected account
|
|
1631
1627
|
* @returns {Promise<ConnectionRequest>} Connection request object
|
|
1632
1628
|
*/
|
|
1633
|
-
createConnectedAccount(userId: string, authConfigId: string, options
|
|
1629
|
+
createConnectedAccount(userId: string, authConfigId: string, options?: CreateConnectedAccountOptions): Promise<ConnectionRequest>;
|
|
1634
1630
|
}
|
|
1635
1631
|
|
|
1636
1632
|
type AcceptableJSONValue = Record<string, unknown> | Array<Record<string, unknown>> | string | number | boolean | null | undefined;
|
package/dist/index.js
CHANGED
|
@@ -35,7 +35,7 @@ var ToolListParamsSchema = z.object({
|
|
|
35
35
|
important: z.string().optional(),
|
|
36
36
|
limit: z.string().optional(),
|
|
37
37
|
search: z.string().optional(),
|
|
38
|
-
toolkits: z.string().optional(),
|
|
38
|
+
toolkits: z.array(z.string()).optional(),
|
|
39
39
|
tools: z.array(z.string()).optional()
|
|
40
40
|
});
|
|
41
41
|
var CustomAuthParamsSchema = z.object({
|
|
@@ -400,7 +400,7 @@ var Tools = class {
|
|
|
400
400
|
important: queryParams.data.important,
|
|
401
401
|
limit: queryParams.data.limit,
|
|
402
402
|
search: queryParams.data.search,
|
|
403
|
-
toolkit_slug: queryParams.data.toolkits,
|
|
403
|
+
toolkit_slug: queryParams.data.toolkits?.join(","),
|
|
404
404
|
tool_slugs: queryParams.data.tools?.join(",")
|
|
405
405
|
});
|
|
406
406
|
if (!tools) {
|
|
@@ -1145,7 +1145,6 @@ var ConnectedAccountAuthConfigSchema = z3.object({
|
|
|
1145
1145
|
});
|
|
1146
1146
|
var ConnectedAccountRetrieveResponseSchema = z3.object({
|
|
1147
1147
|
id: z3.string(),
|
|
1148
|
-
uuid: z3.string(),
|
|
1149
1148
|
authConfig: ConnectedAccountAuthConfigSchema,
|
|
1150
1149
|
userId: z3.string(),
|
|
1151
1150
|
data: z3.record(z3.string(), z3.unknown()),
|
|
@@ -1162,8 +1161,8 @@ var ConnectedAccountRetrieveResponseSchema = z3.object({
|
|
|
1162
1161
|
});
|
|
1163
1162
|
|
|
1164
1163
|
// src/models/ConnectionRequest.ts
|
|
1164
|
+
import { ZodError } from "zod";
|
|
1165
1165
|
var ConnectionRequest = class {
|
|
1166
|
-
FILE_NAME = "core/models/ConnectionRequest.ts";
|
|
1167
1166
|
client;
|
|
1168
1167
|
connectedAccountId;
|
|
1169
1168
|
connectedAccountStatus;
|
|
@@ -1178,23 +1177,31 @@ var ConnectionRequest = class {
|
|
|
1178
1177
|
* @returns
|
|
1179
1178
|
*/
|
|
1180
1179
|
async transformResponse(response) {
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1180
|
+
try {
|
|
1181
|
+
const parsedResponse = ConnectedAccountRetrieveResponseSchema.parse({
|
|
1182
|
+
...response,
|
|
1183
|
+
userId: response.user_id,
|
|
1184
|
+
// Add the missing userId property
|
|
1185
|
+
authConfig: {
|
|
1186
|
+
...response.auth_config,
|
|
1187
|
+
authScheme: response.auth_config.auth_scheme,
|
|
1188
|
+
isComposioManaged: response.auth_config.is_composio_managed,
|
|
1189
|
+
isDisabled: response.auth_config.is_disabled
|
|
1190
|
+
},
|
|
1191
|
+
statusReason: response.status_reason,
|
|
1192
|
+
isDisabled: response.is_disabled,
|
|
1193
|
+
createdAt: response.created_at,
|
|
1194
|
+
updatedAt: response.updated_at,
|
|
1195
|
+
testRequestEndpoint: response.test_request_endpoint
|
|
1196
|
+
});
|
|
1197
|
+
return parsedResponse;
|
|
1198
|
+
} catch (error) {
|
|
1199
|
+
logger_default.error("Error transforming response", error);
|
|
1200
|
+
if (error instanceof ZodError) {
|
|
1201
|
+
logger_default.error(JSON.stringify(error.errors, null, 2));
|
|
1202
|
+
}
|
|
1203
|
+
throw error;
|
|
1204
|
+
}
|
|
1198
1205
|
}
|
|
1199
1206
|
/**
|
|
1200
1207
|
* Wait for the connection to be established.
|
|
@@ -1315,14 +1322,13 @@ var ConnectedAccounts = class {
|
|
|
1315
1322
|
* @returns {Promise<ConnectionRequest>} Connection request object
|
|
1316
1323
|
*/
|
|
1317
1324
|
async createConnectedAccount(userId, authConfigId, options) {
|
|
1318
|
-
const { redirectUrl, data } = options;
|
|
1319
1325
|
const response = await this.create({
|
|
1320
1326
|
auth_config: {
|
|
1321
1327
|
id: authConfigId
|
|
1322
1328
|
},
|
|
1323
1329
|
connection: {
|
|
1324
|
-
data,
|
|
1325
|
-
redirect_uri: redirectUrl,
|
|
1330
|
+
data: options?.data,
|
|
1331
|
+
redirect_uri: options?.redirectUrl,
|
|
1326
1332
|
user_id: userId
|
|
1327
1333
|
}
|
|
1328
1334
|
});
|
|
@@ -1814,7 +1820,7 @@ var OpenAIToolset = class extends BaseNonAgenticToolset {
|
|
|
1814
1820
|
};
|
|
1815
1821
|
|
|
1816
1822
|
// package.json
|
|
1817
|
-
var version = "0.1.
|
|
1823
|
+
var version = "0.1.6-alpha.0";
|
|
1818
1824
|
|
|
1819
1825
|
// src/utils/uuid.ts
|
|
1820
1826
|
import { v4 as uuidv4 } from "uuid";
|
|
@@ -1878,7 +1884,9 @@ var Composio = class {
|
|
|
1878
1884
|
this.triggers = new Triggers(this.client);
|
|
1879
1885
|
this.authConfigs = new AuthConfigs(this.client);
|
|
1880
1886
|
this.connectedAccounts = new ConnectedAccounts(this.client);
|
|
1881
|
-
this.createConnectedAccount = this.connectedAccounts.createConnectedAccount
|
|
1887
|
+
this.createConnectedAccount = this.connectedAccounts.createConnectedAccount.bind(
|
|
1888
|
+
this.connectedAccounts
|
|
1889
|
+
);
|
|
1882
1890
|
if (this.config.allowTracking ?? true) {
|
|
1883
1891
|
this.initializeTelemetry(
|
|
1884
1892
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@composio/core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6-alpha.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"zod": "^3.24.2",
|
|
44
44
|
"zod-to-json-schema": "^3.24.5"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "34bd931298ebfaa2bc901f26f328983796e090f6"
|
|
47
47
|
}
|