Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/Airtable/AirtableTrigger.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
} from 'n8n-workflow';
import { NodeOperationError } from 'n8n-workflow';

import moment from 'moment';
import moment from 'moment-timezone';
import type { IRecord } from './v1/GenericFunctions';
import { apiRequestAllItems, downloadRecordAttachments } from './v1/GenericFunctions';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow';

import moment from 'moment';
import moment from 'moment-timezone';

import { capitalCase } from 'change-case';
import { apiRequest } from '../../../transport';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow';
import { NodeOperationError } from 'n8n-workflow';

import moment from 'moment';
import moment from 'moment-timezone';

import { capitalCase } from 'change-case';
import { apiRequest } from '../../../transport';
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/Cortex/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
ILoadOptionsFunctions,
} from 'n8n-workflow';

import moment from 'moment';
import moment from 'moment-timezone';

export async function cortexApiRequest(
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/DateTime/V2/GenericFunctions.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DateTime } from 'luxon';
import moment from 'moment';
import moment from 'moment-timezone';
import type { IExecuteFunctions } from 'n8n-workflow';
import { NodeOperationError } from 'n8n-workflow';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import moment from 'moment';
import moment from 'moment-timezone';
import { testWorkflows, getWorkflowFilenames } from '@test/nodes/Helpers';

const workflows = getWorkflowFilenames(__dirname);
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/Filter/V1/GenericFunctions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { INode, NodeParameterValue } from 'n8n-workflow';
import { NodeOperationError } from 'n8n-workflow';

import moment from 'moment';
import moment from 'moment-timezone';

const isDateObject = (value: NodeParameterValue) =>
Object.prototype.toString.call(value) === '[object Date]';
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/GoToWebinar/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { NodeApiError } from 'n8n-workflow';

import type { OptionsWithUri } from 'request';

import moment from 'moment';
import moment from 'moment-timezone';

import * as losslessJSON from 'lossless-json';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
} from 'n8n-workflow';
import { NodeApiError, NodeOperationError } from 'n8n-workflow';

import moment from 'moment';
import moment from 'moment-timezone';

