brainerce 1.25.0 → 1.26.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
@@ -49,7 +49,10 @@ Every Brainerce storefront must include **all mandatory features** below. Featur
49
49
  | Global header: cart count + search autocomplete | `client.getCart()`, `client.getSearchSuggestions(query)` | ✅ |
50
50
  | Discount banners + product badges | `client.getDiscountBanners()`, `client.getProductDiscountBadge(productId)` | ✅ |
51
51
  | Product reviews on PDP + JSON-LD aggregateRating | `client.listProductReviews(id)`, `client.submitProductReview(id, …)` | ✅ |
52
- | Multi-language + RTL (when i18n enabled) | `client.setLocale()` | conditional |
52
+ | Site chrome (header + footer + announcement bar) | `client.content.header.get()`, `client.content.footer.get()`, `client.content.announcement.list()` | |
53
+ | FAQ page | `client.content.faq.get('main', locale)` | conditional |
54
+ | Static pages catch-all (`/pages/[slug]`) | `client.content.page.getBySlug(slug, locale)` | conditional |
55
+ | Multi-language + RTL (when i18n enabled) | `client.setLocale()`, `client.getStoreDirection(locale)` | conditional |
53
56
 
54
57
  ---
55
58
 
@@ -368,6 +371,39 @@ Money on the wire is **always strings** (`priceDelta: "5.00"`). Validation failu
368
371
 
369
372
  Full rendering guide: [INTEGRATION.md §2.9](https://brainerce.com/docs/integration). Restaurant features (allergens, scheduled availability, nested combos to depth 3, downsell modifiers): [INTEGRATION-OPTIONAL.md "Restaurant / build-your-own products"](https://brainerce.com/docs/integration/raw?part=optional).
370
373
 
374
+ ### Content (FAQ / Footer / Header / Announcements / Pages)
375
+
376
+ Merchants edit site chrome and static content in the Brainerce dashboard under **Sell → Content**; storefronts pick up changes within ~5 minutes. Six types: `FAQ`, `FOOTER`, `HEADER`, `ANNOUNCEMENT`, `RICH_TEXT`, `PAGE`. Every type has `'main'` as its universal default key.
377
+
378
+ ```typescript
379
+ // Fetch chrome at the root layout (server component if Next.js)
380
+ const [header, footer, announcements] = await Promise.all([
381
+ client.content.header.get('main', locale),
382
+ client.content.footer.get('main', locale),
383
+ client.content.announcement.list(locale),
384
+ ]);
385
+
386
+ // FAQ page
387
+ const faq = await client.content.faq.get('main', locale);
388
+
389
+ // Static pages — catch-all route
390
+ const page = await client.content.page.getBySlug(params.slug, locale);
391
+ if (!page) notFound();
392
+ ```
393
+
394
+ All `get` / `getBySlug` return `null` on 404 — render a hard-coded fallback so the page never crashes when the merchant hasn't seeded yet.
395
+
396
+ **Security**: `FAQ.items[i].answer`, `RICH_TEXT.html`, and `PAGE.html` are **merchant-authored HTML**. The server does NOT pre-sanitize (merchants may embed iframes). ALWAYS sanitize before injecting:
397
+
398
+ ```typescript
399
+ import DOMPurify from 'isomorphic-dompurify';
400
+ <div dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(rawHtml) }} />
401
+ ```
402
+
403
+ The `create-brainerce-store` scaffold ships ready-made components (`<AnnouncementBar>`, `<SiteHeader>`, `<SiteFooter>`, `<FaqSection>`, `<RichTextBlock>`) + a `/pages/[slug]` catch-all route — use them rather than rolling your own renderers.
404
+
405
+ Full guide: [INTEGRATION.md "Content"](https://brainerce.com/docs/integration#content). Advanced patterns (channel scoping, custom fields, translations, admin writes): [INTEGRATION-OPTIONAL.md "Content"](https://brainerce.com/docs/integration/raw?part=optional). Validation + sanitize rules: [INTEGRATION-RULES.md "Content"](https://brainerce.com/docs/integration/raw?part=rules).
406
+
371
407
  ---
372
408
 
373
409
  ## Common Mistakes to Avoid
package/dist/index.d.mts CHANGED
@@ -118,6 +118,28 @@ interface StoreInfo {
118
118
  name: string;
119
119
  currency: string;
120
120
  language: string;
121
+ /**
122
+ * SEO snippet for the storefront homepage. Used for `<meta name="description">`,
123
+ * `og:description`, and `twitter:description`. 50-160 chars recommended.
124
+ * Null when the merchant has not authored one.
125
+ */
126
+ metaDescription?: string | null;
127
+ /**
128
+ * Public-facing store logo URL. Used by the storefront for the Organization
129
+ * JSON-LD on the homepage (Google Knowledge Panel, AI Overviews citation).
130
+ * Null when the merchant has not uploaded one.
131
+ */
132
+ logo?: string | null;
133
+ /** Public contact email — rendered in storefront footer, included in Organization JSON-LD. */
134
+ contactEmail?: string | null;
135
+ /** Public contact phone (free-form local format). Rendered in footer + Organization JSON-LD. */
136
+ contactPhone?: string | null;
137
+ /**
138
+ * Public social profile URLs keyed by platform. Feeds Organization.sameAs in JSON-LD
139
+ * (Google Knowledge Panel reinforcement) and the storefront footer icons.
140
+ * Known keys: `facebook`, `instagram`, `tiktok`, `twitter`, `youtube`.
141
+ */
142
+ socialLinks?: Record<string, string> | null;
121
143
  /** Sales Channel ID (sales-channel mode only) */
122
144
  salesChannelId?: string;
123
145
  /** @deprecated alias of `salesChannelId` — will be removed in SDK 2.0 */
@@ -153,8 +175,25 @@ interface I18nSettings {
153
175
  enabled: boolean;
154
176
  /** The store's default locale (content language) */
155
177
  defaultLocale: string;
178
+ /** Script direction of the default locale (derived from `defaultLocale`) */
179
+ defaultDirection?: 'ltr' | 'rtl';
156
180
  /** All supported locales */
157
181
  supportedLocales: string[];
182
+ /**
183
+ * Same locales as `supportedLocales`, but each entry includes its script
184
+ * direction and a default flag. Additive (introduced alongside `defaultDirection`)
185
+ * so existing consumers reading `supportedLocales` keep working.
186
+ */
187
+ supportedLocaleObjects?: SupportedLocaleObject[];
188
+ }
189
+ /** Per-locale entry returned alongside `supportedLocales` */
190
+ interface SupportedLocaleObject {
191
+ /** BCP-47 code (e.g. 'he', 'en-US') */
192
+ code: string;
193
+ /** Script direction for this locale */
194
+ direction: 'ltr' | 'rtl';
195
+ /** Whether this is the store's default locale */
196
+ isDefault: boolean;
158
197
  }
159
198
  /** Upsell feature configuration exposed to the storefront */
160
199
  interface UpsellSettings {
@@ -519,6 +558,54 @@ declare function getDescriptionContent(product: Pick<Product, 'description' | 'd
519
558
  } | {
520
559
  text: string;
521
560
  } | null;
561
+ /**
562
+ * Strip HTML tags and decode common HTML entities from a string, then collapse
563
+ * whitespace. Safe to use on merchant-authored product descriptions before
564
+ * placing them inside `<meta name="description">`, `og:description`, or
565
+ * `schema.org/Product.description`.
566
+ *
567
+ * @param html - Raw string that may contain HTML markup
568
+ * @returns Plain text suitable for SEO meta tags
569
+ *
570
+ * @example
571
+ * ```typescript
572
+ * import { stripHtml } from 'brainerce';
573
+ * stripHtml('<p>Hello <strong>world</strong></p>'); // 'Hello world'
574
+ * ```
575
+ */
576
+ declare function stripHtml(html: string | null | undefined): string;
577
+ /**
578
+ * Derive a clean meta description for a product, suitable for `<meta name="description">`,
579
+ * `og:description`, `twitter:description`, and `schema.org/Product.description`.
580
+ *
581
+ * Priority order:
582
+ * 1. `product.seoDescription` — merchant-authored, already SEO-shaped (returned as-is)
583
+ * 2. `product.metaDescription` — same idea under the backend field name
584
+ * 3. Truncated, HTML-stripped `product.description` — capped at `maxLength` with
585
+ * a word-boundary cut and an ellipsis when truncation happens
586
+ * 4. `product.name` — last-resort fallback so the meta tag is never empty
587
+ *
588
+ * The truncation is word-aware (never cuts mid-word) and never embeds HTML.
589
+ *
590
+ * @param product - Product or product-like object
591
+ * @param options.maxLength - Hard cap for derived descriptions. Default: 160 (Google SERP cap)
592
+ * @returns Clean meta description string, or empty string if nothing is available
593
+ *
594
+ * @example
595
+ * ```typescript
596
+ * import { deriveSeoDescription } from 'brainerce';
597
+ *
598
+ * // In Next.js generateMetadata:
599
+ * const description = deriveSeoDescription(product);
600
+ * return { description, openGraph: { description }, twitter: { description } };
601
+ * ```
602
+ */
603
+ declare function deriveSeoDescription(product: (Partial<Pick<Product, 'description' | 'descriptionFormat' | 'name'>> & {
604
+ seoDescription?: string | null;
605
+ metaDescription?: string | null;
606
+ }) | null | undefined, options?: {
607
+ maxLength?: number;
608
+ }): string;
522
609
  /**
523
610
  * Get a human-readable stock status string
524
611
  * Now tracking-mode aware:
@@ -3079,6 +3166,9 @@ interface Category {
3079
3166
  /** Platform-specific metadata */
3080
3167
  platformMetadata?: Record<string, Record<string, unknown>> | null;
3081
3168
  parentId?: string | null;
3169
+ image?: string | null;
3170
+ /** R2/S3 object key for `image`; null when the URL is external (e.g. Shopify CDN). */
3171
+ imageKey?: string | null;
3082
3172
  isActive: boolean;
3083
3173
  /** Tax behavior: 'taxable' follows store setting, 'exempt' always skips tax */
3084
3174
  taxBehavior?: 'taxable' | 'exempt';
@@ -3125,12 +3215,18 @@ interface CreateCategoryDto {
3125
3215
  storeId?: string;
3126
3216
  source?: string;
3127
3217
  isActive?: boolean;
3218
+ image?: string;
3219
+ /** R2/S3 object key for `image`; powers asset-deletion cascade. */
3220
+ imageKey?: string;
3128
3221
  taxBehavior?: 'taxable' | 'exempt';
3129
3222
  }
3130
3223
  interface UpdateCategoryDto {
3131
3224
  name?: string;
3132
3225
  parentId?: string | null;
3133
3226
  isActive?: boolean;
3227
+ image?: string | null;
3228
+ /** R2/S3 object key for `image`; pass null to clear. */
3229
+ imageKey?: string | null;
3134
3230
  taxBehavior?: 'taxable' | 'exempt';
3135
3231
  }
3136
3232
  /**
@@ -3144,6 +3240,8 @@ interface Brand {
3144
3240
  slug?: string | null;
3145
3241
  description?: string | null;
3146
3242
  logo?: string | null;
3243
+ /** R2/S3 object key for `logo`; null when the URL is external. */
3244
+ logoKey?: string | null;
3147
3245
  /** Platform-specific IDs */
3148
3246
  platformIds?: Record<string, string> | null;
3149
3247
  /** Platforms this brand is published on */
@@ -3196,6 +3294,8 @@ interface CreateBrandDto {
3196
3294
  slug?: string;
3197
3295
  description?: string;
3198
3296
  logo?: string;
3297
+ /** R2/S3 object key for `logo`; powers asset-deletion cascade. */
3298
+ logoKey?: string;
3199
3299
  storeId?: string;
3200
3300
  isActive?: boolean;
3201
3301
  }
@@ -3204,6 +3304,8 @@ interface UpdateBrandDto {
3204
3304
  slug?: string;
3205
3305
  description?: string | null;
3206
3306
  logo?: string | null;
3307
+ /** R2/S3 object key for `logo`; pass null to clear. */
3308
+ logoKey?: string | null;
3207
3309
  isActive?: boolean;
3208
3310
  }
3209
3311
  /**
@@ -4377,6 +4479,127 @@ interface ContactFormSummary {
4377
4479
  name: string;
4378
4480
  isDefault: boolean;
4379
4481
  }
4482
+ type ContentType = 'FAQ' | 'FOOTER' | 'HEADER' | 'ANNOUNCEMENT' | 'RICH_TEXT' | 'PAGE';
4483
+ type ContentStatus = 'DRAFT' | 'PUBLISHED';
4484
+ interface FaqItem {
4485
+ question: string;
4486
+ /** Sanitized HTML — sanitize before rendering. */
4487
+ answer: string;
4488
+ }
4489
+ interface FaqContent {
4490
+ items: FaqItem[];
4491
+ }
4492
+ interface FooterLink {
4493
+ label: string;
4494
+ url: string;
4495
+ }
4496
+ interface FooterColumn {
4497
+ title: string;
4498
+ links: FooterLink[];
4499
+ }
4500
+ interface FooterSocialLink {
4501
+ /** e.g. 'instagram' | 'facebook' | 'x' | 'linkedin' */
4502
+ platform: string;
4503
+ url: string;
4504
+ }
4505
+ interface FooterContent {
4506
+ columns: FooterColumn[];
4507
+ copyright?: string;
4508
+ social?: FooterSocialLink[];
4509
+ }
4510
+ interface HeaderLogo {
4511
+ src: string;
4512
+ alt: string;
4513
+ }
4514
+ interface HeaderNavItem {
4515
+ label: string;
4516
+ url: string;
4517
+ }
4518
+ interface HeaderCta {
4519
+ label: string;
4520
+ url: string;
4521
+ }
4522
+ interface HeaderContent {
4523
+ logo?: HeaderLogo;
4524
+ navItems: HeaderNavItem[];
4525
+ cta?: HeaderCta;
4526
+ }
4527
+ type AnnouncementSeverity = 'info' | 'warning' | 'success';
4528
+ interface AnnouncementContent {
4529
+ message: string;
4530
+ severity: AnnouncementSeverity;
4531
+ dismissible: boolean;
4532
+ /** ISO 8601. Storefront filters client-side. */
4533
+ startsAt?: string;
4534
+ endsAt?: string;
4535
+ ctaLabel?: string;
4536
+ ctaHref?: string;
4537
+ }
4538
+ interface RichTextContent {
4539
+ /** Raw HTML — sanitize before rendering. */
4540
+ html: string;
4541
+ }
4542
+ interface PageSeo {
4543
+ title?: string;
4544
+ description?: string;
4545
+ ogImage?: string;
4546
+ }
4547
+ interface PageContent {
4548
+ /** URL slug, lower-kebab. */
4549
+ slug: string;
4550
+ title: string;
4551
+ /** Raw HTML — sanitize before rendering. */
4552
+ html: string;
4553
+ seo?: PageSeo;
4554
+ }
4555
+ type ContentDataMap = {
4556
+ FAQ: FaqContent;
4557
+ FOOTER: FooterContent;
4558
+ HEADER: HeaderContent;
4559
+ ANNOUNCEMENT: AnnouncementContent;
4560
+ RICH_TEXT: RichTextContent;
4561
+ PAGE: PageContent;
4562
+ };
4563
+ interface ContentSummary {
4564
+ id: string;
4565
+ type: ContentType;
4566
+ key: string;
4567
+ name: string;
4568
+ status: ContentStatus;
4569
+ position: number;
4570
+ updatedAt: string;
4571
+ }
4572
+ interface Content<T extends ContentType = ContentType> extends ContentSummary {
4573
+ type: T;
4574
+ data: ContentDataMap[T];
4575
+ customFields: Record<string, string>;
4576
+ salesChannelIds: string[];
4577
+ }
4578
+ /** Body for `client.content.<type>.create()` (admin mode). */
4579
+ interface CreateContentInput<T extends ContentType = ContentType> {
4580
+ type: T;
4581
+ /** URL-safe slug. Use `'main'` as the default for the primary entry of each type. */
4582
+ key: string;
4583
+ name: string;
4584
+ description?: string;
4585
+ data: ContentDataMap[T];
4586
+ salesChannelIds?: string[];
4587
+ customFields?: Record<string, string>;
4588
+ translations?: Record<string, Partial<ContentDataMap[T]>>;
4589
+ status?: ContentStatus;
4590
+ position?: number;
4591
+ }
4592
+ /** Body for `client.content.<type>.update()` (admin mode). `data` is replaced wholesale. */
4593
+ interface UpdateContentInput<T extends ContentType = ContentType> {
4594
+ name?: string;
4595
+ description?: string;
4596
+ data?: ContentDataMap[T];
4597
+ salesChannelIds?: string[];
4598
+ customFields?: Record<string, string>;
4599
+ translations?: Record<string, Partial<ContentDataMap[T]>> | null;
4600
+ status?: ContentStatus;
4601
+ position?: number;
4602
+ }
4380
4603
  /**
4381
4604
  * How many modifiers a customer can pick from a group.
4382
4605
  *
@@ -4416,6 +4639,8 @@ interface Modifier {
4416
4639
  thumbnailUrl?: string;
4417
4640
  alt?: string;
4418
4641
  };
4642
+ /** R2/S3 object key for `image`; null when the URL is external. */
4643
+ imageKey?: string | null;
4419
4644
  position: number;
4420
4645
  /** Pre-checked in the UI on first render. */
4421
4646
  isDefault: boolean;
@@ -4650,6 +4875,20 @@ interface BrainerceApiError {
4650
4875
  details?: unknown;
4651
4876
  }
4652
4877
 
4878
+ /**
4879
+ * BCP-47 primary subtags whose script is written right-to-left. Inlined in the
4880
+ * SDK so storefronts don't take a runtime dependency on `@brainerce/types`.
4881
+ * Keep in sync with `packages/types/src/utils/locale-resolver.ts`.
4882
+ */
4883
+ declare const RTL_LOCALES: Set<string>;
4884
+ /**
4885
+ * Resolve script direction (`'ltr' | 'rtl'`) for a BCP-47 locale tag.
4886
+ * Unknown / undefined locales → `'ltr'`. Use this whenever you need direction
4887
+ * without a `BrainerceClient` instance (e.g. inside server-rendered layouts
4888
+ * before any SDK call). When you already have a client, prefer
4889
+ * `client.getStoreDirection()` which picks up the client's configured locale.
4890
+ */
4891
+ declare function getDirectionForLocale(locale: string | undefined | null): 'ltr' | 'rtl';
4653
4892
  /**
4654
4893
  * BrainerceClient - SDK for integrating stores with Brainerce Platform
4655
4894
  *
@@ -4796,6 +5035,17 @@ declare class BrainerceClient {
4796
5035
  * Works in vibe-coded, storefront, and admin mode
4797
5036
  */
4798
5037
  getStoreInfo(): Promise<StoreInfo>;
5038
+ /**
5039
+ * Resolve the script direction (`'ltr' | 'rtl'`) for a locale tag.
5040
+ * Use this on `<html dir>` in your root layout — do not maintain a local
5041
+ * RTL set in your storefront.
5042
+ *
5043
+ * @param locale - Optional BCP-47 tag. If omitted, falls back to the SDK
5044
+ * client's configured locale (`new BrainerceClient({ locale: 'he' })`).
5045
+ * @returns `'rtl'` for Arabic / Hebrew / Persian / Urdu / Yiddish family,
5046
+ * `'ltr'` for everything else (including unknown locales).
5047
+ */
5048
+ getStoreDirection(locale?: string | null): 'ltr' | 'rtl';
4799
5049
  /**
4800
5050
  * Get a list of products with pagination and filtering
4801
5051
  * Works in vibe-coded, storefront (public), and admin mode
@@ -5834,6 +6084,142 @@ declare class BrainerceClient {
5834
6084
  */
5835
6085
  get: (formKey?: string, locale?: string) => Promise<ContactFormPublic>;
5836
6086
  };
6087
+ /**
6088
+ * Typed merchant content store: FAQ, Footer, Header, Announcement,
6089
+ * Rich Text, and Page.
6090
+ *
6091
+ * Works in all three SDK modes (vibe-coded, storefront, admin):
6092
+ * - **Public reads** (`get`, `list`, `getBySlug`): work in any mode.
6093
+ * - **Write operations** (`create`, `update`, `publish`, `unpublish`,
6094
+ * `remove`): admin mode only — they call `/api/v1/content/...` with
6095
+ * the API key. Calling from storefront / vibe-coded mode throws.
6096
+ *
6097
+ * **Default key:** every type has `'main'` as its universal default key.
6098
+ * Pass no argument to fetch the main entry; pass a custom key (e.g.
6099
+ * `'shipping'`, `'holiday-2026'`) for topical entries.
6100
+ *
6101
+ * **404 contract:** public reads return `null` when no PUBLISHED row
6102
+ * exists. Storefronts should render hard-coded fallbacks on `null` so
6103
+ * the page never crashes when the merchant hasn't seeded yet.
6104
+ *
6105
+ * **Security:** RICH_TEXT, PAGE, and FAQ answers contain raw HTML.
6106
+ * Always sanitize with isomorphic-dompurify (or equivalent) before
6107
+ * rendering. The server does NOT pre-sanitize because some merchants
6108
+ * embed iframes (e.g. YouTube videos).
6109
+ *
6110
+ * @example
6111
+ * ```typescript
6112
+ * // Storefront (public) — fetch the merchant's FAQ in Hebrew
6113
+ * const faq = await client.content.faq.get('main', 'he');
6114
+ * if (faq) {
6115
+ * faq.data.items.forEach(({ question, answer }) => {
6116
+ * // sanitize(answer) before injecting via dangerouslySetInnerHTML
6117
+ * });
6118
+ * }
6119
+ *
6120
+ * // Admin — create a shipping FAQ in DRAFT
6121
+ * await client.content.faq.create({
6122
+ * key: 'shipping',
6123
+ * name: 'Shipping FAQ',
6124
+ * data: { items: [{ question: '…', answer: '…' }] },
6125
+ * });
6126
+ * ```
6127
+ */
6128
+ content: {
6129
+ faq: {
6130
+ /**
6131
+ * Fetch one PUBLISHED entry by key (defaults to `'main'`). Returns
6132
+ * `null` on 404 — render a hard-coded fallback when the merchant
6133
+ * hasn't seeded yet.
6134
+ */
6135
+ get: (key?: string, locale?: string) => Promise<Content<"FAQ"> | null>;
6136
+ /** List all PUBLISHED entries of this type. */
6137
+ list: (locale?: string) => Promise<Content<"FAQ">[]>;
6138
+ /** Create a new entry in DRAFT (admin mode). */
6139
+ create: (input: Omit<CreateContentInput<"FAQ">, "type">) => Promise<Content<"FAQ">>;
6140
+ };
6141
+ footer: {
6142
+ /**
6143
+ * Fetch one PUBLISHED entry by key (defaults to `'main'`). Returns
6144
+ * `null` on 404 — render a hard-coded fallback when the merchant
6145
+ * hasn't seeded yet.
6146
+ */
6147
+ get: (key?: string, locale?: string) => Promise<Content<"FOOTER"> | null>;
6148
+ /** List all PUBLISHED entries of this type. */
6149
+ list: (locale?: string) => Promise<Content<"FOOTER">[]>;
6150
+ /** Create a new entry in DRAFT (admin mode). */
6151
+ create: (input: Omit<CreateContentInput<"FOOTER">, "type">) => Promise<Content<"FOOTER">>;
6152
+ };
6153
+ header: {
6154
+ /**
6155
+ * Fetch one PUBLISHED entry by key (defaults to `'main'`). Returns
6156
+ * `null` on 404 — render a hard-coded fallback when the merchant
6157
+ * hasn't seeded yet.
6158
+ */
6159
+ get: (key?: string, locale?: string) => Promise<Content<"HEADER"> | null>;
6160
+ /** List all PUBLISHED entries of this type. */
6161
+ list: (locale?: string) => Promise<Content<"HEADER">[]>;
6162
+ /** Create a new entry in DRAFT (admin mode). */
6163
+ create: (input: Omit<CreateContentInput<"HEADER">, "type">) => Promise<Content<"HEADER">>;
6164
+ };
6165
+ announcement: {
6166
+ /**
6167
+ * Fetch one PUBLISHED entry by key (defaults to `'main'`). Returns
6168
+ * `null` on 404 — render a hard-coded fallback when the merchant
6169
+ * hasn't seeded yet.
6170
+ */
6171
+ get: (key?: string, locale?: string) => Promise<Content<"ANNOUNCEMENT"> | null>;
6172
+ /** List all PUBLISHED entries of this type. */
6173
+ list: (locale?: string) => Promise<Content<"ANNOUNCEMENT">[]>;
6174
+ /** Create a new entry in DRAFT (admin mode). */
6175
+ create: (input: Omit<CreateContentInput<"ANNOUNCEMENT">, "type">) => Promise<Content<"ANNOUNCEMENT">>;
6176
+ };
6177
+ richText: {
6178
+ /**
6179
+ * Fetch one PUBLISHED entry by key (defaults to `'main'`). Returns
6180
+ * `null` on 404 — render a hard-coded fallback when the merchant
6181
+ * hasn't seeded yet.
6182
+ */
6183
+ get: (key?: string, locale?: string) => Promise<Content<"RICH_TEXT"> | null>;
6184
+ /** List all PUBLISHED entries of this type. */
6185
+ list: (locale?: string) => Promise<Content<"RICH_TEXT">[]>;
6186
+ /** Create a new entry in DRAFT (admin mode). */
6187
+ create: (input: Omit<CreateContentInput<"RICH_TEXT">, "type">) => Promise<Content<"RICH_TEXT">>;
6188
+ };
6189
+ page: {
6190
+ /**
6191
+ * Fetch a PUBLISHED page by its `data.slug` (e.g. `'about'`).
6192
+ * Returns `null` on 404. Use this from your `app/[slug]/page.tsx`
6193
+ * catch-all route.
6194
+ */
6195
+ getBySlug: (slug: string, locale?: string) => Promise<Content<"PAGE"> | null>;
6196
+ /**
6197
+ * Fetch one PUBLISHED entry by key (defaults to `'main'`). Returns
6198
+ * `null` on 404 — render a hard-coded fallback when the merchant
6199
+ * hasn't seeded yet.
6200
+ */
6201
+ get: (key?: string, locale?: string) => Promise<Content<"PAGE"> | null>;
6202
+ /** List all PUBLISHED entries of this type. */
6203
+ list: (locale?: string) => Promise<Content<"PAGE">[]>;
6204
+ /** Create a new entry in DRAFT (admin mode). */
6205
+ create: (input: Omit<CreateContentInput<"PAGE">, "type">) => Promise<Content<"PAGE">>;
6206
+ };
6207
+ /** Find a single row by its admin id (admin mode). */
6208
+ findById: <T_1 extends ContentType = ContentType>(id: string) => Promise<Content<T_1>>;
6209
+ /** List rows in admin mode with optional filters. */
6210
+ listAdmin: <T_1 extends ContentType = ContentType>(filters?: {
6211
+ type?: T_1;
6212
+ status?: "DRAFT" | "PUBLISHED";
6213
+ }) => Promise<Array<Content<T_1>>>;
6214
+ /** Replace `data` (and optional metadata) on an existing row. */
6215
+ update: <T_1 extends ContentType>(id: string, input: UpdateContentInput<T_1>) => Promise<Content<T_1>>;
6216
+ /** Transition status DRAFT → PUBLISHED. */
6217
+ publish: (id: string) => Promise<Content>;
6218
+ /** Transition status PUBLISHED → DRAFT. */
6219
+ unpublish: (id: string) => Promise<Content>;
6220
+ /** Hard delete the row. Admin mode only. */
6221
+ remove: (id: string) => Promise<void>;
6222
+ };
5837
6223
  /**
5838
6224
  * Submit a contact inquiry from a storefront contact form.
5839
6225
  *
@@ -8458,4 +8844,4 @@ declare function isAllowedPaymentUrl(url: string, options?: PaymentUrlOptions):
8458
8844
  */
8459
8845
  declare function safePaymentRedirect(url: string, options?: PaymentUrlOptions): void;
8460
8846
 
8461
- export { type AddToCartDto, type AppliedDiscount, type ApplyCouponDto, type AttachModifierGroupInput, type Attribute, type AttributeOption, type AttributeSource, type BrainerceApiError, BrainerceClient, type BrainerceClientOptions, BrainerceError, type Brand, type BulkInventoryResponse, type BulkSaveVariantsDto, type BulkSaveVariantsResponse, type BulkVariantInput, type Cart, type CartAppliedDiscount, type CartBundleOffer, type CartBundlesResponse, type CartIncludeOption, type CartIncludeOptions, type CartItem, type CartItemModifierLine, type CartNudge, type CartRecommendationsResponse, type CartStatus, type CartUpgradeSuggestion, type CartUpgradesResponse, type CartWithIncludes, type Category, type CategoryNode, type CategorySuggestion, type Checkout, type CheckoutAddress, type CheckoutBumpsResponse, type CheckoutCustomFieldDefinition, type CheckoutFieldPricing, type CheckoutFieldVisibility, type CheckoutLineItem, type CheckoutPrefillData, type CheckoutStatus, type CompleteCheckoutResponse, type CompleteDraftDto, type ConfigureOAuthProviderDto as ConfigureOAuthProviderInput, type ConflictStatus, type ConnectorPlatform, type ContactFormFieldType, type ContactFormFieldValidation, type ContactFormPublic, type ContactFormPublicField, type ContactFormSummary, type Coupon, type CouponCreateResponse, type CouponQueryParams, type CouponStatus, type CouponType, type CouponValidationWarning, type CreateAddressDto, type CreateAttributeDto as CreateAttributeInput, type CreateAttributeOptionDto as CreateAttributeOptionInput, type CreateBrandDto as CreateBrandInput, type CreateCategoryDto as CreateCategoryInput, type CreateCheckoutDto, type CreateCouponDto, type CreateCustomApiDto, type CreateCustomerDto, type CreateEmailTemplateDto as CreateEmailTemplateInput, type CreateGuestOrderDto, type CreateInquiryInput, type CreateInquiryResponse, type CreateMetafieldDefinitionDto as CreateMetafieldDefinitionInput, type CreateModifierGroupInput, type CreateModifierInput, type CreateOrderDto, type CreateProductDto, type CreateRefundDto, type CreateShippingRateDto as CreateShippingRateInput, type CreateShippingZoneDto as CreateShippingZoneInput, type CreateTagDto as CreateTagInput, type CreateTaxRateDto as CreateTaxRateInput, type CreateVariantDto, type CustomApiAuthType, type CustomApiConnectionStatus, type CustomApiCredentials, type CustomApiIntegration, type CustomApiSyncConfig, type CustomApiSyncDirection, type CustomApiTestResult, type Customer, type CustomerAddress, type CustomerAuthResponse, type CustomerOAuthProvider, type CustomerProfile, type CustomerQueryParams, type DeleteProductResponse, type DiscountBanner, type DiscountRuleType, type DownloadFile, type DraftLineItem, type EditInventoryDto, type EmailDomain, type EmailEventSettings, type EmailEventType, type EmailSettings, type EmailTemplate, type EmailTemplatePreview, type EmailTemplatesResponse, type EmailVerificationResponse, type ExtendReservationResponse, type FormatPriceOptions, type FreeAllocationPolicy, type FulfillOrderDto, type GuestCheckoutStartResponse, type GuestOrderResponse, type InsufficientStockError, type InventoryInfo, type InventoryReservationStrategy, type InventorySyncStatus, type InventoryTrackingMode, type InvitationStatus, type InviteMemberDto as InviteMemberInput, type InviteStoreMemberDto as InviteStoreMemberInput, type ListModifierGroupsParams, type LocalCart, type LocalCartItem, type LockedVariant, type MergeCartsDto, type MetafieldConflict, type MetafieldConflictResolution, type MetafieldDefinition, type MetafieldType, type Modifier, type ModifierGroup, type ModifierSelection, type ModifierSelectionType, type ModifierValidationCode, type ModifierValidationError, type OAuthAuthorizeResponse, type OAuthCallbackResponse, type OAuthConnection, type OAuthConnectionsResponse, type OAuthProviderConfig, type OAuthProviderType, type OAuthProvidersResponse, type Order, type OrderAddress, type OrderBump, type OrderCustomer, type OrderDownloadLink, type OrderItem, type OrderQueryParams, type OrderStatus, type OrderStatusChange, type PaginatedResponse, type PaymentClientSdk, type PaymentConfig, type PaymentIntent, type PaymentProvider, type PaymentProviderConfig, type PaymentProvidersConfig, type PaymentStatus, type PaymentUrlOptions, type PickupLocation, type PlatformCouponCapabilities, type PlatformMetafieldMetadata, type PreviewEmailTemplateDto as PreviewEmailTemplateInput, type Product, type ProductAttributeInput, type ProductAvailability, type ProductCustomizationField, type ProductDiscount, type ProductDiscountBadge, type ProductImage, type ProductMetafield, type ProductMetafieldValue, type ProductModifierGroupAttachment, type ProductQueryParams, type ProductRecommendation, type ProductRecommendationsResponse, type ProductRelationType, type ProductSuggestion, type ProductVariant, type PublicMetafieldDefinition, type PublishProductResponse, type RecommendationVariant, type ReconcileInventoryResponse, type Refund, type RefundLineItem, type RefundLineItemResponse, type RefundType, type RegisterCustomerDto, type ReservationInfo, type ResolveMetafieldConflictDto as ResolveMetafieldConflictInput, type ResolveSyncConflictDto as ResolveSyncConflictInput, SDK_VERSION, type SearchSuggestions, type SelectPickupLocationDto, type SelectShippingMethodDto, type SendInvoiceDto, type SessionCartRef, type SetBillingAddressDto, type SetCheckoutCustomFieldsDto, type SetCheckoutCustomerDto, type SetDefinitionProductsDto as SetDefinitionProductsInput, type SetMetafieldPlatformsDto as SetMetafieldPlatformsInput, type SetShippingAddressDto, type SetShippingAddressResponse, type ShippingDestinations, type ShippingLine, type ShippingRate, type ShippingRateConfig, type ShippingRateType, type ShippingZone, type ShippingZoneQueryParams, type StockAvailabilityRequest, type StockAvailabilityResponse, type StockAvailabilityResult, type StoreInfo, type StoreInvitation, type StoreInvitationDetails, type StoreMember, type StorePermission, type StoreRole, type StoreTeamResponse, type SyncConflict, type SyncConflictResolution, type SyncJob, type Tag, type TaxBreakdown, type TaxBreakdownItem, type TaxRate, type TaxonomyQueryParams, type TeamInvitation, type TeamInvitationsResponse, type TeamMember, type TeamMembersResponse, type TeamRole, type UpdateAddressDto, type UpdateAttachmentInput, type UpdateAttributeDto as UpdateAttributeInput, type UpdateAttributeOptionDto as UpdateAttributeOptionInput, type UpdateBrandDto as UpdateBrandInput, type UpdateCartItemDto, type UpdateCategoryDto as UpdateCategoryInput, type UpdateCouponDto, type UpdateCustomApiDto, type UpdateCustomerDto, type UpdateDraftDto, type UpdateEmailSettingsDto as UpdateEmailSettingsInput, type UpdateEmailTemplateDto as UpdateEmailTemplateInput, type UpdateInventoryDto, type UpdateMemberRoleDto as UpdateMemberRoleInput, type UpdateMetafieldDefinitionDto as UpdateMetafieldDefinitionInput, type UpdateModifierGroupInput, type UpdateModifierInput, type UpdateOAuthProviderDto as UpdateOAuthProviderInput, type UpdateOrderDto, type UpdateOrderShippingDto, type UpdateProductDto, type UpdateShippingRateDto as UpdateShippingRateInput, type UpdateShippingZoneDto as UpdateShippingZoneInput, type UpdateStoreMemberDto as UpdateStoreMemberInput, type UpdateTagDto as UpdateTagInput, type UpdateTaxRateDto as UpdateTaxRateInput, type UpdateVariantDto, type UpdateVariantInventoryDto, type UpsertProductMetafieldDto as UpsertProductMetafieldInput, type UserStore, type UserStorePermissions, type VariantInventoryResponse, type VariantPlatformOverlay, type VariantStatus, type WaitForOrderOptions, type WaitForOrderResult, type WebhookEvent, type WebhookEventType, createWebhookHandler, enableDevGuards, formatPrice, getCartItemImage, getCartItemName, getCartTotals, getDescriptionContent, formatPrice as getPriceDisplay, getProductCustomizationFields, getProductMetafield, getProductMetafieldValue, getProductMetafieldsByType, getProductPrice, getProductPriceInfo, getProductSwatches, getStockStatus, getVariantOptions, getVariantPrice, isAllowedPaymentUrl, isCouponApplicableToProduct, isHtmlDescription, isWebhookEventType, parseWebhookEvent, safePaymentRedirect, verifyWebhook };
8847
+ export { type AddToCartDto, type AnnouncementContent, type AnnouncementSeverity, type AppliedDiscount, type ApplyCouponDto, type AttachModifierGroupInput, type Attribute, type AttributeOption, type AttributeSource, type BrainerceApiError, BrainerceClient, type BrainerceClientOptions, BrainerceError, type Brand, type BulkInventoryResponse, type BulkSaveVariantsDto, type BulkSaveVariantsResponse, type BulkVariantInput, type Cart, type CartAppliedDiscount, type CartBundleOffer, type CartBundlesResponse, type CartIncludeOption, type CartIncludeOptions, type CartItem, type CartItemModifierLine, type CartNudge, type CartRecommendationsResponse, type CartStatus, type CartUpgradeSuggestion, type CartUpgradesResponse, type CartWithIncludes, type Category, type CategoryNode, type CategorySuggestion, type Checkout, type CheckoutAddress, type CheckoutBumpsResponse, type CheckoutCustomFieldDefinition, type CheckoutFieldPricing, type CheckoutFieldVisibility, type CheckoutLineItem, type CheckoutPrefillData, type CheckoutStatus, type CompleteCheckoutResponse, type CompleteDraftDto, type ConfigureOAuthProviderDto as ConfigureOAuthProviderInput, type ConflictStatus, type ConnectorPlatform, type ContactFormFieldType, type ContactFormFieldValidation, type ContactFormPublic, type ContactFormPublicField, type ContactFormSummary, type Content, type ContentDataMap, type ContentStatus, type ContentSummary, type ContentType, type Coupon, type CouponCreateResponse, type CouponQueryParams, type CouponStatus, type CouponType, type CouponValidationWarning, type CreateAddressDto, type CreateAttributeDto as CreateAttributeInput, type CreateAttributeOptionDto as CreateAttributeOptionInput, type CreateBrandDto as CreateBrandInput, type CreateCategoryDto as CreateCategoryInput, type CreateCheckoutDto, type CreateContentInput, type CreateCouponDto, type CreateCustomApiDto, type CreateCustomerDto, type CreateEmailTemplateDto as CreateEmailTemplateInput, type CreateGuestOrderDto, type CreateInquiryInput, type CreateInquiryResponse, type CreateMetafieldDefinitionDto as CreateMetafieldDefinitionInput, type CreateModifierGroupInput, type CreateModifierInput, type CreateOrderDto, type CreateProductDto, type CreateRefundDto, type CreateShippingRateDto as CreateShippingRateInput, type CreateShippingZoneDto as CreateShippingZoneInput, type CreateTagDto as CreateTagInput, type CreateTaxRateDto as CreateTaxRateInput, type CreateVariantDto, type CustomApiAuthType, type CustomApiConnectionStatus, type CustomApiCredentials, type CustomApiIntegration, type CustomApiSyncConfig, type CustomApiSyncDirection, type CustomApiTestResult, type Customer, type CustomerAddress, type CustomerAuthResponse, type CustomerOAuthProvider, type CustomerProfile, type CustomerQueryParams, type DeleteProductResponse, type DiscountBanner, type DiscountRuleType, type DownloadFile, type DraftLineItem, type EditInventoryDto, type EmailDomain, type EmailEventSettings, type EmailEventType, type EmailSettings, type EmailTemplate, type EmailTemplatePreview, type EmailTemplatesResponse, type EmailVerificationResponse, type ExtendReservationResponse, type FaqContent, type FaqItem, type FooterColumn, type FooterContent, type FooterLink, type FooterSocialLink, type FormatPriceOptions, type FreeAllocationPolicy, type FulfillOrderDto, type GuestCheckoutStartResponse, type GuestOrderResponse, type HeaderContent, type HeaderCta, type HeaderLogo, type HeaderNavItem, type InsufficientStockError, type InventoryInfo, type InventoryReservationStrategy, type InventorySyncStatus, type InventoryTrackingMode, type InvitationStatus, type InviteMemberDto as InviteMemberInput, type InviteStoreMemberDto as InviteStoreMemberInput, type ListModifierGroupsParams, type LocalCart, type LocalCartItem, type LockedVariant, type MergeCartsDto, type MetafieldConflict, type MetafieldConflictResolution, type MetafieldDefinition, type MetafieldType, type Modifier, type ModifierGroup, type ModifierSelection, type ModifierSelectionType, type ModifierValidationCode, type ModifierValidationError, type OAuthAuthorizeResponse, type OAuthCallbackResponse, type OAuthConnection, type OAuthConnectionsResponse, type OAuthProviderConfig, type OAuthProviderType, type OAuthProvidersResponse, type Order, type OrderAddress, type OrderBump, type OrderCustomer, type OrderDownloadLink, type OrderItem, type OrderQueryParams, type OrderStatus, type OrderStatusChange, type PageContent, type PageSeo, type PaginatedResponse, type PaymentClientSdk, type PaymentConfig, type PaymentIntent, type PaymentProvider, type PaymentProviderConfig, type PaymentProvidersConfig, type PaymentStatus, type PaymentUrlOptions, type PickupLocation, type PlatformCouponCapabilities, type PlatformMetafieldMetadata, type PreviewEmailTemplateDto as PreviewEmailTemplateInput, type Product, type ProductAttributeInput, type ProductAvailability, type ProductCustomizationField, type ProductDiscount, type ProductDiscountBadge, type ProductImage, type ProductMetafield, type ProductMetafieldValue, type ProductModifierGroupAttachment, type ProductQueryParams, type ProductRecommendation, type ProductRecommendationsResponse, type ProductRelationType, type ProductSuggestion, type ProductVariant, type PublicMetafieldDefinition, type PublishProductResponse, RTL_LOCALES, type RecommendationVariant, type ReconcileInventoryResponse, type Refund, type RefundLineItem, type RefundLineItemResponse, type RefundType, type RegisterCustomerDto, type ReservationInfo, type ResolveMetafieldConflictDto as ResolveMetafieldConflictInput, type ResolveSyncConflictDto as ResolveSyncConflictInput, type RichTextContent, SDK_VERSION, type SearchSuggestions, type SelectPickupLocationDto, type SelectShippingMethodDto, type SendInvoiceDto, type SessionCartRef, type SetBillingAddressDto, type SetCheckoutCustomFieldsDto, type SetCheckoutCustomerDto, type SetDefinitionProductsDto as SetDefinitionProductsInput, type SetMetafieldPlatformsDto as SetMetafieldPlatformsInput, type SetShippingAddressDto, type SetShippingAddressResponse, type ShippingDestinations, type ShippingLine, type ShippingRate, type ShippingRateConfig, type ShippingRateType, type ShippingZone, type ShippingZoneQueryParams, type StockAvailabilityRequest, type StockAvailabilityResponse, type StockAvailabilityResult, type StoreInfo, type StoreInvitation, type StoreInvitationDetails, type StoreMember, type StorePermission, type StoreRole, type StoreTeamResponse, type SupportedLocaleObject, type SyncConflict, type SyncConflictResolution, type SyncJob, type Tag, type TaxBreakdown, type TaxBreakdownItem, type TaxRate, type TaxonomyQueryParams, type TeamInvitation, type TeamInvitationsResponse, type TeamMember, type TeamMembersResponse, type TeamRole, type UpdateAddressDto, type UpdateAttachmentInput, type UpdateAttributeDto as UpdateAttributeInput, type UpdateAttributeOptionDto as UpdateAttributeOptionInput, type UpdateBrandDto as UpdateBrandInput, type UpdateCartItemDto, type UpdateCategoryDto as UpdateCategoryInput, type UpdateContentInput, type UpdateCouponDto, type UpdateCustomApiDto, type UpdateCustomerDto, type UpdateDraftDto, type UpdateEmailSettingsDto as UpdateEmailSettingsInput, type UpdateEmailTemplateDto as UpdateEmailTemplateInput, type UpdateInventoryDto, type UpdateMemberRoleDto as UpdateMemberRoleInput, type UpdateMetafieldDefinitionDto as UpdateMetafieldDefinitionInput, type UpdateModifierGroupInput, type UpdateModifierInput, type UpdateOAuthProviderDto as UpdateOAuthProviderInput, type UpdateOrderDto, type UpdateOrderShippingDto, type UpdateProductDto, type UpdateShippingRateDto as UpdateShippingRateInput, type UpdateShippingZoneDto as UpdateShippingZoneInput, type UpdateStoreMemberDto as UpdateStoreMemberInput, type UpdateTagDto as UpdateTagInput, type UpdateTaxRateDto as UpdateTaxRateInput, type UpdateVariantDto, type UpdateVariantInventoryDto, type UpsertProductMetafieldDto as UpsertProductMetafieldInput, type UserStore, type UserStorePermissions, type VariantInventoryResponse, type VariantPlatformOverlay, type VariantStatus, type WaitForOrderOptions, type WaitForOrderResult, type WebhookEvent, type WebhookEventType, createWebhookHandler, deriveSeoDescription, enableDevGuards, formatPrice, getCartItemImage, getCartItemName, getCartTotals, getDescriptionContent, getDirectionForLocale, formatPrice as getPriceDisplay, getProductCustomizationFields, getProductMetafield, getProductMetafieldValue, getProductMetafieldsByType, getProductPrice, getProductPriceInfo, getProductSwatches, getStockStatus, getVariantOptions, getVariantPrice, isAllowedPaymentUrl, isCouponApplicableToProduct, isHtmlDescription, isWebhookEventType, parseWebhookEvent, safePaymentRedirect, stripHtml, verifyWebhook };