refactor(core): Remove deprecated TIME constant (#11740)

This commit is contained in:
Iván Ovejero
2024-11-15 10:28:21 +01:00
committed by GitHub
parent fb123b44af
commit f4f0b5110c
6 changed files with 12 additions and 28 deletions

View File

@@ -110,25 +110,12 @@ export const UM_FIX_INSTRUCTION =
'Please fix the database by running ./packages/cli/bin/n8n user-management:reset';
/**
* Units of time in milliseconds
* @deprecated Please use constants.Time instead.
*/
export const TIME = {
SECOND: 1000,
MINUTE: 60 * 1000,
HOUR: 60 * 60 * 1000,
DAY: 24 * 60 * 60 * 1000,
} as const;
/**
* Convert time from any unit to any other unit
*
* Please amend conversions as necessary.
* Eventually this will superseed `TIME` above
* Convert time from any time unit to any other unit
*/
export const Time = {
milliseconds: {
toMinutes: 1 / (60 * 1000),
toSeconds: 1 / 1000,
},
seconds: {
toMilliseconds: 1000,
@@ -150,9 +137,9 @@ export const MIN_PASSWORD_CHAR_LENGTH = 8;
export const MAX_PASSWORD_CHAR_LENGTH = 64;
export const TEST_WEBHOOK_TIMEOUT = 2 * TIME.MINUTE;
export const TEST_WEBHOOK_TIMEOUT = 2 * Time.minutes.toMilliseconds;
export const TEST_WEBHOOK_TIMEOUT_BUFFER = 30 * TIME.SECOND;
export const TEST_WEBHOOK_TIMEOUT_BUFFER = 30 * Time.seconds.toMilliseconds;
export const GENERIC_OAUTH2_CREDENTIALS_WITH_EDITABLE_SCOPE = [
'oAuth2Api',