@shopkit/data-layer 1.2.0 → 1.4.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.js +43 -644
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/index.mjs +42 -643
- package/dist/adapters/index.mjs.map +1 -1
- package/dist/index.d.mts +33 -2
- package/dist/index.d.ts +33 -2
- package/dist/index.js +45 -644
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +43 -644
- package/dist/index.mjs.map +1 -1
- package/dist/models/index.d.mts +13 -0
- package/dist/models/index.d.ts +13 -0
- package/package.json +4 -2
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { I as ICommerceClient } from './interface-NJcjuqaL.mjs';
|
|
2
|
-
import { I as IShopifyConfig, L as LoggerConfig,
|
|
2
|
+
import { I as IShopifyConfig, L as LoggerConfig, a as ICustomConfig, C as CustomBackendClient, S as ShopifyCommerceClient } from './service-DBKEK2oS.mjs';
|
|
3
3
|
export { EAvailability, ECollectionSortKey, EFulfillmentStatus, EOrderSortKey, EOrderStatus, EPaymentStatus, EProductSortKey, IAddToCartRequest, IAddress, IArticleByHandleRequest, IBaseQueryParams, IBlogArticleRequest, ICartItemRequest, ICollectionFilterRequest, ICollectionQueryRequest, ICollectionsByhandlesRequest, ICreateCheckoutRequest, ICustomerQueryRequest, ICustomerRequest, IFetchRequest, IGetArticleRequest, IGraphqlRequest, IImage, IMetafield, IMoney, IOptionsRequest, IOrderByIdRequest, IOrderHistoryRequest, IOrderQueryRequest, IOrderRequest, IPaginationParams, IProductFilters, IProductQueryReqest, IProductRecommendationsRequest, IProductsByHandlesRequest, IRemoveFromCartRequest, IResponse, IResponseMeta, ISeo, ISingleCartRequest, ISingleCollectionRequest, ISingleCustomerRequest, ISingleOrderRequest, ISingleProductRequest, ITrendingArticleRequest, IUpdateCartRequest, IUpdateCustomerRequest, IUpdateOrderRequest } from './models/index.mjs';
|
|
4
4
|
export { createCollectionProductStaticParams, createCollectionStaticParams, createProductStaticParams, createProductViaCollectionsStaticParams } from './static-params/index.mjs';
|
|
5
5
|
|
|
@@ -91,4 +91,35 @@ type IClientConfig = {
|
|
|
91
91
|
*/
|
|
92
92
|
declare function createCommerceClient(clientConfig: IClientConfig): ICommerceClient;
|
|
93
93
|
|
|
94
|
-
|
|
94
|
+
/**
|
|
95
|
+
* Centralized HTTP request deadline policy.
|
|
96
|
+
*
|
|
97
|
+
* Every upstream fetch made by this package MUST carry an AbortSignal.
|
|
98
|
+
* An unbounded fetch against a hung upstream never settles, which pins
|
|
99
|
+
* the awaiting caller (e.g. a Next.js SSR render and all its data) in
|
|
100
|
+
* memory indefinitely — root cause of the Bblunt prod memory leak
|
|
101
|
+
* (Jun 2026). See __tests__/adapters/custom/services/base.test.ts for
|
|
102
|
+
* the regression tests.
|
|
103
|
+
*
|
|
104
|
+
* Chosen default: 10s. Render-path APIs (products/collections) measure
|
|
105
|
+
* P99 well under 1s, while checkout-flow operations have P99s of 9–12s;
|
|
106
|
+
* 10s bounds the leak without failing legitimate slow checkout calls.
|
|
107
|
+
* Callers can tighten or loosen per request via options.timeoutMs, or
|
|
108
|
+
* take full control with options.signal.
|
|
109
|
+
*/
|
|
110
|
+
/** Single source of truth for the default upstream request deadline. */
|
|
111
|
+
declare const DEFAULT_REQUEST_TIMEOUT_MS = 10000;
|
|
112
|
+
/**
|
|
113
|
+
* Resolve the AbortSignal for an upstream request.
|
|
114
|
+
*
|
|
115
|
+
* Precedence: caller-provided signal > caller timeoutMs > defaultMs.
|
|
116
|
+
*
|
|
117
|
+
* @param options - Request options possibly carrying signal/timeoutMs
|
|
118
|
+
* @param defaultMs - Fallback deadline (defaults to DEFAULT_REQUEST_TIMEOUT_MS)
|
|
119
|
+
*/
|
|
120
|
+
declare function resolveRequestSignal(options?: {
|
|
121
|
+
signal?: AbortSignal | null;
|
|
122
|
+
timeoutMs?: number;
|
|
123
|
+
}, defaultMs?: number): AbortSignal;
|
|
124
|
+
|
|
125
|
+
export { DEFAULT_REQUEST_TIMEOUT_MS, type IClientConfig, ICommerceClient, ICustomConfig, IShopifyConfig, createCommerceClient, createCustomClient, createShopifyClient, resolveRequestSignal };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { I as ICommerceClient } from './interface-dqoKc63z.js';
|
|
2
|
-
import { I as IShopifyConfig, L as LoggerConfig,
|
|
2
|
+
import { I as IShopifyConfig, L as LoggerConfig, a as ICustomConfig, C as CustomBackendClient, S as ShopifyCommerceClient } from './service-BHCLUEim.js';
|
|
3
3
|
export { EAvailability, ECollectionSortKey, EFulfillmentStatus, EOrderSortKey, EOrderStatus, EPaymentStatus, EProductSortKey, IAddToCartRequest, IAddress, IArticleByHandleRequest, IBaseQueryParams, IBlogArticleRequest, ICartItemRequest, ICollectionFilterRequest, ICollectionQueryRequest, ICollectionsByhandlesRequest, ICreateCheckoutRequest, ICustomerQueryRequest, ICustomerRequest, IFetchRequest, IGetArticleRequest, IGraphqlRequest, IImage, IMetafield, IMoney, IOptionsRequest, IOrderByIdRequest, IOrderHistoryRequest, IOrderQueryRequest, IOrderRequest, IPaginationParams, IProductFilters, IProductQueryReqest, IProductRecommendationsRequest, IProductsByHandlesRequest, IRemoveFromCartRequest, IResponse, IResponseMeta, ISeo, ISingleCartRequest, ISingleCollectionRequest, ISingleCustomerRequest, ISingleOrderRequest, ISingleProductRequest, ITrendingArticleRequest, IUpdateCartRequest, IUpdateCustomerRequest, IUpdateOrderRequest } from './models/index.js';
|
|
4
4
|
export { createCollectionProductStaticParams, createCollectionStaticParams, createProductStaticParams, createProductViaCollectionsStaticParams } from './static-params/index.js';
|
|
5
5
|
|
|
@@ -91,4 +91,35 @@ type IClientConfig = {
|
|
|
91
91
|
*/
|
|
92
92
|
declare function createCommerceClient(clientConfig: IClientConfig): ICommerceClient;
|
|
93
93
|
|
|
94
|
-
|
|
94
|
+
/**
|
|
95
|
+
* Centralized HTTP request deadline policy.
|
|
96
|
+
*
|
|
97
|
+
* Every upstream fetch made by this package MUST carry an AbortSignal.
|
|
98
|
+
* An unbounded fetch against a hung upstream never settles, which pins
|
|
99
|
+
* the awaiting caller (e.g. a Next.js SSR render and all its data) in
|
|
100
|
+
* memory indefinitely — root cause of the Bblunt prod memory leak
|
|
101
|
+
* (Jun 2026). See __tests__/adapters/custom/services/base.test.ts for
|
|
102
|
+
* the regression tests.
|
|
103
|
+
*
|
|
104
|
+
* Chosen default: 10s. Render-path APIs (products/collections) measure
|
|
105
|
+
* P99 well under 1s, while checkout-flow operations have P99s of 9–12s;
|
|
106
|
+
* 10s bounds the leak without failing legitimate slow checkout calls.
|
|
107
|
+
* Callers can tighten or loosen per request via options.timeoutMs, or
|
|
108
|
+
* take full control with options.signal.
|
|
109
|
+
*/
|
|
110
|
+
/** Single source of truth for the default upstream request deadline. */
|
|
111
|
+
declare const DEFAULT_REQUEST_TIMEOUT_MS = 10000;
|
|
112
|
+
/**
|
|
113
|
+
* Resolve the AbortSignal for an upstream request.
|
|
114
|
+
*
|
|
115
|
+
* Precedence: caller-provided signal > caller timeoutMs > defaultMs.
|
|
116
|
+
*
|
|
117
|
+
* @param options - Request options possibly carrying signal/timeoutMs
|
|
118
|
+
* @param defaultMs - Fallback deadline (defaults to DEFAULT_REQUEST_TIMEOUT_MS)
|
|
119
|
+
*/
|
|
120
|
+
declare function resolveRequestSignal(options?: {
|
|
121
|
+
signal?: AbortSignal | null;
|
|
122
|
+
timeoutMs?: number;
|
|
123
|
+
}, defaultMs?: number): AbortSignal;
|
|
124
|
+
|
|
125
|
+
export { DEFAULT_REQUEST_TIMEOUT_MS, type IClientConfig, ICommerceClient, ICustomConfig, IShopifyConfig, createCommerceClient, createCustomClient, createShopifyClient, resolveRequestSignal };
|