fix(Notion Node): Allow UUID v8 in notion id checks (#10938)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-09-24 12:38:11 +02:00
committed by GitHub
parent 8db8817851
commit 46beda05f6
9 changed files with 103 additions and 85 deletions

View File

@@ -11,6 +11,12 @@ import moment from 'moment-timezone';
import { notionApiRequest, simplifyObjects } from './shared/GenericFunctions';
import { listSearch } from './shared/methods';
import {
databaseUrlExtractionRegexp,
databaseUrlValidationRegexp,
idExtractionRegexp,
idValidationRegexp,
} from './shared/constants';
export class NotionTrigger implements INodeType {
description: INodeTypeDescription = {
@@ -85,16 +91,14 @@ export class NotionTrigger implements INodeType {
{
type: 'regex',
properties: {
regex:
'(?:https|http)://www.notion.so/(?:[a-z0-9-]{2,}/)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12}).*',
regex: databaseUrlValidationRegexp,
errorMessage: 'Not a valid Notion Database URL',
},
},
],
extractValue: {
type: 'regex',
regex:
'(?:https|http)://www.notion.so/(?:[a-z0-9-]{2,}/)?([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})',
regex: databaseUrlExtractionRegexp,
},
},
{
@@ -106,15 +110,14 @@ export class NotionTrigger implements INodeType {
{
type: 'regex',
properties: {
regex:
'^(([0-9a-f]{8}[0-9a-f]{4}4[0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12})|([0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}))[ \t]*',
regex: idValidationRegexp,
errorMessage: 'Not a valid Notion Database ID',
},
},
],
extractValue: {
type: 'regex',
regex: '^([0-9a-f]{8}-?[0-9a-f]{4}-?4[0-9a-f]{3}-?[89ab][0-9a-f]{3}-?[0-9a-f]{12})',
regex: idExtractionRegexp,
},
url: '=https://www.notion.so/{{$value.replace(/-/g, "")}}',
},