import {
encodeURIComponentOnce,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {
INodeTypeDescription,
} from 'n8n-workflow';

import moment from 'moment';
import moment from 'moment-timezone';
import {
allFields,
cleanData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {
} 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 { extractId, googleApiRequest, googleApiRequestAllItems } from './v1/GenericFunctions';
import { fileSearch, folderSearch } from './v2/methods/listSearch';
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/Hubspot/V1/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {
} from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow';

import moment from 'moment';
import moment from 'moment-timezone';

export async function hubspotApiRequest(
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/Hubspot/V2/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {
} from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow';

import moment from 'moment';
import moment from 'moment-timezone';

export async function hubspotApiRequest(
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions,
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/If/V1/IfV1.node.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import moment from 'moment';
import moment from 'moment-timezone';
import type {
IExecuteFunctions,
INodeExecutionData,
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/Mailchimp/Mailchimp.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {
INodeTypeDescription,
} from 'n8n-workflow';

import moment from 'moment';
import moment from 'moment-timezone';
import {
campaignFieldsMetadata,
mailchimpApiRequest,
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/Mandrill/Mandrill.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type {
} from 'n8n-workflow';
import { NodeApiError } from 'n8n-workflow';

import moment from 'moment';
import moment from 'moment-timezone';

import map from 'lodash/map';
import isEmpty from 'lodash/isEmpty';
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/Nasa/Nasa.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
} from 'n8n-workflow';
import { NodeOperationError } from 'n8n-workflow';

import moment from 'moment';
import moment from 'moment-timezone';
import { nasaApiRequest, nasaApiRequestAllItems } from './GenericFunctions';

export class Nasa implements INodeType {
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/Notion/NotionTrigger.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type {
INodeTypeDescription,
} from 'n8n-workflow';

import moment from 'moment';
import moment from 'moment-timezone';
import { notionApiRequest, simplifyObjects } from './GenericFunctions';

import { getDatabases } from './SearchFunctions';
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/Orbit/Orbit.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {
INodeTypeDescription,
} from 'n8n-workflow';

import moment from 'moment';
import moment from 'moment-timezone';
import { orbitApiRequest, orbitApiRequestAllItems, resolveIdentities } from './GenericFunctions';

import { activityFields, activityOperations } from './ActivityDescription';
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/Oura/Oura.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type {
INodeTypeDescription,
} from 'n8n-workflow';

import moment from 'moment';
import moment from 'moment-timezone';
import { ouraApiRequest } from './GenericFunctions';

import { profileOperations } from './ProfileDescription';
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/Paddle/Paddle.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type {
} from 'n8n-workflow';
import { NodeApiError, NodeOperationError } from 'n8n-workflow';

import moment from 'moment';
import moment from 'moment-timezone';
import { couponFields, couponOperations } from './CouponDescription';

import { paddleApiRequest, paddleApiRequestAllItems, validateJSON } from './GenericFunctions';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
} from 'n8n-workflow';
import { NodeOperationError } from 'n8n-workflow';
import Parser from 'rss-parser';
import moment from 'moment';
import moment from 'moment-timezone';

export class RssFeedReadTrigger implements INodeType {
description: INodeTypeDescription = {
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/SeaTable/SeaTableTrigger.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type {
INodeTypeDescription,
} from 'n8n-workflow';

import moment from 'moment';
import moment from 'moment-timezone';
import { getColumns, rowFormatColumns, seaTableApiRequest, simplify } from './GenericFunctions';

import type { ICtx, IRow, IRowResponse } from './Interfaces';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type {
INodeTypeDescription,
} from 'n8n-workflow';

import moment from 'moment';
import moment from 'moment-timezone';
import { companyFields, companyOperations } from './descriptions/CompanyDescription';

import { industryFields, industryOperations } from './descriptions/IndustryDescription';
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/Slack/V1/SlackV1.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import type {
} from 'n8n-workflow';
import { NodeOperationError } from 'n8n-workflow';

import moment from 'moment';
import moment from 'moment-timezone';
import { channelFields, channelOperations } from './ChannelDescription';
import { messageFields, messageOperations } from './MessageDescription';
import { starFields, starOperations } from './StarDescription';
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/Slack/V2/SlackV2.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import type {

import { BINARY_ENCODING, NodeOperationError } from 'n8n-workflow';

import moment from 'moment';
import moment from 'moment-timezone';
import { channelFields, channelOperations } from './ChannelDescription';
import { messageFields, messageOperations } from './MessageDescription';
import { starFields, starOperations } from './StarDescription';
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/Spontit/Spontit.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type {
INodeTypeDescription,
} from 'n8n-workflow';

import moment from 'moment';
import moment from 'moment-timezone';
import { spontitApiRequest } from './GenericFunctions';

import { pushFields, pushOperations } from './PushDescription';
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/Strava/Strava.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type {
INodeTypeDescription,
} from 'n8n-workflow';

import moment from 'moment';
import moment from 'moment-timezone';
import { stravaApiRequest, stravaApiRequestAllItems } from './GenericFunctions';

import { activityFields, activityOperations } from './ActivityDescription';
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/TheHive/GenericFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {
} from 'n8n-workflow';
import { ApplicationError, jsonParse } from 'n8n-workflow';

import moment from 'moment';
import moment from 'moment-timezone';
import { Eq } from './QueryFunctions';

export async function theHiveApiRequest(
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/Toggl/TogglTrigger.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {
} from 'n8n-workflow';
import { NodeApiError, NodeOperationError } from 'n8n-workflow';

import moment from 'moment';
import moment from 'moment-timezone';
import { togglApiRequest } from './GenericFunctions';

export class TogglTrigger implements INodeType {
Expand Down
2 changes: 1 addition & 1 deletion packages/nodes-base/nodes/Twist/Twist.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {
} from 'n8n-workflow';

import { v4 as uuid } from 'uuid';
import moment from 'moment';
import moment from 'moment-timezone';
import { twistApiRequest } from './GenericFunctions';

import { channelFields, channelOperations } from './ChannelDescription';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type {
INodeTypeDescription,
} from 'n8n-workflow';

import moment from 'moment';
import moment from 'moment-timezone';
import {
convertNETDates,
unleashedApiRequest,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type {
INodeTypeDescription,
} from 'n8n-workflow';

import moment from 'moment';
import moment from 'moment-timezone';

import { venafiApiRequest } from './GenericFunctions';

Expand Down
1 change: 0 additions & 1 deletion packages/nodes-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,6 @@
"luxon": "3.3.0",
"mailparser": "3.5.0",
"minifaker": "1.34.1",
"moment": "2.29.4",
"moment-timezone": "0.5.37",
"mongodb": "4.17.1",
"mqtt": "5.0.2",
Expand Down
3 changes: 0 additions & 3 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading