feat: Convert all app files to JS

This commit is contained in:
Faruk AYDIN
2024-01-05 17:44:21 +01:00
parent b95478b635
commit 43dba351c3
1030 changed files with 5114 additions and 6436 deletions

View File

@@ -1,15 +1,16 @@
import defineAction from '../../../../helpers/define-action';
import postMessage from './post-message';
import defineAction from '../../../../helpers/define-action.js';
import postMessage from './post-message.js';
export default defineAction({
name: 'Send a direct message',
key: 'sendDirectMessage',
description: 'Sends a direct message to a user or yourself from the Slackbot.',
description:
'Sends a direct message to a user or yourself from the Slackbot.',
arguments: [
{
label: 'To username',
key: 'toUsername',
type: 'dropdown' as const,
type: 'dropdown',
required: true,
description: 'Pick a user to send the message to.',
variables: true,
@@ -27,7 +28,7 @@ export default defineAction({
{
label: 'Message text',
key: 'message',
type: 'string' as const,
type: 'string',
required: true,
description: 'The content of your new message.',
variables: true,
@@ -35,7 +36,7 @@ export default defineAction({
{
label: 'Send as a bot?',
key: 'sendAsBot',
type: 'dropdown' as const,
type: 'dropdown',
required: false,
value: false,
description:

View File

@@ -1,23 +1,14 @@
import { IGlobalVariable } from '@automatisch/types';
import { URL } from 'url';
type TData = {
channel: string;
text: string;
username?: string;
icon_url?: string;
icon_emoji?: string;
};
const postMessage = async ($: IGlobalVariable) => {
const postMessage = async ($) => {
const { parameters } = $.step;
const toUsername = parameters.toUsername as string;
const text = parameters.message as string;
const sendAsBot = parameters.sendAsBot as boolean;
const botName = parameters.botName as string;
const botIcon = parameters.botIcon as string;
const toUsername = parameters.toUsername;
const text = parameters.message;
const sendAsBot = parameters.sendAsBot;
const botName = parameters.botName;
const botIcon = parameters.botIcon;
const data: TData = {
const data = {
channel: toUsername,
text,
};