This is a mostly working state again. Some files were backed up to ~/tmp/Aether_UI_UX_app. Things are slowly being merged back in. Not easy.
This commit is contained in:
48
src/lib/ae_api/api_get__data_store_v3.ts
Normal file
48
src/lib/ae_api/api_get__data_store_v3.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import type { key_val } from '$lib/stores/ae_stores';
|
||||
import { get_object } from './api_get_object';
|
||||
|
||||
interface GetDataStoreV3Params {
|
||||
api_cfg: any;
|
||||
code: string;
|
||||
for_type?: string | null;
|
||||
for_id?: string | null;
|
||||
no_account_id?: boolean;
|
||||
log_lvl?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a Data Store object by its human-friendly code (V3)
|
||||
* Uses hierarchical fallback logic (Specific -> Account -> Global)
|
||||
* Path: GET /v3/data_store/code/{code}
|
||||
*/
|
||||
export async function get_data_store_v3({
|
||||
api_cfg,
|
||||
code,
|
||||
for_type = null,
|
||||
for_id = null,
|
||||
no_account_id = false,
|
||||
log_lvl = 0
|
||||
}: GetDataStoreV3Params): Promise<any> {
|
||||
if (log_lvl) {
|
||||
console.log(`*** get_data_store_v3() *** code=${code} no_account_id=${no_account_id}`);
|
||||
}
|
||||
|
||||
const endpoint = `/v3/data_store/code/${code}`;
|
||||
const params: key_val = {};
|
||||
if (for_type) params['for_type'] = for_type;
|
||||
if (for_id) params['for_id'] = for_id;
|
||||
|
||||
const headers: key_val = {};
|
||||
if (no_account_id) {
|
||||
// This token allows bypassing the mandatory account_id requirement for global defaults
|
||||
headers['x-no-account-id-token'] = 'Nothing to See Here';
|
||||
}
|
||||
|
||||
return await get_object({
|
||||
api_cfg,
|
||||
endpoint,
|
||||
params,
|
||||
headers,
|
||||
log_lvl
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user