refactor: inline auth, data, triggers and actions in apps
This commit is contained in:
@@ -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,
|
||||
|
7
packages/backend/src/apps/slack/actions/index.ts
Normal file
7
packages/backend/src/apps/slack/actions/index.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import findMessage from './find-message';
|
||||
import sendMessageToChannel from './send-a-message-to-channel';
|
||||
|
||||
export default [
|
||||
findMessage,
|
||||
sendMessageToChannel,
|
||||
];
|
@@ -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,
|
||||
|
@@ -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: [
|
||||
{
|
||||
|
3
packages/backend/src/apps/slack/data/index.ts
Normal file
3
packages/backend/src/apps/slack/data/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import listChannels from './list-channels';
|
||||
|
||||
export default [listChannels];
|
@@ -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,
|
||||
});
|
||||
|
Reference in New Issue
Block a user