build: Upgrade to Vite 5 (#7784)

This commit is contained in:
Csaba Tuncsik
2023-11-23 11:55:02 +01:00
committed by GitHub
parent 77bc8ecd4b
commit e128b23a2b
32 changed files with 442 additions and 94 deletions

View File

@@ -117,9 +117,9 @@ export class Code implements INodeType {
workflowMode === 'manual'
? this.sendMessageToUI
: CODE_ENABLE_STDOUT === 'true'
? (...args) =>
console.log(`[Workflow "${this.getWorkflow().id}"][Node "${node.name}"]`, ...args)
: () => {},
? (...args) =>
console.log(`[Workflow "${this.getWorkflow().id}"][Node "${node.name}"]`, ...args)
: () => {},
);
return sandbox;
};

View File

@@ -9,9 +9,8 @@ import type {
} from 'n8n-workflow';
import { jsonParse, NodeApiError, NodeOperationError, sleep } from 'n8n-workflow';
import type { DiscordAttachment, DiscordWebhook } from './Interfaces';
import { oldVersionNotice } from '../../../utils/descriptions';
import type { DiscordAttachment, DiscordWebhook } from './Interfaces';
const versionDescription: INodeTypeDescription = {
displayName: 'Discord',

View File

@@ -1,11 +1,11 @@
import type { INodeProperties } from 'n8n-workflow';
import { guildRLC } from '../common.description';
import * as create from './create.operation';
import * as get from './get.operation';
import * as getAll from './getAll.operation';
import * as update from './update.operation';
import * as deleteChannel from './deleteChannel.operation';
import { guildRLC } from '../common.description';
export { create, get, getAll, update, deleteChannel };

View File

@@ -1,9 +1,9 @@
import type { INodeProperties } from 'n8n-workflow';
import { guildRLC } from '../common.description';
import * as getAll from './getAll.operation';
import * as roleAdd from './roleAdd.operation';
import * as roleRemove from './roleRemove.operation';
import { guildRLC } from '../common.description';
export { getAll, roleAdd, roleRemove };

View File

@@ -1,11 +1,11 @@
import type { INodeProperties } from 'n8n-workflow';
import { guildRLC } from '../common.description';
import * as getAll from './getAll.operation';
import * as react from './react.operation';
import * as send from './send.operation';
import * as deleteMessage from './deleteMessage.operation';
import * as get from './get.operation';
import { guildRLC } from '../common.description';
export { getAll, react, send, deleteMessage, get };

View File

@@ -8,8 +8,8 @@ import type {
import { jsonParse, NodeOperationError } from 'n8n-workflow';
import { isEmpty } from 'lodash';
import FormData from 'form-data';
import { capitalize } from '../../../../utils/utilities';
import { extension } from 'mime-types';
import { capitalize } from '../../../../utils/utilities';
import { discordApiRequest } from '../transport';
export const createSimplifyFunction =

View File

@@ -285,9 +285,7 @@ export async function execute(this: IExecuteFunctions): Promise<INodeExecutionDa
<em>${attributionText}<a href="${link}" target="_blank">n8n</a></em>
`;
} else {
mailOptions.text = `${
mailOptions.text
}\n\n---\n${attributionText}n8n\n${'https://n8n.io'}`;
mailOptions.text = `${mailOptions.text}\n\n---\n${attributionText}n8n\n${'https://n8n.io'}`;
}
}

View File

@@ -179,9 +179,8 @@ export const objectOperations: INodeProperties[] = [
// Set the headers
if (!requestOptions.headers) requestOptions.headers = {};
requestOptions.headers['Content-Length'] = body.getLengthSync();
requestOptions.headers[
'Content-Type'
] = `multipart/related; boundary=${body.getBoundary()}`;
requestOptions.headers['Content-Type'] =
`multipart/related; boundary=${body.getBoundary()}`;
// Return the request data
requestOptions.body = body;

View File

@@ -30,8 +30,8 @@ export async function gristApiRequest(
planType === 'free'
? `https://docs.getgrist.com/api${endpoint}`
: planType === 'paid'
? `https://${customSubdomain}.getgrist.com/api${endpoint}`
: `${selfHostedUrl}/api${endpoint}`;
? `https://${customSubdomain}.getgrist.com/api${endpoint}`
: `${selfHostedUrl}/api${endpoint}`;
const options: OptionsWithUri = {
headers: {

View File

@@ -83,8 +83,8 @@ export class Grist implements INodeType {
planType === 'free'
? `https://docs.getgrist.com/api${endpoint}`
: planType === 'paid'
? `https://${customSubdomain}.getgrist.com/api${endpoint}`
: `${selfHostedUrl}/api${endpoint}`;
? `https://${customSubdomain}.getgrist.com/api${endpoint}`
: `${selfHostedUrl}/api${endpoint}`;
const options: OptionsWithUri = {
headers: {

View File

@@ -106,11 +106,10 @@ export async function haloPSAApiRequest(
}`;
}
if (message.includes('403')) {
(
error as JsonObject
).message = `You don\'t have permissions to ${method.toLowerCase()} ${resource
.split('/')[1]
.toLowerCase()}.`;
(error as JsonObject).message =
`You don\'t have permissions to ${method.toLowerCase()} ${resource
.split('/')[1]
.toLowerCase()}.`;
}
}
throw new NodeApiError(this.getNode(), error as JsonObject);

View File

@@ -1,3 +1,4 @@
import { parse as parseUrl } from 'url';
import nock from 'nock';
import {
initBinaryDataService,
@@ -6,7 +7,6 @@ import {
workflowToTests,
getWorkflowFilenames,
} from '@test/nodes/Helpers';
import { parse as parseUrl } from 'url';
describe('Test HTTP Request Node', () => {
const workflows = getWorkflowFilenames(__dirname);