brainerce 1.47.3 → 1.48.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/README.md CHANGED
@@ -3082,6 +3082,13 @@ const profile = await client.getMyProfile();
3082
3082
  console.log(profile.firstName);
3083
3083
  console.log(profile.email);
3084
3084
  console.log(profile.addresses);
3085
+
3086
+ // profile.role is a free-form segment the merchant sets from the dashboard
3087
+ // (e.g. "wholesale", "vip") — not customer-editable. Use it to gate custom
3088
+ // storefront features/UI: wholesale pricing, a VIP section, etc.
3089
+ if (profile.role === 'wholesale') {
3090
+ // show wholesale pricing / a bulk-order UI
3091
+ }
3085
3092
  ```
3086
3093
 
3087
3094
  #### Get Customer Orders
package/dist/index.d.mts CHANGED
@@ -299,6 +299,8 @@ interface CustomerProfile {
299
299
  phone?: string;
300
300
  emailVerified: boolean;
301
301
  acceptsMarketing: boolean;
302
+ /** Free-form segment set by the merchant (e.g. "wholesale", "vip") — use to gate custom storefront features. Admin-set only, never customer-editable. */
303
+ role?: string;
302
304
  addresses: CustomerAddress[];
303
305
  createdAt: string;
304
306
  updatedAt: string;
@@ -1863,6 +1865,8 @@ interface Customer {
1863
1865
  emailVerified: boolean;
1864
1866
  acceptsMarketing: boolean;
1865
1867
  tags: string[];
1868
+ /** Free-form segment set by the merchant (e.g. "wholesale", "vip") — use to gate custom storefront features. Admin-set only, never customer-editable. */
1869
+ role?: string;
1866
1870
  totalOrders: number;
1867
1871
  lastOrderAt?: string;
1868
1872
  metadata?: Record<string, unknown>;
@@ -1962,6 +1966,8 @@ interface CreateCustomerDto {
1962
1966
  password?: string;
1963
1967
  acceptsMarketing?: boolean;
1964
1968
  tags?: string[];
1969
+ /** Free-form merchant-set segment (e.g. "wholesale", "vip"), max 50 chars. */
1970
+ role?: string;
1965
1971
  metadata?: Record<string, unknown>;
1966
1972
  }
1967
1973
  interface UpdateCustomerDto {
@@ -1971,6 +1977,8 @@ interface UpdateCustomerDto {
1971
1977
  lastName?: string;
1972
1978
  acceptsMarketing?: boolean;
1973
1979
  tags?: string[];
1980
+ /** Free-form merchant-set segment. Pass '' to clear it. */
1981
+ role?: string;
1974
1982
  metadata?: Record<string, unknown>;
1975
1983
  }
1976
1984
  interface CustomerQueryParams {
@@ -1978,6 +1986,8 @@ interface CustomerQueryParams {
1978
1986
  limit?: number;
1979
1987
  search?: string;
1980
1988
  hasAccount?: boolean;
1989
+ /** Filter by merchant-set customer role/segment (exact match, case-insensitive). */
1990
+ role?: string;
1981
1991
  sortBy?: 'createdAt' | 'email' | 'firstName' | 'lastName' | 'lastOrderAt';
1982
1992
  sortOrder?: 'asc' | 'desc';
1983
1993
  }
@@ -7363,6 +7373,8 @@ declare class BrainerceClient {
7363
7373
  lastName?: string;
7364
7374
  phone?: string;
7365
7375
  emailVerified: boolean;
7376
+ /** Free-form segment set by the merchant (e.g. "wholesale", "vip") — use to gate custom storefront features. */
7377
+ role?: string;
7366
7378
  }>;
7367
7379
  /**
7368
7380
  * Get all addresses for a customer
@@ -10584,7 +10596,7 @@ declare class BrainerceError extends Error {
10584
10596
  constructor(message: string, statusCode: number, details?: unknown);
10585
10597
  }
10586
10598
 
10587
- declare const SDK_VERSION = "1.45.0";
10599
+ declare const SDK_VERSION = "1.48.0";
10588
10600
 
10589
10601
  /**
10590
10602
  * Verify a webhook signature from Brainerce
package/dist/index.d.ts CHANGED
@@ -299,6 +299,8 @@ interface CustomerProfile {
299
299
  phone?: string;
300
300
  emailVerified: boolean;
301
301
  acceptsMarketing: boolean;
302
+ /** Free-form segment set by the merchant (e.g. "wholesale", "vip") — use to gate custom storefront features. Admin-set only, never customer-editable. */
303
+ role?: string;
302
304
  addresses: CustomerAddress[];
303
305
  createdAt: string;
304
306
  updatedAt: string;
@@ -1863,6 +1865,8 @@ interface Customer {
1863
1865
  emailVerified: boolean;
1864
1866
  acceptsMarketing: boolean;
1865
1867
  tags: string[];
1868
+ /** Free-form segment set by the merchant (e.g. "wholesale", "vip") — use to gate custom storefront features. Admin-set only, never customer-editable. */
1869
+ role?: string;
1866
1870
  totalOrders: number;
1867
1871
  lastOrderAt?: string;
1868
1872
  metadata?: Record<string, unknown>;
@@ -1962,6 +1966,8 @@ interface CreateCustomerDto {
1962
1966
  password?: string;
1963
1967
  acceptsMarketing?: boolean;
1964
1968
  tags?: string[];
1969
+ /** Free-form merchant-set segment (e.g. "wholesale", "vip"), max 50 chars. */
1970
+ role?: string;
1965
1971
  metadata?: Record<string, unknown>;
1966
1972
  }
1967
1973
  interface UpdateCustomerDto {
@@ -1971,6 +1977,8 @@ interface UpdateCustomerDto {
1971
1977
  lastName?: string;
1972
1978
  acceptsMarketing?: boolean;
1973
1979
  tags?: string[];
1980
+ /** Free-form merchant-set segment. Pass '' to clear it. */
1981
+ role?: string;
1974
1982
  metadata?: Record<string, unknown>;
1975
1983
  }
1976
1984
  interface CustomerQueryParams {
@@ -1978,6 +1986,8 @@ interface CustomerQueryParams {
1978
1986
  limit?: number;
1979
1987
  search?: string;
1980
1988
  hasAccount?: boolean;
1989
+ /** Filter by merchant-set customer role/segment (exact match, case-insensitive). */
1990
+ role?: string;
1981
1991
  sortBy?: 'createdAt' | 'email' | 'firstName' | 'lastName' | 'lastOrderAt';
1982
1992
  sortOrder?: 'asc' | 'desc';
1983
1993
  }
@@ -7363,6 +7373,8 @@ declare class BrainerceClient {
7363
7373
  lastName?: string;
7364
7374
  phone?: string;
7365
7375
  emailVerified: boolean;
7376
+ /** Free-form segment set by the merchant (e.g. "wholesale", "vip") — use to gate custom storefront features. */
7377
+ role?: string;
7366
7378
  }>;
7367
7379
  /**
7368
7380
  * Get all addresses for a customer
@@ -10584,7 +10596,7 @@ declare class BrainerceError extends Error {
10584
10596
  constructor(message: string, statusCode: number, details?: unknown);
10585
10597
  }
10586
10598
 
10587
- declare const SDK_VERSION = "1.45.0";
10599
+ declare const SDK_VERSION = "1.48.0";
10588
10600
 
10589
10601
  /**
10590
10602
  * Verify a webhook signature from Brainerce
package/dist/index.js CHANGED
@@ -194,7 +194,7 @@ function isDevGuardsEnabled() {
194
194
  }
195
195
 
196
196
  // src/version.ts
197
- var SDK_VERSION = "1.45.0";
197
+ var SDK_VERSION = "1.48.0";
198
198
 
199
199
  // src/client.ts
200
200
  var DEFAULT_BASE_URL = "https://api.brainerce.com";
package/dist/index.mjs CHANGED
@@ -115,7 +115,7 @@ function isDevGuardsEnabled() {
115
115
  }
116
116
 
117
117
  // src/version.ts
118
- var SDK_VERSION = "1.45.0";
118
+ var SDK_VERSION = "1.48.0";
119
119
 
120
120
  // src/client.ts
121
121
  var DEFAULT_BASE_URL = "https://api.brainerce.com";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brainerce",
3
- "version": "1.47.3",
3
+ "version": "1.48.0",
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",