feat: Convert all app files to JS
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
import sendAPushoverNotification from './send-a-pushover-notification';
|
||||
import sendAPushoverNotification from './send-a-pushover-notification/index.js';
|
||||
|
||||
export default [sendAPushoverNotification];
|
||||
@@ -1,5 +1,4 @@
|
||||
import { IJSONArray, IJSONObject } from '@automatisch/types';
|
||||
import defineAction from '../../../../helpers/define-action';
|
||||
import defineAction from '../../../../helpers/define-action.js';
|
||||
|
||||
export default defineAction({
|
||||
name: 'Send a Pushover Notification',
|
||||
@@ -10,7 +9,7 @@ export default defineAction({
|
||||
{
|
||||
label: 'Title',
|
||||
key: 'title',
|
||||
type: 'string' as const,
|
||||
type: 'string',
|
||||
required: false,
|
||||
description: 'An optional title displayed with the message.',
|
||||
variables: true,
|
||||
@@ -18,7 +17,7 @@ export default defineAction({
|
||||
{
|
||||
label: 'Message',
|
||||
key: 'message',
|
||||
type: 'string' as const,
|
||||
type: 'string',
|
||||
required: true,
|
||||
description: 'The main message text of your notification.',
|
||||
variables: true,
|
||||
@@ -26,7 +25,7 @@ export default defineAction({
|
||||
{
|
||||
label: 'Priority',
|
||||
key: 'priority',
|
||||
type: 'dropdown' as const,
|
||||
type: 'dropdown',
|
||||
required: false,
|
||||
description: '',
|
||||
variables: true,
|
||||
@@ -44,7 +43,7 @@ export default defineAction({
|
||||
{
|
||||
label: 'Sound',
|
||||
key: 'sound',
|
||||
type: 'dropdown' as const,
|
||||
type: 'dropdown',
|
||||
required: false,
|
||||
description: 'Optional sound to override your default.',
|
||||
variables: true,
|
||||
@@ -62,7 +61,7 @@ export default defineAction({
|
||||
{
|
||||
label: 'URL',
|
||||
key: 'url',
|
||||
type: 'string' as const,
|
||||
type: 'string',
|
||||
required: false,
|
||||
description: 'URL to display with message.',
|
||||
variables: true,
|
||||
@@ -70,7 +69,7 @@ export default defineAction({
|
||||
{
|
||||
label: 'URL Title',
|
||||
key: 'urlTitle',
|
||||
type: 'string' as const,
|
||||
type: 'string',
|
||||
required: false,
|
||||
description:
|
||||
'Title of URL to display, otherwise URL itself will be displayed.',
|
||||
@@ -79,14 +78,14 @@ export default defineAction({
|
||||
{
|
||||
label: 'Devices',
|
||||
key: 'devices',
|
||||
type: 'dynamic' as const,
|
||||
type: 'dynamic',
|
||||
required: false,
|
||||
description: '',
|
||||
fields: [
|
||||
{
|
||||
label: 'Device',
|
||||
key: 'device',
|
||||
type: 'dropdown' as const,
|
||||
type: 'dropdown',
|
||||
required: false,
|
||||
description:
|
||||
'Restrict sending to just these devices on your account.',
|
||||
@@ -110,10 +109,8 @@ export default defineAction({
|
||||
const { title, message, priority, sound, url, urlTitle } =
|
||||
$.step.parameters;
|
||||
|
||||
const devices = $.step.parameters.devices as IJSONArray;
|
||||
const allDevices = devices
|
||||
.map((device: IJSONObject) => device.device)
|
||||
.join(',');
|
||||
const devices = $.step.parameters.devices;
|
||||
const allDevices = devices.map((device) => device.device).join(',');
|
||||
|
||||
const payload = {
|
||||
token: $.auth.data.apiToken,
|
||||
Reference in New Issue
Block a user