mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
feat(editor): Add HTTP request nodes for credentials without a node (#7157)
Github issue / Community forum post (link here to close automatically): --------- Co-authored-by: Giulio Andreini <g.andreini@gmail.com> Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
@@ -10,9 +10,12 @@
|
||||
|
||||
import get from 'lodash/get';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
import uniqBy from 'lodash/uniqBy';
|
||||
|
||||
import type {
|
||||
FieldType,
|
||||
IContextObject,
|
||||
IHttpRequestMethods,
|
||||
INode,
|
||||
INodeCredentialDescription,
|
||||
INodeIssueObjectProperty,
|
||||
@@ -23,17 +26,15 @@ import type {
|
||||
INodePropertyCollection,
|
||||
INodePropertyMode,
|
||||
INodePropertyModeValidation,
|
||||
INodePropertyOptions,
|
||||
INodePropertyRegexValidation,
|
||||
INodeType,
|
||||
IVersionedNodeType,
|
||||
IParameterDependencies,
|
||||
IRunExecutionData,
|
||||
IVersionedNodeType,
|
||||
IWebhookData,
|
||||
IWorkflowExecuteAdditionalData,
|
||||
NodeParameterValue,
|
||||
IHttpRequestMethods,
|
||||
FieldType,
|
||||
INodePropertyOptions,
|
||||
ResourceMapperValue,
|
||||
ValidationResult,
|
||||
ConnectionTypes,
|
||||
@@ -45,8 +46,8 @@ import type {
|
||||
import { isResourceMapperValue, isValidResourceLocatorParameterValue } from './type-guards';
|
||||
import { deepCopy } from './utils';
|
||||
|
||||
import type { Workflow } from './Workflow';
|
||||
import { DateTime } from 'luxon';
|
||||
import type { Workflow } from './Workflow';
|
||||
|
||||
export const cronNodeOptions: INodePropertyCollection[] = [
|
||||
{
|
||||
@@ -1733,10 +1734,33 @@ export function getVersionedNodeType(
|
||||
|
||||
export function getVersionedNodeTypeAll(object: IVersionedNodeType | INodeType): INodeType[] {
|
||||
if ('nodeVersions' in object) {
|
||||
return Object.values(object.nodeVersions).map((element) => {
|
||||
element.description.name = object.description.name;
|
||||
return element;
|
||||
});
|
||||
return uniqBy(
|
||||
Object.values(object.nodeVersions)
|
||||
.map((element) => {
|
||||
element.description.name = object.description.name;
|
||||
return element;
|
||||
})
|
||||
.reverse(),
|
||||
(node) => {
|
||||
const { version } = node.description;
|
||||
return Array.isArray(version) ? version.join(',') : version.toString();
|
||||
},
|
||||
);
|
||||
}
|
||||
return [object];
|
||||
}
|
||||
|
||||
export function getCredentialsForNode(
|
||||
object: IVersionedNodeType | INodeType,
|
||||
): INodeCredentialDescription[] {
|
||||
if ('nodeVersions' in object) {
|
||||
return uniqBy(
|
||||
Object.values(object.nodeVersions).flatMap(
|
||||
(version) => version.description.credentials ?? [],
|
||||
),
|
||||
'name',
|
||||
);
|
||||
}
|
||||
|
||||
return object.description.credentials ?? [];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user