fix(Notion Node): Version fix (#6531)

This commit is contained in:
Michael Kret 2023-06-23 14:21:08 +03:00 committed by GitHub
parent b06462f441
commit 38dc784d2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 23 additions and 40 deletions

View file

@ -8,7 +8,7 @@ export const databaseOperations: INodeProperties[] = [
noDataExpression: true, noDataExpression: true,
displayOptions: { displayOptions: {
show: { show: {
version: [2], '@version': [2],
resource: ['database'], resource: ['database'],
}, },
}, },
@ -41,7 +41,7 @@ export const databaseOperations: INodeProperties[] = [
noDataExpression: true, noDataExpression: true,
displayOptions: { displayOptions: {
show: { show: {
version: [1], '@version': [1],
resource: ['database'], resource: ['database'],
}, },
}, },
@ -178,7 +178,7 @@ export const databaseFields: INodeProperties[] = [
type: 'boolean', type: 'boolean',
displayOptions: { displayOptions: {
show: { show: {
version: [2], '@version': [2],
resource: ['database'], resource: ['database'],
operation: ['getAll', 'get'], operation: ['getAll', 'get'],
}, },

View file

@ -14,7 +14,7 @@ export const databasePageOperations: INodeProperties[] = [
noDataExpression: true, noDataExpression: true,
displayOptions: { displayOptions: {
show: { show: {
version: [2], '@version': [2],
resource: ['databasePage'], resource: ['databasePage'],
}, },
}, },
@ -53,7 +53,7 @@ export const databasePageOperations: INodeProperties[] = [
noDataExpression: true, noDataExpression: true,
displayOptions: { displayOptions: {
show: { show: {
version: [1], '@version': [1],
resource: ['databasePage'], resource: ['databasePage'],
}, },
}, },
@ -161,7 +161,7 @@ export const databasePageFields: INodeProperties[] = [
default: '', default: '',
displayOptions: { displayOptions: {
show: { show: {
version: [2], '@version': [2],
resource: ['databasePage'], resource: ['databasePage'],
operation: ['create'], operation: ['create'],
}, },
@ -502,7 +502,7 @@ export const databasePageFields: INodeProperties[] = [
}, },
displayOptions: { displayOptions: {
show: { show: {
'/version': [2], '@version': [2],
type: ['files'], type: ['files'],
}, },
}, },
@ -969,7 +969,7 @@ export const databasePageFields: INodeProperties[] = [
}, },
displayOptions: { displayOptions: {
show: { show: {
'/version': [2], '@version': [2],
type: ['files'], type: ['files'],
}, },
}, },
@ -1055,7 +1055,7 @@ export const databasePageFields: INodeProperties[] = [
], ],
displayOptions: { displayOptions: {
show: { show: {
version: [2], '@version': [2],
resource: ['databasePage'], resource: ['databasePage'],
operation: ['get'], operation: ['get'],
}, },
@ -1068,7 +1068,7 @@ export const databasePageFields: INodeProperties[] = [
type: 'boolean', type: 'boolean',
displayOptions: { displayOptions: {
show: { show: {
version: [2], '@version': [2],
resource: ['databasePage'], resource: ['databasePage'],
operation: ['get'], operation: ['get'],
}, },
@ -1212,7 +1212,7 @@ export const databasePageFields: INodeProperties[] = [
type: 'boolean', type: 'boolean',
displayOptions: { displayOptions: {
show: { show: {
'/version': [2], '@version': [2],
'/resource': ['databasePage'], '/resource': ['databasePage'],
'/operation': ['getAll'], '/operation': ['getAll'],
}, },
@ -1230,7 +1230,7 @@ export const databasePageFields: INodeProperties[] = [
}, },
displayOptions: { displayOptions: {
show: { show: {
'/version': [1], '@version': [1],
}, },
}, },
default: {}, default: {},

View file

@ -880,7 +880,7 @@ export function getSearchFilters(resource: string) {
], ],
displayOptions: { displayOptions: {
show: { show: {
version: [2], '@version': [2],
resource: [resource], resource: [resource],
operation: ['getAll'], operation: ['getAll'],
}, },
@ -903,7 +903,7 @@ export function getSearchFilters(resource: string) {
], ],
displayOptions: { displayOptions: {
show: { show: {
version: [2], '@version': [2],
resource: [resource], resource: [resource],
operation: ['getAll'], operation: ['getAll'],
filterType: ['manual'], filterType: ['manual'],
@ -920,7 +920,7 @@ export function getSearchFilters(resource: string) {
}, },
displayOptions: { displayOptions: {
show: { show: {
version: [2], '@version': [2],
resource: [resource], resource: [resource],
operation: ['getAll'], operation: ['getAll'],
filterType: ['manual'], filterType: ['manual'],
@ -943,7 +943,7 @@ export function getSearchFilters(resource: string) {
type: 'notice', type: 'notice',
displayOptions: { displayOptions: {
show: { show: {
version: [2], '@version': [2],
resource: [resource], resource: [resource],
operation: ['getAll'], operation: ['getAll'],
filterType: ['json'], filterType: ['json'],
@ -957,7 +957,7 @@ export function getSearchFilters(resource: string) {
type: 'string', type: 'string',
displayOptions: { displayOptions: {
show: { show: {
version: [2], '@version': [2],
resource: [resource], resource: [resource],
operation: ['getAll'], operation: ['getAll'],
filterType: ['json'], filterType: ['json'],

View file

@ -10,7 +10,7 @@ export const pageOperations: INodeProperties[] = [
noDataExpression: true, noDataExpression: true,
displayOptions: { displayOptions: {
show: { show: {
version: [1], '@version': [1],
resource: ['page'], resource: ['page'],
}, },
}, },
@ -43,7 +43,7 @@ export const pageOperations: INodeProperties[] = [
noDataExpression: true, noDataExpression: true,
displayOptions: { displayOptions: {
show: { show: {
version: [2], '@version': [2],
resource: ['page'], resource: ['page'],
}, },
}, },
@ -127,7 +127,7 @@ export const pageFields: INodeProperties[] = [
], ],
displayOptions: { displayOptions: {
show: { show: {
version: [2], '@version': [2],
resource: ['page'], resource: ['page'],
operation: ['archive'], operation: ['archive'],
}, },
@ -140,7 +140,7 @@ export const pageFields: INodeProperties[] = [
type: 'boolean', type: 'boolean',
displayOptions: { displayOptions: {
show: { show: {
version: [2], '@version': [2],
resource: ['page'], resource: ['page'],
operation: ['archive'], operation: ['archive'],
}, },
@ -289,7 +289,7 @@ export const pageFields: INodeProperties[] = [
required: true, required: true,
displayOptions: { displayOptions: {
show: { show: {
version: [1], '@version': [1],
resource: ['page'], resource: ['page'],
operation: ['get'], operation: ['get'],
}, },
@ -303,7 +303,7 @@ export const pageFields: INodeProperties[] = [
type: 'boolean', type: 'boolean',
displayOptions: { displayOptions: {
show: { show: {
version: [1], '@version': [1],
resource: ['page'], resource: ['page'],
operation: ['get'], operation: ['get'],
}, },

View file

@ -73,12 +73,6 @@ export const versionDescription: INodeTypeDescription = {
type: 'notice', type: 'notice',
default: '', default: '',
}, },
{
displayName: 'Version',
name: 'version',
type: 'hidden',
default: 1,
},
{ {
displayName: 'Resource', displayName: 'Resource',
name: 'resource', name: 'resource',

View file

@ -758,11 +758,6 @@ export class NotionV2 implements INodeType {
} }
} }
if (download) {
const rawData = returnData.map((data) => data.json);
return this.prepareOutputData(rawData as INodeExecutionData[]);
}
return this.prepareOutputData(returnData); return this.prepareOutputData(returnData);
} }
} }

View file

@ -73,12 +73,6 @@ export const versionDescription: INodeTypeDescription = {
type: 'notice', type: 'notice',
default: '', default: '',
}, },
{
displayName: 'Version',
name: 'version',
type: 'hidden',
default: 2,
},
{ {
displayName: 'Resource', displayName: 'Resource',
name: 'resource', name: 'resource',