fix(core): Set correct timezone in luxon (#3115)

This commit is contained in:
Jan Oberhauser
2022-04-10 11:33:42 +02:00
committed by GitHub
parent 027dfb2f0a
commit 3763f815bd
16 changed files with 146 additions and 159 deletions

View File

@@ -867,6 +867,7 @@ export function getNodeWebhooks(
node,
webhookDescription.path,
mode,
additionalData.timezone,
{},
);
if (nodeWebhookPath === undefined) {
@@ -890,6 +891,7 @@ export function getNodeWebhooks(
node,
webhookDescription.isFullPath,
'internal',
additionalData.timezone,
{},
false,
) as boolean;
@@ -897,6 +899,7 @@ export function getNodeWebhooks(
node,
webhookDescription.restartWebhook,
'internal',
additionalData.timezone,
{},
false,
) as boolean;
@@ -906,6 +909,7 @@ export function getNodeWebhooks(
node,
webhookDescription.httpMethod,
mode,
additionalData.timezone,
{},
'GET',
);
@@ -937,86 +941,6 @@ export function getNodeWebhooks(
return returnData;
}
export function getNodeWebhooksBasic(workflow: Workflow, node: INode): IWebhookData[] {
if (node.disabled === true) {
// Node is disabled so webhooks will also not be enabled
return [];
}
const nodeType = workflow.nodeTypes.getByNameAndVersion(node.type, node.typeVersion) as INodeType;
if (nodeType.description.webhooks === undefined) {
// Node does not have any webhooks so return
return [];
}
const workflowId = workflow.id || '__UNSAVED__';
const mode = 'internal';
const returnData: IWebhookData[] = [];
for (const webhookDescription of nodeType.description.webhooks) {
let nodeWebhookPath = workflow.expression.getSimpleParameterValue(
node,
webhookDescription.path,
mode,
{},
);
if (nodeWebhookPath === undefined) {
// TODO: Use a proper logger
console.error(
`No webhook path could be found for node "${node.name}" in workflow "${workflowId}".`,
);
continue;
}
nodeWebhookPath = nodeWebhookPath.toString();
if (nodeWebhookPath.startsWith('/')) {
nodeWebhookPath = nodeWebhookPath.slice(1);
}
if (nodeWebhookPath.endsWith('/')) {
nodeWebhookPath = nodeWebhookPath.slice(0, -1);
}
const isFullPath: boolean = workflow.expression.getSimpleParameterValue(
node,
webhookDescription.isFullPath,
mode,
{},
false,
) as boolean;
const path = getNodeWebhookPath(workflowId, node, nodeWebhookPath, isFullPath);
const httpMethod = workflow.expression.getSimpleParameterValue(
node,
webhookDescription.httpMethod,
mode,
{},
);
if (httpMethod === undefined) {
// TODO: Use a proper logger
console.error(
`The webhook "${path}" for node "${node.name}" in workflow "${workflowId}" could not be added because the httpMethod is not defined.`,
);
continue;
}
// @ts-ignore
returnData.push({
httpMethod: httpMethod.toString() as WebhookHttpMethod,
node: node.name,
path,
webhookDescription,
workflowId,
});
}
return returnData;
}
/**
* Returns the webhook path
*