refactor: inline auth, data, triggers and actions in apps

This commit is contained in:
Ali BARIN
2022-10-28 15:48:39 +02:00
parent 179fe512af
commit 9a973c8257
47 changed files with 233 additions and 167 deletions

View File

@@ -17,7 +17,7 @@ export default defineAction({
{
label: 'Search Query',
key: 'query',
type: 'string',
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.',
@@ -26,7 +26,7 @@ export default defineAction({
{
label: 'Sort by',
key: 'sortBy',
type: 'dropdown',
type: 'dropdown' as const,
description:
'Sort messages by their match strength or by their date. Default is score.',
required: true,
@@ -46,7 +46,7 @@ export default defineAction({
{
label: 'Sort direction',
key: 'sortDirection',
type: 'dropdown',
type: 'dropdown' as const,
description:
'Sort matching messages in ascending or descending order. Default is descending.',
required: true,

View File

@@ -0,0 +1,7 @@
import findMessage from './find-message';
import sendMessageToChannel from './send-a-message-to-channel';
export default [
findMessage,
sendMessageToChannel,
];

View File

@@ -17,7 +17,7 @@ export default defineAction({
{
label: 'Channel',
key: 'channel',
type: 'dropdown',
type: 'dropdown' as const,
required: true,
description: 'Pick a channel to send the message to.',
variables: false,
@@ -35,7 +35,7 @@ export default defineAction({
{
label: 'Message text',
key: 'message',
type: 'string',
type: 'string' as const,
required: true,
description: 'The content of your new message.',
variables: true,

View File

@@ -6,7 +6,7 @@ export default {
{
key: 'accessToken',
label: 'Access Token',
type: 'string',
type: 'string' as const,
required: true,
readOnly: false,
value: null,
@@ -18,7 +18,7 @@ export default {
authenticationSteps: [
{
step: 1,
type: 'mutation',
type: 'mutation' as const,
name: 'createConnection',
arguments: [
{
@@ -39,7 +39,7 @@ export default {
},
{
step: 2,
type: 'mutation',
type: 'mutation' as const,
name: 'verifyConnection',
arguments: [
{
@@ -52,7 +52,7 @@ export default {
reconnectionSteps: [
{
step: 1,
type: 'mutation',
type: 'mutation' as const,
name: 'resetConnection',
arguments: [
{
@@ -63,7 +63,7 @@ export default {
},
{
step: 2,
type: 'mutation',
type: 'mutation' as const,
name: 'updateConnection',
arguments: [
{
@@ -84,7 +84,7 @@ export default {
},
{
step: 3,
type: 'mutation',
type: 'mutation' as const,
name: 'verifyConnection',
arguments: [
{

View File

@@ -0,0 +1,3 @@
import listChannels from './list-channels';
export default [listChannels];

View File

@@ -1,5 +1,8 @@
import defineApp from '../../helpers/define-app';
import addAuthHeader from './common/add-auth-header';
import actions from './actions';
import auth from './auth';
import data from './data';
export default defineApp({
name: 'Slack',
@@ -11,4 +14,7 @@ export default defineApp({
apiBaseUrl: 'https://slack.com/api',
primaryColor: '4a154b',
beforeRequest: [addAuthHeader],
auth,
actions,
data,
});