brainerce 2.0.0 → 2.0.2

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/index.d.mts CHANGED
@@ -14,7 +14,7 @@ interface BrainerceClientOptions {
14
14
  salesChannelId?: string;
15
15
  /**
16
16
  * @deprecated Use `salesChannelId` instead. `connectionId` is kept as a
17
- * backwards-compatible alias and will be removed in SDK 2.0.
17
+ * backwards-compatible alias. It is permanent and is not scheduled for removal.
18
18
  */
19
19
  connectionId?: string;
20
20
  /**
@@ -202,13 +202,13 @@ interface StoreInfo {
202
202
  socialLinks?: Record<string, string> | null;
203
203
  /** Sales Channel ID (sales-channel mode only) */
204
204
  salesChannelId?: string;
205
- /** @deprecated alias of `salesChannelId` — will be removed in SDK 2.0 */
205
+ /** @deprecated permanent back-compat alias of `salesChannelId` — not scheduled for removal */
206
206
  connectionId?: string;
207
207
  /** Store name (sales-channel mode only - same as name) */
208
208
  storeName?: string;
209
209
  /** Sales channel status (sales-channel mode only) */
210
210
  salesChannelStatus?: string;
211
- /** @deprecated alias of `salesChannelStatus` — will be removed in SDK 2.0 */
211
+ /** @deprecated permanent back-compat alias of `salesChannelStatus` — not scheduled for removal */
212
212
  status?: string;
213
213
  /** Allowed API scopes (sales-channel mode only) */
214
214
  allowedScopes?: string[];
@@ -765,7 +765,7 @@ interface Product {
765
765
  attribute: {
766
766
  id: string;
767
767
  name: string;
768
- displayType?: string;
768
+ displayType?: AttributeDisplayType;
769
769
  translations?: Record<string, Record<string, string>> | null;
770
770
  } | null;
771
771
  attributeOption: {
@@ -785,14 +785,14 @@ interface Product {
785
785
  name: string;
786
786
  connectionId: string;
787
787
  };
788
- /** @deprecated alias of `salesChannel` — will be removed in SDK 2.0 */
788
+ /** @deprecated permanent back-compat alias of `salesChannel` — not scheduled for removal */
789
789
  connection?: {
790
790
  id: string;
791
791
  name: string;
792
792
  connectionId: string;
793
793
  };
794
794
  }>;
795
- /** @deprecated alias of `channelPublishes` — will be removed in SDK 2.0 */
795
+ /** @deprecated permanent back-compat alias of `channelPublishes` — not scheduled for removal */
796
796
  vibeCodedPublishes?: Array<{
797
797
  salesChannel: {
798
798
  id: string;
@@ -2144,14 +2144,14 @@ interface Coupon {
2144
2144
  name: string;
2145
2145
  connectionId: string;
2146
2146
  };
2147
- /** @deprecated alias of `salesChannel` — will be removed in SDK 2.0 */
2147
+ /** @deprecated permanent back-compat alias of `salesChannel` — not scheduled for removal */
2148
2148
  connection?: {
2149
2149
  id: string;
2150
2150
  name: string;
2151
2151
  connectionId: string;
2152
2152
  };
2153
2153
  }>;
2154
- /** @deprecated alias of `channelPublishes` — will be removed in SDK 2.0 */
2154
+ /** @deprecated permanent back-compat alias of `channelPublishes` — not scheduled for removal */
2155
2155
  vibeCodedPublishes?: Array<{
2156
2156
  salesChannel: {
2157
2157
  id: string;
@@ -3886,7 +3886,7 @@ interface WebhookEvent {
3886
3886
  data: unknown;
3887
3887
  timestamp: string;
3888
3888
  }
3889
- type WebhookEventType = 'product.created' | 'product.updated' | 'product.deleted' | 'inventory.updated' | 'order.created' | 'order.updated' | 'coupon.created' | 'coupon.updated' | 'coupon.deleted' | 'cart.created' | 'cart.updated' | 'cart.abandoned' | 'checkout.started' | 'checkout.completed' | 'checkout.failed';
3889
+ type WebhookEventType = 'order.created' | 'order.updated' | 'order.paid' | 'order.fulfilled' | 'order.cancelled' | 'order.refunded' | 'customer.created' | 'customer.updated' | 'customer.deleted' | 'product.created' | 'product.updated' | 'product.deleted' | 'inventory.updated' | 'inventory.low' | 'checkout.completed' | 'checkout.abandoned' | 'payment.succeeded' | 'payment.failed' | 'payment.refunded' | 'blog.post.published' | 'blog.post.updated';
3890
3890
  type VariantStatus = 'active' | 'draft';
3891
3891
  interface CreateVariantDto {
3892
3892
  sku?: string;
@@ -4697,14 +4697,14 @@ interface Category {
4697
4697
  name: string;
4698
4698
  connectionId: string;
4699
4699
  };
4700
- /** @deprecated alias of `salesChannel` — will be removed in SDK 2.0 */
4700
+ /** @deprecated permanent back-compat alias of `salesChannel` — not scheduled for removal */
4701
4701
  connection?: {
4702
4702
  id: string;
4703
4703
  name: string;
4704
4704
  connectionId: string;
4705
4705
  };
4706
4706
  }>;
4707
- /** @deprecated alias of `channelPublishes` — will be removed in SDK 2.0 */
4707
+ /** @deprecated permanent back-compat alias of `channelPublishes` — not scheduled for removal */
4708
4708
  vibeCodedPublishes?: Array<{
4709
4709
  salesChannel: {
4710
4710
  id: string;
@@ -4785,14 +4785,14 @@ interface Brand {
4785
4785
  name: string;
4786
4786
  connectionId: string;
4787
4787
  };
4788
- /** @deprecated alias of `salesChannel` — will be removed in SDK 2.0 */
4788
+ /** @deprecated permanent back-compat alias of `salesChannel` — not scheduled for removal */
4789
4789
  connection?: {
4790
4790
  id: string;
4791
4791
  name: string;
4792
4792
  connectionId: string;
4793
4793
  };
4794
4794
  }>;
4795
- /** @deprecated alias of `channelPublishes` — will be removed in SDK 2.0 */
4795
+ /** @deprecated permanent back-compat alias of `channelPublishes` — not scheduled for removal */
4796
4796
  vibeCodedPublishes?: Array<{
4797
4797
  salesChannel: {
4798
4798
  id: string;
@@ -4854,14 +4854,14 @@ interface Tag {
4854
4854
  name: string;
4855
4855
  connectionId: string;
4856
4856
  };
4857
- /** @deprecated alias of `salesChannel` — will be removed in SDK 2.0 */
4857
+ /** @deprecated permanent back-compat alias of `salesChannel` — not scheduled for removal */
4858
4858
  connection?: {
4859
4859
  id: string;
4860
4860
  name: string;
4861
4861
  connectionId: string;
4862
4862
  };
4863
4863
  }>;
4864
- /** @deprecated alias of `channelPublishes` — will be removed in SDK 2.0 */
4864
+ /** @deprecated permanent back-compat alias of `channelPublishes` — not scheduled for removal */
4865
4865
  vibeCodedPublishes?: Array<{
4866
4866
  salesChannel: {
4867
4867
  id: string;
@@ -4890,6 +4890,11 @@ interface UpdateTagDto {
4890
4890
  * Attribute source type
4891
4891
  */
4892
4892
  type AttributeSource = 'GLOBAL' | 'PLATFORM';
4893
+ /**
4894
+ * How an attribute's options render as swatches on the storefront.
4895
+ * `'DEFAULT'` is a plain text/dropdown option list.
4896
+ */
4897
+ type AttributeDisplayType = 'DEFAULT' | 'COLOR_SWATCH' | 'IMAGE_SWATCH' | 'MIXED_SWATCH';
4893
4898
  /**
4894
4899
  * Attribute for product variations
4895
4900
  */
@@ -4898,7 +4903,7 @@ interface Attribute {
4898
4903
  accountId: string;
4899
4904
  storeId?: string | null;
4900
4905
  name: string;
4901
- displayType?: string;
4906
+ displayType?: AttributeDisplayType;
4902
4907
  source: AttributeSource;
4903
4908
  platform?: ConnectorPlatform | null;
4904
4909
  externalId?: string | null;
@@ -4930,7 +4935,7 @@ interface AttributeOption {
4930
4935
  }
4931
4936
  interface CreateAttributeDto {
4932
4937
  name: string;
4933
- displayType?: string;
4938
+ displayType?: AttributeDisplayType;
4934
4939
  source: AttributeSource;
4935
4940
  platform?: ConnectorPlatform;
4936
4941
  storeId?: string;
@@ -4940,7 +4945,7 @@ interface CreateAttributeDto {
4940
4945
  }
4941
4946
  interface UpdateAttributeDto {
4942
4947
  name?: string;
4943
- displayType?: string;
4948
+ displayType?: AttributeDisplayType;
4944
4949
  platformMetadata?: Record<string, unknown>;
4945
4950
  isActive?: boolean;
4946
4951
  }
@@ -5125,6 +5130,72 @@ interface ShippingZoneQueryParams {
5125
5130
  sortBy?: string;
5126
5131
  sortOrder?: 'asc' | 'desc';
5127
5132
  }
5133
+ /**
5134
+ * Parcel override for a return label. Omit to use the installed shipping
5135
+ * app's configured defaults — what the customer packs a return into is
5136
+ * rarely what left the warehouse.
5137
+ */
5138
+ interface ReturnLabelParcel {
5139
+ length?: string;
5140
+ width?: string;
5141
+ height?: string;
5142
+ weight?: string;
5143
+ distanceUnit?: 'in' | 'cm';
5144
+ massUnit?: 'lb' | 'oz' | 'g' | 'kg';
5145
+ }
5146
+ /**
5147
+ * Buy a return label for an order: the customer ships, the merchant receives.
5148
+ * See {@link BrainerceClient.createReturnLabel}.
5149
+ *
5150
+ * There is no `rateId` here, unlike a normal shipment. A return is a distinct
5151
+ * kind of shipment at the carrier, fixed when it is created and not amendable
5152
+ * afterwards, so it cannot be rate-shopped first — this quotes and buys in
5153
+ * one call. `preferredCarrier` / `preferredService` are the only steering;
5154
+ * omit both and the cheapest rate wins, with the response reporting what was
5155
+ * actually billed.
5156
+ *
5157
+ * The merchant's carrier account pays. There is no mechanism for charging the
5158
+ * customer for return postage — the cost lands on
5159
+ * {@link CreateReturnLabelResponse.rate} so it can be deducted from a refund
5160
+ * deliberately rather than absorbed silently.
5161
+ */
5162
+ interface CreateReturnLabelDto {
5163
+ /** Parcel dimensions for the return. Defaults to the shipping app config. */
5164
+ parcel?: ReturnLabelParcel;
5165
+ /**
5166
+ * Label file format. `'PDF'` prints from a browser, which is what a
5167
+ * customer needs; `'ZPL'`/`'EPL'` drive warehouse thermal printers.
5168
+ * Defaults to `'PDF'`. If the carrier cannot produce the requested format
5169
+ * it returns its closest match rather than failing the purchase.
5170
+ */
5171
+ labelFormat?: 'PDF' | 'PNG' | 'ZPL' | 'EPL';
5172
+ /** Preferred carrier slug (e.g. `'USPS'`). Falls back to the cheapest rate. */
5173
+ preferredCarrier?: string;
5174
+ /** Preferred service slug (e.g. `'GroundAdvantage'`). Falls back to the cheapest rate. */
5175
+ preferredService?: string;
5176
+ /**
5177
+ * The outbound `Shipment.id` this return reverses. Recorded on the return
5178
+ * for the merchant's own records; not required, since a return can predate
5179
+ * any shipment record.
5180
+ */
5181
+ returnForShipmentId?: string;
5182
+ /** Why the customer is returning it. Stored on the shipment, shown to the merchant. */
5183
+ reason?: string;
5184
+ }
5185
+ /** Response from {@link BrainerceClient.createReturnLabel}. */
5186
+ interface CreateReturnLabelResponse {
5187
+ shipmentId: string;
5188
+ labelUrl: string;
5189
+ trackingNumber: string;
5190
+ carrier: string;
5191
+ /**
5192
+ * What the merchant's carrier account was billed for this return. `null`
5193
+ * only when the app reported no usable figure — the label is real either
5194
+ * way, and showing nothing beats showing a guess.
5195
+ */
5196
+ rate: string | null;
5197
+ rateCurrency: string | null;
5198
+ }
5128
5199
  /**
5129
5200
  * Tax rate configuration
5130
5201
  */
@@ -5507,14 +5578,14 @@ interface MetafieldDefinition {
5507
5578
  name: string;
5508
5579
  connectionId: string;
5509
5580
  };
5510
- /** @deprecated alias of `salesChannel` — will be removed in SDK 2.0 */
5581
+ /** @deprecated permanent back-compat alias of `salesChannel` — not scheduled for removal */
5511
5582
  connection?: {
5512
5583
  id: string;
5513
5584
  name: string;
5514
5585
  connectionId: string;
5515
5586
  };
5516
5587
  }>;
5517
- /** @deprecated alias of `channelPublishes` — will be removed in SDK 2.0 */
5588
+ /** @deprecated permanent back-compat alias of `channelPublishes` — not scheduled for removal */
5518
5589
  vibeCodedPublishes?: Array<{
5519
5590
  salesChannel: {
5520
5591
  id: string;
@@ -7046,6 +7117,75 @@ interface BlogPostListResponse {
7046
7117
  totalPages: number;
7047
7118
  };
7048
7119
  }
7120
+ /**
7121
+ * Entity types that carry a `translations` JSON blob and are reachable via
7122
+ * the Translations admin API (`client.getTranslations`, `setTranslation`,
7123
+ * `deleteTranslation`, `aiTranslateSingle`, `aiTranslateBulk`,
7124
+ * `getTranslationStatus`).
7125
+ */
7126
+ type TranslatableEntityType = 'store' | 'product' | 'category' | 'brand' | 'tag' | 'variant' | 'attribute' | 'attributeOption' | 'metafield' | 'metafieldDefinition' | 'contactForm' | 'contactFormField' | 'modifierGroup' | 'modifier' | 'bundleOffer' | 'orderBump' | 'discountRule' | 'blogPost';
7127
+ /** One locale's translated field values for an entity. `undefined`/missing keys fall back to the base (default-locale) field. */
7128
+ type LocaleTranslation = Record<string, string | undefined>;
7129
+ /** All persisted translations for one entity, keyed by BCP-47 locale (e.g. `"he"`, `"fr-CA"`). */
7130
+ type TranslationsMap = Record<string, LocaleTranslation>;
7131
+ /**
7132
+ * Body for `setTranslation`. Only the fields valid for the target
7133
+ * `entityType` are persisted server-side (e.g. `blogPost` accepts
7134
+ * `title`/`excerpt`/`content`/`seoTitle`/`seoDescription`/`slug`; `category`
7135
+ * accepts `name`/`description`/`slug`) — passing others is a silent no-op,
7136
+ * not an error. Omitted fields leave the existing translation untouched.
7137
+ */
7138
+ interface SetTranslationFields {
7139
+ name?: string;
7140
+ description?: string;
7141
+ title?: string;
7142
+ excerpt?: string;
7143
+ content?: string;
7144
+ seoTitle?: string;
7145
+ seoDescription?: string;
7146
+ slug?: string;
7147
+ }
7148
+ /** Input for `aiTranslateSingle`. */
7149
+ interface AiTranslateSingleInput {
7150
+ entityType: TranslatableEntityType;
7151
+ entityId: string;
7152
+ /** BCP-47 locale code, e.g. `"he"`, `"fr-CA"`. */
7153
+ targetLocale: string;
7154
+ /**
7155
+ * Optional in-flight source text (e.g. unsaved editor state) to translate
7156
+ * from instead of the entity's persisted base fields. Keys must match the
7157
+ * entity's translatable fields (e.g. `seoDescription`, not `metaDescription`);
7158
+ * unrecognized keys are ignored.
7159
+ */
7160
+ sourceFields?: Record<string, string>;
7161
+ }
7162
+ /** Input for `aiTranslateBulk`. */
7163
+ interface AiTranslateBulkInput {
7164
+ /** Bulk-supported types: `product`, `category`, `brand`, `tag`, `attribute`, `modifierGroup`, `metafieldDefinition`, `blogPost`. */
7165
+ entityType: TranslatableEntityType;
7166
+ /** Explicit ids to translate. Omitted = every entity of `entityType` in the store missing a complete translation for `targetLocale`. */
7167
+ entityIds?: string[];
7168
+ /** BCP-47 locale code, e.g. `"he"`, `"fr-CA"`. Must differ from the store's default language. */
7169
+ targetLocale: string;
7170
+ }
7171
+ /** Result of `aiTranslateBulk` — job count, not finished translations (the work runs async). */
7172
+ interface AiTranslateBulkResult {
7173
+ queued: number;
7174
+ }
7175
+ /** One row of `getTranslationStatus`'s per-entity-type, per-locale breakdown. */
7176
+ interface TranslationStatusEntry {
7177
+ entityType: TranslatableEntityType;
7178
+ /** BCP-47 locale code this row's counts apply to. */
7179
+ locale: string;
7180
+ /** Total entities of this type in the store (exact count, not sampled). */
7181
+ total: number;
7182
+ /** Entities with every translatable field filled for `locale`. */
7183
+ translated: number;
7184
+ /** Entities with some but not all translatable fields filled for `locale`. */
7185
+ partial: number;
7186
+ /** Entities with no translation for `locale` at all. */
7187
+ missing: number;
7188
+ }
7049
7189
  /**
7050
7190
  * Payload for `client.trackEvent()` — the programmatic counterpart to the
7051
7191
  * `t.js` script-tag pixel. Every field is optional; the server degrades
@@ -7118,8 +7258,9 @@ declare function getDirectionForLocale(locale: string | undefined | null): 'ltr'
7118
7258
  * const client = new BrainerceClient({ salesChannelId: 'vc_abc123...' });
7119
7259
  * const products = await client.getProducts();
7120
7260
  * ```
7121
- * (`connectionId` is a deprecated alias of `salesChannelId`. It still works but
7122
- * logs a deprecation warning on every construction and is removed in SDK 2.0.)
7261
+ * (`connectionId` is a deprecated alias of `salesChannelId`. It still works and
7262
+ * logs a deprecation warning on every construction it is a permanent
7263
+ * backward-compat alias and is not scheduled for removal.)
7123
7264
  *
7124
7265
  * **Storefront Mode (Frontend)** - Use storeId for public access:
7125
7266
  * ```typescript
@@ -8128,6 +8269,29 @@ declare class BrainerceClient {
8128
8269
  occurredAt: string;
8129
8270
  }>;
8130
8271
  }>>;
8272
+ /**
8273
+ * Buy a return label the merchant sends to their customer to print.
8274
+ *
8275
+ * Requires admin mode (`apiKey`) with `FULFILL_ORDERS` permission — it
8276
+ * spends the store's carrier balance, same as {@link createShippingLabel}.
8277
+ *
8278
+ * Unlike {@link createShippingLabel}, this is **not** on the API-key `/v1`
8279
+ * surface — it calls the internal `/api/orders/:id/shipments/return-label`
8280
+ * route, which takes `storeId` explicitly rather than resolving it from the
8281
+ * key. There is no `rateId` in the body: a return is quoted and bought in
8282
+ * one call at the shipping app, because the carrier fixes a shipment as a
8283
+ * return when it is created and will not amend it afterwards.
8284
+ *
8285
+ * @example
8286
+ * ```typescript
8287
+ * const label = await client.createReturnLabel('store_abc', 'order_abc', {
8288
+ * reason: 'Wrong size',
8289
+ * returnForShipmentId: 'shp_original123',
8290
+ * });
8291
+ * console.log('Return label URL:', label.labelUrl);
8292
+ * ```
8293
+ */
8294
+ createReturnLabel(storeId: string, orderId: string, data: CreateReturnLabelDto): Promise<CreateReturnLabelResponse>;
8131
8295
  /**
8132
8296
  * Cancel an order.
8133
8297
  *
@@ -12283,6 +12447,110 @@ declare class BrainerceClient {
12283
12447
  * Requires Admin mode (apiKey)
12284
12448
  */
12285
12449
  deleteOAuthProvider(provider: OAuthProviderType): Promise<void>;
12450
+ /**
12451
+ * Get translation completeness across every translatable entity type, for
12452
+ * one or more locales. Useful as a pre-flight before a bulk import to see
12453
+ * which entity types/locales still need coverage.
12454
+ * Requires Admin mode (apiKey).
12455
+ *
12456
+ * @param storeId - Store to inspect.
12457
+ * @param locales - BCP-47 locale codes to check (e.g. `['he', 'fr']`). Omit
12458
+ * or pass an empty array to get rows with `total` populated but no
12459
+ * locale breakdown.
12460
+ *
12461
+ * @example
12462
+ * ```typescript
12463
+ * const status = await client.getTranslationStatus('store_123', ['he', 'fr']);
12464
+ * const blogHe = status.find((s) => s.entityType === 'blogPost' && s.locale === 'he');
12465
+ * console.log(`${blogHe?.missing} blog posts still need Hebrew`);
12466
+ * ```
12467
+ */
12468
+ getTranslationStatus(storeId: string, locales?: string[]): Promise<TranslationStatusEntry[]>;
12469
+ /**
12470
+ * Get every persisted translation for a single entity, keyed by locale.
12471
+ * Requires Admin mode (apiKey).
12472
+ *
12473
+ * @example
12474
+ * ```typescript
12475
+ * const translations = await client.getTranslations('store_123', 'product', 'prod_abc');
12476
+ * console.log(translations.he?.name); // Hebrew product name, if set
12477
+ * ```
12478
+ */
12479
+ getTranslations(storeId: string, entityType: TranslatableEntityType, entityId: string): Promise<TranslationsMap>;
12480
+ /**
12481
+ * Set/update one locale's translation for an entity. Only the fields valid
12482
+ * for `entityType` are persisted (e.g. `title`/`excerpt`/`content` for
12483
+ * `blogPost`, `name`/`description` for `category`) — fields outside that
12484
+ * entity's allowlist are silently ignored server-side, and omitted fields
12485
+ * leave any existing translation for them untouched (this is a merge, not
12486
+ * a replace, of the locale's fields).
12487
+ * Requires Admin mode (apiKey) with `products:write` (or the equivalent
12488
+ * scope for the target entity type).
12489
+ *
12490
+ * @example
12491
+ * ```typescript
12492
+ * // Bulk-import a pre-translated blog post
12493
+ * await client.setTranslation('store_123', 'blogPost', 'post_abc', 'fr', {
12494
+ * title: 'Le titre en français',
12495
+ * excerpt: "L'extrait en français",
12496
+ * content: '<p>Le contenu en français</p>',
12497
+ * });
12498
+ * ```
12499
+ */
12500
+ setTranslation(storeId: string, entityType: TranslatableEntityType, entityId: string, locale: string, fields: SetTranslationFields): Promise<TranslationsMap>;
12501
+ /**
12502
+ * Delete one locale's translation for an entity. The entity's base
12503
+ * (default-locale) fields are unaffected.
12504
+ * Requires Admin mode (apiKey) with `products:write` (or the equivalent
12505
+ * scope for the target entity type).
12506
+ */
12507
+ deleteTranslation(storeId: string, entityType: TranslatableEntityType, entityId: string, locale: string): Promise<void>;
12508
+ /**
12509
+ * AI-translate a single entity into one target locale and persist the
12510
+ * result inline (synchronous — the response already reflects the write).
12511
+ * Only fields that are still empty for `targetLocale` are filled; existing
12512
+ * translated values are never overwritten.
12513
+ * Requires Admin mode (apiKey) with `products:write` (or the equivalent
12514
+ * scope for the target entity type).
12515
+ *
12516
+ * @param sourceFields - Optional override of the source-language text to
12517
+ * translate from (e.g. unsaved edits from an open editor), instead of the
12518
+ * entity's persisted base fields. Keys outside the entity's translatable
12519
+ * field set are ignored.
12520
+ *
12521
+ * @example
12522
+ * ```typescript
12523
+ * const translations = await client.aiTranslateSingle('store_123', {
12524
+ * entityType: 'product',
12525
+ * entityId: 'prod_abc',
12526
+ * targetLocale: 'he',
12527
+ * });
12528
+ * ```
12529
+ */
12530
+ aiTranslateSingle(storeId: string, input: AiTranslateSingleInput): Promise<TranslationsMap>;
12531
+ /**
12532
+ * Bulk AI-translate — enqueues a background job per entity (and, for
12533
+ * `entityType: 'attribute'`, one per attribute option too) rather than
12534
+ * translating inline. Returns the number of jobs queued, not the finished
12535
+ * translations; poll `getTranslationStatus` or `getTranslations` to see
12536
+ * results land.
12537
+ * Requires Admin mode (apiKey) with `products:write` (or the equivalent
12538
+ * scope for the target entity type).
12539
+ *
12540
+ * @param entityIds - Optional explicit ids to translate. Omit to target
12541
+ * every entity of `entityType` in the store that isn't already fully
12542
+ * translated for `targetLocale`.
12543
+ *
12544
+ * @example
12545
+ * ```typescript
12546
+ * // Translate every blog post missing French coverage
12547
+ * const { queued } = await client.aiTranslateBulk('store_123', {
12548
+ * entityType: 'blogPost',
12549
+ * targetLocale: 'fr',
12550
+ * });
12551
+ * ```
12552
+ */
12553
+ aiTranslateBulk(storeId: string, input: AiTranslateBulkInput): Promise<AiTranslateBulkResult>;
12286
12554
  }
12287
12555
  /**
12288
12556
  * Custom error class for Brainerce API errors
@@ -12293,7 +12561,7 @@ declare class BrainerceError extends Error {
12293
12561
  constructor(message: string, statusCode: number, details?: unknown);
12294
12562
  }
12295
12563
 
12296
- declare const SDK_VERSION = "2.0.0";
12564
+ declare const SDK_VERSION = "2.0.1";
12297
12565
 
12298
12566
  /**
12299
12567
  * Verify a webhook signature from Brainerce
@@ -12794,4 +13062,4 @@ interface CategorySitemapOptions {
12794
13062
  */
12795
13063
  declare function getCategorySitemapEntries(client: BrainerceClient, opts: CategorySitemapOptions): Promise<SitemapEntry[]>;
12796
13064
 
12797
- export { type AddToCartDto, type AddressDetailsResult, type AddressSuggestion, type AnnouncementContent, type AnnouncementSeverity, type AppliedDiscount, type ApplyCouponDto, type AttachModifierGroupInput, type Attribute, type AttributeOption, type AttributeSource, type AvailabilityClock, type BlogPost, type BlogPostListParams, type BlogPostListResponse, type BlogSitemapOptions, type BrainerceApiError, BrainerceClient, type BrainerceClientOptions, BrainerceError, type Brand, type BulkCreateProductsDto, type BulkCreateProductsError, type BulkCreateProductsJob, type BulkCreateProductsStatus, type BulkInventoryResponse, type BulkSaveVariantsDto, type BulkSaveVariantsResponse, type BulkVariantInput, type BusinessHoursWindow, 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 CategoryDetail, type CategoryNode, type CategorySitemapOptions, 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 DateAvailabilityConstraints, type DateAvailabilitySurface, type DateFieldParseResult, type DeleteProductResponse, type DeliveryType, 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 FormatProductPriceOptions, 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 JsonLdOptions, type ListModifierGroupsParams, type LocalCart, type LocalCartItem, type LockedVariant, type LoyaltyNextTierSummary, type LoyaltyReward, type LoyaltyStatus, type LoyaltyTierSummary, type MergeCartsDto, type MetafieldConflict, type MetafieldConflictResolution, type MetafieldDefinition, type MetafieldFilter, type MetafieldFilterValue, type MetafieldFiltersResponse, type MetafieldType, type Modifier, type ModifierGroup, type ModifierSelection, type ModifierSelectionType, type ModifierValidationCode, type ModifierValidationError, type ModifierValidationFailedError, type MyProductReview, 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 ParsedDateFieldValue, type PaymentClientSdk, type PaymentConfig, type PaymentIntent, type PaymentProvider, type PaymentProviderConfig, type PaymentProvidersConfig, type PaymentRecordStatus, type PaymentStatus, type PaymentUrlOptions, type PickupLocation, type PlatformCouponCapabilities, type PlatformMetafieldMetadata, type PreviewEmailTemplateDto as PreviewEmailTemplateInput, type PriceDriftError, 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 ProductReview, type ProductReviewAdmin, type ProductSitemapOptions, type ProductStatus, type ProductSuggestion, type ProductUnavailableError, type ProductVariant, type PublicMetafieldDefinition, type PublishProductResponse, RTL_LOCALES, type RecommendationVariant, type ReconcileInventoryResponse, type RedeemRewardResult, type ReferralInfo, type Refund, type RefundLineItem, type RefundLineItemResponse, type RefundType, type RegisterCustomerDto, type RelativeDateBounds, type ReservationInfo, type ResolveMetafieldConflictDto as ResolveMetafieldConflictInput, type ResolveSyncConflictDto as ResolveSyncConflictInput, type ReviewStatus, 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 ShippingSummaryEntry, type ShippingZone, type ShippingZoneQueryParams, type SitemapEntry, type StockAvailabilityRequest, type StockAvailabilityResponse, type StockAvailabilityResult, type StoreInfo, type StoreInvitation, type StoreInvitationDetails, type StoreMember, type StorePermission, type StoreRole, type StoreTeamResponse, type StoreTracking, type SubmitProductReviewInput, 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 TrackingEventItem, type TrackingEventName, type TrackingEventPayload, 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, type WriteProductReviewInput, buildArticleJsonLd, buildBreadcrumbJsonLd, buildCollectionPageJsonLd, buildOrganizationJsonLd, buildProductFaqJsonLd, buildProductJsonLd, buildWebsiteJsonLd, computeAvailableSlots, createWebhookHandler, deriveSeoDescription, enableDevGuards, formatMoney, formatPrice, formatProductPrice, formatVariantPrice, getBlogSitemapEntries, getBusinessHoursForDate, getCartItemImage, getCartItemName, getCartTotals, getCategorySitemapEntries, getDescriptionContent, getDirectionForLocale, formatPrice as getPriceDisplay, getProductCustomizationFields, getProductMetafield, getProductMetafieldValue, getProductMetafieldsByType, getProductPrice, getProductPriceInfo, getProductSitemapEntries, getProductSwatches, getStockStatus, getVariantOptions, getVariantPrice, isAllowedPaymentUrl, isCalendarDateAllowed, isCouponApplicableToProduct, isDateValueAllowed, isHtmlDescription, isWebhookEventType, jsonLdScriptProps, parseDateFieldValue, parseWebhookEvent, resolveRelativeBounds, resolveStoreLocalParts, safePaymentRedirect, stripHtml, validateDateAvailabilityConfig, verifyWebhook };
13065
+ export { type AddToCartDto, type AddressDetailsResult, type AddressSuggestion, type AiTranslateBulkInput, type AiTranslateBulkResult, type AiTranslateSingleInput, type AnnouncementContent, type AnnouncementSeverity, type AppliedDiscount, type ApplyCouponDto, type AttachModifierGroupInput, type Attribute, type AttributeDisplayType, type AttributeOption, type AttributeSource, type AvailabilityClock, type BlogPost, type BlogPostListParams, type BlogPostListResponse, type BlogSitemapOptions, type BrainerceApiError, BrainerceClient, type BrainerceClientOptions, BrainerceError, type Brand, type BulkCreateProductsDto, type BulkCreateProductsError, type BulkCreateProductsJob, type BulkCreateProductsStatus, type BulkInventoryResponse, type BulkSaveVariantsDto, type BulkSaveVariantsResponse, type BulkVariantInput, type BusinessHoursWindow, 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 CategoryDetail, type CategoryNode, type CategorySitemapOptions, 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 CreateReturnLabelDto as CreateReturnLabelInput, type CreateReturnLabelResponse, 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 DateAvailabilityConstraints, type DateAvailabilitySurface, type DateFieldParseResult, type DeleteProductResponse, type DeliveryType, 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 FormatProductPriceOptions, 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 JsonLdOptions, type ListModifierGroupsParams, type LocalCart, type LocalCartItem, type LocaleTranslation, type LockedVariant, type LoyaltyNextTierSummary, type LoyaltyReward, type LoyaltyStatus, type LoyaltyTierSummary, type MergeCartsDto, type MetafieldConflict, type MetafieldConflictResolution, type MetafieldDefinition, type MetafieldFilter, type MetafieldFilterValue, type MetafieldFiltersResponse, type MetafieldType, type Modifier, type ModifierGroup, type ModifierSelection, type ModifierSelectionType, type ModifierValidationCode, type ModifierValidationError, type ModifierValidationFailedError, type MyProductReview, 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 ParsedDateFieldValue, type PaymentClientSdk, type PaymentConfig, type PaymentIntent, type PaymentProvider, type PaymentProviderConfig, type PaymentProvidersConfig, type PaymentRecordStatus, type PaymentStatus, type PaymentUrlOptions, type PickupLocation, type PlatformCouponCapabilities, type PlatformMetafieldMetadata, type PreviewEmailTemplateDto as PreviewEmailTemplateInput, type PriceDriftError, 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 ProductReview, type ProductReviewAdmin, type ProductReviewImage, type ProductReviewImageAdmin, type ProductSitemapOptions, type ProductStatus, type ProductSuggestion, type ProductUnavailableError, type ProductVariant, type PublicMetafieldDefinition, type PublishProductResponse, RTL_LOCALES, type RecommendationVariant, type ReconcileInventoryResponse, type RedeemRewardResult, type ReferralInfo, type Refund, type RefundLineItem, type RefundLineItemResponse, type RefundType, type RegisterCustomerDto, type RelativeDateBounds, type ReservationInfo, type ResolveMetafieldConflictDto as ResolveMetafieldConflictInput, type ResolveSyncConflictDto as ResolveSyncConflictInput, type ReturnLabelParcel, type ReviewPhotoUpload, type ReviewStatus, 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 SetTranslationFields, type ShippingDestinations, type ShippingLine, type ShippingRate, type ShippingRateConfig, type ShippingRateType, type ShippingSummaryEntry, type ShippingZone, type ShippingZoneQueryParams, type SitemapEntry, type StockAvailabilityRequest, type StockAvailabilityResponse, type StockAvailabilityResult, type StoreInfo, type StoreInvitation, type StoreInvitationDetails, type StoreMember, type StorePermission, type StoreRole, type StoreTeamResponse, type StoreTracking, type SubmitProductReviewInput, 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 TrackingEventItem, type TrackingEventName, type TrackingEventPayload, type TranslatableEntityType, type TranslationStatusEntry, type TranslationsMap, 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, type WriteProductReviewInput, buildArticleJsonLd, buildBreadcrumbJsonLd, buildCollectionPageJsonLd, buildOrganizationJsonLd, buildProductFaqJsonLd, buildProductJsonLd, buildWebsiteJsonLd, computeAvailableSlots, createWebhookHandler, deriveSeoDescription, enableDevGuards, formatMoney, formatPrice, formatProductPrice, formatVariantPrice, getBlogSitemapEntries, getBusinessHoursForDate, getCartItemImage, getCartItemName, getCartTotals, getCategorySitemapEntries, getDescriptionContent, getDirectionForLocale, formatPrice as getPriceDisplay, getProductCustomizationFields, getProductMetafield, getProductMetafieldValue, getProductMetafieldsByType, getProductPrice, getProductPriceInfo, getProductSitemapEntries, getProductSwatches, getStockStatus, getVariantOptions, getVariantPrice, isAllowedPaymentUrl, isCalendarDateAllowed, isCouponApplicableToProduct, isDateValueAllowed, isHtmlDescription, isWebhookEventType, jsonLdScriptProps, parseDateFieldValue, parseWebhookEvent, resolveRelativeBounds, resolveStoreLocalParts, safePaymentRedirect, stripHtml, validateDateAvailabilityConfig, verifyWebhook };