@composio/core 0.1.16 → 0.1.17
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 +34 -19
- package/dist/index.d.cts +2970 -2998
- package/dist/index.d.ts +2970 -2998
- package/dist/index.js +34 -19
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -154,6 +154,7 @@ var JSONSchemaType = import_zod.z.enum([
|
|
|
154
154
|
var JSONSchemaProperty = import_zod.z.object({
|
|
155
155
|
type: JSONSchemaType.optional(),
|
|
156
156
|
description: import_zod.z.string().optional(),
|
|
157
|
+
anyOf: import_zod.z.lazy(() => import_zod.z.array(JSONSchemaProperty)).optional(),
|
|
157
158
|
title: import_zod.z.string().optional(),
|
|
158
159
|
default: import_zod.z.any().optional(),
|
|
159
160
|
properties: import_zod.z.lazy(() => import_zod.z.record(import_zod.z.string(), JSONSchemaProperty)).optional(),
|
|
@@ -162,6 +163,7 @@ var JSONSchemaProperty = import_zod.z.object({
|
|
|
162
163
|
});
|
|
163
164
|
var ParametersSchema = import_zod.z.object({
|
|
164
165
|
type: import_zod.z.literal("object"),
|
|
166
|
+
anyOf: import_zod.z.array(JSONSchemaProperty).optional(),
|
|
165
167
|
properties: import_zod.z.record(import_zod.z.string(), JSONSchemaProperty),
|
|
166
168
|
required: import_zod.z.array(import_zod.z.string()).optional(),
|
|
167
169
|
title: import_zod.z.string().optional(),
|
|
@@ -1889,7 +1891,7 @@ var CustomTools = class {
|
|
|
1889
1891
|
if (!tool) {
|
|
1890
1892
|
throw new ComposioToolNotFoundError(`Tool with slug ${slug} not found`);
|
|
1891
1893
|
}
|
|
1892
|
-
let authCredentials =
|
|
1894
|
+
let authCredentials = null;
|
|
1893
1895
|
const { toolkitSlug, execute, inputParams } = tool.options;
|
|
1894
1896
|
let connectedAccountId = body.connectedAccountId;
|
|
1895
1897
|
if (toolkitSlug && toolkitSlug !== "custom") {
|
|
@@ -1913,7 +1915,7 @@ var CustomTools = class {
|
|
|
1913
1915
|
}
|
|
1914
1916
|
);
|
|
1915
1917
|
}
|
|
1916
|
-
authCredentials = connectedAccount.
|
|
1918
|
+
authCredentials = connectedAccount.state ?? null;
|
|
1917
1919
|
connectedAccountId = connectedAccount.id;
|
|
1918
1920
|
}
|
|
1919
1921
|
if (typeof execute !== "function") {
|
|
@@ -2595,11 +2597,7 @@ var ToolKitItemSchema = import_zod6.z.object({
|
|
|
2595
2597
|
composioManagedAuthSchemes: import_zod6.z.array(import_zod6.z.string()).optional(),
|
|
2596
2598
|
noAuth: import_zod6.z.boolean().optional()
|
|
2597
2599
|
});
|
|
2598
|
-
var ToolKitListResponseSchema = import_zod6.z.
|
|
2599
|
-
items: import_zod6.z.array(ToolKitItemSchema),
|
|
2600
|
-
nextCursor: import_zod6.z.string().nullable(),
|
|
2601
|
-
totalPages: import_zod6.z.number()
|
|
2602
|
-
});
|
|
2600
|
+
var ToolKitListResponseSchema = import_zod6.z.array(ToolKitItemSchema);
|
|
2603
2601
|
var ToolkitAuthFieldSchema = import_zod6.z.object({
|
|
2604
2602
|
name: import_zod6.z.string(),
|
|
2605
2603
|
displayName: import_zod6.z.string(),
|
|
@@ -3449,22 +3447,34 @@ var Toolkits = class {
|
|
|
3449
3447
|
managed_by: parsedQuery.data.managedBy,
|
|
3450
3448
|
sort_by: parsedQuery.data.sortBy
|
|
3451
3449
|
});
|
|
3452
|
-
const parsedResult = ToolKitListResponseSchema.safeParse(
|
|
3453
|
-
|
|
3454
|
-
const parsedItem = ToolKitItemSchema.
|
|
3450
|
+
const parsedResult = ToolKitListResponseSchema.safeParse(
|
|
3451
|
+
result.items.map((item) => {
|
|
3452
|
+
const parsedItem = ToolKitItemSchema.safeParse({
|
|
3455
3453
|
name: item.name,
|
|
3456
3454
|
slug: item.slug,
|
|
3457
|
-
meta:
|
|
3455
|
+
meta: {
|
|
3456
|
+
...item.meta,
|
|
3457
|
+
createdAt: item.meta.created_at,
|
|
3458
|
+
updatedAt: item.meta.updated_at,
|
|
3459
|
+
toolsCount: item.meta.tools_count,
|
|
3460
|
+
triggersCount: item.meta.triggers_count,
|
|
3461
|
+
categories: item.meta.categories,
|
|
3462
|
+
appUrl: item.meta.app_url,
|
|
3463
|
+
logo: item.meta.logo
|
|
3464
|
+
},
|
|
3458
3465
|
isLocalToolkit: item.is_local_toolkit,
|
|
3459
3466
|
authSchemes: item.auth_schemes,
|
|
3460
3467
|
composioManagedAuthSchemes: item.composio_managed_auth_schemes,
|
|
3461
3468
|
noAuth: item.no_auth
|
|
3462
3469
|
});
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3470
|
+
if (!parsedItem.success) {
|
|
3471
|
+
throw new ValidationError("Failed to parse toolkit response", {
|
|
3472
|
+
cause: parsedItem.error
|
|
3473
|
+
});
|
|
3474
|
+
}
|
|
3475
|
+
return parsedItem.data;
|
|
3476
|
+
})
|
|
3477
|
+
);
|
|
3468
3478
|
if (!parsedResult.success) {
|
|
3469
3479
|
throw new ValidationError("Failed to parse toolkit list response", {
|
|
3470
3480
|
cause: parsedResult.error
|
|
@@ -3570,7 +3580,7 @@ var Toolkits = class {
|
|
|
3570
3580
|
*/
|
|
3571
3581
|
async listCategories() {
|
|
3572
3582
|
const result = await this.client.toolkits.retrieveCategories();
|
|
3573
|
-
const parsedResult = ToolkitRetrieveCategoriesResponseSchema.
|
|
3583
|
+
const parsedResult = ToolkitRetrieveCategoriesResponseSchema.safeParse({
|
|
3574
3584
|
items: result.items.map((item) => {
|
|
3575
3585
|
const parsedItem = ToolkitCategorySchema.parse({
|
|
3576
3586
|
id: item.id,
|
|
@@ -3581,7 +3591,12 @@ var Toolkits = class {
|
|
|
3581
3591
|
nextCursor: result.next_cursor,
|
|
3582
3592
|
totalPages: result.total_pages
|
|
3583
3593
|
});
|
|
3584
|
-
|
|
3594
|
+
if (!parsedResult.success) {
|
|
3595
|
+
throw new ValidationError("Failed to parse toolkit categories response", {
|
|
3596
|
+
cause: parsedResult.error
|
|
3597
|
+
});
|
|
3598
|
+
}
|
|
3599
|
+
return parsedResult.data;
|
|
3585
3600
|
}
|
|
3586
3601
|
/**
|
|
3587
3602
|
* Authorizes a user to use a toolkit.
|
|
@@ -4802,7 +4817,7 @@ var OpenAIProvider = class extends BaseNonAgenticProvider {
|
|
|
4802
4817
|
};
|
|
4803
4818
|
|
|
4804
4819
|
// package.json
|
|
4805
|
-
var version = "0.1.
|
|
4820
|
+
var version = "0.1.17";
|
|
4806
4821
|
|
|
4807
4822
|
// src/composio.ts
|
|
4808
4823
|
var Composio = class _Composio {
|