mirror of
https://github.com/ComposioHQ/composio.git
synced 2026-09-22 11:46:35 +08:00
9e002c5ca3
Co-authored-by: jkomyno <12381818+jkomyno@users.noreply.github.com>
45 lines
1.5 KiB
TypeScript
45 lines
1.5 KiB
TypeScript
import {
|
|
ToolRouterToolkitsDisabledConfigSchema,
|
|
ToolRouterToolkitsEnabledConfigSchema,
|
|
ToolRouterToolkitsParamSchema
|
|
} from './ts/packages/core/dist/index.js';
|
|
import z from 'zod/v3';
|
|
|
|
console.log('Testing individual schemas...\n');
|
|
|
|
// Test ToolRouterToolkitsParamSchema
|
|
console.log('ToolRouterToolkitsParamSchema type:', typeof ToolRouterToolkitsParamSchema);
|
|
console.log('Has _def?', ToolRouterToolkitsParamSchema?._def);
|
|
|
|
// Test ToolRouterToolkitsDisabledConfigSchema
|
|
console.log('\nToolRouterToolkitsDisabledConfigSchema type:', typeof ToolRouterToolkitsDisabledConfigSchema);
|
|
console.log('Has _def?', ToolRouterToolkitsDisabledConfigSchema?._def);
|
|
|
|
// Test ToolRouterToolkitsEnabledConfigSchema
|
|
console.log('\nToolRouterToolkitsEnabledConfigSchema type:', typeof ToolRouterToolkitsEnabledConfigSchema);
|
|
console.log('Has _def?', ToolRouterToolkitsEnabledConfigSchema?._def);
|
|
|
|
// Try creating a union manually
|
|
const manualUnion = z.union([
|
|
ToolRouterToolkitsDisabledConfigSchema,
|
|
ToolRouterToolkitsEnabledConfigSchema,
|
|
ToolRouterToolkitsParamSchema,
|
|
]);
|
|
|
|
console.log('\n--- Testing manual union ---');
|
|
|
|
try {
|
|
const result = manualUnion.parse({ disabled: ['test'] });
|
|
console.log('✅ Manual union disabled passed:', result);
|
|
} catch (e: any) {
|
|
console.error('❌ Manual union disabled failed:', e.message);
|
|
}
|
|
|
|
try {
|
|
const result = manualUnion.parse({ enabled: ['test'] });
|
|
console.log('✅ Manual union enabled passed:', result);
|
|
} catch (e: any) {
|
|
console.error('❌ Manual union enabled failed:', e.message);
|
|
}
|
|
|