@shopkit/data-layer 1.7.0 → 1.8.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.
@@ -1,4 +1,4 @@
1
- import { ISingleProductRequest, IOptionsRequest, IResponse, IProductQueryReqest, IProductsByHandlesRequest, IProductRecommendationsRequest, ISingleCollectionRequest, ICollectionQueryRequest, ICollectionsByhandlesRequest, ICollectionFilterRequest, IQueryCollectionsRequest, ISingleOrderRequest, IOrderQueryRequest, IOrderRequest, IUpdateOrderRequest, IOrderHistoryRequest, IOrderByIdRequest, ISingleCustomerRequest, ICustomerQueryRequest, ICustomerRequest, IUpdateCustomerRequest, ISingleCartRequest, IUpdateCartRequest, IAddToCartRequest, IRemoveFromCartRequest, ICreateCheckoutRequest, IGetArticleRequest, IBlogArticleRequest, ITrendingArticleRequest, IArticleByHandleRequest, IGraphqlRequest, IFetchRequest } from './models/index.js';
1
+ import { ISingleProductRequest, IOptionsRequest, IResponse, IProductQueryReqest, IProductsByHandlesRequest, IProductRecommendationsRequest, ISingleCollectionRequest, ICollectionQueryRequest, ICollectionsByhandlesRequest, ICollectionFilterRequest, IQueryCollectionsRequest, IGetCollectionVariantCardsRequest, VariantCardsPageDto, ISingleOrderRequest, IOrderQueryRequest, IOrderRequest, IUpdateOrderRequest, IOrderHistoryRequest, IOrderByIdRequest, ISingleCustomerRequest, ICustomerQueryRequest, ICustomerRequest, IUpdateCustomerRequest, ISingleCartRequest, IUpdateCartRequest, IAddToCartRequest, IRemoveFromCartRequest, ICreateCheckoutRequest, IGetArticleRequest, IBlogArticleRequest, ITrendingArticleRequest, IArticleByHandleRequest, IGraphqlRequest, IFetchRequest } from './models/index.js';
2
2
 
3
3
  /**
4
4
  * Core interface that all platform adapters will implement
@@ -88,6 +88,13 @@ interface ICommerceClient {
88
88
  * @returns Promise resolving to the collections, with paging in meta.pagination
89
89
  */
90
90
  queryCollections(params: IQueryCollectionsRequest, options?: IOptionsRequest): Promise<IResponse>;
91
+ /**
92
+ * Read a page of a collection's products, with one card per matching variant
93
+ * @param params - Handle plus page/per_page, sort, filter, fields; see IGetCollectionVariantCardsRequest
94
+ * @param options - Request options (headers, timeout, etc.)
95
+ * @returns Promise resolving to a VariantCardsPageDto (products, variants, counts, price_range, next_cursor)
96
+ */
97
+ getCollectionVariantCards(params: IGetCollectionVariantCardsRequest, options?: IOptionsRequest): Promise<IResponse<VariantCardsPageDto>>;
91
98
  /**
92
99
  * Retrieve a single order by ID
93
100
  * @param params - Order identifier
@@ -1,4 +1,4 @@
1
- import { ISingleProductRequest, IOptionsRequest, IResponse, IProductQueryReqest, IProductsByHandlesRequest, IProductRecommendationsRequest, ISingleCollectionRequest, ICollectionQueryRequest, ICollectionsByhandlesRequest, ICollectionFilterRequest, IQueryCollectionsRequest, ISingleOrderRequest, IOrderQueryRequest, IOrderRequest, IUpdateOrderRequest, IOrderHistoryRequest, IOrderByIdRequest, ISingleCustomerRequest, ICustomerQueryRequest, ICustomerRequest, IUpdateCustomerRequest, ISingleCartRequest, IUpdateCartRequest, IAddToCartRequest, IRemoveFromCartRequest, ICreateCheckoutRequest, IGetArticleRequest, IBlogArticleRequest, ITrendingArticleRequest, IArticleByHandleRequest, IGraphqlRequest, IFetchRequest } from './models/index.mjs';
1
+ import { ISingleProductRequest, IOptionsRequest, IResponse, IProductQueryReqest, IProductsByHandlesRequest, IProductRecommendationsRequest, ISingleCollectionRequest, ICollectionQueryRequest, ICollectionsByhandlesRequest, ICollectionFilterRequest, IQueryCollectionsRequest, IGetCollectionVariantCardsRequest, VariantCardsPageDto, ISingleOrderRequest, IOrderQueryRequest, IOrderRequest, IUpdateOrderRequest, IOrderHistoryRequest, IOrderByIdRequest, ISingleCustomerRequest, ICustomerQueryRequest, ICustomerRequest, IUpdateCustomerRequest, ISingleCartRequest, IUpdateCartRequest, IAddToCartRequest, IRemoveFromCartRequest, ICreateCheckoutRequest, IGetArticleRequest, IBlogArticleRequest, ITrendingArticleRequest, IArticleByHandleRequest, IGraphqlRequest, IFetchRequest } from './models/index.mjs';
2
2
 
3
3
  /**
4
4
  * Core interface that all platform adapters will implement
@@ -88,6 +88,13 @@ interface ICommerceClient {
88
88
  * @returns Promise resolving to the collections, with paging in meta.pagination
89
89
  */
