@shopkit/data-layer 1.4.6 → 1.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/dist/adapters/index.d.mts +2 -2
- package/dist/adapters/index.d.ts +2 -2
- package/dist/adapters/index.js +142 -1
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/index.mjs +142 -1
- package/dist/adapters/index.mjs.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +142 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +142 -1
- package/dist/index.mjs.map +1 -1
- package/dist/{interface-NJcjuqaL.d.mts → interface-BGV7d5F8.d.ts} +9 -1
- package/dist/{interface-dqoKc63z.d.ts → interface-CgPiwpPe.d.mts} +9 -1
- package/dist/models/index.d.mts +97 -1
- package/dist/models/index.d.ts +97 -1
- package/dist/{service-BHCLUEim.d.ts → service-BPzeuSLS.d.mts} +11 -2
- package/dist/{service-DBKEK2oS.d.mts → service-Cb074q9F.d.ts} +11 -2
- package/dist/static-params/index.d.mts +1 -1
- package/dist/static-params/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ISingleProductRequest, IOptionsRequest, IResponse, IProductQueryReqest, IProductsByHandlesRequest, IProductRecommendationsRequest, ISingleCollectionRequest, ICollectionQueryRequest, ICollectionsByhandlesRequest, ICollectionFilterRequest, ISingleOrderRequest, IOrderQueryRequest, IOrderRequest, IUpdateOrderRequest, IOrderHistoryRequest, IOrderByIdRequest, ISingleCustomerRequest, ICustomerQueryRequest, ICustomerRequest, IUpdateCustomerRequest, ISingleCartRequest, IUpdateCartRequest, IAddToCartRequest, IRemoveFromCartRequest, ICreateCheckoutRequest, IGetArticleRequest, IBlogArticleRequest, ITrendingArticleRequest, IArticleByHandleRequest, IGraphqlRequest, IFetchRequest } from './models/index.
|
|
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
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Core interface that all platform adapters will implement
|
|
@@ -80,6 +80,14 @@ interface ICommerceClient {
|
|
|
80
80
|
* @returns Promise resolving to available filter options (price ranges, brands, categories, etc.)
|
|
81
81
|
*/
|
|
82
82
|
getCollectionFilters(params: ICollectionFilterRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
83
|
+
/**
|
|
84
|
+
* Read a page of collections, with their products and variants, from one
|
|
85
|
+
* query document (filter, fields, include, sort, paging)
|
|
86
|
+
* @param params - Query document; see IQueryCollectionsRequest for the syntax and limits
|
|
87
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
88
|
+
* @returns Promise resolving to the collections, with paging in meta.pagination
|
|
89
|
+
*/
|
|
90
|
+
queryCollections(params: IQueryCollectionsRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
83
91
|
/**
|
|
84
92
|
* Retrieve a single order by ID
|
|
85
93
|
* @param params - Order identifier
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ISingleProductRequest, IOptionsRequest, IResponse, IProductQueryReqest, IProductsByHandlesRequest, IProductRecommendationsRequest, ISingleCollectionRequest, ICollectionQueryRequest, ICollectionsByhandlesRequest, ICollectionFilterRequest, ISingleOrderRequest, IOrderQueryRequest, IOrderRequest, IUpdateOrderRequest, IOrderHistoryRequest, IOrderByIdRequest, ISingleCustomerRequest, ICustomerQueryRequest, ICustomerRequest, IUpdateCustomerRequest, ISingleCartRequest, IUpdateCartRequest, IAddToCartRequest, IRemoveFromCartRequest, ICreateCheckoutRequest, IGetArticleRequest, IBlogArticleRequest, ITrendingArticleRequest, IArticleByHandleRequest, IGraphqlRequest, IFetchRequest } from './models/index.
|
|
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
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Core interface that all platform adapters will implement
|
|
@@ -80,6 +80,14 @@ interface ICommerceClient {
|
|
|
80
80
|
* @returns Promise resolving to available filter options (price ranges, brands, categories, etc.)
|
|
81
81
|
*/
|
|
82
82
|
getCollectionFilters(params: ICollectionFilterRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
83
|
+
/**
|
|
84
|
+
* Read a page of collections, with their products and variants, from one
|
|
85
|
+
* query document (filter, fields, include, sort, paging)
|
|
86
|
+
* @param params - Query document; see IQueryCollectionsRequest for the syntax and limits
|
|
87
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
88
|
+
* @returns Promise resolving to the collections, with paging in meta.pagination
|
|
89
|
+
*/
|
|
90
|
+
queryCollections(params: IQueryCollectionsRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
83
91
|
/**
|
|
84
92
|
* Retrieve a single order by ID
|
|
85
93
|
* @param params - Order identifier
|
package/dist/models/index.d.mts
CHANGED
|
@@ -376,6 +376,102 @@ interface ICollectionsByhandlesRequest extends ICollectionQueryRequest {
|
|
|
376
376
|
interface ICollectionFilterRequest {
|
|
377
377
|
handle: string;
|
|
378
378
|
}
|
|
379
|
+
/** Sort direction for a query document column. */
|
|
380
|
+
type QuerySortDirection = "asc" | "desc";
|
|
381
|
+
/**
|
|
382
|
+
* One relation under `include`: `true` returns the whole related row, an object
|
|
383
|
+
* narrows it. Relations nest: collections -> products -> variants/images/options,
|
|
384
|
+
* at most 3 relations per level and 3 levels deep.
|
|
385
|
+
*/
|
|
386
|
+
type IQueryCollectionsInclude = true | {
|
|
387
|
+
fields?: string[];
|
|
388
|
+
filter?: Record<string, unknown>;
|
|
389
|
+
sort?: Record<string, QuerySortDirection>;
|
|
390
|
+
limit?: number;
|
|
391
|
+
skip?: number;
|
|
392
|
+
/** Adds `<relation>Count` beside the page, e.g. `productsCount`. */
|
|
393
|
+
count?: boolean;
|
|
394
|
+
include?: Record<string, IQueryCollectionsInclude>;
|
|
395
|
+
};
|
|
396
|
+
/**
|
|
397
|
+
* Query document for the custom backend's collections query.
|
|
398
|
+
*
|
|
399
|
+
* Backend limits: 10 collections, 20 products per collection, 5 variants per
|
|
400
|
+
* product, and at most 200 rows across one collection x product x variant chain.
|
|
401
|
+
* The backend rejects any top-level key not listed here with a 400.
|
|
402
|
+
*
|
|
403
|
+
* @example
|
|
404
|
+
* ```typescript
|
|
405
|
+
* {
|
|
406
|
+
* filter: { handle: "summer" },
|
|
407
|
+
* limit: 1,
|
|
408
|
+
* include: {
|
|
409
|
+
* products: {
|
|
410
|
+
* fields: ["id", "title", "handle", "priceRange"],
|
|
411
|
+
* limit: 20,
|
|
412
|
+
* count: true,
|
|
413
|
+
* include: { variants: { fields: ["id", "price"], limit: 1 }, images: { limit: 1 } },
|
|
414
|
+
* },
|
|
415
|
+
* },
|
|
416
|
+
* availability: true,
|
|
417
|
+
* }
|
|
418
|
+
* ```
|
|
419
|
+
*/
|
|
420
|
+
interface IQueryCollectionsRequest {
|
|
421
|
+
/**
|
|
422
|
+
* Conditions on Collection. A bare value is equality; operators are $eq, $ne,
|
|
423
|
+
* $gt, $gte, $lt, $lte, $in, $not_in, $like, $is_null. To-many relations take
|
|
424
|
+
* $some / $every / $none, and $and / $or take a list.
|
|
425
|
+
*/
|
|
426
|
+
filter?: Record<string, unknown>;
|
|
427
|
+
/** Columns to return. The whole row when omitted. */
|
|
428
|
+
fields?: string[];
|
|
429
|
+
include?: Record<string, IQueryCollectionsInclude>;
|
|
430
|
+
sort?: Record<string, QuerySortDirection>;
|
|
431
|
+
/** Page size, at most 10. */
|
|
432
|
+
limit?: number;
|
|
433
|
+
skip?: number;
|
|
434
|
+
/** `next_cursor` of the previous page. Cannot be sent with `skip`. */
|
|
435
|
+
after?: string;
|
|
436
|
+
/** Fills `paging.total`. A second statement — send it on the first page only. */
|
|
437
|
+
count?: boolean;
|
|
438
|
+
/** Metafield levels to fetch. */
|
|
439
|
+
metafields?: {
|
|
440
|
+
collections?: boolean;
|
|
441
|
+
products?: boolean;
|
|
442
|
+
variants?: boolean;
|
|
443
|
+
};
|
|
444
|
+
/** Fills stock and availableForSale on variants. Needs the variants include. */
|
|
445
|
+
availability?: boolean;
|
|
446
|
+
/** Fills average_rating and rating_count on products. */
|
|
447
|
+
ratings?: boolean;
|
|
448
|
+
/**
|
|
449
|
+
* Opt in to filtering by the collection in the page URL. Off by default: the
|
|
450
|
+
* page builder merges route params into every data source's params, and on a
|
|
451
|
+
* product page the route `handle` is the PRODUCT's, so applying it implicitly
|
|
452
|
+
* would filter collections by a product handle.
|
|
453
|
+
*
|
|
454
|
+
* When true, the route `handle` becomes `filter.handle`, unless the filter
|
|
455
|
+
* already names a handle.
|
|
456
|
+
*
|
|
457
|
+
* COLLECTION TEMPLATES ONLY — the one template whose route `handle` is always a
|
|
458
|
+
* collection. Never set it on a product template: each one also renders at
|
|
459
|
+
* `/products/<handle>`, where the route `handle` is the product's, and the
|
|
460
|
+
* route params there look exactly like a collection page's, so this cannot be
|
|
461
|
+
* detected here. On a product template the widget comes back empty.
|
|
462
|
+
*/
|
|
463
|
+
useRouteHandle?: boolean;
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* Why a queryCollections call failed, in `error.code`.
|
|
467
|
+
*
|
|
468
|
+
* - `QUERY_REJECTED`: the backend refused the query (a 4xx). A template or code
|
|
469
|
+
* bug; retrying will not help. `error.message` names the path at fault.
|
|
470
|
+
* - `UPSTREAM_UNAVAILABLE`: no usable answer — network failure, timeout, 5xx,
|
|
471
|
+
* or a 200 that carried no data. Same meaning as `success: false` on
|
|
472
|
+
* getProduct / getCollection, so a route can keep its last good page.
|
|
473
|
+
*/
|
|
474
|
+
type QueryCollectionsErrorCode = "QUERY_REJECTED" | "UPSTREAM_UNAVAILABLE";
|
|
379
475
|
|
|
380
476
|
/**
|
|
381
477
|
* Order data models for the commerce library
|
|
@@ -591,4 +687,4 @@ interface IGetArticleRequest {
|
|
|
591
687
|
reverse?: boolean;
|
|
592
688
|
}
|
|
593
689
|
|
|
594
|
-
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 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 };
|
|
690
|
+
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 };
|
package/dist/models/index.d.ts
CHANGED
|
@@ -376,6 +376,102 @@ interface ICollectionsByhandlesRequest extends ICollectionQueryRequest {
|
|
|
376
376
|
interface ICollectionFilterRequest {
|
|
377
377
|
handle: string;
|
|
378
378
|
}
|
|
379
|
+
/** Sort direction for a query document column. */
|
|
380
|
+
type QuerySortDirection = "asc" | "desc";
|
|
381
|
+
/**
|
|
382
|
+
* One relation under `include`: `true` returns the whole related row, an object
|
|
383
|
+
* narrows it. Relations nest: collections -> products -> variants/images/options,
|
|
384
|
+
* at most 3 relations per level and 3 levels deep.
|
|
385
|
+
*/
|
|
386
|
+
type IQueryCollectionsInclude = true | {
|
|
387
|
+
fields?: string[];
|
|
388
|
+
filter?: Record<string, unknown>;
|
|
389
|
+
sort?: Record<string, QuerySortDirection>;
|
|
390
|
+
limit?: number;
|
|
391
|
+
skip?: number;
|
|
392
|
+
/** Adds `<relation>Count` beside the page, e.g. `productsCount`. */
|
|
393
|
+
count?: boolean;
|
|
394
|
+
include?: Record<string, IQueryCollectionsInclude>;
|
|
395
|
+
};
|
|
396
|
+
/**
|
|
397
|
+
* Query document for the custom backend's collections query.
|
|
398
|
+
*
|
|
399
|
+
* Backend limits: 10 collections, 20 products per collection, 5 variants per
|
|
400
|
+
* product, and at most 200 rows across one collection x product x variant chain.
|
|
401
|
+
* The backend rejects any top-level key not listed here with a 400.
|
|
402
|
+
*
|
|
403
|
+
* @example
|
|
404
|
+
* ```typescript
|
|
405
|
+
* {
|
|
406
|
+
* filter: { handle: "summer" },
|
|
407
|
+
* limit: 1,
|
|
408
|
+
* include: {
|
|
409
|
+
* products: {
|
|
410
|
+
* fields: ["id", "title", "handle", "priceRange"],
|
|
411
|
+
* limit: 20,
|
|
412
|
+
* count: true,
|
|
413
|
+
* include: { variants: { fields: ["id", "price"], limit: 1 }, images: { limit: 1 } },
|
|
414
|
+
* },
|
|
415
|
+
* },
|
|
416
|
+
* availability: true,
|
|
417
|
+
* }
|
|
418
|
+
* ```
|
|
419
|
+
*/
|
|
420
|
+
interface IQueryCollectionsRequest {
|
|
421
|
+
/**
|
|
422
|
+
* Conditions on Collection. A bare value is equality; operators are $eq, $ne,
|
|
423
|
+
* $gt, $gte, $lt, $lte, $in, $not_in, $like, $is_null. To-many relations take
|
|
424
|
+
* $some / $every / $none, and $and / $or take a list.
|
|
425
|
+
*/
|
|
426
|
+
filter?: Record<string, unknown>;
|
|
427
|
+
/** Columns to return. The whole row when omitted. */
|
|
428
|
+
fields?: string[];
|
|
429
|
+
include?: Record<string, IQueryCollectionsInclude>;
|
|
430
|
+
sort?: Record<string, QuerySortDirection>;
|
|
431
|
+
/** Page size, at most 10. */
|
|
432
|
+
limit?: number;
|
|
433
|
+
skip?: number;
|
|
434
|
+
/** `next_cursor` of the previous page. Cannot be sent with `skip`. */
|
|
435
|
+
after?: string;
|
|
436
|
+
/** Fills `paging.total`. A second statement — send it on the first page only. */
|
|
437
|
+
count?: boolean;
|
|
438
|
+
/** Metafield levels to fetch. */
|
|
439
|
+
metafields?: {
|
|
440
|
+
collections?: boolean;
|
|
441
|
+
products?: boolean;
|
|
442
|
+
variants?: boolean;
|
|
443
|
+
};
|
|
444
|
+
/** Fills stock and availableForSale on variants. Needs the variants include. */
|
|
445
|
+
availability?: boolean;
|
|
446
|
+
/** Fills average_rating and rating_count on products. */
|
|
447
|
+
ratings?: boolean;
|
|
448
|
+
/**
|
|
449
|
+
* Opt in to filtering by the collection in the page URL. Off by default: the
|
|
450
|
+
* page builder merges route params into every data source's params, and on a
|
|
451
|
+
* product page the route `handle` is the PRODUCT's, so applying it implicitly
|
|
452
|
+
* would filter collections by a product handle.
|
|
453
|
+
*
|
|
454
|
+
* When true, the route `handle` becomes `filter.handle`, unless the filter
|
|
455
|
+
* already names a handle.
|
|
456
|
+
*
|
|
457
|
+
* COLLECTION TEMPLATES ONLY — the one template whose route `handle` is always a
|
|
458
|
+
* collection. Never set it on a product template: each one also renders at
|
|
459
|
+
* `/products/<handle>`, where the route `handle` is the product's, and the
|
|
460
|
+
* route params there look exactly like a collection page's, so this cannot be
|
|
461
|
+
* detected here. On a product template the widget comes back empty.
|
|
462
|
+
*/
|
|
463
|
+
useRouteHandle?: boolean;
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* Why a queryCollections call failed, in `error.code`.
|
|
467
|
+
*
|
|
468
|
+
* - `QUERY_REJECTED`: the backend refused the query (a 4xx). A template or code
|
|
469
|
+
* bug; retrying will not help. `error.message` names the path at fault.
|
|
470
|
+
* - `UPSTREAM_UNAVAILABLE`: no usable answer — network failure, timeout, 5xx,
|
|
471
|
+
* or a 200 that carried no data. Same meaning as `success: false` on
|
|
472
|
+
* getProduct / getCollection, so a route can keep its last good page.
|
|
473
|
+
*/
|
|
474
|
+
type QueryCollectionsErrorCode = "QUERY_REJECTED" | "UPSTREAM_UNAVAILABLE";
|
|
379
475
|
|
|
380
476
|
/**
|
|
381
477
|
* Order data models for the commerce library
|
|
@@ -591,4 +687,4 @@ interface IGetArticleRequest {
|
|
|
591
687
|
reverse?: boolean;
|
|
592
688
|
}
|
|
593
689
|
|
|
594
|
-
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 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 };
|
|
690
|
+
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 };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ISingleProductRequest, IOptionsRequest, IResponse, IProductQueryReqest, IProductsByHandlesRequest, IProductRecommendationsRequest, ISingleCollectionRequest, ICollectionQueryRequest, ICollectionsByhandlesRequest, ICollectionFilterRequest, ISingleOrderRequest, IOrderQueryRequest, IOrderRequest, IUpdateOrderRequest, IOrderHistoryRequest, IOrderByIdRequest, ISingleCustomerRequest, ICustomerQueryRequest, ICustomerRequest, IUpdateCustomerRequest, ISingleCartRequest, IUpdateCartRequest, IAddToCartRequest, IRemoveFromCartRequest, ICreateCheckoutRequest, IGetArticleRequest, IBlogArticleRequest, ITrendingArticleRequest, IArticleByHandleRequest, IGraphqlRequest, IFetchRequest } from './models/index.
|
|
2
|
-
import { I as ICommerceClient } from './interface-
|
|
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';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Shopify-specific types for the commerce library
|
|
@@ -146,6 +146,14 @@ declare abstract class BaseCommerceClient implements ICommerceClient {
|
|
|
146
146
|
* @throws NotImplementedError if not implemented in adapter
|
|
147
147
|
*/
|
|
148
148
|
getCollectionFilters(params: ICollectionFilterRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
149
|
+
/**
|
|
150
|
+
* Read a page of collections, with their products and variants, from one query document
|
|
151
|
+
* @param params - Query document (filter, fields, include, sort, paging)
|
|
152
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
153
|
+
* @returns Promise resolving to collections, with paging in meta.pagination
|
|
154
|
+
* @throws NotImplementedError if not implemented in adapter
|
|
155
|
+
*/
|
|
156
|
+
queryCollections(params: IQueryCollectionsRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
149
157
|
/**
|
|
150
158
|
* Retrieve a single order by ID
|
|
151
159
|
* @param params - Order identifier
|
|
@@ -488,6 +496,7 @@ declare class CustomBackendClient extends BaseCommerceClient {
|
|
|
488
496
|
*/
|
|
489
497
|
getCollectionsByHandles(params: ICollectionsByhandlesRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
490
498
|
getCollectionFilters(params: ICollectionFilterRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
499
|
+
queryCollections(params: IQueryCollectionsRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
491
500
|
getCart(params: ISingleCartRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
492
501
|
createCart(options?: IOptionsRequest): Promise<IResponse>;
|
|
493
502
|
updateCart(params: IUpdateCartRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ISingleProductRequest, IOptionsRequest, IResponse, IProductQueryReqest, IProductsByHandlesRequest, IProductRecommendationsRequest, ISingleCollectionRequest, ICollectionQueryRequest, ICollectionsByhandlesRequest, ICollectionFilterRequest, ISingleOrderRequest, IOrderQueryRequest, IOrderRequest, IUpdateOrderRequest, IOrderHistoryRequest, IOrderByIdRequest, ISingleCustomerRequest, ICustomerQueryRequest, ICustomerRequest, IUpdateCustomerRequest, ISingleCartRequest, IUpdateCartRequest, IAddToCartRequest, IRemoveFromCartRequest, ICreateCheckoutRequest, IGetArticleRequest, IBlogArticleRequest, ITrendingArticleRequest, IArticleByHandleRequest, IGraphqlRequest, IFetchRequest } from './models/index.
|
|
2
|
-
import { I as ICommerceClient } from './interface-
|
|
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';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Shopify-specific types for the commerce library
|
|
@@ -146,6 +146,14 @@ declare abstract class BaseCommerceClient implements ICommerceClient {
|
|
|
146
146
|
* @throws NotImplementedError if not implemented in adapter
|
|
147
147
|
*/
|
|
148
148
|
getCollectionFilters(params: ICollectionFilterRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
149
|
+
/**
|
|
150
|
+
* Read a page of collections, with their products and variants, from one query document
|
|
151
|
+
* @param params - Query document (filter, fields, include, sort, paging)
|
|
152
|
+
* @param options - Request options (headers, timeout, etc.)
|
|
153
|
+
* @returns Promise resolving to collections, with paging in meta.pagination
|
|
154
|
+
* @throws NotImplementedError if not implemented in adapter
|
|
155
|
+
*/
|
|
156
|
+
queryCollections(params: IQueryCollectionsRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
149
157
|
/**
|
|
150
158
|
* Retrieve a single order by ID
|
|
151
159
|
* @param params - Order identifier
|
|
@@ -488,6 +496,7 @@ declare class CustomBackendClient extends BaseCommerceClient {
|
|
|
488
496
|
*/
|
|
489
497
|
getCollectionsByHandles(params: ICollectionsByhandlesRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
490
498
|
getCollectionFilters(params: ICollectionFilterRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
499
|
+
queryCollections(params: IQueryCollectionsRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
491
500
|
getCart(params: ISingleCartRequest, options?: IOptionsRequest): Promise<IResponse>;
|
|
492
501
|
createCart(options?: IOptionsRequest): Promise<IResponse>;
|
|
493
502
|
updateCart(params: IUpdateCartRequest, options?: IOptionsRequest): Promise<IResponse>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopkit/data-layer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.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",
|