Last round of prettier: npx prettier --write src/

This commit is contained in:
Scott Idem
2026-03-24 13:27:40 -04:00
parent 23d25bf65a
commit a8f3c29b9f
146 changed files with 13201 additions and 9277 deletions

View File

@@ -36,7 +36,9 @@ export async function load_ae_obj_id__archive({
log_lvl?: number;
}): Promise<ae_Archive | null> {
if (log_lvl) {
console.log(`*** load_ae_obj_id__archive() *** archive_id=${archive_id}`);
console.log(
`*** load_ae_obj_id__archive() *** archive_id=${archive_id}`
);
}
ae_promises.load__archive_obj = await api
@@ -52,10 +54,11 @@ export async function load_ae_obj_id__archive({
.then(async function (archive_obj_get_result) {
if (archive_obj_get_result) {
if (try_cache) {
const processed_obj_li = await process_ae_obj__archive_props({
obj_li: [archive_obj_get_result],
log_lvl: log_lvl
});
const processed_obj_li =
await process_ae_obj__archive_props({
obj_li: [archive_obj_get_result],
log_lvl: log_lvl
});
await db_save_ae_obj_li__ae_obj({
db_instance: db_archives,
table_name: 'archive',
@@ -76,19 +79,21 @@ export async function load_ae_obj_id__archive({
if (inc_content_li && ae_promises.load__archive_obj) {
// Load the contents for the archive
const load_archive_content_obj_li = await load_ae_obj_li__archive_content({
api_cfg: api_cfg,
for_obj_type: 'archive',
for_obj_id: archive_id,
enabled: enabled,
hidden: hidden,
limit: limit,
offset: offset,
params: params,
try_cache: try_cache,
log_lvl: log_lvl
});
ae_promises.load__archive_obj.archive_content_li = load_archive_content_obj_li;
const load_archive_content_obj_li =
await load_ae_obj_li__archive_content({
api_cfg: api_cfg,
for_obj_type: 'archive',
for_obj_id: archive_id,
enabled: enabled,
hidden: hidden,
limit: limit,
offset: offset,
params: params,
try_cache: try_cache,
log_lvl: log_lvl
});
ae_promises.load__archive_obj.archive_content_li =
load_archive_content_obj_li;
}
return ae_promises.load__archive_obj;
@@ -125,7 +130,9 @@ export async function load_ae_obj_li__archive({
view?: string;
limit?: number;
offset?: number;
order_by_li?: Record<string, 'ASC' | 'DESC'> | Record<string, 'ASC' | 'DESC'>[];
order_by_li?:
| Record<string, 'ASC' | 'DESC'>
| Record<string, 'ASC' | 'DESC'>[];
params?: key_val;
try_cache?: boolean;
log_lvl?: number;
@@ -138,7 +145,9 @@ export async function load_ae_obj_li__archive({
// DEBUG: Trace massive content loads
if (inc_content_li) {
console.warn(`load_ae_obj_li__archive: Loading content for ALL archives in list! Limit: ${limit}`);
console.warn(
`load_ae_obj_li__archive: Loading content for ALL archives in list! Limit: ${limit}`
);
// console.trace();
}
@@ -159,10 +168,11 @@ export async function load_ae_obj_li__archive({
.then(async function (archive_obj_li_get_result) {
if (archive_obj_li_get_result) {
if (try_cache) {
const processed_obj_li = await process_ae_obj__archive_props({
obj_li: archive_obj_li_get_result,
log_lvl: log_lvl
});
const processed_obj_li =
await process_ae_obj__archive_props({
obj_li: archive_obj_li_get_result,
log_lvl: log_lvl
});
await db_save_ae_obj_li__ae_obj({
db_instance: db_archives,
table_name: 'archive',
@@ -220,7 +230,9 @@ export async function create_ae_obj__archive({
log_lvl?: number;
}): Promise<ae_Archive | null> {
if (log_lvl) {
console.log(`*** create_ae_obj__archive() *** account_id=${account_id}`);
console.log(
`*** create_ae_obj__archive() *** account_id=${account_id}`
);
}
const result = await api.create_ae_obj({
@@ -268,7 +280,9 @@ export async function delete_ae_obj_id__archive({
log_lvl?: number;
}) {
if (log_lvl) {
console.log(`*** delete_ae_obj_id__archive() *** archive_id=${archive_id}`);
console.log(
`*** delete_ae_obj_id__archive() *** archive_id=${archive_id}`
);
}
const result = await api.delete_ae_obj({
@@ -304,7 +318,10 @@ export async function update_ae_obj__archive({
log_lvl?: number;
}): Promise<ae_Archive | null> {
if (log_lvl) {
console.log(`*** update_ae_obj__archive() *** archive_id=${archive_id}`, data_kv);
console.log(
`*** update_ae_obj__archive() *** archive_id=${archive_id}`,
data_kv
);
}
const result = await api.update_ae_obj({
@@ -366,7 +383,11 @@ export async function qry__archive({
const search_query: any = { and: [] };
if (account_id) {
search_query.and.push({ field: 'account_id_random', op: 'eq', value: account_id });
search_query.and.push({
field: 'account_id_random',
op: 'eq',
value: account_id
});
}
if (qry_str) {
@@ -452,11 +473,15 @@ async function _process_generic_props<T extends Record<string, any>>({
const updated = processed_obj.updated_on ?? processed_obj.created_on;
const name = processed_obj.name ?? '';
(processed_obj as any).tmp_sort_1 = `${group}_${priority}_${sort}_${updated}`;
(processed_obj as any).tmp_sort_2 = `${group}_${priority}_${sort}_${name}_${updated}`;
(processed_obj as any).tmp_sort_1 =
`${group}_${priority}_${sort}_${updated}`;
(processed_obj as any).tmp_sort_2 =
`${group}_${priority}_${sort}_${name}_${updated}`;
if (specific_processor) {
processed_obj = await Promise.resolve(specific_processor(processed_obj));
processed_obj = await Promise.resolve(
specific_processor(processed_obj)
);
}
processed_obj_li.push(processed_obj as T);
@@ -489,4 +514,4 @@ export async function process_ae_obj__archive_props({
return obj;
}
});
}
}

View File

@@ -41,10 +41,11 @@ export async function load_ae_obj_id__archive_content({
.then(async function (archive_content_obj_get_result) {
if (archive_content_obj_get_result) {
if (try_cache) {
const processed_obj_li = await process_ae_obj__archive_content_props({
obj_li: [archive_content_obj_get_result],
log_lvl: log_lvl
});
const processed_obj_li =
await process_ae_obj__archive_content_props({
obj_li: [archive_content_obj_get_result],
log_lvl: log_lvl
});
await db_save_ae_obj_li__ae_obj({
db_instance: db_archives,
table_name: 'content',
@@ -96,7 +97,9 @@ export async function load_ae_obj_li__archive_content({
view?: string;
limit?: number;
offset?: number;
order_by_li?: Record<string, 'ASC' | 'DESC'> | Record<string, 'ASC' | 'DESC'>[];
order_by_li?:
| Record<string, 'ASC' | 'DESC'>
| Record<string, 'ASC' | 'DESC'>[];
params?: key_val;
try_cache?: boolean;
log_lvl?: number;
@@ -124,10 +127,11 @@ export async function load_ae_obj_li__archive_content({
.then(async function (archive_content_obj_li_get_result) {
if (archive_content_obj_li_get_result) {
if (try_cache) {
const processed_obj_li = await process_ae_obj__archive_content_props({
obj_li: archive_content_obj_li_get_result,
log_lvl: log_lvl
});
const processed_obj_li =
await process_ae_obj__archive_content_props({
obj_li: archive_content_obj_li_get_result,
log_lvl: log_lvl
});
await db_save_ae_obj_li__ae_obj({
db_instance: db_archives,
table_name: 'content',
@@ -162,11 +166,15 @@ export async function create_ae_obj__archive_content({
log_lvl?: number;
}): Promise<ae_ArchiveContent | null> {
if (log_lvl) {
console.log(`*** create_ae_obj__archive_content() *** archive_id=${archive_id}`);
console.log(
`*** create_ae_obj__archive_content() *** archive_id=${archive_id}`
);
}
if (!archive_id) {
console.log(`ERROR: Archives - Content - archive_id required to create`);
console.log(
`ERROR: Archives - Content - archive_id required to create`
);
return null;
}
@@ -357,11 +365,15 @@ async function _process_generic_props<T extends Record<string, any>>({
const updated = processed_obj.updated_on ?? processed_obj.created_on;
const name = processed_obj.name ?? '';
(processed_obj as any).tmp_sort_1 = `${group}_${priority}_${sort}_${updated}`;
(processed_obj as any).tmp_sort_2 = `${group}_${priority}_${sort}_${name}_${updated}`;
(processed_obj as any).tmp_sort_1 =
`${group}_${priority}_${sort}_${updated}`;
(processed_obj as any).tmp_sort_2 =
`${group}_${priority}_${sort}_${name}_${updated}`;
if (specific_processor) {
processed_obj = await Promise.resolve(specific_processor(processed_obj));
processed_obj = await Promise.resolve(
specific_processor(processed_obj)
);
}
processed_obj_li.push(processed_obj as T);
@@ -399,4 +411,4 @@ export async function process_ae_obj__archive_content_props({
return obj;
}
});
}
}