90
90
  queryCollections(params: IQueryCollectionsRequest, options?: IOptionsRequest): Promise<IResponse>;
91
+ /**
92
+ * Read a page of a collection's products, with one card per matching variant
93
+ * @param params - Handle plus page/per_page, sort, filter, fields; see IGetCollectionVariantCardsRequest
94
+ * @param options - Request options (headers, timeout, etc.)
95
+ * @returns Promise resolving to a VariantCardsPageDto (products, variants, counts, price_range, next_cursor)
96
+ */
97
+ getCollectionVariantCards(params: IGetCollectionVariantCardsRequest, options?: IOptionsRequest): Promise<IResponse<VariantCardsPageDto>>;
91
98
  /**
92
99
  * Retrieve a single order by ID
93
100
  * @param params - Order identifier
@@ -483,6 +483,175 @@ interface IQueryCollectionsRequest {
483
483
  * getProduct / getCollection, so a route can keep its last good page.
484
484
  */
485
485
  type QueryCollectionsErrorCode = "QUERY_REJECTED" | "UPSTREAM_UNAVAILABLE";
486
+ /** Columns `sort` accepts on the variants endpoint; anything else is a 400. */
487
+ type CollectionVariantCardsSortKey = "price" | "created_at" | "title";
488
+ /**
489
+ * Request for `getCollectionVariantCards`: a page of a collection's PRODUCTS,
490
+ * with one card per matching VARIANT.
491
+ *
492
+ * Paging is two-level:
493
+ * - `page` / `per_page` choose the products (per_page at most 50, default 24).
494
+ * - The page's variants come back as one stream, at most `limit` per call
495
+ * (at most 100, default 50). When `next_cursor` is set, send the SAME body
496
+ * with `after: next_cursor` for the rest — or set `allVariants: true` to have
497
+ * the data layer follow the cursor for you.
498
+ *
499
+ * @example
500
+ * ```typescript
501
+ * {
502
+ * handle: "silicone-back-cover",
503
+ * page: 1,
504
+ * per_page: 24,
505
+ * sort: { price: "asc" },
506
+ * filter: { $applied_filters: [{ filter_id: "fd_123", values: ["Black"] }] },
507
+ * product: { fields: ["title", "handle", "price_range", "images"] },
508
+ * metafields: { products: true },
509
+ * ratings: true,
510
+ * }
511
+ * ```
512
+ */
513
+ interface IGetCollectionVariantCardsRequest {
514
+ /** Collection handle (a URL path segment; escaped by the data layer). */
515
+ handle: string;
516
+ /** 1-based product page. */
517
+ page?: number;
518
+ /** Products per page, 1–50. Backend default 24. */
519
+ per_page?: number;
520
+ /** Variant cards per call, 1–100. Backend default 50. */
521
+ limit?: number;
522
+ /** `next_cursor` of the previous call. Only valid with the same body (handle, filter, sort, page). */
523
+ after?: string;
524
+ /** Without it, products follow the admin order. `price` sorts by the cheapest variant up, dearest down. */
525
+ sort?: Partial<Record<CollectionVariantCardsSortKey, QuerySortDirection>>;
526
+ /**
527
+ * Which variants (and so which products) match: option values, `$applied_filters`
528
+ * (filter ids from `getCollectionFilters`), `product.$is`, `$available`.
529
+ */
530
+ filter?: Record<string, unknown>;
531
+ /** Variant columns on each card. `product_id`, `available`, `image` and `options` always come back. */
532
+ fields?: string[];
533
+ /** Product columns, e.g. `{ fields: ["title", "handle", "price_range", "images"] }`. Always includes `id`. */
534
+ product?: {
535
+ fields?: string[];
536
+ };
537
+ /** Metafields on the product (`products`) and on each card (`variants`). */
538
+ metafields?: {
539
+ products?: boolean;
540
+ variants?: boolean;
541
+ };
542
+ /** Adds `average_rating` and `rating_count` to each product. */
543
+ ratings?: boolean;
544
+ /**
545
+ * Follow `next_cursor` and return every variant of the page in one result
546
+ * (handled here, not sent). Without it, a call returns at most `limit` cards
547
+ * (50 by default), so a page of products with many variants comes back with
548
+ * later products missing their cards — set it for a grid render.
549
+ *
550
+ * Always asks for 100 cards per call (`limit` is ignored). The result is the
551
+ * whole page or a failure, never a partial page: `UPSTREAM_UNAVAILABLE` when a
552
+ * follow-up call fails, the cursor repeats, or the page needs more than 20
553
+ * calls (2000 cards) or 15s in all.
554
+ */
555
+ allVariants?: boolean;
556
+ }
557
+ /** A min/max price pair, in paise. */
558
+ interface PriceRangeDto {
559
+ min: number;
560
+ max: number;
561
+ }
562
+ /** One image of a product's gallery (product `fields: ["images"]`). */
563
+ interface ProductCardImageDto {
564
+ url: string;
565
+ alt: string | null;
566
+ width?: number | null;
567
+ height?: number | null;
568
+ media_type?: string | null;
569
+ thumbnail_url?: string | null;
570
+ }
571
+ /**
572
+ * A product of the page. Carries the columns asked for under `product.fields`
573
+ * (always `id`), plus `average_rating` / `rating_count` with `ratings: true`
574
+ * and `metafields` with `metafields.products`.
575
+ */
576
+ interface ProductCardDto {
577
+ id: string;
578
+ title?: string;
579
+ handle?: string;
580
+ /** Over every variant of the product; null when it has no such price. */
581
+ price_range?: PriceRangeDto | null;
582
+ compare_at_price_range?: PriceRangeDto | null;
583
+ /** The product's gallery in admin order, at most 50. */
584
+ images?: ProductCardImageDto[];
585
+ average_rating?: number;
586
+ rating_count?: number;
587
+ metafields?: Record<string, {
588
+ value: unknown;
589
+ data_type?: string;
590
+ }>;
591
+ [column: string]: unknown;
592
+ }
593
+ /** The image of a variant card. */
594
+ interface VariantCardImageDto {
595
+ url: string;
596
+ alt: string | null;
597
+ }
598
+ /** One option value of a variant, e.g. `{ name: "Color", value: "Black" }`. */
599
+ interface VariantCardOptionDto {
600
+ name: string;
601
+ value: string;
602
+ }
603
+ /** One card: a variant that matched the filter. Prices are in paise. */
604
+ interface VariantCardDto {
605
+ id?: string;
606
+ title?: string;
607
+ sku?: string;
608
+ barcode?: string;
609
+ price?: number;
610
+ compare_at_price?: number | null;
611
+ position?: number;
612
+ created_at?: string;
613
+ weight?: string;
614
+ weight_unit?: string;
615
+ /** The `id` of the product in `products` this card belongs to. */
616
+ product_id: string;
617
+ /** From inventory: untracked stock, oversell allowed, or a real count. */
618
+ available: boolean;
619
+ image: VariantCardImageDto | null;
620
+ options: VariantCardOptionDto[];
621
+ metafields?: Record<string, {
622
+ value: unknown;
623
+ data_type?: string;
624
+ }>;
625
+ [column: string]: unknown;
626
+ }
627
+ /** A page of a collection: its products and their matching variant cards. */
628
+ interface VariantCardsPageDto {
629
+ /** Every product of the page, in page order, even one whose variants have not come yet. */
630
+ products: ProductCardDto[];
631
+ /** One stream over the page's products: the first product's matching variants, then the next's. */
632
+ variants: VariantCardDto[];
633
+ page: number;
634
+ per_page: number;
635
+ total_pages: number;
636
+ /** Products in the collection that the filter matches. */
637
+ total_products: number;
638
+ /** Products in the collection, whatever the filter. */
639
+ all_products: number;
640
+ /** Over every variant of the collection, whatever the filter, sort or page. In paise. */
641
+ price_range: PriceRangeDto | null;
642
+ /** Set when the page has more variants than this call held: send the same body with it as `after`. */
643
+ next_cursor: string | null;
644
+ }
645
+ /**
646
+ * Why a getCollectionVariantCards call failed, in `error.code`. As for
647
+ * queryCollections, plus:
648
+ *
649
+ * - `NOT_FOUND`: no collection has this handle (the backend's 404 with
650
+ * `errors[0].code: "NOT_FOUND"`). A collection route can answer `notFound()`.
651
+ * Any other 404 (the route itself missing, a gateway misroute) is
652
+ * `UPSTREAM_UNAVAILABLE`, so a page is never cached as not-found for it.
653
+ */
654
+ type CollectionVariantCardsErrorCode = QueryCollectionsErrorCode | "NOT_FOUND";
486
655
 
