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,3 +1,3 @@
import listIncomingPhoneNumbers from './list-incoming-phone-numbers';
import listIncomingPhoneNumbers from './list-incoming-phone-numbers/index.js';
export default [listIncomingPhoneNumbers];

View File

@@ -1,37 +1,16 @@
import { IGlobalVariable, IJSONObject } from '@automatisch/types';
type TResponse = {
data: IJSONObject[];
error?: IJSONObject;
};
type TIncomingPhoneNumber = {
phone_number: string;
friendly_name: string;
sid: string;
capabilities: {
sms: boolean;
};
};
type TResponseData = {
incoming_phone_numbers: TIncomingPhoneNumber[];
next_page_uri: string;
};
export default {
name: 'List incoming phone numbers',
key: 'listIncomingPhoneNumbers',
async run($: IGlobalVariable) {
const valueType = $.step.parameters.valueType as string;
async run($) {
const valueType = $.step.parameters.valueType;
const isSid = valueType === 'sid';
const aggregatedResponse: TResponse = { data: [] };
const aggregatedResponse = { data: [] };
let pathname = `/2010-04-01/Accounts/${$.auth.data.accountSid}/IncomingPhoneNumbers.json`;
do {
const response = await $.http.get<TResponseData>(pathname);
const response = (await $.http.get) < TResponseData > pathname;
for (const incomingPhoneNumber of response.data.incoming_phone_numbers) {
if (incomingPhoneNumber.capabilities.sms === false) {