n8n/packages/nodes-base/nodes/Slack/StarDescription.ts

194 lines
4 KiB
TypeScript
Raw Normal View History

2020-03-08 15:22:33 -07:00
import { INodeProperties } from 'n8n-workflow';
export const starOperations = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
displayOptions: {
show: {
resource: [
'star',
],
},
},
options: [
{
name: 'Add',
value: 'add',
description: 'Add a star to an item.',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a star from an item.',
},
{
name: 'Get All',
value: 'getAll',
2020-03-15 07:51:49 -07:00
description: 'Get all stars of autenticated user.',
2020-03-08 15:22:33 -07:00
},
],
default: 'add',
description: 'The operation to perform.',
},
] as INodeProperties[];
export const starFields = [
/* -------------------------------------------------------------------------- */
/* star:add */
/* -------------------------------------------------------------------------- */
2020-03-08 15:22:33 -07:00
{
displayName: 'Options',
name: 'options',
type: 'collection',
displayOptions: {
show: {
operation: [
2020-10-22 06:46:03 -07:00
'add',
2020-03-08 15:22:33 -07:00
],
resource: [
'star',
],
},
},
default: {},
description: 'Options to set',
placeholder: 'Add options',
options: [
{
displayName: 'Channel ID',
name: 'channelId',
2020-03-15 07:51:49 -07:00
type: 'options',
typeOptions: {
loadOptionsMethod: 'getChannels',
},
2020-03-08 15:22:33 -07:00
default: '',
description: 'Channel to add star to, or channel where the message to add star to was posted (used with timestamp).',
},
{
displayName: 'File Comment',
name: 'fileComment',
2020-03-08 15:22:33 -07:00
type: 'string',
default: '',
description: 'File comment to add star to.',
2020-03-08 15:22:33 -07:00
},
{
displayName: 'File ID',
name: 'fileId',
2020-03-08 15:22:33 -07:00
type: 'string',
default: '',
description: 'File to add star to.',
2020-03-08 15:22:33 -07:00
},
{
displayName: 'Timestamp',
name: 'timestamp',
type: 'string',
default: '',
description: 'Timestamp of the message to add star to.',
},
],
},
/* ----------------------------------------------------------------------- */
/* star:delete */
/* ----------------------------------------------------------------------- */
2020-03-08 15:22:33 -07:00
{
displayName: 'Options',
name: 'options',
type: 'collection',
displayOptions: {
show: {
operation: [
2020-10-22 06:46:03 -07:00
'delete',
2020-03-08 15:22:33 -07:00
],
resource: [
'star',
],
},
},
default: {},
description: 'Options to set',
placeholder: 'Add options',
options: [
{
displayName: 'Channel ID',
name: 'channelId',
2020-03-15 07:51:49 -07:00
type: 'options',
typeOptions: {
loadOptionsMethod: 'getChannels',
},
2020-03-08 15:22:33 -07:00
default: '',
description: 'Channel to add star to, or channel where the message to add star to was posted (used with timestamp).',
},
{
displayName: 'File ID',
name: 'fileId',
type: 'string',
default: '',
description: 'File to add star to.',
},
{
displayName: 'File Comment',
name: 'fileComment',
type: 'string',
default: '',
description: 'File comment to add star to.',
},
{
displayName: 'Timestamp',
name: 'timestamp',
type: 'string',
default: '',
description: 'Timestamp of the message to add star to.',
},
],
},
/* -------------------------------------------------------------------------- */
/* star:getAll */
/* -------------------------------------------------------------------------- */
2020-03-08 15:22:33 -07:00
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
resource: [
'star',
],
operation: [
'getAll',
],
},
},
default: false,
description: 'If all results should be returned or only up to a given limit.',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
resource: [
'star',
],
operation: [
'getAll',
],
returnAll: [
false,
],
},
},
typeOptions: {
minValue: 1,
maxValue: 100,
},
default: 50,
description: 'How many results to return.',
},
] as INodeProperties[];