487
656
  /**
488
657
  * Order data models for the commerce library
@@ -698,4 +867,4 @@ interface IGetArticleRequest {
698
867
  reverse?: boolean;
699
868
  }
700
869
 
701
- export { EAvailability, ECollectionSortKey, EFulfillmentStatus, EOrderSortKey, EOrderStatus, EPaymentStatus, EProductSortKey, type IAddToCartRequest, type IAddress, type IArticleByHandleRequest, type IBaseQueryParams, type IBlogArticleRequest, type ICartItemRequest, type ICollectionFilterRequest, type ICollectionQueryRequest, type ICollectionsByhandlesRequest, type ICreateCheckoutRequest, type ICustomerQueryRequest, type ICustomerRequest, type IFetchRequest, type IGetArticleRequest, type IGraphqlRequest, type IImage, type IMetafield, type IMoney, type IOptionsRequest, type IOrderByIdRequest, type IOrderHistoryRequest, type IOrderQueryRequest, type IOrderRequest, type IPaginationParams, type IProductFilters, type IProductQueryReqest, type IProductRecommendationsRequest, type IProductsByHandlesRequest, type IQueryCollectionsInclude, type IQueryCollectionsRequest, type IRemoveFromCartRequest, type IResponse, type IResponseMeta, type ISeo, type ISingleCartRequest, type ISingleCollectionRequest, type ISingleCustomerRequest, type ISingleOrderRequest, type ISingleProductRequest, type ITrendingArticleRequest, type IUpdateCartRequest, type IUpdateCustomerRequest, type IUpdateOrderRequest, type QueryCollectionsErrorCode, type QuerySortDirection };
870
+ export { type CollectionVariantCardsErrorCode, type CollectionVariantCardsSortKey, EAvailability, ECollectionSortKey, EFulfillmentStatus, EOrderSortKey, EOrderStatus, EPaymentStatus, EProductSortKey, type IAddToCartRequest, type IAddress, type IArticleByHandleRequest, type IBaseQueryParams, type IBlogArticleRequest, type ICartItemRequest, type ICollectionFilterRequest, type ICollectionQueryRequest, type ICollectionsByhandlesRequest, type ICreateCheckoutRequest, type ICustomerQueryRequest, type ICustomerRequest, type IFetchRequest, type IGetArticleRequest, type IGetCollectionVariantCardsRequest, type IGraphqlRequest, type IImage, type IMetafield, type IMoney, type IOptionsRequest, type IOrderByIdRequest, type IOrderHistoryRequest, type IOrderQueryRequest, type IOrderRequest, type IPaginationParams, type IProductFilters, type IProductQueryReqest, type IProductRecommendationsRequest, type IProductsByHandlesRequest, type IQueryCollectionsInclude, type IQueryCollectionsRequest, type IRemoveFromCartRequest, type IResponse, type IResponseMeta, type ISeo, type ISingleCartRequest, type ISingleCollectionRequest, type ISingleCustomerRequest, type ISingleOrderRequest, type ISingleProductRequest, type ITrendingArticleRequest, type IUpdateCartRequest, type IUpdateCustomerRequest, type IUpdateOrderRequest, type PriceRangeDto, type ProductCardDto, type ProductCardImageDto, type QueryCollectionsErrorCode, type QuerySortDirection, type VariantCardDto, type VariantCardImageDto, type VariantCardOptionDto, type VariantCardsPageDto };
@@ -483,6 +483,175 @@ interface IQueryCollectionsRequest {
483
483
  * getProduct / getCollection, so a route can keep its last good page.
484
484
  */
