feat: Convert all app files to JS
This commit is contained in:
@@ -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,
|
||||
};
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
@@ -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;
|
||||
};
|
Reference in New Issue
Block a user