refactor: Use only arguments for action definitions

This commit is contained in:
Faruk AYDIN
2022-10-31 18:26:58 +01:00
parent bcfc9beb99
commit 1cfe84fc3d
10 changed files with 246 additions and 321 deletions

View File

@@ -5,69 +5,55 @@ export default defineAction({
name: 'Find message',
key: 'findMessage',
description: 'Find a Slack message using the Slack Search feature.',
substeps: [
arguments: [
{
key: 'chooseConnection',
name: 'Choose connection',
label: 'Search Query',
key: 'query',
type: 'string' as const,
required: true,
description:
'Search query to use for finding matching messages. See the Slack Search Documentation for more information on constructing a query.',
variables: true,
},
{
key: 'setupAction',
name: 'Set up action',
arguments: [
label: 'Sort by',
key: 'sortBy',
type: 'dropdown' as const,
description:
'Sort messages by their match strength or by their date. Default is score.',
required: true,
value: 'score',
variables: false,
options: [
{
label: 'Search Query',
key: 'query',
type: 'string' as const,
required: true,
description:
'Search query to use for finding matching messages. See the Slack Search Documentation for more information on constructing a query.',
variables: true,
},
{
label: 'Sort by',
key: 'sortBy',
type: 'dropdown' as const,
description:
'Sort messages by their match strength or by their date. Default is score.',
required: true,
label: 'Match strength',
value: 'score',
variables: false,
options: [
{
label: 'Match strength',
value: 'score',
},
{
label: 'Message date time',
value: 'timestamp',
},
],
},
{
label: 'Sort direction',
key: 'sortDirection',
type: 'dropdown' as const,
description:
'Sort matching messages in ascending or descending order. Default is descending.',
required: true,
value: 'desc',
variables: false,
options: [
{
label: 'Descending (newest or best match first)',
value: 'desc',
},
{
label: 'Ascending (oldest or worst match first)',
value: 'asc',
},
],
label: 'Message date time',
value: 'timestamp',
},
],
},
{
key: 'testStep',
name: 'Test action',
label: 'Sort direction',
key: 'sortDirection',
type: 'dropdown' as const,
description:
'Sort matching messages in ascending or descending order. Default is descending.',
required: true,
value: 'desc',
variables: false,
options: [
{
label: 'Descending (newest or best match first)',
value: 'desc',
},
{
label: 'Ascending (oldest or worst match first)',
value: 'asc',
},
],
},
],

View File

@@ -5,46 +5,32 @@ export default defineAction({
name: 'Send a message to channel',
key: 'sendMessageToChannel',
description: 'Send a message to a specific channel you specify.',
substeps: [
arguments: [
{
key: 'chooseConnection',
name: 'Choose connection',
},
{
key: 'setupAction',
name: 'Set up action',
arguments: [
{
label: 'Channel',
key: 'channel',
type: 'dropdown' as const,
required: true,
description: 'Pick a channel to send the message to.',
variables: false,
source: {
type: 'query',
name: 'getData',
arguments: [
{
name: 'key',
value: 'listChannels',
},
],
label: 'Channel',
key: 'channel',
type: 'dropdown' as const,
required: true,
description: 'Pick a channel to send the message to.',
variables: false,
source: {
type: 'query',
name: 'getData',
arguments: [
{
name: 'key',
value: 'listChannels',
},
},
{
label: 'Message text',
key: 'message',
type: 'string' as const,
required: true,
description: 'The content of your new message.',
variables: true,
},
],
],
},
},
{
key: 'testStep',
name: 'Test action',
label: 'Message text',
key: 'message',
type: 'string' as const,
required: true,
description: 'The content of your new message.',
variables: true,
},
],