485
485
  type QueryCollectionsErrorCode = "QUERY_REJECTED" | "UPSTREAM_UNAVAILABLE";
486
+ /** Columns `sort` accepts on the variants endpoint; anything else is a 400. */
487
+ type CollectionVariantCardsSortKey = "price" | "created_at" | "title";
488
+ /**
489
+ * Request for `getCollectionVariantCards`: a page of a collection's PRODUCTS,
490
+ * with one card per matching VARIANT.
491
+ *
492
+ * Paging is two-level:
493
+ * - `page` / `per_page` choose the products (per_page at most 50, default 24).
494
+ * - The page's variants come back as one stream, at most `limit` per call
495
+ * (at most 100, default 50). When `next_cursor` is set, send the SAME body
496
+ * with `after: next_cursor` for the rest — or set `allVariants: true` to have
497
+ * the data layer follow the cursor for you.
498
+ *
499
+ * @example
500
+ * ```typescript
501
+ * {
502
+ * handle: "silicone-back-cover",
503
+ * page: 1,
504
+ * per_page: 24,
505
+ * sort: { price: "asc" },
506
+ * filter: { $applied_filters: [{ filter_id: "fd_123", values: ["Black"] }] },
507
+ * product: { fields: ["title", "handle", "price_range", "images"] },
508
+ * metafields: { products: true },
509
+ * ratings: true,
510
+ * }
511
+ * ```
512
+ */
513
+ interface IGetCollectionVariantCardsRequest {
514
+ /** Collection handle (a URL path segment; escaped by the data layer). */
515
+ handle: string;
516
+ /** 1-based product page. */
517
+ page?: number;
518
+ /** Products per page, 1–50. Backend default 24. */
519
+ per_page?: number;
520
+ /** Variant cards per call, 1–100. Backend default 50. */
521
+ limit?: number;
522
+ /** `next_cursor` of the previous call. Only valid with the same body (handle, filter, sort, page). */
523
+ after?: string;
524
+ /** Without it, products follow the admin order. `price` sorts by the cheapest variant up, dearest down. */
525
+ sort?: Partial<Record<CollectionVariantCardsSortKey, QuerySortDirection>>;
526
+ /**
527
+ * Which variants (and so which products) match: option values, `$applied_filters`
528
+ * (filter ids from `getCollectionFilters`), `product.$is`, `$available`.
529
+ */
530
+ filter?: Record<string, unknown>;
531
+ /** Variant columns on each card. `product_id`, `available`, `image` and `options` always come back. */
532
+ fields?: string[];
533
+ /** Product columns, e.g. `{ fields: ["title", "handle", "price_range", "images"] }`. Always includes `id`. */
534
+ product?: {
535
+ fields?: string[];
536
+ };
537
+ /** Metafields on the product (`products`) and on each card (`variants`). */
538
+ metafields?: {
539
+ products?: boolean;
540
+ variants?: boolean;
541
+ };
542
+ /** Adds `average_rating` and `rating_count` to each product. */
543
+ ratings?: boolean;
544
+ /**
545
+ * Follow `next_cursor` and return every variant of the page in one result
546
+ * (handled here, not sent). Without it, a call returns at most `limit` cards
547
+ * (50 by default), so a page of products with many variants comes back with
548
+ * later products missing their cards — set it for a grid render.
549
+ *
550
+ * Always asks for 100 cards per call (`limit` is ignored). The result is the
551
+ * whole page or a failure, never a partial page: `UPSTREAM_UNAVAILABLE` when a
552
+ * follow-up call fails, the cursor repeats, or the page needs more than 20
553
+ * calls (2000 cards) or 15s in all.
554
+ */
555
+ allVariants?: boolean;
556
+ }
557
+ /** A min/max price pair, in paise. */
558
+ interface PriceRangeDto {
559
+ min: number;
560
+ max: number;
561
+ }
562
+ /** One image of a product's gallery (product `fields: ["images"]`). */
563
+ interface ProductCardImageDto {
564
+ url: string;
565
+ alt: string | null;
566
+ width?: number | null;
567
+ height?: number | null;
568
+ media_type?: string | null;
569
+ thumbnail_url?: string | null;
570
+ }
571
+ /**
572
+ * A product of the page. Carries the columns asked for under `product.fields`
573
+ * (always `id`), plus `average_rating` / `rating_count` with `ratings: true`
574
+ * and `metafields` with `metafields.products`.
575
+ */
576
+ interface ProductCardDto {
577
+ id: string;
578
+ title?: string;
579
+ handle?: string;
580
+ /** Over every variant of the product; null when it has no such price. */
581
+ price_range?: PriceRangeDto | null;
582
+ compare_at_price_range?: PriceRangeDto | null;
583
+ /** The product's gallery in admin order, at most 50. */
584
+ images?: ProductCardImageDto[];
585
+ average_rating?: number;
586
+ rating_count?: number;
587
+ metafields?: Record<string, {
588
+ value: unknown;
589
+ data_type?: string;
590
+ }>;
591
+ [column: string]: unknown;
592
+ }
593
+ /** The image of a variant card. */
594
+ interface VariantCardImageDto {
595
+ url: string;
596
+ alt: string | null;
597
+ }
598
+ /** One option value of a variant, e.g. `{ name: "Color", value: "Black" }`. */
599
+ interface VariantCardOptionDto {
600
+ name: string;
601
+ value: string;
602
+ }
603
+ /** One card: a variant that matched the filter. Prices are in paise. */
604
+ interface VariantCardDto {
605
+ id?: string;
606
+ title?: string;
607
+ sku?: string;
608
+ barcode?: string;
609
+ price?: number;
610
+ compare_at_price?: number | null;
611
+ position?: number;
612
+ created_at?: string;
613
+ weight?: string;
614
+ weight_unit?: string;
615
+ /** The `id` of the product in `products` this card belongs to. */
616
+ product_id: string;
617
+ /** From inventory: untracked stock, oversell allowed, or a real count. */
618
+ available: boolean;
619
+ image: VariantCardImageDto | null;
620
+ options: VariantCardOptionDto[];
621
+ metafields?: Record<string, {
622
+ value: unknown;
623
+ data_type?: string;
624
+ }>;
625
+ [column: string]: unknown;
626
+ }
627
+ /** A page of a collection: its products and their matching variant cards. */
628
+ interface VariantCardsPageDto {
629
+ /** Every product of the page, in page order, even one whose variants have not come yet. */
630
+ products: ProductCardDto[];
631
+ /** One stream over the page's products: the first product's matching variants, then the next's. */
632
+ variants: VariantCardDto[];
633
+ page: number;
634
+ per_page: number;
635
+ total_pages: number;
636
+ /** Products in the collection that the filter matches. */
637
+ total_products: number;
638
+ /** Products in the collection, whatever the filter. */
639
+ all_products: number;
640
+ /** Over every variant of the collection, whatever the filter, sort or page. In paise. */
641
+ price_range: PriceRangeDto | null;
642
+ /** Set when the page has more variants than this call held: send the same body with it as `after`. */
643
+ next_cursor: string | null;
644
+ }
645
+ /**
646
+ * Why a getCollectionVariantCards call failed, in `error.code`. As for
647
+ * queryCollections, plus:
648
+ *
649
+ * - `NOT_FOUND`: no collection has this handle (the backend's 404 with
650
+ * `errors[0].code: "NOT_FOUND"`). A collection route can answer `notFound()`.
651
+ * Any other 404 (the route itself missing, a gateway misroute) is
652
+ * `UPSTREAM_UNAVAILABLE`, so a page is never cached as not-found for it.
653
+ */
654
+ type CollectionVariantCardsErrorCode = QueryCollectionsErrorCode | "NOT_FOUND";
486
655
 
