mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
sync upstream master
This commit is contained in:
commit
ba743f4eb8
|
@ -6,6 +6,32 @@ It is possible to change some of the n8n defaults via special environment variab
|
|||
The ones that currently exist are:
|
||||
|
||||
|
||||
## Publish
|
||||
|
||||
Sets how n8n should be made available.
|
||||
|
||||
```bash
|
||||
# The port n8n should be made available on
|
||||
N8N_PORT=5678
|
||||
|
||||
# This ones are currently only important for the webhook URL creation.
|
||||
# So if "WEBHOOK_TUNNEL_URL" got set they do get ignored. It is however
|
||||
# encouraged to set them correctly anyway in case they will become
|
||||
# important in the future.
|
||||
N8N_PROTOCOL=https
|
||||
N8N_HOST=n8n.example.com
|
||||
```
|
||||
|
||||
|
||||
## Base URL
|
||||
|
||||
Tells the frontend how to reach the REST API of the backend.
|
||||
|
||||
```bash
|
||||
export VUE_APP_URL_BASE_API="https://n8n.example.com/"
|
||||
```
|
||||
|
||||
|
||||
## Execution Data Manual Runs
|
||||
|
||||
n8n creates a random encryption key automatically on the first launch and saves
|
||||
|
@ -99,3 +125,18 @@ user-folder via an environment variable.
|
|||
```bash
|
||||
export N8N_USER_FOLDER="/home/jim/n8n"
|
||||
```
|
||||
|
||||
|
||||
## Webhook URL
|
||||
|
||||
The webhook URL will normally be created automatically by combining
|
||||
`N8N_PROTOCOL`, `N8N_HOST` and `N8N_PORT`. If n8n runs, however, behind a
|
||||
reverse proxy that would not work. Because n8n does for example run internally
|
||||
on port 5678 but is exposed to the web via the reverse proxy on port 443. In
|
||||
that case, it is important to set the webhook URL manually that it can be
|
||||
displayed correctly in the Editor UI and even more important that the correct
|
||||
webhook URLs get registred with external services.
|
||||
|
||||
```bash
|
||||
export WEBHOOK_TUNNEL_URL="https://n8n.example.com/"
|
||||
```
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "n8n",
|
||||
"version": "0.33.0",
|
||||
"version": "0.34.0",
|
||||
"description": "n8n Workflow Automation Tool",
|
||||
"license": "SEE LICENSE IN LICENSE.md",
|
||||
"homepage": "https://n8n.io",
|
||||
|
@ -90,8 +90,8 @@
|
|||
"localtunnel": "^1.9.1",
|
||||
"mongodb": "^3.2.3",
|
||||
"n8n-core": "~0.14.0",
|
||||
"n8n-editor-ui": "~0.24.0",
|
||||
"n8n-nodes-base": "~0.28.0",
|
||||
"n8n-editor-ui": "~0.25.0",
|
||||
"n8n-nodes-base": "~0.29.0",
|
||||
"n8n-workflow": "~0.15.0",
|
||||
"open": "^6.1.0",
|
||||
"pg": "^7.11.0",
|
||||
|
|
|
@ -220,7 +220,13 @@ export function getNodeParameter(workflow: Workflow, runExecutionData: IRunExecu
|
|||
throw new Error(`Could not get parameter "${parameterName}"!`);
|
||||
}
|
||||
|
||||
const returnData = workflow.getParameterValue(value, runExecutionData, runIndex, itemIndex, node.name, connectionInputData);
|
||||
let returnData;
|
||||
try {
|
||||
returnData = workflow.getParameterValue(value, runExecutionData, runIndex, itemIndex, node.name, connectionInputData);
|
||||
} catch (e) {
|
||||
e.message += ` [Error in parameter: "${parameterName}"]`;
|
||||
throw e;
|
||||
}
|
||||
|
||||
return returnData;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "n8n-editor-ui",
|
||||
"version": "0.24.0",
|
||||
"version": "0.25.0",
|
||||
"description": "Workflow Editor UI for n8n",
|
||||
"license": "SEE LICENSE IN LICENSE.md",
|
||||
"homepage": "https://n8n.io",
|
||||
|
|
25
packages/nodes-base/credentials/FreshdeskApi.credentials.ts
Normal file
25
packages/nodes-base/credentials/FreshdeskApi.credentials.ts
Normal file
|
@ -0,0 +1,25 @@
|
|||
import {
|
||||
ICredentialType,
|
||||
NodePropertyTypes,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
|
||||
export class FreshdeskApi implements ICredentialType {
|
||||
name = 'freshdeskApi';
|
||||
displayName = 'Freshdesk API';
|
||||
properties = [
|
||||
{
|
||||
displayName: 'API Key',
|
||||
name: 'apiKey',
|
||||
type: 'string' as NodePropertyTypes,
|
||||
default: '',
|
||||
},
|
||||
{
|
||||
displayName: 'Domain',
|
||||
name: 'domain',
|
||||
type: 'string' as NodePropertyTypes,
|
||||
placeholder: 'https://domain.freshdesk.com',
|
||||
default: ''
|
||||
}
|
||||
];
|
||||
}
|
|
@ -16,10 +16,17 @@ import {
|
|||
} from './GenericFunctions';
|
||||
|
||||
enum Status {
|
||||
<<<<<<< HEAD
|
||||
Open = 1,
|
||||
Pending = 2,
|
||||
Resolved = 3,
|
||||
Closed = 4
|
||||
=======
|
||||
Open = 2,
|
||||
Pending = 3,
|
||||
Resolved = 4,
|
||||
Closed = 5,
|
||||
>>>>>>> 0689f4e403043c5e3f13bc393f1164785772cb19
|
||||
}
|
||||
|
||||
enum Priority {
|
||||
|
@ -36,7 +43,7 @@ enum Source {
|
|||
Chat = 4,
|
||||
Mobihelp = 5,
|
||||
FeedbackWidget = 6,
|
||||
OutboundEmail = 7
|
||||
OutboundEmail = 7
|
||||
}
|
||||
|
||||
interface ICreateTicketBody {
|
||||
|
@ -683,7 +690,6 @@ export class Freshdesk implements INodeType {
|
|||
// @ts-ignore
|
||||
source: Source[capitalize(source)]
|
||||
};
|
||||
|
||||
if (requester === 'requesterId') {
|
||||
// @ts-ignore
|
||||
if (isNaN(value)) {
|
||||
|
@ -737,36 +743,39 @@ export class Freshdesk implements INodeType {
|
|||
}
|
||||
|
||||
if (options.agent) {
|
||||
options.responder_id = options.agent as number;
|
||||
body.responder_id = options.agent as number;
|
||||
}
|
||||
|
||||
if (options.company) {
|
||||
options.company_id = options.company as number;
|
||||
body.company_id = options.company as number;
|
||||
}
|
||||
|
||||
if (options.product) {
|
||||
options.product_id = options.product as number;
|
||||
body.product_id = options.product as number;
|
||||
}
|
||||
|
||||
|
||||
if (options.group) {
|
||||
options.group_id = options.group as number;
|
||||
body.group_id = options.group as number;
|
||||
}
|
||||
|
||||
if (options.frDueBy) {
|
||||
options.fr_due_by = options.frDueBy as string;
|
||||
body.fr_due_by = options.frDueBy as string;
|
||||
}
|
||||
|
||||
if (options.emailConfigId) {
|
||||
options.email_config_id = options.emailConfigId as number;
|
||||
body.email_config_id = options.emailConfigId as number;
|
||||
}
|
||||
|
||||
if (options.dueBy) {
|
||||
options.due_by = options.dueBy as string;
|
||||
body.due_by = options.dueBy as string;
|
||||
}
|
||||
|
||||
if (options.tags) {
|
||||
body.tags = (options.tags as string).split(',') as [string];
|
||||
}
|
||||
|
||||
if (options.ccEmails) {
|
||||
// @ts-ignore
|
||||
options.cc_emails = options.ccEmails.split(',') as [string];
|
||||
body.cc_emails = (options.ccEmails as string).split(',') as [string];
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
66
packages/nodes-base/nodes/Freshdesk/GenericFunctions.ts
Normal file
66
packages/nodes-base/nodes/Freshdesk/GenericFunctions.ts
Normal file
|
@ -0,0 +1,66 @@
|
|||
import { OptionsWithUri } from 'request';
|
||||
|
||||
import {
|
||||
IExecuteFunctions,
|
||||
IHookFunctions,
|
||||
ILoadOptionsFunctions,
|
||||
IExecuteSingleFunctions,
|
||||
BINARY_ENCODING
|
||||
} from 'n8n-core';
|
||||
|
||||
import * as _ from 'lodash';
|
||||
|
||||
export async function freshdeskApiRequest(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, resource: string, method: string, body: any = {}, headers?: object): Promise<any> { // tslint:disable-line:no-any
|
||||
|
||||
const credentials = this.getCredentials('freshdeskApi');
|
||||
|
||||
if (credentials === undefined) {
|
||||
throw new Error('No credentials got returned!');
|
||||
}
|
||||
|
||||
const apiKey = `${credentials.apiKey}:X`;
|
||||
|
||||
const headerWithAuthentication = Object.assign({}, headers, { Authorization: `${Buffer.from(apiKey).toString(BINARY_ENCODING)}` });
|
||||
|
||||
const endpoint = 'freshdesk.com/api/v2/';
|
||||
|
||||
const options: OptionsWithUri = {
|
||||
headers: headerWithAuthentication,
|
||||
method,
|
||||
body,
|
||||
uri: `https://${credentials.domain}.${endpoint}${resource}`,
|
||||
json: true
|
||||
};
|
||||
|
||||
if (_.isEmpty(options.body)) {
|
||||
delete options.body;
|
||||
}
|
||||
|
||||
try {
|
||||
return await this.helpers.request!(options);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
||||
const errorMessage = error.response.body.message || error.response.body.Message;
|
||||
|
||||
if (errorMessage !== undefined) {
|
||||
throw errorMessage;
|
||||
}
|
||||
throw error.response.body;
|
||||
}
|
||||
}
|
||||
|
||||
export function validateJSON(json: string | undefined): any { // tslint:disable-line:no-any
|
||||
let result;
|
||||
try {
|
||||
result = JSON.parse(json!);
|
||||
} catch (exception) {
|
||||
result = [];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
export function capitalize (s: string) : string {
|
||||
if (typeof s !== 'string') return '';
|
||||
return s.charAt(0).toUpperCase() + s.slice(1);
|
||||
}
|
BIN
packages/nodes-base/nodes/Freshdesk/freshdesk.png
Normal file
BIN
packages/nodes-base/nodes/Freshdesk/freshdesk.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.8 KiB |
|
@ -259,6 +259,23 @@ export class Gitlab implements INodeType {
|
|||
},
|
||||
description: 'The body of the issue.',
|
||||
},
|
||||
{
|
||||
displayName: 'Due Date',
|
||||
name: 'due_date',
|
||||
type: 'dateTime',
|
||||
displayOptions: {
|
||||
show: {
|
||||
operation: [
|
||||
'create',
|
||||
],
|
||||
resource: [
|
||||
'issue',
|
||||
],
|
||||
},
|
||||
},
|
||||
default: '',
|
||||
description: 'Due Date for issue.',
|
||||
},
|
||||
{
|
||||
displayName: 'Labels',
|
||||
name: 'labels',
|
||||
|
@ -318,6 +335,7 @@ export class Gitlab implements INodeType {
|
|||
],
|
||||
},
|
||||
|
||||
|
||||
// ----------------------------------
|
||||
// issue:createComment
|
||||
// ----------------------------------
|
||||
|
@ -409,7 +427,7 @@ export class Gitlab implements INodeType {
|
|||
},
|
||||
{
|
||||
displayName: 'Body',
|
||||
name: 'body',
|
||||
name: 'description',
|
||||
type: 'string',
|
||||
typeOptions: {
|
||||
rows: 5,
|
||||
|
@ -474,6 +492,13 @@ export class Gitlab implements INodeType {
|
|||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
displayName: 'Due Date',
|
||||
name: 'due_date',
|
||||
type: 'dateTime',
|
||||
default: '',
|
||||
description: 'Due Date for issue.',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
|
@ -829,6 +854,7 @@ export class Gitlab implements INodeType {
|
|||
|
||||
body.title = this.getNodeParameter('title', i) as string;
|
||||
body.description = this.getNodeParameter('body', i) as string;
|
||||
body.due_date = this.getNodeParameter('due_date', i) as string;
|
||||
const labels = this.getNodeParameter('labels', i) as IDataObject[];
|
||||
|
||||
const assigneeIds = this.getNodeParameter('assignee_ids', i) as IDataObject[];
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "n8n-nodes-base",
|
||||
"version": "0.28.0",
|
||||
"version": "0.29.0",
|
||||
"description": "Base nodes of n8n",
|
||||
"license": "SEE LICENSE IN LICENSE.md",
|
||||
"homepage": "https://n8n.io",
|
||||
|
@ -33,6 +33,7 @@
|
|||
"dist/credentials/Aws.credentials.js",
|
||||
"dist/credentials/ChargebeeApi.credentials.js",
|
||||
"dist/credentials/DropboxApi.credentials.js",
|
||||
"dist/credentials/FreshdeskApi.credentials.js",
|
||||
"dist/credentials/GithubApi.credentials.js",
|
||||
"dist/credentials/GitlabApi.credentials.js",
|
||||
"dist/credentials/GoogleApi.credentials.js",
|
||||
|
@ -42,6 +43,7 @@
|
|||
"dist/credentials/Imap.credentials.js",
|
||||
"dist/credentials/LinkFishApi.credentials.js",
|
||||
"dist/credentials/MailgunApi.credentials.js",
|
||||
"dist/credentials/MandrillApi.credentials.js",
|
||||
"dist/credentials/MattermostApi.credentials.js",
|
||||
"dist/credentials/MongoDb.credentials.js",
|
||||
"dist/credentials/NextCloudApi.credentials.js",
|
||||
|
@ -53,11 +55,10 @@
|
|||
"dist/credentials/Smtp.credentials.js",
|
||||
"dist/credentials/StripeApi.credentials.js",
|
||||
"dist/credentials/TelegramApi.credentials.js",
|
||||
"dist/credentials/TodoistApi.credentials.js",
|
||||
"dist/credentials/TrelloApi.credentials.js",
|
||||
"dist/credentials/TwilioApi.credentials.js",
|
||||
"dist/credentials/TypeformApi.credentials.js",
|
||||
"dist/credentials/MandrillApi.credentials.js",
|
||||
"dist/credentials/TodoistApi.credentials.js"
|
||||
"dist/credentials/TypeformApi.credentials.js"
|
||||
],
|
||||
"nodes": [
|
||||
"dist/nodes/ActiveCampaign/ActiveCampaign.node.js",
|
||||
|
@ -78,6 +79,7 @@
|
|||
"dist/nodes/EmailSend.node.js",
|
||||
"dist/nodes/ErrorTrigger.node.js",
|
||||
"dist/nodes/ExecuteCommand.node.js",
|
||||
"dist/nodes/Freshdesk/Freshdesk.node.js",
|
||||
"dist/nodes/Function.node.js",
|
||||
"dist/nodes/FunctionItem.node.js",
|
||||
"dist/nodes/Github/Github.node.js",
|
||||
|
@ -92,6 +94,7 @@
|
|||
"dist/nodes/Interval.node.js",
|
||||
"dist/nodes/LinkFish/LinkFish.node.js",
|
||||
"dist/nodes/Mailgun/Mailgun.node.js",
|
||||
"dist/nodes/Mandrill/Mandrill.node.js",
|
||||
"dist/nodes/Mattermost/Mattermost.node.js",
|
||||
"dist/nodes/Merge.node.js",
|
||||
"dist/nodes/MoveBinaryData.node.js",
|
||||
|
@ -116,15 +119,14 @@
|
|||
"dist/nodes/Stripe/StripeTrigger.node.js",
|
||||
"dist/nodes/Telegram/Telegram.node.js",
|
||||
"dist/nodes/Telegram/TelegramTrigger.node.js",
|
||||
"dist/nodes/Todoist/Todoist.node.js",
|
||||
"dist/nodes/Trello/Trello.node.js",
|
||||
"dist/nodes/Trello/TrelloTrigger.node.js",
|
||||
"dist/nodes/Twilio/Twilio.node.js",
|
||||
"dist/nodes/Typeform/TypeformTrigger.node.js",
|
||||
"dist/nodes/WriteBinaryFile.node.js",
|
||||
"dist/nodes/Webhook.node.js",
|
||||
"dist/nodes/Xml.node.js",
|
||||
"dist/nodes/Mandrill/Mandrill.node.js",
|
||||
"dist/nodes/Todoist/Todoist.node.js"
|
||||
"dist/nodes/Xml.node.js"
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
Loading…
Reference in a new issue