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

@@ -23,6 +23,7 @@ import moment from 'moment-timezone';
import { validate as uuidValidate } from 'uuid';
import set from 'lodash/set';
import { filters } from './descriptions/Filters';
import { blockUrlExtractionRegexp } from './constants';
function uuidValidateWithoutDashes(this: IExecuteFunctions, value: string) {
if (uuidValidate(value)) return true;
@@ -1152,8 +1153,7 @@ export function extractBlockId(this: IExecuteFunctions, nodeVersion: number, ite
const match = (blockIdRLCData.value as string).match(blockRegex);
if (match === null) {
const pageRegex =
/(?:https|http):\/\/www\.notion\.so\/(?:[a-z0-9-]{2,}\/)?(?:[a-zA-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})/;
const pageRegex = new RegExp(blockUrlExtractionRegexp);
const pageMatch = (blockIdRLCData.value as string).match(pageRegex);
if (pageMatch === null) {