487
656
  /**
488
657
  * Order data models for the commerce library
@@ -698,4 +867,4 @@ interface IGetArticleRequest {
698
867
  reverse?: boolean;
699
868
  }
700
869
 
701
- export { EAvailability, ECollectionSortKey, EFulfillmentStatus, EOrderSortKey, EOrderStatus, EPaymentStatus, EProductSortKey, type IAddToCartRequest, type IAddress, type IArticleByHandleRequest, type IBaseQueryParams, type IBlogArticleRequest, type ICartItemRequest, type ICollectionFilterRequest, type ICollectionQueryRequest, type ICollectionsByhandlesRequest, type ICreateCheckoutRequest, type ICustomerQueryRequest, type ICustomerRequest, type IFetchRequest, type IGetArticleRequest, type IGraphqlRequest, type IImage, type IMetafield, type IMoney, type IOptionsRequest, type IOrderByIdRequest, type IOrderHistoryRequest, type IOrderQueryRequest, type IOrderRequest, type IPaginationParams, type IProductFilters, type IProductQueryReqest, type IProductRecommendationsRequest, type IProductsByHandlesRequest, type IQueryCollectionsInclude, type IQueryCollectionsRequest, type IRemoveFromCartRequest, type IResponse, type IResponseMeta, type ISeo, type ISingleCartRequest, type ISingleCollectionRequest, type ISingleCustomerRequest, type ISingleOrderRequest, type ISingleProductRequest, type ITrendingArticleRequest, type IUpdateCartRequest, type IUpdateCustomerRequest, type IUpdateOrderRequest, type QueryCollectionsErrorCode, type QuerySortDirection };
870
+ export { type CollectionVariantCardsErrorCode, type CollectionVariantCardsSortKey, EAvailability, ECollectionSortKey, EFulfillmentStatus, EOrderSortKey, EOrderStatus, EPaymentStatus, EProductSortKey, type IAddToCartRequest, type IAddress, type IArticleByHandleRequest, type IBaseQueryParams, type IBlogArticleRequest, type ICartItemRequest, type ICollectionFilterRequest, type ICollectionQueryRequest, type ICollectionsByhandlesRequest, type ICreateCheckoutRequest, type ICustomerQueryRequest, type ICustomerRequest, type IFetchRequest, type IGetArticleRequest, type IGetCollectionVariantCardsRequest, type IGraphqlRequest, type IImage, type IMetafield, type IMoney, type IOptionsRequest, type IOrderByIdRequest, type IOrderHistoryRequest, type IOrderQueryRequest, type IOrderRequest, type IPaginationParams, type IProductFilters, type IProductQueryReqest, type IProductRecommendationsRequest, type IProductsByHandlesRequest, type IQueryCollectionsInclude, type IQueryCollectionsRequest, type IRemoveFromCartRequest, type IResponse, type IResponseMeta, type ISeo, type ISingleCartRequest, type ISingleCollectionRequest, type ISingleCustomerRequest, type ISingleOrderRequest, type ISingleProductRequest, type ITrendingArticleRequest, type IUpdateCartRequest, type IUpdateCustomerRequest, type IUpdateOrderRequest, type PriceRangeDto, type ProductCardDto, type ProductCardImageDto, type QueryCollectionsErrorCode, type QuerySortDirection, type VariantCardDto, type VariantCardImageDto, type VariantCardOptionDto, type VariantCardsPageDto };
@@ -1,5 +1,5 @@
1
- import { ISingleProductRequest, IOptionsRequest, IResponse, IProductQueryReqest, IProductsByHandlesRequest, IProductRecommendationsRequest, ISingleCollectionRequest, ICollectionQueryRequest, ICollectionsByhandlesRequest, ICollectionFilterRequest, IQueryCollectionsRequest, ISingleOrderRequest, IOrderQueryRequest, IOrderRequest, IUpdateOrderRequest, IOrderHistoryRequest, IOrderByIdRequest, ISingleCustomerRequest, ICustomerQueryRequest, ICustomerRequest, IUpdateCustomerRequest, ISingleCartRequest, IUpdateCartRequest, IAddToCartRequest, IRemoveFromCartRequest, ICreateCheckoutRequest, IGetArticleRequest, IBlogArticleRequest, ITrendingArticleRequest, IArticleByHandleRequest, IGraphqlRequest, IFetchRequest } from './models/index.js';
2
- import { I as ICommerceClient } from './interface-BGV7d5F8.js';
1
+ import { ISingleProductRequest, IOptionsRequest, IResponse, IProductQueryReqest, IProductsByHandlesRequest, IProductRecommendationsRequest, ISingleCollectionRequest, ICollectionQueryRequest, ICollectionsByhandlesRequest, ICollectionFilterRequest, IQueryCollectionsRequest, IGetCollectionVariantCardsRequest, VariantCardsPageDto, ISingleOrderRequest, IOrderQueryRequest, IOrderRequest, IUpdateOrderRequest, IOrderHistoryRequest, IOrderByIdRequest, ISingleCustomerRequest, ICustomerQueryRequest, ICustomerRequest, IUpdateCustomerRequest, ISingleCartRequest, IUpdateCartRequest, IAddToCartRequest, IRemoveFromCartRequest, ICreateCheckoutRequest, IGetArticleRequest, IBlogArticleRequest, ITrendingArticleRequest, IArticleByHandleRequest, IGraphqlRequest, IFetchRequest } from './models/index.mjs';
2
+ import { I as ICommerceClient } from './interface-D4gQCRsx.mjs';
3
3
 
4
4
  /**
5
5
  * Shopify-specific types for the commerce library
@@ -154,6 +154,14 @@ declare abstract class BaseCommerceClient implements ICommerceClient {
154
154
  * @throws NotImplementedError if not implemented in adapter
155
155
  */
