feeef 0.12.6 → 0.12.8

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.
@@ -229,9 +229,12 @@ export interface ProductOffer {
229
229
  code: string;
230
230
  title: string;
231
231
  subtitle?: string;
232
- price?: number;
233
- minQuantity?: number;
234
- maxQuantity?: number;
232
+ /** Unit price override; API may emit `null` when unset. */
233
+ price?: number | null;
234
+ /** Minimum qty for this offer; API may emit `null` when unset. */
235
+ minQuantity?: number | null;
236
+ /** Maximum qty for this offer; API may emit `null` when unset. */
237
+ maxQuantity?: number | null;
235
238
  freeShipping?: boolean;
236
239
  }
237
240
  /**
@@ -5,6 +5,19 @@ export type ProductOfferPolicySource = Pick<ProductEntity, 'offers' | 'forceOffe
5
5
  force_offer?: boolean | null;
6
6
  default_offer_code?: string | null;
7
7
  };
8
+ /**
9
+ * Coerce API offer quantity / price bounds.
10
+ *
11
+ * JSON often emits `null` for unset min/max. `Math.min(n, null)` is `0` in JS
12
+ * because `null` coerces to `0` — that zeroed cart qty after default/force offer
13
+ * apply. Only finite numbers are valid bounds; `null` / `undefined` / `NaN` mean
14
+ * "no limit" (or "no override" for price).
15
+ */
16
+ export declare function finiteOfferNumber(value: number | string | null | undefined): number | undefined;
17
+ /**
18
+ * Clamp cart quantity to an offer's min/max, ignoring nullish/non-finite bounds.
19
+ */
20
+ export declare function clampQuantityToOfferLimits(offer: Pick<ProductOffer, 'minQuantity' | 'maxQuantity'>, quantity: number): number;
8
21
  /**
9
22
  * Returns [defaultOfferCode] only when it exists in [offers]; otherwise null.
10
23
  * Use whenever persisting or applying a default so stale codes never leak.
@@ -20,6 +20,17 @@ export interface StoreTemplateListOptions {
20
20
  export declare class StoreTemplatesRepository extends ModelRepository<StoreTemplateEntity, StoreTemplateCreateInput, StoreTemplateUpdateInput> {
21
21
  constructor(client: AxiosInstance);
22
22
  list(options?: StoreTemplateListOptions): Promise<ListResponse<StoreTemplateEntity>>;
23
+ /**
24
+ * Platform default Lithium theme (`GET /store_templates/default`).
25
+ * Configured via `templateMarketplace.defaultTemplateId`.
26
+ */
27
+ getDefault(): Promise<{
28
+ id: string;
29
+ schema: Record<string, unknown>;
30
+ data: Record<string, unknown>;
31
+ version: number;
32
+ title: string;
33
+ }>;
23
34
  fork(options: {
24
35
  fromId: string;
25
36
  storeId: string;
@@ -88,13 +88,6 @@ export declare class CartService extends NotifiableService {
88
88
  * - Forced+default: always keep the forced offer
89
89
  */
90
90
  private applyProductOfferPolicy;
91
- /**
92
- * Clamps the quantity to be within the offer's min/max range
93
- * @param offer - The offer containing quantity constraints
94
- * @param quantity - The quantity to clamp
95
- * @returns The clamped quantity value
96
- */
97
- private clampQuantityToOfferLimits;
98
91
  /**
99
92
  * Update item by unique key (product ID + variant + offer + addons).
100
93
  * @param item - The item to identify the cart item to update.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "feeef",
3
3
  "description": "feeef sdk for javascript",
4
- "version": "0.12.6",
4
+ "version": "0.12.8",
5
5
  "main": "build/index.js",
6
6
  "type": "module",
7
7
  "files": [