fix(core): Replace all moment imports with moment-timezone (#8337)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2024-01-15 15:45:33 +01:00 committed by GitHub
parent e3cedf7db0
commit 52a2e25a25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 33 additions and 37 deletions

View file

@ -7,7 +7,7 @@ import type {
} from 'n8n-workflow'; } from 'n8n-workflow';
import { NodeOperationError } from 'n8n-workflow'; import { NodeOperationError } from 'n8n-workflow';
import moment from 'moment'; import moment from 'moment-timezone';
import type { IRecord } from './v1/GenericFunctions'; import type { IRecord } from './v1/GenericFunctions';
import { apiRequestAllItems, downloadRecordAttachments } from './v1/GenericFunctions'; import { apiRequestAllItems, downloadRecordAttachments } from './v1/GenericFunctions';

View file

@ -1,6 +1,6 @@
import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow'; import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow';
import moment from 'moment'; import moment from 'moment-timezone';
import { capitalCase } from 'change-case'; import { capitalCase } from 'change-case';
import { apiRequest } from '../../../transport'; import { apiRequest } from '../../../transport';

View file

@ -1,7 +1,7 @@
import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow'; import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow';
import { NodeOperationError } from 'n8n-workflow'; import { NodeOperationError } from 'n8n-workflow';
import moment from 'moment'; import moment from 'moment-timezone';
import { capitalCase } from 'change-case'; import { capitalCase } from 'change-case';
import { apiRequest } from '../../../transport'; import { apiRequest } from '../../../transport';

View file