156
156
  queryCollections(params: IQueryCollectionsRequest, options?: IOptionsRequest): Promise<IResponse>;
157
+ /**
158
+ * Read a page of a collection's products, with one card per matching variant
159
+ * @param params - Handle plus page/per_page, sort, filter, fields
160
+ * @param options - Request options (headers, timeout, etc.)
161
+ * @returns Promise resolving to a VariantCardsPageDto
162
+ * @throws NotImplementedError if not implemented in adapter (custom backend only)
163
+ */
164
+ getCollectionVariantCards(params: IGetCollectionVariantCardsRequest, options?: IOptionsRequest): Promise<IResponse<VariantCardsPageDto>>;
157
165
  /**
158
166
  * Retrieve a single order by ID
159
167
  * @param params - Order identifier
@@ -497,6 +505,7 @@ declare class CustomBackendClient extends BaseCommerceClient {
497
505
  getCollectionsByHandles(params: ICollectionsByhandlesRequest, options?: IOptionsRequest): Promise<IResponse>;
498
506
  getCollectionFilters(params: ICollectionFilterRequest, options?: IOptionsRequest): Promise<IResponse>;
499
507
  queryCollections(params: IQueryCollectionsRequest, options?: IOptionsRequest): Promise<IResponse>;
508
+ getCollectionVariantCards(params: IGetCollectionVariantCardsRequest, options?: IOptionsRequest): Promise<IResponse<VariantCardsPageDto>>;
500
509
  getCart(params: ISingleCartRequest, options?: IOptionsRequest): Promise<IResponse>;
501
510
  createCart(options?: IOptionsRequest): Promise<IResponse>;
502
511
  updateCart(params: IUpdateCartRequest, options?: IOptionsRequest): Promise<IResponse>;
@@ -1,5 +1,5 @@
1
- import { ISingleProductRequest, IOptionsRequest, IResponse, IProductQueryReqest, IProductsByHandlesRequest, IProductRecommendationsRequest, ISingleCollectionRequest, ICollectionQueryRequest, ICollectionsByhandlesRequest, ICollectionFilterRequest, IQueryCollectionsRequest, ISingleOrderRequest, IOrderQueryRequest, IOrderRequest, IUpdateOrderRequest, IOrderHistoryRequest, IOrderByIdRequest, ISingleCustomerRequest, ICustomerQueryRequest, ICustomerRequest, IUpdateCustomerRequest, ISingleCartRequest, IUpdateCartRequest, IAddToCartRequest, IRemoveFromCartRequest, ICreateCheckoutRequest, IGetArticleRequest, IBlogArticleRequest, ITrendingArticleRequest, IArticleByHandleRequest, IGraphqlRequest, IFetchRequest } from './models/index.mjs';
2
- import { I as ICommerceClient } from './interface-CgPiwpPe.mjs';
1
+ import { ISingleProductRequest, IOptionsRequest, IResponse, IProductQueryReqest, IProductsByHandlesRequest, IProductRecommendationsRequest, ISingleCollectionRequest, ICollectionQueryRequest, ICollectionsByhandlesRequest, ICollectionFilterRequest, IQueryCollectionsRequest, IGetCollectionVariantCardsRequest, VariantCardsPageDto, ISingleOrderRequest, IOrderQueryRequest, IOrderRequest, IUpdateOrderRequest, IOrderHistoryRequest, IOrderByIdRequest, ISingleCustomerRequest, ICustomerQueryRequest, ICustomerRequest, IUpdateCustomerRequest, ISingleCartRequest, IUpdateCartRequest, IAddToCartRequest, IRemoveFromCartRequest, ICreateCheckoutRequest, IGetArticleRequest, IBlogArticleRequest, ITrendingArticleRequest, IArticleByHandleRequest, IGraphqlRequest, IFetchRequest } from './models/index.js';
2
+ import { I as ICommerceClient } from './interface-CWuOTUIW.js';
3
3
 
4
4
  /**
5
5
  * Shopify-specific types for the commerce library
@@ -154,6 +154,14 @@ declare abstract class BaseCommerceClient implements ICommerceClient {
154
154
  * @throws NotImplementedError if not implemented in adapter
155
155
  */
