General code clean up

This commit is contained in:
Scott Idem
2024-06-24 14:42:14 -04:00
parent 31ba1c9200
commit 0c4185f74c
16 changed files with 56 additions and 44 deletions

View File

@@ -20,7 +20,7 @@ async function handle_load_ae_obj_id__site_domain(
try_cache=false, try_cache=false,
timeout=7000, timeout=7000,
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
fqdn: string, fqdn: string,
try_cache: boolean, try_cache: boolean,
@@ -236,7 +236,7 @@ async function handle_load_ae_obj_li__person(
params={}, params={},
try_cache=true, try_cache=true,
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
account_id: string, account_id: string,
params?: key_val, params?: key_val,
@@ -366,7 +366,7 @@ async function handle_download_export__obj_type(
limit=5000, limit=5000,
params={}, // key value object is expected params={}, // key value object is expected
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
get_obj_type: string, get_obj_type: string,
for_obj_type: string, for_obj_type: string,

View File

@@ -13,7 +13,7 @@ export async function handle_load_ae_obj_id__event(
event_id, event_id,
try_cache=false, try_cache=false,
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
event_id: string, event_id: string,
try_cache?: boolean, try_cache?: boolean,
@@ -58,7 +58,7 @@ export async function handle_load_ae_obj_li__event(
params={}, params={},
try_cache=true, try_cache=true,
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
account_id: string, account_id: string,
params?: key_val, params?: key_val,
@@ -114,11 +114,19 @@ export async function handle_load_ae_obj_li__event(
// This function will loop through the event_obj_li and save each one to the DB. // This function will loop through the event_obj_li and save each one to the DB.
export function handle_db_save_ae_obj_li__event({obj_type, obj_li}) { export function handle_db_save_ae_obj_li__event(
{
obj_type,
obj_li
}: {
obj_type: string,
obj_li: any
}
) {
console.log(`*** handle_db_save_ae_obj_li__event() ***`); console.log(`*** handle_db_save_ae_obj_li__event() ***`);
if (obj_li && obj_li.length) { if (obj_li && obj_li.length) {
obj_li.forEach(async function (obj) { obj_li.forEach(async function (obj: any) {
// console.log(`ae_obj ${obj_type}:`, obj); // console.log(`ae_obj ${obj_type}:`, obj);
try { try {

View File

@@ -13,7 +13,7 @@ export async function handle_load_ae_obj_id__badge(
badge_id, badge_id,
try_cache=false, try_cache=false,
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
badge_id: string, badge_id: string,
try_cache?: boolean, try_cache?: boolean,
@@ -271,7 +271,7 @@ export function handle_db_save_ae_obj_li__badge(
{ {
obj_type, obj_type,
obj_li obj_li
} : { }: {
obj_type: string, obj_type: string,
obj_li: any obj_li: any
} }

View File

@@ -13,7 +13,7 @@ export async function handle_load_ae_obj_id__event_file(
event_file_id, event_file_id,
try_cache=false, try_cache=false,
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
event_file_id: string, event_file_id: string,
try_cache?: boolean, try_cache?: boolean,
@@ -59,7 +59,7 @@ export async function handle_load_ae_obj_li__event_file(
params={}, params={},
try_cache=true, try_cache=true,
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
event_session_id: string, event_session_id: string,
params?: key_val, params?: key_val,
@@ -119,7 +119,7 @@ export async function handle_delete_ae_obj_id__event_file(
event_file_id, event_file_id,
params={}, params={},
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
event_file_id: string, event_file_id: string,
params?: key_val, params?: key_val,
@@ -158,7 +158,7 @@ export async function create_event_file_obj_from_hosted_file_async(
inc_hosted_file=false, inc_hosted_file=false,
return_meta=false, return_meta=false,
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
hosted_file_id: string, hosted_file_id: string,
params?: key_val, params?: key_val,
@@ -214,7 +214,7 @@ export function handle_db_save_ae_obj_li__event_file(
{ {
obj_type, obj_type,
obj_li obj_li
} : { }: {
obj_type: string, obj_type: string,
obj_li: any obj_li: any
} }

View File

@@ -13,7 +13,7 @@ export async function handle_load_ae_obj_id__event_presentation(
event_presentation_id, event_presentation_id,
try_cache=false, try_cache=false,
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
event_presentation_id: string, event_presentation_id: string,
try_cache?: boolean, try_cache?: boolean,
@@ -59,7 +59,7 @@ export async function handle_load_ae_obj_li__event_presentation(
params={}, params={},
try_cache=true, try_cache=true,
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
event_session_id: string, event_session_id: string,
params?: key_val, params?: key_val,
@@ -117,7 +117,7 @@ export function handle_db_save_ae_obj_li__event_presentation(
{ {
obj_type, obj_type,
obj_li obj_li
} : { }: {
obj_type: string, obj_type: string,
obj_li: any obj_li: any
} }

View File

@@ -13,7 +13,7 @@ export async function handle_load_ae_obj_id__event_presenter(
event_presenter_id, event_presenter_id,
try_cache=false, try_cache=false,
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
event_presenter_id: string, event_presenter_id: string,
try_cache?: boolean, try_cache?: boolean,
@@ -59,7 +59,7 @@ export async function handle_load_ae_obj_li__event_presenter(
params={}, params={},
try_cache=true, try_cache=true,
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
event_presentation_id: string, event_presentation_id: string,
params?: key_val, params?: key_val,
@@ -119,7 +119,7 @@ export async function handle_update_ae_obj__event_presenter(
data, data,
params={}, params={},
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
event_presenter_id: string, event_presenter_id: string,
data: any, data: any,
@@ -163,7 +163,7 @@ export function handle_db_save_ae_obj_li__event_presenter(
{ {
obj_type, obj_type,
obj_li obj_li
} : { }: {
obj_type: string, obj_type: string,
obj_li: any obj_li: any
} }

View File

@@ -13,7 +13,7 @@ export async function handle_load_ae_obj_id__event_session(
event_session_id, event_session_id,
try_cache=false, try_cache=false,
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
event_session_id: string, event_session_id: string,
try_cache?: boolean, try_cache?: boolean,
@@ -60,7 +60,7 @@ export async function handle_load_ae_obj_li__event_session(
params={}, params={},
try_cache=true, try_cache=true,
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
event_id: string, event_id: string,
params?: key_val, params?: key_val,
@@ -235,7 +235,7 @@ export function handle_db_save_ae_obj_li__event_session(
{ {
obj_type, obj_type,
obj_li obj_li
} : { }: {
obj_type: string, obj_type: string,
obj_li: any obj_li: any
} }

View File

@@ -13,7 +13,7 @@ export async function handle_load_ae_obj_id__exhibit(
exhibit_id, exhibit_id,
try_cache=false, try_cache=false,
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
exhibit_id: string, exhibit_id: string,
try_cache?: boolean, try_cache?: boolean,
@@ -60,7 +60,7 @@ export async function handle_load_ae_obj_li__exhibit(
params={}, params={},
try_cache=true, try_cache=true,
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
event_id: any, event_id: any,
params: any, params: any,
@@ -199,7 +199,7 @@ export async function handle_load_ae_obj_id__exhibit_tracking(
exhibit_tracking_id, exhibit_tracking_id,
try_cache=false, try_cache=false,
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
exhibit_tracking_id: string, exhibit_tracking_id: string,
try_cache?: boolean, try_cache?: boolean,
@@ -246,7 +246,7 @@ export async function handle_load_ae_obj_li__exhibit_tracking(
params={}, params={},
try_cache=true, try_cache=true,
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
exhibit_id: any, exhibit_id: any,
params: any, params: any,
@@ -313,7 +313,7 @@ export async function handle_create_ae_obj__exhibit_tracking(
external_person_id, external_person_id,
params={}, params={},
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
exhibit_id: string, exhibit_id: string,
event_badge_id: string, event_badge_id: string,
@@ -373,7 +373,7 @@ export async function handle_update_ae_obj__exhibit_tracking(
data, data,
params={}, params={},
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
exhibit_tracking_id: string, exhibit_tracking_id: string,
data: any, data: any,
@@ -422,7 +422,7 @@ export async function handle_download_export__event_exhibit_tracking(
auto_download=false, auto_download=false,
params={}, params={},
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
exhibit_id: string, exhibit_id: string,
file_type?: string, file_type?: string,
@@ -513,7 +513,7 @@ export function handle_db_save_ae_obj_li__exhibitor_tracking(
{ {
obj_type, obj_type,
obj_li obj_li
} : { }: {
obj_type: string, obj_type: string,
obj_li: any obj_li: any
} }

View File

@@ -1,6 +1,10 @@
// This file is used to export all the functions that are used for Aether Events related functions. // This file is used to export all the functions that are used for Aether Events related functions.
import { handle_load_ae_obj_id__event, handle_load_ae_obj_li__event, handle_db_save_ae_obj_li__event } from "$lib/ae_events__event"; import {
handle_load_ae_obj_id__event,
handle_load_ae_obj_li__event,
handle_db_save_ae_obj_li__event
} from "$lib/ae_events__event";
import { import {
handle_load_ae_obj_id__event_file, handle_load_ae_obj_id__event_file,

View File

@@ -19,7 +19,7 @@ async function handle_load_ae_obj_id__sponsorship_cfg(
sponsorship_cfg_id, sponsorship_cfg_id,
try_cache=false, try_cache=false,
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
sponsorship_cfg_id: string, sponsorship_cfg_id: string,
try_cache: boolean, try_cache: boolean,
@@ -76,7 +76,7 @@ async function handle_download_export__sponsorship(
auto_download=false, auto_download=false,
params={}, // key value object is expected params={}, // key value object is expected
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
account_id: string, account_id: string,
file_type?: string, file_type?: string,

View File

@@ -669,7 +669,7 @@ export let shorten_string = function shorten_string(
begin_length=15, begin_length=15,
end_length=5, end_length=5,
wildcard_length=3 wildcard_length=3
} : { }: {
string: string, string: string,
max_length?: number, max_length?: number,
begin_length?: number, begin_length?: number,
@@ -726,7 +726,7 @@ function shorten_filename(
max_length=20, max_length=20,
slice_end_at=15, slice_end_at=15,
max_end_length=5 max_end_length=5
} : { }: {
filename: string, filename: string,
max_length?: number, max_length?: number,
slice_end_at?: number, slice_end_at?: number,

View File

@@ -31,7 +31,7 @@ export let get_ae_obj_id_crud = async function get_ae_obj_id_crud(
timeout=25000, timeout=25000,
return_meta=false, return_meta=false,
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
no_account_id?: boolean, no_account_id?: boolean,
obj_type: string, obj_type: string,
@@ -203,7 +203,7 @@ export let get_ae_obj_li_for_obj_id_crud = async function get_ae_obj_li_for_obj_
params={}, params={},
return_meta=false, return_meta=false,
log_lvl=1 log_lvl=1
} : { }: {
api_cfg: any, api_cfg: any,
obj_type: string, obj_type: string,
for_obj_type: string, for_obj_type: string,
@@ -567,7 +567,7 @@ export let update_ae_obj_id_crud = async function update_ae_obj_id_crud(
obj_v_name='', obj_v_name='',
return_meta=false, return_meta=false,
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
obj_type: string, obj_type: string,
obj_id: string, obj_id: string,

View File

@@ -75,7 +75,7 @@ export let get_object = async function get_object(
// The task_id value should be a random string that is unique to the task. This is used to identify the task in the message event. // The task_id value should be a random string that is unique to the task. This is used to identify the task in the message event.
task_id='get_object_x', task_id='get_object_x',
log_lvl=0 log_lvl=0
// } : { // }: {
// api_cfg: any, // api_cfg: any,
// endpoint: string, // endpoint: string,
// headers?: any, // headers?: any,

View File

@@ -27,7 +27,7 @@ export let get_object = async function get_object(
// The task_id value should be a random string that is unique to the task. This is used to identify the task in the message event. // The task_id value should be a random string that is unique to the task. This is used to identify the task in the message event.
task_id=crypto.randomUUID(), task_id=crypto.randomUUID(),
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
endpoint: string, endpoint: string,
headers?: any, headers?: any,

View File

@@ -9,7 +9,7 @@ export let patch_object = async function patch_object(
data={}, data={},
return_meta=false, return_meta=false,
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
endpoint: string, endpoint: string,
params?: any, params?: any,

View File

@@ -20,7 +20,7 @@ export let post_object = async function post_object(
// The task_id value should be a random string that is unique to the task. This is used to identify the task in the message event. // The task_id value should be a random string that is unique to the task. This is used to identify the task in the message event.
task_id=crypto.randomUUID(), task_id=crypto.randomUUID(),
log_lvl=0 log_lvl=0
} : { }: {
api_cfg: any, api_cfg: any,
endpoint: string, endpoint: string,
params?: any, params?: any,