@anker-in/shopify-sdk 1.2.0-beta.11 → 1.2.0-beta.13

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.
package/dist/index.mjs CHANGED
@@ -2527,21 +2527,12 @@ function normalizePage(page) {
2527
2527
  bodySummary: page.bodySummary,
2528
2528
  createdAt: page.createdAt,
2529
2529
  updatedAt: page.updatedAt,
2530
- seo: page.seo,
2531
- metafields: normalizeMetafields3(page.metafields)
2530
+ seo: page.seo ? {
2531
+ ...page.seo
2532
+ } : void 0,
2533
+ metafields: normalizeMetafields(page.metafields)
2532
2534
  };
2533
2535
  }
2534
- function normalizeMetafields3(metafields) {
2535
- if (!metafields || metafields.length === 0) {
2536
- return void 0;
2537
- }
2538
- return metafields.reduce((acc, metafield) => {
2539
- if (metafield && metafield.key) {
2540
- acc[metafield.key] = metafield.value;
2541
- }
2542
- return acc;
2543
- }, {});
2544
- }
2545
2536
 
2546
2537
  // src/api/page/get-page.ts
2547
2538
  async function getPage(client, options) {
@@ -2578,29 +2569,12 @@ async function getPage(client, options) {
2578
2569
  function normalizeShop(shop) {
2579
2570
  return {
2580
2571
  name: shop.name,
2581
- description: shop.description,
2572
+ description: shop.description || "",
2582
2573
  primaryDomain: shop.primaryDomain,
2583
- brand: shop.brand ? {
2584
- logo: shop.brand.logo,
2585
- colors: shop.brand.colors ? {
2586
- primary: shop.brand.colors.primary?.background,
2587
- secondary: shop.brand.colors.secondary?.background
2588
- } : void 0
2589
- } : void 0,
2590
- metafields: normalizeMetafields4(shop.metafields)
2574
+ brand: shop.brand || void 0,
2575
+ metafields: normalizeMetafields(shop.metafields)
2591
2576
  };
2592
2577
  }
2593
- function normalizeMetafields4(metafields) {
2594
- if (!metafields || metafields.length === 0) {
2595
- return void 0;
2596
- }
2597
- return metafields.reduce((acc, metafield) => {
2598
- if (metafield && metafield.key) {
2599
- acc[metafield.key] = metafield.value;
2600
- }
2601
- return acc;
2602
- }, {});
2603
- }
2604
2578
 
2605
2579
  // src/api/shop/get-shop.ts
2606
2580
  async function getShop(client, options) {