@anker-in/shopify-sdk 1.2.0-beta.15 → 1.2.0-beta.16

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.js CHANGED
@@ -6,10 +6,7 @@ var shopifyCore = require('@anker-in/shopify-core');
6
6
  var SPECIAL_METAFIELD_NAMESPACES = ["__discountCodeApp", "discounts_function"];
7
7
  function constructMetafieldIdentifiersQueryParams(metafieldIdentifiers, metafieldNamespacePrefix) {
8
8
  if (!metafieldIdentifiers || Object.keys(metafieldIdentifiers).length === 0) {
9
- return {
10
- productMetafieldIdentifiers: [],
11
- variantMetafieldIdentifiers: []
12
- };
9
+ return {};
13
10
  }
14
11
  const identifiers = Object.entries(metafieldIdentifiers).reduce(
15
12
  (queryInput, [key, value]) => {
@@ -697,8 +694,6 @@ var articleFragment = (
697
694
  name
698
695
  }
699
696
  }
700
- ${imageFragment}
701
- ${seoFragment}
702
697
  `
703
698
  );
704
699
  var articleWithMetafieldsFragment = (
@@ -727,9 +722,6 @@ var articleWithMetafieldsFragment = (
727
722
  ...metafield
728
723
  }
729
724
  }
730
- ${imageFragment}
731
- ${seoFragment}
732
- ${metafieldFragment}
733
725
  `
734
726
  );
735
727
  var blogFragment = (
@@ -743,7 +735,6 @@ var blogFragment = (
743
735
  ...seo
744
736
  }
745
737
  }
746
- ${seoFragment}
747
738
  `
748
739
  );
749
740
  var blogWithMetafieldsFragment = (
@@ -760,8 +751,6 @@ var blogWithMetafieldsFragment = (
760
751
  ...metafield
761
752
  }
762
753
  }
763
- ${seoFragment}
764
- ${metafieldFragment}
765
754
  `
766
755
  );
767
756
 
@@ -814,9 +803,14 @@ var shopFragment = (
814
803
  fragment shop on Shop {
815
804
  name
816
805
  description
806
+ moneyFormat
817
807
  primaryDomain {
818
- url
819
808
  host
809
+ url
810
+ }
811
+ paymentSettings {
812
+ currencyCode
813
+ enabledPresentmentCurrencies
820
814
  }
821
815
  brand {
822
816
  logo {
@@ -842,9 +836,14 @@ var shopWithMetafieldsFragment = (
842
836
  fragment shopWithMetafields on Shop {
843
837
  name
844
838
  description
839
+ moneyFormat
845
840
  primaryDomain {
846
- url
847
841
  host
842
+ url
843
+ }
844
+ paymentSettings {
845
+ currencyCode
846
+ enabledPresentmentCurrencies
848
847
  }
849
848
  brand {
850
849
  logo {
@@ -2288,6 +2287,9 @@ async function getBlog(client, options) {
2288
2287
  ...${hasMetafields ? "blogWithMetafields" : "blog"}
2289
2288
  }
2290
2289
  }
2290
+ ${imageFragment}
2291
+ ${metafieldFragment}
2292
+ ${seoFragment}
2291
2293
  ${fragment}
2292
2294
  `
2293
2295
  );
@@ -2335,6 +2337,9 @@ async function fetchAllPages2(client, options, afterCursor) {
2335
2337
  }
2336
2338
  }
2337
2339
  }
2340
+ ${imageFragment}
2341
+ ${metafieldFragment}
2342
+ ${seoFragment}
2338
2343
  ${fragment}
2339
2344
  ${pageInfoFragment}
2340
2345
  `
@@ -2391,6 +2396,9 @@ async function getArticle(client, options) {
2391
2396
  }
2392
2397
  }
2393
2398
  }
2399
+ ${imageFragment}
2400
+ ${metafieldFragment}
2401
+ ${seoFragment}
2394
2402
  ${articleFrag}
2395
2403
  ${blogFrag}
2396
2404
  `
@@ -2450,6 +2458,9 @@ async function fetchAllArticles(client, options, afterCursor) {
2450
2458
  }
2451
2459
  }
2452
2460
  }
2461
+ ${imageFragment}
2462
+ ${metafieldFragment}
2463
+ ${seoFragment}
2453
2464
  ${fragment}
2454
2465
  ${pageInfoFragment}
2455
2466
  `
@@ -2486,7 +2497,7 @@ async function getArticles(client, options) {
2486
2497
  }
2487
2498
 
2488
2499
  // src/api/blog/get-articles-in-blog.ts
2489
- async function fetchAllPages3(client, options, afterCursor) {
2500
+ async function fetchArticlesInBlog(client, options, afterCursor) {
2490
2501
  const {
2491
2502
  blogHandle,
2492
2503
  first = 250,
@@ -2530,6 +2541,9 @@ async function fetchAllPages3(client, options, afterCursor) {
2530
2541
  }
2531
2542
  }
2532
2543
  }
2544
+ ${imageFragment}
2545
+ ${metafieldFragment}
2546
+ ${seoFragment}
2533
2547
  ${articleFrag}
2534
2548
  ${blogFrag}
2535
2549
  ${pageInfoFragment}
@@ -2555,13 +2569,17 @@ async function fetchAllPages3(client, options, afterCursor) {
2555
2569
  }
2556
2570
  const articles = data.blog.articles.edges?.map((edge) => normalizeArticle(edge.node)) || [];
2557
2571
  if (data.blog.articles.pageInfo.hasNextPage) {
2558
- const nextArticles = await fetchAllPages3(client, options, data.blog.articles.pageInfo.endCursor);
2572
+ const nextArticles = await fetchArticlesInBlog(
2573
+ client,
2574
+ options,
2575
+ data.blog.articles.pageInfo.endCursor
2576
+ );
2559
2577
  return [...articles, ...nextArticles];
2560
2578
  }
2561
2579
  return articles;
2562
2580
  }
2563
2581
  async function getArticlesInBlog(client, options) {
2564
- return fetchAllPages3(client, options);
2582
+ return fetchArticlesInBlog(client, options);
2565
2583
  }
2566
2584
 
2567
2585
  // src/api/page/normalize.ts
@@ -2623,6 +2641,8 @@ function normalizeShop(shop) {
2623
2641
  return {
2624
2642
  name: shop.name,
2625
2643
  description: shop.description || "",
2644
+ moneyFormat: shop.moneyFormat,
2645
+ paymentSettings: shop.paymentSettings,
2626
2646
  primaryDomain: shop.primaryDomain,
2627
2647
  brand: shop.brand || void 0,
2628
2648
  metafields: normalizeMetafields(shop.metafields)