@sprintup-cms/sdk 1.9.3 → 1.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -285,23 +285,28 @@ function createCMSClient(options) {
285
285
  }
286
286
  async function getGlobals() {
287
287
  const { baseUrl, appId } = cfg();
288
- if (!baseUrl || !appId) return { navigation: null, footer: null, navItems: [] };
288
+ const empty = { navigation: null, footer: null, navItems: [], logoUrl: "", logoAlt: "", logoShape: "rectangle" };
289
+ if (!baseUrl || !appId) return empty;
289
290
  try {
290
291
  const res = await fetch(`${baseUrl}/api/v1/${appId}/globals`, {
291
292
  headers: headers(),
292
293
  next: { revalidate: 60, tags: [`cms-globals-${appId}`] }
293
294
  });
294
- if (!res.ok) return { navigation: null, footer: null, navItems: [] };
295
+ if (!res.ok) return empty;
295
296
  const json = await res.json();
296
297
  const navigation = json.data?.navigation ?? null;
297
- const rawItems = navigation?.blocks?.[0]?.content?.items ?? navigation?.blocks?.[0]?.data?.items ?? [];
298
+ const sd = navigation?.sectionData ?? {};
299
+ const rawItems = sd.items ?? navigation?.blocks?.[0]?.content?.items ?? [];
298
300
  return {
299
301
  navigation,
300
302
  footer: json.data?.footer ?? null,
301
- navItems: resolveNavItems(rawItems)
303
+ navItems: resolveNavItems(rawItems),
304
+ logoUrl: sd.logo_url ?? "",
305
+ logoAlt: sd.logo_alt ?? "",
306
+ logoShape: sd.logo_shape ?? "rectangle"
302
307
  };
303
308
  } catch {
304
- return { navigation: null, footer: null, navItems: [] };
309
+ return empty;
305
310
  }
306
311
  }
307
312
  return {