156
156
  queryCollections(params: IQueryCollectionsRequest, options?: IOptionsRequest): Promise<IResponse>;
157
+ /**
158
+ * Read a page of a collection's products, with one card per matching variant
159
+ * @param params - Handle plus page/per_page, sort, filter, fields
160
+ * @param options - Request options (headers, timeout, etc.)
161
+ * @returns Promise resolving to a VariantCardsPageDto
162
+ * @throws NotImplementedError if not implemented in adapter (custom backend only)
163
+ */
164
+ getCollectionVariantCards(params: IGetCollectionVariantCardsRequest, options?: IOptionsRequest): Promise<IResponse<VariantCardsPageDto>>;
157
165
  /**
158
166
  * Retrieve a single order by ID
159
167
  * @param params - Order identifier
@@ -497,6 +505,7 @@ declare class CustomBackendClient extends BaseCommerceClient {
497
505
  getCollectionsByHandles(params: ICollectionsByhandlesRequest, options?: IOptionsRequest): Promise<IResponse>;
498
506
  getCollectionFilters(params: ICollectionFilterRequest, options?: IOptionsRequest): Promise<IResponse>;
499
507
  queryCollections(params: IQueryCollectionsRequest, options?: IOptionsRequest): Promise<IResponse>;
508
+ getCollectionVariantCards(params: IGetCollectionVariantCardsRequest, options?: IOptionsRequest): Promise<IResponse<VariantCardsPageDto>>;
500
509
  getCart(params: ISingleCartRequest, options?: IOptionsRequest): Promise<IResponse>;
501
510
  createCart(options?: IOptionsRequest): Promise<IResponse>;
502
511
  updateCart(params: IUpdateCartRequest, options?: IOptionsRequest): Promise<IResponse>;
@@ -1,4 +1,4 @@
1
- import { I as ICommerceClient } from '../interface-CgPiwpPe.mjs';
1
+ import { I as ICommerceClient } from '../interface-D4gQCRsx.mjs';
2
2
  import '../models/index.mjs';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { I as ICommerceClient } from '../interface-BGV7d5F8.js';
1
+ import { I as ICommerceClient } from '../interface-CWuOTUIW.js';
2
2
  import '../models/index.js';
3
3
 
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shopkit/data-layer",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "description": "Enterprise data abstraction layer providing unified API for e-commerce platforms including Shopify and custom backends",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",