JS SDK - v0.5.0
himanshu-dixit
released this
02 Jan 07:20
·
29 commits
to master
since this release
π New Features
π οΈ Toolset Enhancements:
- π Exposed ComposioToolset in index.ts.
- ποΈ Added new method getTriggerInfo and getTriggerConfig to trigger.
- π Exposed .apps, .actions, .triggers, and .connectedAccounts in toolset classes.
π¨ Error Handling:
- π All errors are now instances of ComposioError for improved consistency.
- π Added error.error_code for better debugging.
- π§ Backend (BE) errors now include more helpful error messages.
β‘ Performance Improvements:
- π Decreased bundle size significantly from 10MB to 400KB.
πΌοΈ Framework Support:
- π₯οΈ Added support for frontend (FE) frameworks and resolved issues with React server components.
π Type Safety and Validation:
- β Improved type safety and early validation using Zod.
π οΈ Enhanced codebase types for better developer experience.
- βοΈ Improved format for PreProcessor, PostProcessor, and SchemaProcessor.
π Method Improvements:
- π§ Enhanced method consistency across the codebase.
- π New API Client with types.
- π New JS Docs for methods.
β οΈ Breaking Changes
π₯οΈ Remove Workspace Support:
- ποΈ Support for local and Docker workspaces was removed.
π·οΈ Type Name Changes: - π Updated type names associated with models. Types are now more robust and can be inferred directly from methods.
π Refer to updated methods for adjustments. Inferred should still be the same. - π οΈ toolset.createAction change: params -> inputParams and response. Migration code
await toolset.createAction({
...
params: z.object({
name: z.string().optional()
}),
callback: async () => {
return "Hello World from the function";
}
});
to
await toolset.createAction({
...
inputParams: z.object({
name: z.string().optional()
}),
callback: async (params) => {
const { name } = params;
return {
successful: true,
data: {
name: name || "World"
}
}
}
});