@truto/langchain-toolset 0.1.1 → 0.1.2
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/main.cjs +50 -42
- package/dist/main.cjs.map +1 -1
- package/dist/module.js +50 -42
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/module.js
CHANGED
|
@@ -2012,51 +2012,59 @@ async function $783922f5df7b52a4$export$ffc9f93b394316dd(integratedAccountId, co
|
|
|
2012
2012
|
baseUrl: config.truto.baseUrl,
|
|
2013
2013
|
token: config.truto.token
|
|
2014
2014
|
});
|
|
2015
|
-
const availableTools = await trutoApi.integratedAccount.tools(integratedAccountId, config?.methods);
|
|
2015
|
+
const availableTools = await trutoApi.integratedAccount.tools(integratedAccountId, config?.methods, config?.tags);
|
|
2016
2016
|
(0, $8b5aa36aaeb84d98$export$2e2bcd8739ae039)(availableTools, (availableTool)=>{
|
|
2017
2017
|
const toolName = availableTool.name;
|
|
2018
2018
|
tools[toolName] = (0, $7dQ0M$tool)(async (config)=>{
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2019
|
+
try {
|
|
2020
|
+
const resourceName = availableTool.resource;
|
|
2021
|
+
const methodToCall = availableTool.method;
|
|
2022
|
+
const query = $783922f5df7b52a4$export$34efffa2116fc158(config, availableTool.query_schema) || {};
|
|
2023
|
+
const body = $783922f5df7b52a4$export$34efffa2116fc158(config, availableTool.body_schema) || {};
|
|
2024
|
+
switch(methodToCall){
|
|
2025
|
+
case "list":
|
|
2026
|
+
return JSON.stringify(await trutoApi.proxyApi.list({
|
|
2027
|
+
integrated_account_id: integratedAccountId,
|
|
2028
|
+
resource: resourceName,
|
|
2029
|
+
...query
|
|
2030
|
+
}).next(), null, 2);
|
|
2031
|
+
case "get":
|
|
2032
|
+
return JSON.stringify(await trutoApi.proxyApi.get(config?.id, {
|
|
2033
|
+
integrated_account_id: integratedAccountId,
|
|
2034
|
+
resource: resourceName,
|
|
2035
|
+
...query
|
|
2036
|
+
}), null, 2);
|
|
2037
|
+
case "create":
|
|
2038
|
+
return JSON.stringify(await trutoApi.proxyApi.create(body, {
|
|
2039
|
+
integrated_account_id: integratedAccountId,
|
|
2040
|
+
resource: resourceName,
|
|
2041
|
+
...query
|
|
2042
|
+
}), null, 2);
|
|
2043
|
+
case "update":
|
|
2044
|
+
return JSON.stringify(await trutoApi.proxyApi.update(config?.id, body, {
|
|
2045
|
+
integrated_account_id: integratedAccountId,
|
|
2046
|
+
resource: resourceName,
|
|
2047
|
+
...query
|
|
2048
|
+
}), null, 2);
|
|
2049
|
+
case "delete":
|
|
2050
|
+
return JSON.stringify(await trutoApi.proxyApi.delete(config?.id, {
|
|
2051
|
+
integrated_account_id: integratedAccountId,
|
|
2052
|
+
resource: resourceName,
|
|
2053
|
+
...query
|
|
2054
|
+
}), null, 2);
|
|
2055
|
+
default:
|
|
2056
|
+
return JSON.stringify(await trutoApi.proxyApi.customMethod(methodToCall, body, {
|
|
2057
|
+
integrated_account_id: integratedAccountId,
|
|
2058
|
+
resource: resourceName,
|
|
2059
|
+
...query
|
|
2060
|
+
}), null, 2);
|
|
2061
|
+
}
|
|
2062
|
+
} catch (error) {
|
|
2063
|
+
return JSON.stringify({
|
|
2064
|
+
error: true,
|
|
2065
|
+
message: error instanceof Error ? error.message : "Unknown error occurred",
|
|
2066
|
+
details: error instanceof Error ? error.stack : String(error)
|
|
2067
|
+
}, null, 2);
|
|
2060
2068
|
}
|
|
2061
2069
|
}, {
|
|
2062
2070
|
name: toolName,
|