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,6 +1,4 @@
import { TBeforeRequest } from '@automatisch/types';
const addAuthHeader: TBeforeRequest = ($, requestConfig) => {
const addAuthHeader = ($, requestConfig) => {
if (
requestConfig.headers &&
$.auth.data?.accountSid &&
@@ -9,8 +7,8 @@ const addAuthHeader: TBeforeRequest = ($, requestConfig) => {
requestConfig.headers['Content-Type'] = 'application/x-www-form-urlencoded';
requestConfig.auth = {
username: $.auth.data.accountSid as string,
password: $.auth.data.authToken as string,
username: $.auth.data.accountSid,
password: $.auth.data.authToken,
};
}

View File

@@ -0,0 +1,7 @@
export default async function getIncomingPhoneNumber($) {
const phoneNumberSid = $.step.parameters.phoneNumberSid;
const path = `/2010-04-01/Accounts/${$.auth.data.accountSid}/IncomingPhoneNumbers/${phoneNumberSid}.json`;
const response = await $.http.get(path);
return response.data;
}

View File

@@ -1,14 +0,0 @@
import { IGlobalVariable } from "@automatisch/types";
type Response = {
sid: string;
phone_number: string;
};
export default async function getIncomingPhoneNumber($: IGlobalVariable) {
const phoneNumberSid = $.step.parameters.phoneNumberSid as string;
const path = `/2010-04-01/Accounts/${$.auth.data.accountSid}/IncomingPhoneNumbers/${phoneNumberSid}.json`;
const response = await $.http.get<Response>(path);
return response.data;
};