fix(Google Drive Node): Fix regex in file RLC (#6607)

This commit is contained in:
Michael Kret
2023-07-05 23:15:13 +03:00
committed by GitHub
parent 8abb03d7cf
commit 56721468df
7 changed files with 37 additions and 52 deletions

View File

@@ -1,6 +1,7 @@
import type { IExecuteFunctions, IDataObject, INodeExecutionData } from 'n8n-workflow';
import type { SpreadSheetProperties } from '../../helpers/GoogleSheets.types';
import { apiRequest } from '../../transport';
import { GOOGLE_DRIVE_FILE_URL_REGEX } from '../../../../constants';
export const description: SpreadSheetProperties = [
// {
@@ -37,15 +38,13 @@ export const description: SpreadSheetProperties = [
type: 'string',
extractValue: {
type: 'regex',
regex:
'https:\\/\\/(?:drive|docs)\\.google\\.com(?:\\/.*|)\\/d\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)',
regex: GOOGLE_DRIVE_FILE_URL_REGEX,
},
validation: [
{
type: 'regex',
properties: {
regex:
'https:\\/\\/(?:drive|docs)\\.google.com(?:\\/.*|)\\/d\\/([0-9a-zA-Z\\-_]+)(?:\\/.*|)',
regex: GOOGLE_DRIVE_FILE_URL_REGEX,
errorMessage: 'Not a valid Google Drive File URL',
},
},