fix: Eslint offenses for backend package

This commit is contained in:
Faruk AYDIN
2024-01-04 12:32:07 +01:00
parent 2ad23ff2e3
commit ea81697b5f
4 changed files with 12 additions and 18 deletions

View File

@@ -1,4 +1,3 @@
import qs from 'qs';
import defineAction from '../../../../helpers/define-action'; import defineAction from '../../../../helpers/define-action';
export default defineAction({ export default defineAction({
@@ -19,7 +18,8 @@ export default defineAction({
key: 'message', key: 'message',
type: 'string' as const, type: 'string' as const,
required: true, 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, variables: true,
}, },
{ {
@@ -67,22 +67,15 @@ export default defineAction({
key: 'delay', key: 'delay',
type: 'string' as const, type: 'string' as const,
required: false, 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, variables: true,
}, },
], ],
async run($) { async run($) {
const { const { topic, message, title, email, click, attach, filename, delay } =
topic, $.step.parameters;
message,
title,
email,
click,
attach,
filename,
delay
} = $.step.parameters;
const payload = { const payload = {
topic, topic,
message, message,
@@ -91,7 +84,7 @@ export default defineAction({
click, click,
attach, attach,
filename, filename,
delay delay,
}; };
const response = await $.http.post('/', payload); const response = await $.http.post('/', payload);

View File

@@ -1,4 +1,3 @@
import qs from 'qs';
import defineAction from '../../../../helpers/define-action'; import defineAction from '../../../../helpers/define-action';
export default defineAction({ export default defineAction({
@@ -11,7 +10,8 @@ export default defineAction({
key: 'chatId', key: 'chatId',
type: 'string' as const, type: 'string' as const,
required: true, required: true,
description: 'Unique identifier for the target chat or username of the target channel (in the format @channelusername).', description:
'Unique identifier for the target chat or username of the target channel (in the format @channelusername).',
variables: true, variables: true,
}, },
{ {
@@ -28,7 +28,8 @@ export default defineAction({
type: 'dropdown' as const, type: 'dropdown' as const,
required: false, required: false,
value: false, value: false,
description: 'Sends the message silently. Users will receive a notification with no sound.', description:
'Sends the message silently. Users will receive a notification with no sound.',
variables: true, variables: true,
options: [ options: [
{ {

View File

@@ -1,6 +1,7 @@
import logger from './logger'; import logger from './logger';
// Do not remove `next` argument as the function signature will not fit for an error handler middleware // Do not remove `next` argument as the function signature will not fit for an error handler middleware
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const errorHandler = (err, req, res, next) => { const errorHandler = (err, req, res, next) => {
if (err.message === 'Not Found') { if (err.message === 'Not Found') {
res.status(404).end(); res.status(404).end();

View File

@@ -1,7 +1,6 @@
import SamlAuthProvider from '../models/saml-auth-provider.ee'; import SamlAuthProvider from '../models/saml-auth-provider.ee';
import User from '../models/user'; import User from '../models/user';
import Identity from '../models/identity.ee'; import Identity from '../models/identity.ee';
import SamlAuthProvidersRoleMapping from '../models/saml-auth-providers-role-mapping.ee';
const getUser = ( const getUser = (
user: Record<string, unknown>, user: Record<string, unknown>,