add aiplugintools

This commit is contained in:
Henry
2023-04-17 20:26:57 +01:00
parent 7631f651ab
commit ed81dc228f
5 changed files with 88 additions and 17 deletions
+17
View File
@@ -233,3 +233,20 @@ export const copyToClipboard = (e) => {
navigator.clipboard.writeText(src)
}
}
export const rearrangeToolsOrdering = (newValues, sourceNodeId) => {
// RequestsGet and RequestsPost have to be in order before other tools
newValues.push(`{{${sourceNodeId}.data.instance}}`)
const sortKey = (item) => {
if (item.includes('requestsGet')) {
return 0
} else if (item.includes('requestsPost')) {
return 1
} else {
return 2
}
}
newValues.sort((a, b) => sortKey(a) - sortKey(b))
}