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

@@ -0,0 +1,3 @@
import sendMessage from './send-message/index.js';
export default [sendMessage];

View File

@@ -1,3 +0,0 @@
import sendMessage from './send-message';
export default [sendMessage];

View File

@@ -1,5 +1,5 @@
import qs from 'qs';
import defineAction from '../../../../helpers/define-action';
import defineAction from '../../../../helpers/define-action.js';
export default defineAction({
name: 'Send message',
@@ -9,7 +9,7 @@ export default defineAction({
{
label: 'Topic',
key: 'topic',
type: 'string' as const,
type: 'string',
required: true,
description: 'Target topic name.',
variables: true,
@@ -17,15 +17,16 @@ export default defineAction({
{
label: 'Message body',
key: 'message',
type: 'string' as const,
type: 'string',
required: true,
description: 'Message body to be sent, set to triggered if empty or not passed.',
description:
'Message body to be sent, set to triggered if empty or not passed.',
variables: true,
},
{
label: 'Title',
key: 'title',
type: 'string' as const,
type: 'string',
required: false,
description: 'Message title.',
variables: true,
@@ -33,7 +34,7 @@ export default defineAction({
{
label: 'Email',
key: 'email',
type: 'string' as const,
type: 'string',
required: false,
description: 'E-mail address for e-mail notifications.',
variables: true,
@@ -41,7 +42,7 @@ export default defineAction({
{
label: 'Click URL',
key: 'click',
type: 'string' as const,
type: 'string',
required: false,
description: 'Website opened when notification is clicked.',
variables: true,
@@ -49,7 +50,7 @@ export default defineAction({
{
label: 'Attach file by URL',
key: 'attach',
type: 'string' as const,
type: 'string',
required: false,
description: 'URL of an attachment.',
variables: true,
@@ -57,7 +58,7 @@ export default defineAction({
{
label: 'Filename',
key: 'filename',
type: 'string' as const,
type: 'string',
required: false,
description: 'File name of the attachment.',
variables: true,
@@ -65,24 +66,17 @@ export default defineAction({
{
label: 'Delay',
key: 'delay',
type: 'string' as const,
type: 'string',
required: false,
description: 'Timestamp or duration for delayed delivery. For example, 30min or 9am.',
description:
'Timestamp or duration for delayed delivery. For example, 30min or 9am.',
variables: true,
},
],
async run($) {
const {
topic,
message,
title,
email,
click,
attach,
filename,
delay
} = $.step.parameters;
const { topic, message, title, email, click, attach, filename, delay } =
$.step.parameters;
const payload = {
topic,
message,
@@ -91,7 +85,7 @@ export default defineAction({
click,
attach,
filename,
delay
delay,
};
const response = await $.http.post('/', payload);