@ -7,7 +7,7 @@ import type {
ILoadOptionsFunctions, ILoadOptionsFunctions,
} from 'n8n-workflow'; } from 'n8n-workflow';
import moment from 'moment'; import moment from 'moment-timezone';
export async function cortexApiRequest( export async function cortexApiRequest(
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,

View file

@ -1,5 +1,5 @@
import { DateTime } from 'luxon'; import { DateTime } from 'luxon';
import moment from 'moment'; import moment from 'moment-timezone';
import type { IExecuteFunctions } from 'n8n-workflow'; import type { IExecuteFunctions } from 'n8n-workflow';
import { NodeOperationError } from 'n8n-workflow'; import { NodeOperationError } from 'n8n-workflow';

View file

@ -1,4 +1,4 @@
import moment from 'moment'; import moment from 'moment-timezone';
import { testWorkflows, getWorkflowFilenames } from '@test/nodes/Helpers'; import { testWorkflows, getWorkflowFilenames } from '@test/nodes/Helpers';
const workflows = getWorkflowFilenames(__dirname); const workflows = getWorkflowFilenames(__dirname);

View file

@ -1,7 +1,7 @@
import type { INode, NodeParameterValue } from 'n8n-workflow'; import type { INode, NodeParameterValue } from 'n8n-workflow';
import { NodeOperationError } from 'n8n-workflow'; import { NodeOperationError } from 'n8n-workflow';
import moment from 'moment'; import moment from 'moment-timezone';
const isDateObject = (value: NodeParameterValue) => const isDateObject = (value: NodeParameterValue) =>
Object.prototype.toString.call(value) === '[object Date]'; Object.prototype.toString.call(value) === '[object Date]';

View file

@ -10,7 +10,7 @@ import { NodeApiError } from 'n8n-workflow';
import type { OptionsWithUri } from 'request'; import type { OptionsWithUri } from 'request';
import moment from 'moment'; import moment from 'moment-timezone';
import * as losslessJSON from 'lossless-json'; import * as losslessJSON from 'lossless-json';

View file

@ -7,7 +7,7 @@ import type {
} from 'n8n-workflow'; } from 'n8n-workflow';
import { NodeApiError, NodeOperationError } from 'n8n-workflow'; import { NodeApiError, NodeOperationError } from 'n8n-workflow';
import moment from 'moment'; import moment from 'moment-timezone';
import { import {
encodeURIComponentOnce, encodeURIComponentOnce,

View file

@ -8,7 +8,7 @@ import type {
INodeTypeDescription, INodeTypeDescription,
} from 'n8n-workflow'; } from 'n8n-workflow';
import moment from 'moment'; import moment from 'moment-timezone';
import { import {
allFields, allFields,
cleanData, cleanData,

View file

@ -9,7 +9,7 @@ import type {
} from 'n8n-workflow'; } from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow'; import { NodeApiError } from 'n8n-workflow';
import moment from 'moment'; import moment from 'moment-timezone';
import { GOOGLE_DRIVE_FILE_URL_REGEX, GOOGLE_DRIVE_FOLDER_URL_REGEX } from '../constants'; import { GOOGLE_DRIVE_FILE_URL_REGEX, GOOGLE_DRIVE_FOLDER_URL_REGEX } from '../constants';
import { extractId, googleApiRequest, googleApiRequestAllItems } from './v1/GenericFunctions'; import { extractId, googleApiRequest, googleApiRequestAllItems } from './v1/GenericFunctions';
import { fileSearch, folderSearch } from './v2/methods/listSearch'; import { fileSearch, folderSearch } from './v2/methods/listSearch';

View file

@ -11,7 +11,7 @@ import type {
} from 'n8n-workflow'; } from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow'; import { NodeApiError } from 'n8n-workflow';
import moment from 'moment'; import moment from 'moment-timezone';
export async function hubspotApiRequest( export async function hubspotApiRequest(
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,

View file

@ -11,7 +11,7 @@ import type {
} from 'n8n-workflow'; } from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow'; import { NodeApiError } from 'n8n-workflow';
import moment from 'moment'; import moment from 'moment-timezone';
export async function hubspotApiRequest( export async function hubspotApiRequest(
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,

View file

@ -1,4 +1,4 @@
import moment from 'moment'; import moment from 'moment-timezone';
import type { import type {
IExecuteFunctions, IExecuteFunctions,
INodeExecutionData, INodeExecutionData,

View file

@ -8,7 +8,7 @@ import type {
INodeTypeDescription, INodeTypeDescription,
} from 'n8n-workflow'; } from 'n8n-workflow';
import moment from 'moment'; import moment from 'moment-timezone';
import { import {
campaignFieldsMetadata, campaignFieldsMetadata,
mailchimpApiRequest, mailchimpApiRequest,

View file

@ -10,7 +10,7 @@ import type {
} from 'n8n-workflow'; } from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow'; import { NodeApiError } from 'n8n-workflow';
import moment from 'moment'; import moment from 'moment-timezone';
import map from 'lodash/map'; import map from 'lodash/map';
import isEmpty from 'lodash/isEmpty'; import isEmpty from 'lodash/isEmpty';

View file

@ -7,7 +7,7 @@ import type {
} from 'n8n-workflow'; } from 'n8n-workflow';
import { NodeOperationError } from 'n8n-workflow'; import { NodeOperationError } from 'n8n-workflow';
import moment from 'moment'; import moment from 'moment-timezone';
import { nasaApiRequest, nasaApiRequestAllItems } from './GenericFunctions'; import { nasaApiRequest, nasaApiRequestAllItems } from './GenericFunctions';
export class Nasa implements INodeType { export class Nasa implements INodeType {

View file

@ -6,7 +6,7 @@ import type {
INodeTypeDescription, INodeTypeDescription,
} from 'n8n-workflow'; } from 'n8n-workflow';
import moment from 'moment'; import moment from 'moment-timezone';
import { notionApiRequest, simplifyObjects } from './GenericFunctions'; import { notionApiRequest, simplifyObjects } from './GenericFunctions';
import { getDatabases } from './SearchFunctions'; import { getDatabases } from './SearchFunctions';

View file

@ -8,7 +8,7 @@ import type {
INodeTypeDescription, INodeTypeDescription,
} from 'n8n-workflow'; } from 'n8n-workflow';
import moment from 'moment'; import moment from 'moment-timezone';
import { orbitApiRequest, orbitApiRequestAllItems, resolveIdentities } from './GenericFunctions'; import { orbitApiRequest, orbitApiRequestAllItems, resolveIdentities } from './GenericFunctions';
import { activityFields, activityOperations } from './ActivityDescription'; import { activityFields, activityOperations } from './ActivityDescription';

View file

@ -6,7 +6,7 @@ import type {
INodeTypeDescription, INodeTypeDescription,
} from 'n8n-workflow'; } from 'n8n-workflow';
import moment from 'moment'; import moment from 'moment-timezone';
import { ouraApiRequest } from './GenericFunctions'; import { ouraApiRequest } from './GenericFunctions';
import { profileOperations } from './ProfileDescription'; import { profileOperations } from './ProfileDescription';

View file

@ -10,7 +10,7 @@ import type {
} from 'n8n-workflow'; } from 'n8n-workflow';
import { NodeApiError, NodeOperationError } from 'n8n-workflow'; import { NodeApiError, NodeOperationError } from 'n8n-workflow';
import moment from 'moment'; import moment from 'moment-timezone';
import { couponFields, couponOperations } from './CouponDescription'; import { couponFields, couponOperations } from './CouponDescription';
import { paddleApiRequest, paddleApiRequestAllItems, validateJSON } from './GenericFunctions'; import { paddleApiRequest, paddleApiRequestAllItems, validateJSON } from './GenericFunctions';

View file

@ -7,7 +7,7 @@ import type {
} from 'n8n-workflow'; } from 'n8n-workflow';
import { NodeOperationError } from 'n8n-workflow'; import { NodeOperationError } from 'n8n-workflow';
import Parser from 'rss-parser'; import Parser from 'rss-parser';
import moment from 'moment'; import moment from 'moment-timezone';
export class RssFeedReadTrigger implements INodeType { export class RssFeedReadTrigger implements INodeType {
description: INodeTypeDescription = { description: INodeTypeDescription = {

View file

@ -7,7 +7,7 @@ import type {
INodeTypeDescription, INodeTypeDescription,
} from 'n8n-workflow'; } from 'n8n-workflow';
import moment from 'moment'; import moment from 'moment-timezone';
import { getColumns, rowFormatColumns, seaTableApiRequest, simplify } from './GenericFunctions'; import { getColumns, rowFormatColumns, seaTableApiRequest, simplify } from './GenericFunctions';
import type { ICtx, IRow, IRowResponse } from './Interfaces'; import type { ICtx, IRow, IRowResponse } from './Interfaces';

View file

@ -6,7 +6,7 @@ import type {
INodeTypeDescription, INodeTypeDescription,
} from 'n8n-workflow'; } from 'n8n-workflow';
import moment from 'moment'; import moment from 'moment-timezone';
import { companyFields, companyOperations } from './descriptions/CompanyDescription'; import { companyFields, companyOperations } from './descriptions/CompanyDescription';
import { industryFields, industryOperations } from './descriptions/IndustryDescription'; import { industryFields, industryOperations } from './descriptions/IndustryDescription';

View file

@ -11,7 +11,7 @@ import type {
} from 'n8n-workflow'; } from 'n8n-workflow';
import { NodeOperationError } from 'n8n-workflow'; import { NodeOperationError } from 'n8n-workflow';
import moment from 'moment'; import moment from 'moment-timezone';
import { channelFields, channelOperations } from './ChannelDescription'; import { channelFields, channelOperations } from './ChannelDescription';
import { messageFields, messageOperations } from './MessageDescription'; import { messageFields, messageOperations } from './MessageDescription';
import { starFields, starOperations } from './StarDescription'; import { starFields, starOperations } from './StarDescription';

View file

@ -17,7 +17,7 @@ import type {
import { BINARY_ENCODING, NodeOperationError } from 'n8n-workflow'; import { BINARY_ENCODING, NodeOperationError } from 'n8n-workflow';
import moment from 'moment'; import moment from 'moment-timezone';
import { channelFields, channelOperations } from './ChannelDescription'; import { channelFields, channelOperations } from './ChannelDescription';
import { messageFields, messageOperations } from './MessageDescription'; import { messageFields, messageOperations } from './MessageDescription';
import { starFields, starOperations } from './StarDescription'; import { starFields, starOperations } from './StarDescription';

View file

@ -6,7 +6,7 @@ import type {
INodeTypeDescription, INodeTypeDescription,
} from 'n8n-workflow'; } from 'n8n-workflow';
import moment from 'moment'; import moment from 'moment-timezone';
import { spontitApiRequest } from './GenericFunctions'; import { spontitApiRequest } from './GenericFunctions';
import { pushFields, pushOperations } from './PushDescription'; import { pushFields, pushOperations } from './PushDescription';

View file

@ -6,7 +6,7 @@ import type {
INodeTypeDescription, INodeTypeDescription,
} from 'n8n-workflow'; } from 'n8n-workflow';
import moment from 'moment'; import moment from 'moment-timezone';
import { stravaApiRequest, stravaApiRequestAllItems } from './GenericFunctions'; import { stravaApiRequest, stravaApiRequestAllItems } from './GenericFunctions';
import { activityFields, activityOperations } from './ActivityDescription'; import { activityFields, activityOperations } from './ActivityDescription';

View file

@ -8,7 +8,7 @@ import type {
} from 'n8n-workflow'; } from 'n8n-workflow';
import { ApplicationError, jsonParse } from 'n8n-workflow'; import { ApplicationError, jsonParse } from 'n8n-workflow';
import moment from 'moment'; import moment from 'moment-timezone';
import { Eq } from './QueryFunctions'; import { Eq } from './QueryFunctions';
export async function theHiveApiRequest( export async function theHiveApiRequest(

View file

@ -8,7 +8,7 @@ import type {
} from 'n8n-workflow'; } from 'n8n-workflow';
import { NodeApiError, NodeOperationError } from 'n8n-workflow'; import { NodeApiError, NodeOperationError } from 'n8n-workflow';
import moment from 'moment'; import moment from 'moment-timezone';
import { togglApiRequest } from './GenericFunctions'; import { togglApiRequest } from './GenericFunctions';
export class TogglTrigger implements INodeType { export class TogglTrigger implements INodeType {

View file

@ -9,7 +9,7 @@ import type {
} from 'n8n-workflow'; } from 'n8n-workflow';
import { v4 as uuid } from 'uuid'; import { v4 as uuid } from 'uuid';
import moment from 'moment'; import moment from 'moment-timezone';
import { twistApiRequest } from './GenericFunctions'; import { twistApiRequest } from './GenericFunctions';
import { channelFields, channelOperations } from './ChannelDescription'; import { channelFields, channelOperations } from './ChannelDescription';

View file

@ -6,7 +6,7 @@ import type {
INodeTypeDescription, INodeTypeDescription,
} from 'n8n-workflow'; } from 'n8n-workflow';
import moment from 'moment'; import moment from 'moment-timezone';
import { import {
convertNETDates, convertNETDates,
unleashedApiRequest, unleashedApiRequest,

View file

@ -6,7 +6,7 @@ import type {
INodeTypeDescription, INodeTypeDescription,
} from 'n8n-workflow'; } from 'n8n-workflow';
import moment from 'moment'; import moment from 'moment-timezone';
import { venafiApiRequest } from './GenericFunctions'; import { venafiApiRequest } from './GenericFunctions';

View file

@ -860,7 +860,6 @@
"luxon": "3.3.0", "luxon": "3.3.0",
"mailparser": "3.5.0", "mailparser": "3.5.0",
"minifaker": "1.34.1", "minifaker": "1.34.1",
"moment": "2.29.4",
"moment-timezone": "0.5.37", "moment-timezone": "0.5.37",
"mongodb": "4.17.1", "mongodb": "4.17.1",
"mqtt": "5.0.2", "mqtt": "5.0.2",

View file

@ -1308,9 +1308,6 @@ importers:
minifaker: minifaker:
specifier: 1.34.1 specifier: 1.34.1
version: 1.34.1 version: 1.34.1
moment:
specifier: 2.29.4
version: 2.29.4
moment-timezone: moment-timezone:
specifier: 0.5.37 specifier: 0.5.37
version: 0.5.37 version: 0.5.37