2020-10-12 01:05:16 -07:00
import {
INodeProperties ,
} from 'n8n-workflow' ;
2021-12-03 00:44:16 -08:00
export const mediaOperations : INodeProperties [ ] = [
2020-10-12 01:05:16 -07:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2020-10-12 01:05:16 -07:00
displayOptions : {
show : {
resource : [
'media' ,
] ,
} ,
} ,
options : [
{
name : 'Upload' ,
value : 'upload' ,
description : 'Send media to a chat room' ,
2022-07-10 13:50:51 -07:00
action : 'Upload media to a chatroom' ,
2020-10-12 01:05:16 -07:00
} ,
] ,
default : 'upload' ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2020-10-12 01:05:16 -07:00
2021-12-03 00:44:16 -08:00
export const mediaFields : INodeProperties [ ] = [
2020-10-12 01:05:16 -07:00
/* -------------------------------------------------------------------------- */
/* media:upload */
/* -------------------------------------------------------------------------- */
{
2022-06-03 10:23:49 -07:00
displayName : 'Room Name or ID' ,
2020-10-12 01:05:16 -07:00
name : 'roomId' ,
type : 'options' ,
typeOptions : {
loadOptionsMethod : 'getChannels' ,
} ,
default : '' ,
displayOptions : {
show : {
resource : [
'media' ,
] ,
operation : [
'upload' ,
] ,
} ,
} ,
2022-07-14 13:05:11 -07:00
description : 'Room ID to post. Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>.' ,
2020-10-12 01:05:16 -07:00
required : true ,
} ,
{
displayName : 'Binary Property' ,
name : 'binaryPropertyName' ,
type : 'string' ,
default : 'data' ,
required : true ,
displayOptions : {
show : {
resource : [
'media' ,
] ,
operation : [
'upload' ,
] ,
} ,
} ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Media Type' ,
2020-10-12 01:05:16 -07:00
name : 'mediaType' ,
type : 'options' ,
default : 'image' ,
displayOptions : {
show : {
resource : [
'media' ,
] ,
operation : [
'upload' ,
] ,
} ,
} ,
options : [
{
name : 'File' ,
value : 'file' ,
description : 'General file' ,
} ,
{
name : 'Image' ,
value : 'image' ,
description : 'Image media type' ,
} ,
] ,
description : 'Name of the uploaded file' ,
placeholder : 'mxc://matrix.org/uploaded-media-uri' ,
required : true ,
} ,
2021-12-03 00:44:16 -08:00
] ;