@spiffcommerce/core 26.4.4 → 26.5.0

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/CHANGELOG.md CHANGED
@@ -14,6 +14,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
14
14
  - `Fixed` for any bug fixes.
15
15
  - `Security` in case of vulnerabilities.
16
16
 
17
+ ## [26.5.0] - 18-11-2024
18
+
19
+ ### Added
20
+
21
+ - ProductCollection has a new function `fetchProductsFeed`, which fetches a paginated array of product collection products (entries in the product collection). Note that this does not edit the internal array of previously fetched products like `fetchProducts` does, so calls to `fetchProductsFeed` will not change the array that is returned by `getProducts`. If `fetchProducts` has already been called, or if the ProductCollection has been initialised with products, `fetchProductsFeed` will avoid making any network calls where it can.
22
+
17
23
  ## [26.4.0] - 07-11-2024
18
24
 
19
25
  ### Added
package/dist/index.d.ts CHANGED
@@ -1544,6 +1544,17 @@ declare class ProductCollection {
1544
1544
  * @param filters A list of filters to apply.
1545
1545
  */
1546
1546
  filterProducts(filters: ProductMetafieldFilter[]): Promise<CollectionProduct[]>;
1547
+ /**
1548
+ * Fetches a paginated feed of products.
1549
+ * @param offset The zero-based start index.
1550
+ * @param limit The maximum number of products to return.
1551
+ * @param filters Optional filters to apply to the query.
1552
+ * @returns
1553
+ */
1554
+ fetchProductsFeed(offset: number, limit: number, filters?: ProductMetafieldFilter[]): Promise<{
1555
+ items: CollectionProduct[];
1556
+ total: number;
1557
+ }>;
1547
1558
  getTransformCollection(): TransformCollection$1 | undefined;
1548
1559
  /**
1549
1560
  * The raw collection resource. This is generally not needed and should be avoided.
@@ -3954,6 +3965,7 @@ type ProductCollectionResource = {
3954
3965
  id: string;
3955
3966
  globalPropertyConfiguration?: GlobalPropertyConfiguration;
3956
3967
  productCollectionProducts?: ProductCollectionProductResource[];
3968
+ productCollectionProductsFeed?: ProductCollectionProductsFeedResource;
3957
3969
  name: string;
3958
3970
  description?: string;
3959
3971
  image?: Asset;
@@ -3967,6 +3979,10 @@ type ProductCollectionProductResource = {
3967
3979
  productId: string;
3968
3980
  workflowId?: string;
3969
3981
  };
3982
+ type ProductCollectionProductsFeedResource = {
3983
+ items: ProductCollectionProductResource[];
3984
+ total: number;
3985
+ };
3970
3986
  type GlobalPropertyState = {
3971
3987
  id: string;
3972
3988
  aspects: GlobalPropertyStateAspect[];