Skip to content

Commit d979587

Browse files
committed
Merge remote-tracking branch 'origin/master' into release/1.0.1
2 parents 66e43b2 + 5672146 commit d979587

File tree

9 files changed

+209
-55
lines changed

9 files changed

+209
-55
lines changed

packages/nodes-base/nodes/Google/Drive/GoogleDriveTrigger.node.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { extractId, googleApiRequest, googleApiRequestAllItems } from './v1/Gene
1313

1414
import moment from 'moment';
1515
import { fileSearch, folderSearch } from './v1/SearchFunctions';
16+
import { GOOGLE_DRIVE_FILE_URL_REGEX, GOOGLE_DRIVE_FOLDER_URL_REGEX } from '../constants';
1617

1718
export class GoogleDriveTrigger implements INodeType {
1819
description: INodeTypeDescription = {
@@ -112,15 +113,13 @@ export class GoogleDriveTrigger implements INodeType {
112113
placeholder: 'https://drive.google.com/file/d/1wroCSfK-hupQIYf_xzeoUEzOhvfTFH2P/edit',
113114
extractValue: {
114115
type: 'regex',
115-
regex:
116-
'https:\\/\\/(?:drive|docs)\\.google\\.com(?:\\/.*|)\\/d\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)',
116+
regex: GOOGLE_DRIVE_FILE_URL_REGEX,
117117
},
118118
validation: [
119119
{
120120
type: 'regex',
121121
properties: {
122-
regex:
123-
'https:\\/\\/(?:drive|docs)\\.google.com(?:\\/.*|)\\/d\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)',
122+
regex: GOOGLE_DRIVE_FILE_URL_REGEX,
124123
errorMessage: 'Not a valid Google Drive File URL',
125124
},
126125
},
@@ -192,15 +191,13 @@ export class GoogleDriveTrigger implements INodeType {
192191
placeholder: 'https://drive.google.com/drive/folders/1Tx9WHbA3wBpPB4C_HcoZDH9WZFWYxAMU',
193192
extractValue: {
194193
type: 'regex',
195-
regex:
196-
'https:\\/\\/drive\\.google\\.com(?:\\/.*|)\\/folders\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)',
194+
regex: GOOGLE_DRIVE_FOLDER_URL_REGEX,
197195
},
198196
validation: [
199197
{
200198
type: 'regex',
201199
properties: {
202-
regex:
203-
'https:\\/\\/drive\\.google\\.com(?:\\/.*|)\\/folders\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)',
200+
regex: GOOGLE_DRIVE_FOLDER_URL_REGEX,
204201
errorMessage: 'Not a valid Google Drive Folder URL',
205202
},
206203
},

packages/nodes-base/nodes/Google/Drive/v1/GoogleDriveV1.node.ts

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import type { Readable } from 'stream';
1717
import { driveSearch, fileSearch, folderSearch } from './SearchFunctions';
1818

1919
import { oldVersionNotice } from '@utils/descriptions';
20+
import { GOOGLE_DRIVE_FILE_URL_REGEX, GOOGLE_DRIVE_FOLDER_URL_REGEX } from '../../constants';
2021

2122
const UPLOAD_CHUNK_SIZE = 256 * 1024;
2223

@@ -242,15 +243,13 @@ const versionDescription: INodeTypeDescription = {
242243
'https://drive.google.com/file/d/1anGBg0b5re2VtF2bKu201_a-Vnz5BHq9Y4r-yBDAj5A/edit',
243244
extractValue: {
244245
type: 'regex',
245-
regex:
246-
'https:\\/\\/(?:drive|docs)\\.google\\.com\\/\\w+\\/d\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)',
246+
regex: GOOGLE_DRIVE_FILE_URL_REGEX,
247247
},
248248
validation: [
249249
{
250250
type: 'regex',
251251
properties: {
252-
regex:
253-
'https:\\/\\/(?:drive|docs)\\.google.com\\/\\w+\\/d\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)',
252+
regex: GOOGLE_DRIVE_FILE_URL_REGEX,
254253
errorMessage: 'Not a valid Google Drive File URL',
255254
},
256255
},
@@ -306,15 +305,13 @@ const versionDescription: INodeTypeDescription = {
306305
placeholder: 'https://drive.google.com/drive/folders/1Tx9WHbA3wBpPB4C_HcoZDH9WZFWYxAMU',
307306
extractValue: {
308307
type: 'regex',
309-
regex:
310-
'https:\\/\\/drive\\.google\\.com\\/\\w+\\/folders\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)',
308+
regex: GOOGLE_DRIVE_FOLDER_URL_REGEX,
311309
},
312310
validation: [
313311
{
314312
type: 'regex',
315313
properties: {
316-
regex:
317-
'https:\\/\\/drive\\.google\\.com\\/\\w+\\/folders\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)',
314+
regex: GOOGLE_DRIVE_FOLDER_URL_REGEX,
318315
errorMessage: 'Not a valid Google Drive Folder URL',
319316
},
320317
},
@@ -1489,15 +1486,13 @@ const versionDescription: INodeTypeDescription = {
14891486
placeholder: 'https://drive.google.com/drive/folders/0AaaaaAAAAAAAaa',
14901487
extractValue: {
14911488
type: 'regex',
1492-
regex:
1493-
'https:\\/\\/drive\\.google\\.com\\/\\w+\\/folders\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)',
1489+
regex: GOOGLE_DRIVE_FOLDER_URL_REGEX,
14941490
},
14951491
validation: [
14961492
{
14971493
type: 'regex',
14981494
properties: {
1499-
regex:
1500-
'https:\\/\\/drive\\.google\\.com\\/\\w+\\/folders\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)',
1495+
regex: GOOGLE_DRIVE_FOLDER_URL_REGEX,
15011496
errorMessage: 'Not a valid Google Drive Drive URL',
15021497
},
15031498
},

packages/nodes-base/nodes/Google/Drive/v2/actions/common.descriptions.ts

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { INodeProperties } from 'n8n-workflow';
22
import { DRIVE, RLC_DRIVE_DEFAULT } from '../helpers/interfaces';
3+
import { GOOGLE_DRIVE_FILE_URL_REGEX, GOOGLE_DRIVE_FOLDER_URL_REGEX } from '../../../constants';
34

45
export const fileRLC: INodeProperties = {
56
displayName: 'File',
@@ -26,15 +27,13 @@ export const fileRLC: INodeProperties = {
2627
'e.g. https://drive.google.com/file/d/1anGBg0b5re2VtF2bKu201_a-Vnz5BHq9Y4r-yBDAj5A/edit',
2728
extractValue: {
2829
type: 'regex',
29-
regex:
30-
'https:\\/\\/(?:drive|docs)\\.google\\.com\\/\\w+\\/d\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)',
30+
regex: GOOGLE_DRIVE_FILE_URL_REGEX,
3131
},
3232
validation: [
3333
{
3434
type: 'regex',
3535
properties: {
36-
regex:
37-
'https:\\/\\/(?:drive|docs)\\.google.com\\/\\w+\\/d\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)',
36+
regex: GOOGLE_DRIVE_FILE_URL_REGEX,
3837
errorMessage: 'Not a valid Google Drive File URL',
3938
},
4039
},
@@ -84,15 +83,13 @@ export const folderNoRootRLC: INodeProperties = {
8483
placeholder: 'e.g. https://drive.google.com/drive/folders/1Tx9WHbA3wBpPB4C_HcoZDH9WZFWYxAMU',
8584
extractValue: {
8685
type: 'regex',
87-
regex:
88-
'https:\\/\\/drive\\.google\\.com(?:\\/.*|)\\/folders\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)',
86+
regex: GOOGLE_DRIVE_FOLDER_URL_REGEX,
8987
},
9088
validation: [
9189
{
9290
type: 'regex',
9391
properties: {
94-
regex:
95-
'https:\\/\\/drive\\.google\\.com(?:\\/.*|)\\/folders\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)',
92+
regex: GOOGLE_DRIVE_FOLDER_URL_REGEX,
9693
errorMessage: 'Not a valid Google Drive Folder URL',
9794
},
9895
},
@@ -142,15 +139,13 @@ export const folderRLC: INodeProperties = {
142139
placeholder: 'e.g. https://drive.google.com/drive/folders/1Tx9WHbA3wBpPB4C_HcoZDH9WZFWYxAMU',
143140
extractValue: {
144141
type: 'regex',
145-
regex:
146-
'https:\\/\\/drive\\.google\\.com(?:\\/.*|)\\/folders\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)',
142+
regex: GOOGLE_DRIVE_FOLDER_URL_REGEX,
147143
},
148144
validation: [
149145
{
150146
type: 'regex',
151147
properties: {
152-
regex:
153-
'https:\\/\\/drive\\.google\\.com(?:\\/.*|)\\/folders\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)',
148+
regex: GOOGLE_DRIVE_FOLDER_URL_REGEX,
154149
errorMessage: 'Not a valid Google Drive Folder URL',
155150
},
156151
},
@@ -200,15 +195,13 @@ export const driveRLC: INodeProperties = {
200195
placeholder: 'https://drive.google.com/drive/folders/0AaaaaAAAAAAAaa',
201196
extractValue: {
202197
type: 'regex',
203-
regex:
204-
'https:\\/\\/drive\\.google\\.com(?:\\/.*|)\\/folders\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)',
198+
regex: GOOGLE_DRIVE_FOLDER_URL_REGEX,
205199
},
206200
validation: [
207201
{
208202
type: 'regex',
209203
properties: {
210-
regex:
211-
'https:\\/\\/drive\\.google\\.com(?:\\/.*|)\\/folders\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)',
204+
regex: GOOGLE_DRIVE_FOLDER_URL_REGEX,
212205
errorMessage: 'Not a valid Google Drive Drive URL',
213206
},
214207
},
@@ -258,15 +251,13 @@ export const sharedDriveRLC: INodeProperties = {
258251
placeholder: 'e.g. https://drive.google.com/drive/u/1/folders/0AIjtcbwnjtcbwn9PVA',
259252
extractValue: {
260253
type: 'regex',
261-
regex:
262-
'https:\\/\\/drive\\.google\\.com(?:\\/.*|)\\/folders\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)',
254+
regex: GOOGLE_DRIVE_FOLDER_URL_REGEX,
263255
},
264256
validation: [
265257
{
266258
type: 'regex',
267259
properties: {
268-
regex:
269-
'https:\\/\\/drive\\.google\\.com(?:\\/.*|)\\/folders\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)',
260+
regex: GOOGLE_DRIVE_FOLDER_URL_REGEX,
270261
errorMessage: 'Not a valid Google Drive Drive URL',
271262
},
272263
},

packages/nodes-base/nodes/Google/Sheet/GoogleSheetsTrigger.node.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
getRevisionFile,
2121
sheetBinaryToArrayOfArrays,
2222
} from './GoogleSheetsTrigger.utils';
23+
import { GOOGLE_DRIVE_FILE_URL_REGEX } from '../constants';
2324

2425
export class GoogleSheetsTrigger implements INodeType {
2526
description: INodeTypeDescription = {
@@ -84,15 +85,13 @@ export class GoogleSheetsTrigger implements INodeType {
8485
type: 'string',
8586
extractValue: {
8687
type: 'regex',
87-
regex:
88-
'https:\\/\\/(?:drive|docs)\\.google\\.com(?:\\/.*|)\\/d\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)',
88+
regex: GOOGLE_DRIVE_FILE_URL_REGEX,
8989
},
9090
validation: [
9191
{
9292
type: 'regex',
9393
properties: {
94-
regex:
95-
'https:\\/\\/(?:drive|docs)\\.google.com(?:\\/.*|)\\/d\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)',
94+
regex: GOOGLE_DRIVE_FILE_URL_REGEX,
9695
errorMessage: 'Not a valid Google Drive File URL',
9796
},
9897
},

packages/nodes-base/nodes/Google/Sheet/v2/actions/sheet/Sheet.resource.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import * as del from './delete.operation';
77
import * as read from './read.operation';
88
import * as remove from './remove.operation';
99
import * as update from './update.operation';
10+
import { GOOGLE_DRIVE_FILE_URL_REGEX } from '../../../../constants';
1011

1112
export { append, appendOrUpdate, clear, create, del as delete, read, remove, update };
1213

@@ -96,15 +97,13 @@ export const descriptions: INodeProperties[] = [
9697
type: 'string',
9798
extractValue: {
9899
type: 'regex',
99-
regex:
100-
'https:\\/\\/(?:drive|docs)\\.google\\.com(?:\\/.*|)\\/d\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)',
100+
regex: GOOGLE_DRIVE_FILE_URL_REGEX,
101101
},
102102
validation: [
103103
{
104104
type: 'regex',
105105
properties: {
106-
regex:
107-
'https:\\/\\/(?:drive|docs)\\.google.com(?:\\/.*|)\\/d\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)',
106+
regex: GOOGLE_DRIVE_FILE_URL_REGEX,
108107
errorMessage: 'Not a valid Google Drive File URL',
109108
},
110109
},

packages/nodes-base/nodes/Google/Sheet/v2/actions/spreadsheet/delete.operation.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow';
22
import type { SpreadSheetProperties } from '../../helpers/GoogleSheets.types';
33
import { apiRequest } from '../../transport';
4+
import { GOOGLE_DRIVE_FILE_URL_REGEX } from '../../../../constants';
45

56
export const description: SpreadSheetProperties = [
67
// {
@@ -37,15 +38,13 @@ export const description: SpreadSheetProperties = [
3738
type: 'string',
3839
extractValue: {
3940
type: 'regex',
40-
regex:
41-
'https:\\/\\/(?:drive|docs)\\.google\\.com(?:\\/.*|)\\/d\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)',
41+
regex: GOOGLE_DRIVE_FILE_URL_REGEX,
4242
},
4343
validation: [
4444
{
4545
type: 'regex',
4646
properties: {
47-
regex:
48-
'https:\\/\\/(?:drive|docs)\\.google.com(?:\\/.*|)\\/d\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)',
47+
regex: GOOGLE_DRIVE_FILE_URL_REGEX,
4948
errorMessage: 'Not a valid Google Drive File URL',
5049
},
5150
},
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export const GOOGLE_DRIVE_FILE_URL_REGEX =
2+
'https:\\/\\/(?:drive|docs)\\.google\\.com(?:\\/.*|)\\/d\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)';
3+
4+
export const GOOGLE_DRIVE_FOLDER_URL_REGEX =
5+
'https:\\/\\/drive\\.google\\.com(?:\\/.*|)\\/folders\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)';

packages/nodes-base/nodes/Html/Html.node.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
"subcategories": {
1414
"Core Nodes": ["Helpers", "Data Transformation"]
1515
},
16-
"alias": ["extract", "template"]
16+
"alias": ["extract", "template", "table"]
1717
}

0 commit comments

Comments
 (0)