Migrate Content and Storage modules to unified type system
- Added ae_HostedFile, ae_HostedFileLink, ae_DataStore, ae_Post, ae_PostComment, ae_Page, ae_Archive, and ae_ArchiveContent to ae_types.ts. - Replaced local interfaces in core__hosted_files.ts and core__data_store.ts with unified imports. - Replaced local interfaces in ae_archives/*.ts with unified imports. - Standardized Promise return types for all core data loading, creation, search, and update functions across migrated modules. - Synchronized storage and archival modules with Backend V3 field naming and Triple-ID patterns.
This commit is contained in:
@@ -1,26 +1,7 @@
|
||||
import { browser } from '$app/environment';
|
||||
import type { key_val } from '$lib/stores/ae_stores';
|
||||
import { api } from '$lib/api/api';
|
||||
|
||||
export interface Data_Store {
|
||||
id: string;
|
||||
account_id: string;
|
||||
code: string;
|
||||
name: string;
|
||||
type: string;
|
||||
for_type?: string | null;
|
||||
for_id?: string | null;
|
||||
access_read?: string | null;
|
||||
access_write?: string | null;
|
||||
access_delete?: string | null;
|
||||
html?: string | null;
|
||||
json?: key_val | null;
|
||||
md?: string | null;
|
||||
text?: string | null;
|
||||
updated_on?: string | null;
|
||||
chk_account_id?: string;
|
||||
loaded_on?: string;
|
||||
}
|
||||
import type { ae_DataStore } from '$lib/types/ae_types';
|
||||
|
||||
/**
|
||||
* Fetches a data_store object by its unique code.
|
||||
|
||||
@@ -2,6 +2,7 @@ import type { key_val } from '$lib/stores/ae_stores';
|
||||
import { api } from '$lib/api/api';
|
||||
|
||||
import { db_core } from '$lib/ae_core/db_core';
|
||||
import type { ae_HostedFile } from '$lib/types/ae_types';
|
||||
|
||||
const ae_promises: key_val = {};
|
||||
|
||||
@@ -16,7 +17,7 @@ export async function load_ae_obj_id__hosted_file({
|
||||
hosted_file_id: string;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_HostedFile | null> {
|
||||
if (log_lvl) {
|
||||
console.log(`*** load_ae_obj_id__hosted_file() *** hosted_file_id=${hosted_file_id}`);
|
||||
}
|
||||
@@ -78,7 +79,7 @@ export async function load_ae_obj_li__hosted_file({
|
||||
params?: key_val;
|
||||
try_cache?: boolean;
|
||||
log_lvl?: number;
|
||||
}) {
|
||||
}): Promise<ae_HostedFile[]> {
|
||||
if (log_lvl) {
|
||||
console.log(
|
||||
`*** load_ae_obj_li__hosted_file() *** for_obj_type=${for_obj_type} for_obj_id=${for_obj_id}`
|
||||
|
||||
Reference in New Issue
Block a user