feat(core): Add support for building LLM applications (#7235)

This extracts all core and editor changes from #7246 and #7137, so that
we can get these changes merged first.

ADO-1120

[DB Tests](https://github.com/n8n-io/n8n/actions/runs/6379749011)
[E2E Tests](https://github.com/n8n-io/n8n/actions/runs/6379751480)
[Workflow Tests](https://github.com/n8n-io/n8n/actions/runs/6379752828)

---------

Co-authored-by: Jan Oberhauser <jan.oberhauser@gmail.com>
Co-authored-by: Oleg Ivaniv <me@olegivaniv.com>
Co-authored-by: Alex Grozav <alex@grozav.com>
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-10-02 17:33:43 +02:00
committed by GitHub
parent 04dfcd73be
commit 00a4b8b0c6
93 changed files with 6209 additions and 728 deletions

View File

@@ -39,6 +39,15 @@
@action="onNoticeAction"
/>
<n8n-button
v-else-if="parameter.type === 'button'"
class="parameter-item"
block
@click="onButtonAction(parameter)"
>
{{ $locale.nodeText().inputLabelDisplayName(parameter, path) }}
</n8n-button>
<div
v-else-if="['collection', 'fixedCollection'].includes(parameter.type)"
class="multi-parameter"
@@ -151,6 +160,7 @@ import { useNDVStore } from '@/stores/ndv.store';
import { useNodeTypesStore } from '@/stores/nodeTypes.store';
import { isAuthRelatedParameter, getNodeAuthFields, getMainAuthField } from '@/utils';
import { KEEP_AUTH_IN_NDV_FOR_NODES } from '@/constants';
import { nodeViewEventBus } from '@/event-bus';
const FixedCollectionParameter = defineAsyncComponent(
async () => import('./FixedCollectionParameter.vue'),
@@ -263,9 +273,9 @@ export default defineComponent({
);
// Get names of all fields that credentials rendering depends on (using displayOptions > show)
if (nodeType && nodeType.credentials) {
if (nodeType?.credentials) {
for (const cred of nodeType.credentials) {
if (cred.displayOptions && cred.displayOptions.show) {
if (cred.displayOptions?.show) {
Object.keys(cred.displayOptions.show).forEach((fieldName) =>
dependencies.add(fieldName),
);
@@ -309,7 +319,7 @@ export default defineComponent({
},
mustHideDuringCustomApiCall(parameter: INodeProperties, nodeValues: INodeParameters): boolean {
if (parameter && parameter.displayOptions && parameter.displayOptions.hide) return true;
if (parameter?.displayOptions?.hide) return true;
const MUST_REMAIN_VISIBLE = [
'authentication',
@@ -396,7 +406,7 @@ export default defineComponent({
}
} while (resolveKeys.length !== 0);
if (parameterGotResolved === true) {
if (parameterGotResolved) {
if (this.path) {
rawValues = deepCopy(this.nodeValues);
set(rawValues, this.path, nodeValues);
@@ -416,6 +426,16 @@ export default defineComponent({
this.$emit('activate');
}
},
onButtonAction(parameter: INodeProperties) {
const action: string | undefined = parameter.typeOptions?.action;
switch (action) {
case 'openChat':
this.ndvStore.setActiveNodeName(null);
nodeViewEventBus.emit('openChat');
break;
}
},
isNodeAuthField(name: string): boolean {
return this.nodeAuthFields.find((field) => field.name === name) !== undefined;
},