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,9 +1,8 @@
import { IField, IGlobalVariable } from '@automatisch/types';
import { URLSearchParams } from 'url';
export default async function generateAuthUrl($: IGlobalVariable) {
export default async function generateAuthUrl($) {
const oauthRedirectUrlField = $.app.auth.fields.find(
(field: IField) => field.key == 'oAuthRedirectUrl'
(field) => field.key == 'oAuthRedirectUrl'
);
const callbackUrl = oauthRedirectUrlField.value;

View File

@@ -1,13 +1,13 @@
import generateAuthUrl from './generate-auth-url';
import verifyCredentials from './verify-credentials';
import isStillVerified from './is-still-verified';
import generateAuthUrl from './generate-auth-url.js';
import verifyCredentials from './verify-credentials.js';
import isStillVerified from './is-still-verified.js';
export default {
fields: [
{
key: 'oAuthRedirectUrl',
label: 'OAuth Redirect URL',
type: 'string' as const,
type: 'string',
required: true,
readOnly: true,
value: '{WEB_APP_URL}/app/flickr/connections/add',
@@ -20,7 +20,7 @@ export default {
{
key: 'consumerKey',
label: 'Consumer Key',
type: 'string' as const,
type: 'string',
required: true,
readOnly: false,
value: null,
@@ -32,7 +32,7 @@ export default {
{
key: 'consumerSecret',
label: 'Consumer Secret',
type: 'string' as const,
type: 'string',
required: true,
readOnly: false,
value: null,

View File

@@ -1,6 +1,4 @@
import { IGlobalVariable } from '@automatisch/types';
const isStillVerified = async ($: IGlobalVariable) => {
const isStillVerified = async ($) => {
const params = {
method: 'flickr.test.login',
format: 'json',

View File

@@ -1,7 +1,6 @@
import { IGlobalVariable } from '@automatisch/types';
import { URLSearchParams } from 'url';
const verifyCredentials = async ($: IGlobalVariable) => {
const verifyCredentials = async ($) => {
const response = await $.http.post(
`/oauth/access_token?oauth_verifier=${$.auth.data.oauth_verifier}&oauth_token=${$.auth.data.accessToken}`,
null