Implemented Aether API V3 Lookup integration for standardized tables.

- Created 'src/lib/ae_api/api_get__lookup_v3.ts' to handle the new '/v3/lookup/{lu_type}/list' endpoint.
- Refactored 'get_ae_obj_li_for_lu' in 'api.ts' to prioritize the V3 system for countries, subdivisions, and time zones, with V2 fallback for legacy types.
- Ensured lookups use the 'x-no-account-id' bypass for unauthenticated site bootstrapping.
- Updated core country, subdivision, and time zone loaders to use the refined API interface.
This commit is contained in:
Scott Idem
2026-02-20 16:12:06 -05:00
parent b4d85f4618
commit 52c9e765a0
5 changed files with 84 additions and 33 deletions

View File

@@ -12,6 +12,7 @@ import { post_object } from '$lib/ae_api/api_post_object'; // Exported at the en
import { get_ae_obj_id_crud } from '$lib/ae_api/api_get__crud_obj_id';
import { get_ae_obj_li_for_obj_id_crud } from '$lib/ae_api/api_get__crud_obj_li_v1';
import { get_ae_obj_li_for_obj_id_crud_v2 } from '$lib/ae_api/api_get__crud_obj_li_v2';
import { get_ae_lookup_li_v3 } from '$lib/ae_api/api_get__lookup_v3';
import {
get_ae_obj_v3,
get_nested_ae_obj_v3,
@@ -31,9 +32,9 @@ import {
import { get_data_store_v3 } from '$lib/ae_api/api_get__data_store_v3';
/**
* Get a list of lookup objects (V2 Legacy)
* Get a list of lookup objects (V3 with V2 Fallback)
* Standardized lookup data like countries, timezones, and subdivisions.
* Updated 2026-01-20
* Updated 2026-02-20
*/
export const get_ae_obj_li_for_lu = async function get_ae_obj_li_for_lu({
api_cfg,
@@ -41,7 +42,7 @@ export const get_ae_obj_li_for_lu = async function get_ae_obj_li_for_lu({
enabled = 'enabled',
hidden = 'not_hidden',
order_by_li = null,
limit = 999999,
limit = 9999,
offset = 0,
headers = {},
params_json = null,
@@ -66,11 +67,23 @@ export const get_ae_obj_li_for_lu = async function get_ae_obj_li_for_lu({
// Lookup data is global; bypass account-id scope check
const merged_headers = {
...headers,
'x-no-account-id': 'Nothing to See Here'
'x-no-account-id': 'Nothing to See Here',
...headers
};
// Delegate to V2 helper which handles the /v2 prefix and /list suffix correctly
// Use V3 system for primary lookup types
if (['country', 'country_subdivision', 'time_zone'].includes(for_lu_type)) {
return await get_ae_lookup_li_v3({
api_cfg,
lu_type: for_lu_type,
include_disabled: enabled === 'all',
params,
headers: merged_headers,
log_lvl
});
}
// Delegate to V2 helper for any other legacy lookup types
return await get_ae_obj_li_for_obj_id_crud_v2({
api_cfg,
obj_type: 'lu',