@swell/apps-sdk 1.0.150 → 1.0.152

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.
Files changed (43) hide show
  1. package/dist/index.cjs +767 -185
  2. package/dist/index.cjs.map +4 -4
  3. package/dist/index.js +747 -185
  4. package/dist/index.js.map +4 -4
  5. package/dist/index.mjs +757 -185
  6. package/dist/index.mjs.map +4 -4
  7. package/dist/src/cache/cache-api-stub.d.ts +25 -0
  8. package/dist/src/cache/index.d.ts +2 -0
  9. package/dist/src/cache/worker-html-cache.d.ts +43 -0
  10. package/dist/src/compatibility/drops/all_products.d.ts +1 -1
  11. package/dist/src/compatibility/drops/articles.d.ts +1 -1
  12. package/dist/src/compatibility/drops/blogs.d.ts +1 -1
  13. package/dist/src/compatibility/drops/collections.d.ts +2 -3
  14. package/dist/src/compatibility/drops/images.d.ts +1 -1
  15. package/dist/src/compatibility/drops/pages.d.ts +2 -3
  16. package/dist/src/compatibility/shopify-objects/collections.d.ts +2 -2
  17. package/dist/src/content.d.ts +3 -3
  18. package/dist/src/index.d.ts +3 -0
  19. package/dist/src/liquid/filters/shopify/default_pagination.d.ts +1 -1
  20. package/dist/src/resources/account.d.ts +4 -4
  21. package/dist/src/resources/addresses.d.ts +7 -0
  22. package/dist/src/resources/blog.d.ts +5 -4
  23. package/dist/src/resources/blog_category.d.ts +5 -4
  24. package/dist/src/resources/cart.d.ts +4 -4
  25. package/dist/src/resources/categories.d.ts +7 -0
  26. package/dist/src/resources/category.d.ts +5 -4
  27. package/dist/src/resources/index.d.ts +18 -9
  28. package/dist/src/resources/order.d.ts +5 -4
  29. package/dist/src/resources/orders.d.ts +7 -0
  30. package/dist/src/resources/page.d.ts +5 -4
  31. package/dist/src/resources/predictive_search.d.ts +6 -0
  32. package/dist/src/resources/product.d.ts +5 -19
  33. package/dist/src/resources/product_helpers.d.ts +12 -2
  34. package/dist/src/resources/product_recommendations.d.ts +6 -0
  35. package/dist/src/resources/search.d.ts +6 -0
  36. package/dist/src/resources/subscription.d.ts +7 -0
  37. package/dist/src/resources/subscriptions.d.ts +7 -0
  38. package/dist/src/resources/swell_types.d.ts +66 -9
  39. package/dist/src/resources/variant.d.ts +8 -8
  40. package/dist/src/resources.d.ts +11 -12
  41. package/dist/types/shopify.d.ts +2 -2
  42. package/dist/types/swell.d.ts +3 -1
  43. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import type { SwellData, SwellCollection, ThemeSectionEnabledDisabled } from './swell';
1
+ import type { SwellData, ThemeSectionEnabledDisabled } from './swell';
2
2
  import type { ShopifyResource } from '../src/compatibility/shopify-objects/resource';
3
3
  import type { ShopifyCompatibility } from '../src/compatibility/shopify';
4
4
  import type { StorefrontResource, SwellStorefrontCollection } from '../src/resources';
@@ -446,7 +446,7 @@ export interface ShopifyCollection {
446
446
  metafields: Record<string, unknown>;
447
447
  next_product?: ShopifyProduct;
448
448
  previous_product?: ShopifyProduct;
449
- products: SwellStorefrontCollection<SwellCollection<ShopifyResource<ShopifyProduct>>>;
449
+ products: SwellStorefrontCollection<ShopifyResource<ShopifyProduct>>;
450
450
  products_count: number;
451
451
  published_at: string;
452
452
  sort_by?: string;
@@ -245,7 +245,9 @@ export interface SwellMenuItem {
245
245
  }
246
246
  export type QueryParams = import('qs').ParsedQs;
247
247
  export type StorefrontResourceGetter<T extends SwellData = SwellData> = (this: SwellStorefrontResource<T>) => Promise<T | null> | T | null;
248
- export type StorefrontCollectionGetter<T extends SwellCollection<SwellData> = SwellCollection<SwellData>> = (this: SwellStorefrontCollection<T>) => Promise<T | null> | T | null;
248
+ export type StorefrontRecordGetter<T extends SwellData = SwellData> = (this: SwellStorefrontRecord<T>) => Promise<T | null> | T | null;
249
+ export type StorefrontSingletonGetter<T extends SwellData = SwellData> = (this: SwellStorefrontSingleton<T>) => Promise<T | null> | T | null;
250
+ export type StorefrontCollectionGetter<T extends SwellData = SwellData> = (this: SwellStorefrontCollection<T>) => Promise<SwellCollection<T> | null> | SwellCollection<T> | null;
249
251
  export interface ThemeSettings {
250
252
  [key: string]: any;
251
253
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@swell/apps-sdk",
3
3
  "type": "module",
4
- "version": "1.0.150",
4
+ "version": "1.0.152",
5
5
  "description": "Swell SDK for building isomorphic apps.",
6
6
  "author": "Swell",
7
7
  "license": "MIT",