2023-01-27 03:22:44 -08:00
|
|
|
import type { INodeTypeBaseDescription, IVersionedNodeType } from 'n8n-workflow';
|
|
|
|
import { VersionedNodeType } from 'n8n-workflow';
|
2019-06-23 03:35:23 -07:00
|
|
|
|
2022-09-29 14:28:02 -07:00
|
|
|
import { HttpRequestV1 } from './V1/HttpRequestV1.node';
|
|
|
|
import { HttpRequestV2 } from './V2/HttpRequestV2.node';
|
|
|
|
import { HttpRequestV3 } from './V3/HttpRequestV3.node';
|
2019-06-23 03:35:23 -07:00
|
|
|
|
2022-10-25 12:33:12 -07:00
|
|
|
export class HttpRequest extends VersionedNodeType {
|
2022-09-29 14:28:02 -07:00
|
|
|
constructor() {
|
|
|
|
const baseDescription: INodeTypeBaseDescription = {
|
|
|
|
displayName: 'HTTP Request',
|
|
|
|
name: 'httpRequest',
|
|
|
|
icon: 'fa:at',
|
|
|
|
group: ['output'],
|
|
|
|
subtitle: '={{$parameter["requestMethod"] + ": " + $parameter["url"]}}',
|
|
|
|
description: 'Makes an HTTP request and returns the response data',
|
2023-05-04 00:55:35 -07:00
|
|
|
defaultVersion: 4.1,
|
2019-06-23 03:35:23 -07:00
|
|
|
};
|
|
|
|
|
2022-10-25 12:33:12 -07:00
|
|
|
const nodeVersions: IVersionedNodeType['nodeVersions'] = {
|
2022-09-29 14:28:02 -07:00
|
|
|
1: new HttpRequestV1(baseDescription),
|
|
|
|
2: new HttpRequestV2(baseDescription),
|
|
|
|
3: new HttpRequestV3(baseDescription),
|
2023-03-31 09:31:03 -07:00
|
|
|
4: new HttpRequestV3(baseDescription),
|
2023-05-04 00:55:35 -07:00
|
|
|
4.1: new HttpRequestV3(baseDescription),
|
2019-06-23 03:35:23 -07:00
|
|
|
};
|
2022-06-13 13:25:09 -07:00
|
|
|
|
2022-09-29 14:28:02 -07:00
|
|
|
super(nodeVersions, baseDescription);
|
2019-06-23 03:35:23 -07:00
|
|
|
}
|
2021-10-27 13:00:13 -07:00
|
|
|
}
|