diff --git a/packages/nodes-base/nodes/Google/Drive/GoogleDrive.node.ts b/packages/nodes-base/nodes/Google/Drive/GoogleDrive.node.ts index 6aaf6f5ad..38eee4a3b 100644 --- a/packages/nodes-base/nodes/Google/Drive/GoogleDrive.node.ts +++ b/packages/nodes-base/nodes/Google/Drive/GoogleDrive.node.ts @@ -741,6 +741,7 @@ export class GoogleDrive implements INodeType { placeholder: '', description: 'Name of the binary property which contains
the data for the file to be uploaded.', }, + // ---------------------------------- // file:update // ---------------------------------- @@ -1898,6 +1899,91 @@ export class GoogleDrive implements INodeType { }, ], }, + { + displayName: 'Options', + name: 'options', + type: 'collection', + placeholder: 'Add Option', + default: {}, + displayOptions: { + show: { + operation: [ + 'upload', + ], + resource: [ + 'file', + ], + }, + }, + options: [ + { + displayName: 'APP Properties', + name: 'appPropertiesUi', + placeholder: 'Add Property', + type: 'fixedCollection', + default: '', + typeOptions: { + multipleValues: true, + }, + description: 'A collection of arbitrary key-value pairs which are private to the requesting app', + options: [ + { + name: 'appPropertyValues', + displayName: 'APP Property', + values: [ + { + displayName: 'Key', + name: 'key', + type: 'string', + default: '', + description: 'Name of the key to add.', + }, + { + displayName: 'Value', + name: 'value', + type: 'string', + default: '', + description: 'Value to set for the key.', + }, + ], + }, + ], + }, + { + displayName: 'Properties', + name: 'propertiesUi', + placeholder: 'Add Property', + type: 'fixedCollection', + default: '', + typeOptions: { + multipleValues: true, + }, + description: 'A collection of arbitrary key-value pairs which are visible to all apps.', + options: [ + { + name: 'propertyValues', + displayName: 'Property', + values: [ + { + displayName: 'Key', + name: 'key', + type: 'string', + default: '', + description: 'Name of the key to add.', + }, + { + displayName: 'Value', + name: 'value', + type: 'string', + default: '', + description: 'Value to set for the key.', + }, + ], + }, + ], + }, + ], + }, ], }; @@ -2228,6 +2314,18 @@ export class GoogleDrive implements INodeType { originalFilename, }; + const properties = this.getNodeParameter('options.propertiesUi.propertyValues', i, []) as IDataObject[]; + + if (properties.length) { + Object.assign(body, { properties: properties.reduce((obj, value) => Object.assign(obj, { [`${value.key}`]: value.value }), {}) } ); + } + + const appProperties = this.getNodeParameter('options.appPropertiesUi.appPropertyValues', i, []) as IDataObject[]; + + if (properties.length) { + Object.assign(body, { appProperties: appProperties.reduce((obj, value) => Object.assign(obj, { [`${value.key}`]: value.value }), {}) }); + } + qs = { addParents: parents.join(','), // When set to true shared drives can be used.