brainerce 1.23.12 → 1.23.13

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/README.md CHANGED
@@ -3047,7 +3047,7 @@ const attributes = await client.listAttributes();
3047
3047
  // Create a color swatch attribute
3048
3048
  const colorAttr = await client.createAttribute({
3049
3049
  name: 'Color',
3050
- displayType: 'COLOR_SWATCH', // Options: 'DEFAULT' | 'COLOR_SWATCH' | 'IMAGE_SWATCH'
3050
+ displayType: 'COLOR_SWATCH', // Options: 'DEFAULT' | 'COLOR_SWATCH' | 'IMAGE_SWATCH' | 'MIXED_SWATCH'
3051
3051
  source: 'GLOBAL',
3052
3052
  });
3053
3053
 
@@ -3081,6 +3081,25 @@ await client.createAttributeOption(materialAttr.id, {
3081
3081
  source: 'GLOBAL',
3082
3082
  });
3083
3083
 
3084
+ // Mixed swatch attribute — each option independently uses color or image (image takes priority)
3085
+ const finishAttr = await client.createAttribute({
3086
+ name: 'Finish',
3087
+ displayType: 'MIXED_SWATCH',
3088
+ source: 'GLOBAL',
3089
+ });
3090
+ await client.createAttributeOption(finishAttr.id, {
3091
+ name: 'Gold',
3092
+ value: 'gold',
3093
+ swatchColor: '#FFD700',
3094
+ source: 'GLOBAL',
3095
+ });
3096
+ await client.createAttributeOption(finishAttr.id, {
3097
+ name: 'Marble',
3098
+ value: 'marble',
3099
+ swatchImageUrl: 'https://example.com/marble.jpg',
3100
+ source: 'GLOBAL',
3101
+ });
3102
+
3084
3103
  // Default attribute (text buttons/dropdown)
3085
3104
  const sizeAttr = await client.createAttribute({
3086
3105
  name: 'Size',
package/dist/index.d.mts CHANGED
@@ -4354,6 +4354,8 @@ interface Modifier {
4354
4354
  isDefault: boolean;
4355
4355
  /** Sold-out toggle: `false` = out of stock, hidden as selectable in storefronts. */
4356
4356
  available: boolean;
4357
+ /** When `true`, this modifier is never allocated as a free selection — customers always pay its `priceDelta` even when `freeQuantity > 0` on the group. */
4358
+ excludeFromFree?: boolean;
4357
4359
  /**
4358
4360
  * Nested-combo target. When present, picking this modifier opens the
4359
4361
  * referenced product's own modifier groups (depth ≤ 3).
@@ -4524,6 +4526,8 @@ interface CreateModifierInput {
4524
4526
  position?: number;
4525
4527
  isDefault?: boolean;
4526
4528
  available?: boolean;
4529
+ /** When `true`, never allocated as a free selection — customers always pay this modifier's `priceDelta`. */
4530
+ excludeFromFree?: boolean;
4527
4531
  referencedProductId?: string;
4528
4532
  }
4529
4533
  interface UpdateModifierInput extends Partial<CreateModifierInput> {
package/dist/index.d.ts CHANGED
@@ -4354,6 +4354,8 @@ interface Modifier {
4354
4354
  isDefault: boolean;
4355
4355
  /** Sold-out toggle: `false` = out of stock, hidden as selectable in storefronts. */
4356
4356
  available: boolean;
4357
+ /** When `true`, this modifier is never allocated as a free selection — customers always pay its `priceDelta` even when `freeQuantity > 0` on the group. */
4358
+ excludeFromFree?: boolean;
4357
4359
  /**
4358
4360
  * Nested-combo target. When present, picking this modifier opens the
4359
4361
  * referenced product's own modifier groups (depth ≤ 3).
@@ -4524,6 +4526,8 @@ interface CreateModifierInput {
4524
4526
  position?: number;
4525
4527
  isDefault?: boolean;
4526
4528
  available?: boolean;
4529
+ /** When `true`, never allocated as a free selection — customers always pay this modifier's `priceDelta`. */
4530
+ excludeFromFree?: boolean;
4527
4531
  referencedProductId?: string;
4528
4532
  }
4529
4533
  interface UpdateModifierInput extends Partial<CreateModifierInput> {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brainerce",
3
- "version": "1.23.12",
3
+ "version": "1.23.13",
4
4
  "description": "Official SDK for building e-commerce storefronts with Brainerce Platform. Perfect for vibe-coded sites, AI-built stores (Cursor, Lovable, v0), and custom storefronts.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",