@ecomweb/sdk 0.14.0 → 0.15.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/dist/index.d.ts CHANGED
@@ -46,15 +46,42 @@ declare function clientHeaderValue(clientInfo?: string): string;
46
46
  */
47
47
  declare function withClientHeader(http: IHttpClient, clientInfo?: string): IHttpClient;
48
48
 
49
+ /**
50
+ * The error thrown when the API answers with an error. Carries the HTTP status and the API's error code.
51
+ */
49
52
  declare class ApiClientError extends Error {
53
+ /**
54
+ * The HTTP status code, or `0` when there was no response.
55
+ */
50
56
  statusCode: number;
57
+ /**
58
+ * The API's machine-readable error code, when it sent one.
59
+ */
51
60
  code?: string;
52
61
  /** The business error's structured `details`, when the backend sent any. */
53
62
  details?: unknown;
54
63
  constructor(message: string, statusCode?: number, code?: string, details?: unknown);
55
64
  }
65
+ /**
66
+ * Returns the data of a successful response and throws on an error response.
67
+ *
68
+ * @param response - the response to read
69
+ * @returns The response data; throws {@link ApiClientError} when the API answers with an error
70
+ */
56
71
  declare function unwrap<T>(response: ApiResponse<T>): T;
72
+ /**
73
+ * Like {@link unwrap}, but resolves `null` for the statuses that mean "not found".
74
+ *
75
+ * @param response - the response to read
76
+ * @param nullStatusCodes - the statuses that resolve `null`, `[404]` by default
77
+ * @returns The response data, or `null` when the status is in `nullStatusCodes`; throws {@link ApiClientError} on any other API error
78
+ */
57
79
  declare function unwrapOrNull<T>(response: ApiResponse<T>, nullStatusCodes?: number[]): T | null;
80
+ /**
81
+ * Throws on an error response and returns nothing on success. Use it when you do not need the data.
82
+ *
83
+ * @param response - the response to check
84
+ */
58
85
  declare function ensureSuccess(response: ApiResponse<any>): void;
59
86
 
60
87
  /**
@@ -1096,6 +1123,12 @@ interface InventoryQuantities {
1096
1123
  }
1097
1124
  /** What is physically held: everything except incoming. */
1098
1125
  declare function onHand(level: InventoryQuantities): number;
1126
+ /**
1127
+ * Adds up the stock that cannot be sold: damaged, quality control, safety stock and other.
1128
+ *
1129
+ * @param level - the quantities of one variant at one location
1130
+ * @returns The total unavailable quantity
1131
+ */
1099
1132
  declare function unavailable(level: Pick<InventoryQuantities, UnavailableState>): number;
1100
1133
  /** One row of `GET /inventory/levels`: a variant at a location. */
1101
1134
  interface InventoryLevelRow extends InventoryQuantities {
@@ -3164,8 +3197,27 @@ declare const themeSchemaSchema: z.ZodArray<z.ZodObject<{
3164
3197
  * an Error whose message lists every problem, readable in a build log.
3165
3198
  */
3166
3199
  declare function parseThemeSchema(input: unknown): ThemeSchema;
3200
+ /**
3201
+ * Lists every setting in a theme schema, across all groups, leaving out headers and other non-setting entries.
3202
+ *
3203
+ * @param schema - the theme schema
3204
+ * @returns The settings in schema order
3205
+ */
3167
3206
  declare function themeSettings(schema: ThemeSchema): ThemeSetting[];
3207
+ /**
3208
+ * Builds the default value of every setting in a theme schema.
3209
+ *
3210
+ * @param schema - the theme schema
3211
+ * @returns A map from setting id to its default, or `null` when a setting has none
3212
+ */
3168
3213
  declare function themeDefaults(schema: ThemeSchema): ThemeValues;
3214
+ /**
3215
+ * Checks a set of saved theme values against a theme schema. Settings with no value are skipped.
3216
+ *
3217
+ * @param schema - the theme schema
3218
+ * @param input - the values to check, as an object keyed by setting id
3219
+ * @returns The accepted values and a list of per-setting errors
3220
+ */
3169
3221
  declare function validateThemeValues(schema: ThemeSchema, input: unknown): {
3170
3222
  values: Record<string, ThemeValue>;
3171
3223
  errors: ThemeValueError[];
@@ -3249,6 +3301,12 @@ declare const themeMigrationSchema: z.ZodObject<{
3249
3301
  value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
3250
3302
  }, z.core.$strict>], "op">>;
3251
3303
  }, z.core.$strict>;
3304
+ /**
3305
+ * Parses and validates a theme migration definition.
3306
+ *
3307
+ * @param input - the unparsed migration
3308
+ * @returns The validated migration; throws an `Error` listing the problems when it is invalid
3309
+ */
3252
3310
  declare function parseThemeMigration(input: unknown): ThemeMigration;
3253
3311
  /** Runs the steps in order over a copy of `input`. */
3254
3312
  declare function applyThemeMigration(input: Record<string, unknown>, migration: ThemeMigration): {
@@ -3663,9 +3721,37 @@ declare const DEFAULT_BUCKET = "public-cdn";
3663
3721
  * dynamic `process.env[key]` read is not inlined.
3664
3722
  */
3665
3723
  declare function assetBaseUrl(): string;
3724
+ /**
3725
+ * Tells whether image resizing is on. Controlled by `NEXT_PUBLIC_ENABLE_IMAGE_TRANSFORMATIONS`; when unset it is on, except for a local asset host.
3726
+ *
3727
+ * @returns `true` when image URLs should use the resizing endpoint
3728
+ */
3666
3729
  declare function transformationsEnabled(): boolean;
3730
+ /**
3731
+ * Builds the query string for an image resize request.
3732
+ *
3733
+ * @param opts - the resize options; unset or non-finite values are left out
3734
+ * @returns The query string including the leading `?`, or an empty string when there is nothing to add
3735
+ */
3667
3736
  declare function buildTransformQuery(opts?: ImageTransformOptions): string;
3737
+ /**
3738
+ * Builds the URL of a resized version of a stored image. Defaults to `resize=cover` and `quality=80`.
3739
+ *
3740
+ * @param baseUrl - the origin that serves storage objects
3741
+ * @param bucket - the storage bucket
3742
+ * @param path - the object path inside the bucket
3743
+ * @param opts - resize options that override the defaults
3744
+ * @returns The resized image URL
3745
+ */
3668
3746
  declare function toRenderUrl(baseUrl: string, bucket: string, path: string, opts?: ImageTransformOptions): string;
3747
+ /**
3748
+ * Builds the URL of the original, unresized stored image.
3749
+ *
3750
+ * @param baseUrl - the origin that serves storage objects
3751
+ * @param bucket - the storage bucket
3752
+ * @param path - the object path inside the bucket
3753
+ * @returns The original image URL
3754
+ */
3669
3755
  declare function toObjectUrl(baseUrl: string, bucket: string, path: string): string;
3670
3756
  /**
3671
3757
  * Pull bucket + object path out of a storage URL, whatever host it names.
@@ -3693,6 +3779,8 @@ declare function fromObjectPublicUrlToRender(publicUrl: string, opts?: ImageTran
3693
3779
  */
3694
3780
  declare function resolveAssetUrl(imagePathOrUrl: string | null | undefined, opts?: ImageTransformOptions, bucket?: string, baseUrl?: string): string | null;
3695
3781
  /**
3782
+ * Resolves a stored image URL to the asset host, resized when options are given.
3783
+ *
3696
3784
  * @deprecated Renamed to {@link resolveAssetUrl}. The old name described a
3697
3785
  * Supabase-specific rewrite; the implementation is no longer Supabase-aware.
3698
3786
  * Kept so existing callers keep compiling.
@@ -3754,10 +3842,29 @@ type ProductDetail = Product & {
3754
3842
  metafields?: StorefrontMetafields;
3755
3843
  } & WithSeoMetadata$3;
3756
3844
 
3845
+ /**
3846
+ * Products of a store, reached through `sdk.products`.
3847
+ */
3757
3848
  declare class ProductsApi {
3758
3849
  private http;
3759
3850
  constructor(http: IHttpClient);
3851
+ /**
3852
+ * Gets one product by id.
3853
+ *
3854
+ * @param storeRef - the store's ref or handle
3855
+ * @param productId - the product id
3856
+ * @param query - optional fields to include
3857
+ * @returns The product, or `null` when it is not found; throws {@link ApiClientError} on any other API error
3858
+ */
3760
3859
  getById(storeRef: string, productId: number, query?: ProductQueryParams): Promise<ProductDetail | null>;
3860
+ /**
3861
+ * Gets one product by slug.
3862
+ *
3863
+ * @param storeRef - the store's ref or handle
3864
+ * @param slug - the product slug
3865
+ * @param query - optional fields to include
3866
+ * @returns The product, or `null` when it is not found; throws {@link ApiClientError} on any other API error
3867
+ */
3761
3868
  getBySlug(storeRef: string, slug: string, query?: ProductQueryParams): Promise<ProductDetail | null>;
3762
3869
  }
3763
3870
 
@@ -3976,6 +4083,12 @@ declare const RULE_FIELDS: readonly RuleField[];
3976
4083
  * before the request rather than after it is rejected. */
3977
4084
  declare const MAX_RULES_PER_SET = 25;
3978
4085
  declare const MAX_RULE_VALUE_ENTRIES = 100;
4086
+ /**
4087
+ * Tells whether a name is a field that smart collection rules can use.
4088
+ *
4089
+ * @param name - the name to test
4090
+ * @returns `true` when it is a rule field
4091
+ */
3979
4092
  declare function isRuleField(name: string): name is RuleField;
3980
4093
  /** The operators a field accepts, in display order. Empty for unknown fields. */
3981
4094
  declare function operatorsForField(field: string): RuleOperator[];
@@ -4040,11 +4153,36 @@ interface CollectionQueryParams extends BaseQueryParams {
4040
4153
  include_product_count?: boolean;
4041
4154
  }
4042
4155
 
4156
+ /**
4157
+ * Product collections of a store, reached through `sdk.collections`.
4158
+ */
4043
4159
  declare class CollectionsApi {
4044
4160
  private http;
4045
4161
  constructor(http: IHttpClient);
4162
+ /**
4163
+ * Lists collections, one page at a time.
4164
+ *
4165
+ * @param storeRef - the store's ref or handle
4166
+ * @param params - filters, sorting and paging
4167
+ * @returns A page of collections; throws {@link ApiClientError} when the API answers with an error
4168
+ */
4046
4169
  getAllPaginated(storeRef: string, params?: CollectionQueryParams): Promise<PaginatedResponse<Collection>>;
4170
+ /**
4171
+ * Lists up to 100 collections in one call.
4172
+ *
4173
+ * @param storeRef - the store's ref or handle
4174
+ * @param ids - limit the result to these collection ids
4175
+ * @returns The collections; throws {@link ApiClientError} when the API answers with an error
4176
+ */
4047
4177
  getAll(storeRef: string, ids?: number[]): Promise<Collection[]>;
4178
+ /**
4179
+ * Gets one collection by slug.
4180
+ *
4181
+ * @param storeRef - the store's ref or handle
4182
+ * @param slug - the collection slug
4183
+ * @param query - `include_seo_metadata` adds the SEO fields
4184
+ * @returns The collection, or `null` when it is not found; throws {@link ApiClientError} on any other API error
4185
+ */
4048
4186
  getBySlug(storeRef: string, slug: string, query?: {
4049
4187
  include_seo_metadata?: boolean;
4050
4188
  }): Promise<Collection | null>;
@@ -4056,12 +4194,43 @@ interface CategoryQueryParams extends BaseQueryParams {
4056
4194
  parent_id?: number | null;
4057
4195
  }
4058
4196
 
4197
+ /**
4198
+ * Product categories of a store, reached through `sdk.categories`.
4199
+ */
4059
4200
  declare class CategoriesApi {
4060
4201
  private http;
4061
4202
  constructor(http: IHttpClient);
4203
+ /**
4204
+ * Lists categories, one page at a time.
4205
+ *
4206
+ * @param storeRef - the store's ref or handle
4207
+ * @param params - filters, sorting and paging
4208
+ * @returns A page of categories; throws {@link ApiClientError} when the API answers with an error
4209
+ */
4062
4210
  getAllPaginated(storeRef: string, params?: CategoryQueryParams): Promise<PaginatedResponse<Category>>;
4211
+ /**
4212
+ * Lists up to 1,000 categories in one call.
4213
+ *
4214
+ * @param storeRef - the store's ref or handle
4215
+ * @param activeOnly - `true` (the default) returns only active categories
4216
+ * @returns The categories; throws {@link ApiClientError} when the API answers with an error
4217
+ */
4063
4218
  getAll(storeRef: string, activeOnly?: boolean): Promise<Category[]>;
4219
+ /**
4220
+ * Gets one category by id.
4221
+ *
4222
+ * @param storeRef - the store's ref or handle
4223
+ * @param categoryId - the category id
4224
+ * @returns The category, or `null` when it is not found; throws {@link ApiClientError} on any other API error
4225
+ */
4064
4226
  getById(storeRef: string, categoryId: number): Promise<Category | null>;
4227
+ /**
4228
+ * Gets one category by slug.
4229
+ *
4230
+ * @param storeRef - the store's ref or handle
4231
+ * @param slug - the category slug
4232
+ * @returns The category, or `null` when it is not found; throws {@link ApiClientError} on any other API error
4233
+ */
4065
4234
  getBySlug(storeRef: string, slug: string): Promise<Category | null>;
4066
4235
  }
4067
4236
 
@@ -4125,25 +4294,73 @@ interface UpdateCartItemRequest {
4125
4294
  quantity: number;
4126
4295
  }
4127
4296
 
4297
+ /**
4298
+ * A shopper's cart: a guest cart keyed by a session id, or the signed-in customer's cart, reached through `sdk.cart`.
4299
+ */
4128
4300
  declare class CartApi {
4129
- private publicHttp;
4130
- private authHttp;
4131
- constructor(publicHttp: IHttpClient, authHttp: IHttpClient);
4301
+ private privateHttp;
4302
+ private shopperHttp;
4303
+ constructor(privateHttp: IHttpClient, shopperHttp: IHttpClient);
4132
4304
  private client;
4133
- private basePath;
4305
+ /** Guest cart: `/storefront/stores/:ref/cart`; signed-in: `.../customers/cart`. */
4306
+ private cartPath;
4307
+ /**
4308
+ * Gets the shopper's cart.
4309
+ *
4310
+ * @param storeRef - the store's ref or handle
4311
+ * @param sessionId - the guest cart session id
4312
+ * @param isAuth - `true` for the signed-in customer's cart, `false` for the guest cart
4313
+ * @returns The cart, or `null` when it is not found; throws {@link ApiClientError} on any other API error
4314
+ */
4134
4315
  getCart(storeRef: string, sessionId: string, isAuth: boolean): Promise<CartApiResponse | null>;
4316
+ /**
4317
+ * Adds a product variant to the cart.
4318
+ *
4319
+ * @param storeRef - the store's ref or handle
4320
+ * @param data - the variant and the quantity
4321
+ * @param sessionId - the guest cart session id
4322
+ * @param isAuth - `true` for the signed-in customer's cart, `false` for the guest cart
4323
+ * @returns The cart id and the added item; throws {@link ApiClientError} when the API answers with an error
4324
+ */
4135
4325
  addItem(storeRef: string, data: AddToCartRequest, sessionId: string, isAuth: boolean): Promise<{
4136
4326
  cart_id: string;
4137
4327
  item: CartApiItem;
4138
4328
  }>;
4329
+ /**
4330
+ * Changes the quantity of a cart line.
4331
+ *
4332
+ * @param storeRef - the store's ref or handle
4333
+ * @param itemId - the cart line id
4334
+ * @param data - the new quantity
4335
+ * @param sessionId - the guest cart session id
4336
+ * @param isAuth - `true` for the signed-in customer's cart, `false` for the guest cart
4337
+ * @returns The cart id and the updated item (`null` when the line was removed); throws {@link ApiClientError} when the API answers with an error
4338
+ */
4139
4339
  updateItem(storeRef: string, itemId: string, data: UpdateCartItemRequest, sessionId: string, isAuth: boolean): Promise<{
4140
4340
  cart_id: string;
4141
4341
  item: CartApiItem | null;
4142
4342
  }>;
4343
+ /**
4344
+ * Removes a line from the cart.
4345
+ *
4346
+ * @param storeRef - the store's ref or handle
4347
+ * @param itemId - the cart line id
4348
+ * @param sessionId - the guest cart session id
4349
+ * @param isAuth - `true` for the signed-in customer's cart, `false` for the guest cart
4350
+ * @returns The cart id and the removed line's id; throws {@link ApiClientError} when the API answers with an error
4351
+ */
4143
4352
  removeItem(storeRef: string, itemId: string, sessionId: string, isAuth: boolean): Promise<{
4144
4353
  cartId: string;
4145
4354
  itemId: string;
4146
4355
  }>;
4356
+ /**
4357
+ * Empties the cart.
4358
+ *
4359
+ * @param storeRef - the store's ref or handle
4360
+ * @param sessionId - the guest cart session id
4361
+ * @param isAuth - `true` for the signed-in customer's cart, `false` for the guest cart
4362
+ * @returns The cart id; throws {@link ApiClientError} when the API answers with an error
4363
+ */
4147
4364
  clear(storeRef: string, sessionId: string, isAuth: boolean): Promise<{
4148
4365
  cart_id: string;
4149
4366
  }>;
@@ -4245,17 +4462,35 @@ interface GuestOrderLookupParams {
4245
4462
  customer_phone?: string;
4246
4463
  }
4247
4464
 
4465
+ /**
4466
+ * Placing orders, and reading them back as a guest or as the signed-in customer, reached through `sdk.orders`.
4467
+ */
4248
4468
  declare class OrdersApi {
4249
- private publicHttp;
4250
- private authHttp;
4251
- constructor(publicHttp: IHttpClient, authHttp: IHttpClient);
4469
+ private privateHttp;
4470
+ private shopperHttp;
4471
+ constructor(privateHttp: IHttpClient, shopperHttp: IHttpClient);
4252
4472
  /**
4253
4473
  * Look up a guest order. The API answers with the bare order when it
4254
4474
  * matches and `{ message }` (HTTP 200) when it does not; a 404 is treated
4255
4475
  * the same way. Returns null for "not found".
4256
4476
  */
4257
4477
  lookupGuest(storeRef: string, params: GuestOrderLookupParams): Promise<OrderWithItems | null>;
4478
+ /**
4479
+ * Places an order.
4480
+ *
4481
+ * @param storeRef - the store's ref or handle
4482
+ * @param data - the order details
4483
+ * @param isAuth - `true` to place it as the signed-in customer, `false` as a guest
4484
+ * @returns The created order with its items; throws {@link ApiClientError} when the API answers with an error
4485
+ */
4258
4486
  create(storeRef: string, data: CreateOrderRequest, isAuth: boolean): Promise<OrderWithItems>;
4487
+ /**
4488
+ * Lists the signed-in customer's orders, newest first by default.
4489
+ *
4490
+ * @param storeRef - the store's ref or handle
4491
+ * @param params - search, status filter, sorting and paging (`page`, or `limit` and `offset`)
4492
+ * @returns A page of orders; throws {@link ApiClientError} when the API answers with an error
4493
+ */
4259
4494
  listCustomerOrders(storeRef: string, params?: Partial<CustomerOrderFilter> & {
4260
4495
  page?: number;
4261
4496
  }): Promise<PaginatedResponse<Order>>;
@@ -4299,20 +4534,83 @@ interface BlogTagQueryParams extends BaseQueryParams {
4299
4534
  include_post_counts?: boolean;
4300
4535
  }
4301
4536
 
4537
+ /**
4538
+ * Published blog posts, categories, tags and comments of a store, reached through `sdk.blog`.
4539
+ */
4302
4540
  declare class BlogApi {
4303
- private publicHttp;
4304
- private authHttp;
4541
+ /** Client for the public routes, sent with the publishable key. */
4542
+ protected publicHttp: IHttpClient;
4543
+ /** Client for the calls that read the shopper's session (comments), sent with the shopper's bearer. */
4544
+ protected authHttp: IHttpClient;
4305
4545
  constructor(publicHttp: IHttpClient, authHttp: IHttpClient);
4546
+ /**
4547
+ * Lists published blog posts.
4548
+ *
4549
+ * @param storeRef - the store's ref or handle
4550
+ * @param query - filters, sorting and paging
4551
+ * @returns A page of posts; throws {@link ApiClientError} when the API answers with an error
4552
+ */
4306
4553
  getPosts(storeRef: string, query?: Partial<BlogPostQueryParams>): Promise<PaginatedResponse<BlogPost>>;
4554
+ /**
4555
+ * Gets one published blog post by its slug.
4556
+ *
4557
+ * @param storeRef - the store's ref or handle
4558
+ * @param slug - the post slug
4559
+ * @param options - `incrementView` counts a view; `include_seo_metadata` and `include_products` add those fields
4560
+ * @returns The post, or `null` when it is not found; throws {@link ApiClientError} on any other API error
4561
+ */
4307
4562
  getPostBySlug(storeRef: string, slug: string, options?: {
4308
4563
  incrementView?: boolean;
4309
4564
  include_seo_metadata?: boolean;
4310
4565
  include_products?: boolean;
4311
4566
  }): Promise<BlogPost | null>;
4567
+ /**
4568
+ * Lists blog categories.
4569
+ *
4570
+ * @param storeRef - the store's ref or handle
4571
+ * @param query - filters and paging
4572
+ * @returns A page of categories; throws {@link ApiClientError} when the API answers with an error
4573
+ */
4312
4574
  getCategories(storeRef: string, query?: BlogCategoryQueryParams): Promise<PaginatedResponse<BlogCategory>>;
4575
+ /**
4576
+ * Lists blog tags.
4577
+ *
4578
+ * @param storeRef - the store's ref or handle
4579
+ * @param query - filters and paging
4580
+ * @returns A page of tags; throws {@link ApiClientError} when the API answers with an error
4581
+ */
4313
4582
  getTags(storeRef: string, query?: BlogTagQueryParams): Promise<PaginatedResponse<BlogTag>>;
4583
+ /**
4584
+ * Lists the approved comments of a post, as an anonymous visitor.
4585
+ *
4586
+ * @param storeRef - the store's ref or handle
4587
+ * @param postId - the post id
4588
+ * @returns The comments; throws {@link ApiClientError} when the API answers with an error
4589
+ */
4314
4590
  getPostComments(storeRef: string, postId: number): Promise<any[]>;
4591
+ /**
4592
+ * Lists the approved comments of a post, sending the signed-in customer's credentials.
4593
+ *
4594
+ * @param storeRef - the store's ref or handle
4595
+ * @param postId - the post id
4596
+ * @returns The comments; throws {@link ApiClientError} when the API answers with an error
4597
+ */
4315
4598
  getPostCommentsAuth(storeRef: string, postId: number): Promise<any[]>;
4599
+ }
4600
+ /**
4601
+ * Blog comment submission, reached through `sdk.blog` on the server and proxied SDKs.
4602
+ *
4603
+ * Needs a storefront secret key: available on `createEcomwebServerSdk` and `createEcomwebProxiedSdk`, never on `createEcomwebSdk`.
4604
+ */
4605
+ declare class BlogServerApi extends BlogApi {
4606
+ /**
4607
+ * Submits a comment on a post, as the signed-in customer. It may wait for moderation.
4608
+ *
4609
+ * @param storeRef - the store's ref or handle
4610
+ * @param postId - the post id
4611
+ * @param data - the author name, the text, and optionally a website and the parent comment id
4612
+ * @returns The created comment; throws {@link ApiClientError} when the API answers with an error
4613
+ */
4316
4614
  submitComment(storeRef: string, postId: number, data: {
4317
4615
  author_name: string;
4318
4616
  content: string;
@@ -4347,7 +4645,7 @@ type StoreConfigurationInfo = Store & {
4347
4645
  /** Shop metafields with storefront access (spec §6.4). */
4348
4646
  metafields?: StorefrontMetafields;
4349
4647
  };
4350
- /** `GET /public/stores/domain/:domain`: the store a host serves. */
4648
+ /** `GET /storefront/stores/domain/:domain`: the store a host serves. */
4351
4649
  type StoreByDomainInfo = StoreConfigurationInfo & {
4352
4650
  /**
4353
4651
  * The live theme's URL when it is external (the shared storefront sends
@@ -4368,14 +4666,31 @@ type StoreByDomainInfo = StoreConfigurationInfo & {
4368
4666
  store_preview_token?: string | null;
4369
4667
  };
4370
4668
 
4669
+ /**
4670
+ * Looking up a store and its public configuration, reached through `sdk.stores`.
4671
+ */
4371
4672
  declare class StoresApi {
4372
4673
  private http;
4373
4674
  constructor(http: IHttpClient);
4675
+ /**
4676
+ * Gets a store's public information, by default with its configuration, settings and embedded scripts.
4677
+ *
4678
+ * @param storeRef - the store's ref or handle
4679
+ * @param options - set `includeConfig`, `includeSettings` or `includeEmbeddedScripts` to `false` to leave that part out
4680
+ * @param requestOptions - extra request options, passed to the HTTP client only when given
4681
+ * @returns The store information, or `null` when it is not found; throws {@link ApiClientError} on any other API error
4682
+ */
4374
4683
  getById(storeRef: string, options?: {
4375
4684
  includeConfig?: boolean;
4376
4685
  includeSettings?: boolean;
4377
4686
  includeEmbeddedScripts?: boolean;
4378
4687
  }, requestOptions?: RequestOptions): Promise<StoreConfigurationInfo | null>;
4688
+ /**
4689
+ * Gets a store by its subdomain.
4690
+ *
4691
+ * @param subdomain - the store's subdomain
4692
+ * @returns The store, or `null` when it is not found; throws {@link ApiClientError} on any other API error
4693
+ */
4379
4694
  getBySubdomain(subdomain: string): Promise<Store | null>;
4380
4695
  /**
4381
4696
  * The store `domain` serves. `options` (e.g. an `x-store-preview` header,
@@ -4384,6 +4699,9 @@ declare class StoresApi {
4384
4699
  getByDomain(domain: string, options?: RequestOptions): Promise<StoreByDomainInfo | null>;
4385
4700
  }
4386
4701
 
4702
+ /**
4703
+ * Theme previews opened from the dashboard, reached through `sdk.themes`.
4704
+ */
4387
4705
  declare class ThemesApi {
4388
4706
  private http;
4389
4707
  constructor(http: IHttpClient);
@@ -4407,6 +4725,9 @@ interface MetaobjectListResult {
4407
4725
  next_cursor: string | null;
4408
4726
  }
4409
4727
 
4728
+ /**
4729
+ * Custom structured content (metaobject entries) a store publishes, reached through `sdk.metaobjects`.
4730
+ */
4410
4731
  declare class MetaobjectsApi {
4411
4732
  private publicHttp;
4412
4733
  private authHttp;
@@ -4650,11 +4971,35 @@ type CategorySearchResponse = z.infer<typeof categorySearchResponseSchema>;
4650
4971
  type BlogSearchParams = z.infer<typeof searchBlogParamsSchema>;
4651
4972
  type BlogSearchResponse = z.infer<typeof blogSearchResponseSchema>;
4652
4973
 
4974
+ /**
4975
+ * Search over a store's products and blog posts, reached through `sdk.search`.
4976
+ */
4653
4977
  declare class SearchApi {
4654
4978
  private http;
4655
4979
  constructor(http: IHttpClient);
4980
+ /**
4981
+ * Searches products.
4982
+ *
4983
+ * @param storeRef - the store's ref or handle
4984
+ * @param params - the query, filters and paging
4985
+ * @returns The matching products; throws {@link ApiClientError} when the API answers with an error
4986
+ */
4656
4987
  searchCatalog(storeRef: string, params: ProductSearchParams): Promise<ProductSearchResponse>;
4988
+ /**
4989
+ * Suggests product matches while the shopper is typing.
4990
+ *
4991
+ * @param storeRef - the store's ref or handle
4992
+ * @param params - the partial query and the suggestion limit
4993
+ * @returns The suggestions; throws {@link ApiClientError} when the API answers with an error
4994
+ */
4657
4995
  autocompleteCatalog<T>(storeRef: string, params: AutocompleteParams): Promise<T>;
4996
+ /**
4997
+ * Searches published blog posts.
4998
+ *
4999
+ * @param storeRef - the store's ref or handle
5000
+ * @param params - the query and paging
5001
+ * @returns The matching posts; throws {@link ApiClientError} when the API answers with an error
5002
+ */
4658
5003
  searchBlog(storeRef: string, params: BlogSearchParams): Promise<BlogSearchResponse>;
4659
5004
  }
4660
5005
 
@@ -4777,15 +5122,35 @@ interface ShippingQuoteChangedDetails {
4777
5122
  options: ShippingOption[];
4778
5123
  }
4779
5124
 
5125
+ /**
5126
+ * Shipping areas and shipping rates for a store, reached through `sdk.shipping`.
5127
+ */
4780
5128
  declare class ShippingApi {
4781
- private http;
4782
- constructor(http: IHttpClient);
5129
+ /** Client for the public routes, sent with the publishable key. */
5130
+ protected publicHttp: IHttpClient;
5131
+ constructor(publicHttp: IHttpClient);
4783
5132
  /**
4784
5133
  * List administrative areas. Pass `level` for one tier or `parent_code`
4785
5134
  * for one area's children; passing neither returns every area, which for
4786
5135
  * Vietnam is 3,355 rows and about 900 KB. Prefer a filter.
4787
5136
  */
4788
5137
  listLocationAreas(storeRef: string, query?: LocationAreaQuery): Promise<LocationAreasResponse>;
5138
+ }
5139
+ /**
5140
+ * Shipping rates for a cart, reached through `sdk.shipping` on the server and proxied SDKs.
5141
+ *
5142
+ * Needs a storefront secret key: available on `createEcomwebServerSdk` and `createEcomwebProxiedSdk`, never on `createEcomwebSdk`.
5143
+ */
5144
+ declare class ShippingServerApi extends ShippingApi {
5145
+ private privateHttp;
5146
+ constructor(publicHttp: IHttpClient, privateHttp: IHttpClient);
5147
+ /**
5148
+ * Works out the shipping options and prices for a cart and a destination.
5149
+ *
5150
+ * @param storeRef - the store's ref or handle
5151
+ * @param data - the destination and the cart contents
5152
+ * @returns The available shipping options; throws {@link ApiClientError} when the API answers with an error
5153
+ */
4789
5154
  calculate(storeRef: string, data: ShippingCalculationRequest): Promise<ShippingOption[]>;
4790
5155
  }
4791
5156
 
@@ -4835,12 +5200,39 @@ interface PromotionSuggestionsResponse {
4835
5200
  promotions: PromotionSuggestion[];
4836
5201
  }
4837
5202
 
5203
+ /**
5204
+ * Promotion codes and offers of a store, reached through `sdk.promotions`.
5205
+ */
4838
5206
  declare class PromotionsApi {
4839
- private http;
4840
- constructor(http: IHttpClient);
4841
- validate(storeRef: string, data: ValidatePromotionCodeRequest): Promise<ValidatePromotionCodeResponse>;
5207
+ /** Client for the public routes, sent with the publishable key. */
5208
+ protected publicHttp: IHttpClient;
5209
+ constructor(publicHttp: IHttpClient);
5210
+ /**
5211
+ * Lists promotions the shopper could use, optionally for a given cart subtotal.
5212
+ *
5213
+ * @param storeRef - the store's ref or handle
5214
+ * @param subtotal - the cart subtotal in the store's currency
5215
+ * @returns The suggested promotions; throws {@link ApiClientError} when the API answers with an error
5216
+ */
4842
5217
  getSuggestions(storeRef: string, subtotal?: number): Promise<PromotionSuggestionsResponse>;
4843
5218
  }
5219
+ /**
5220
+ * Promotion code checks, reached through `sdk.promotions` on the server and proxied SDKs.
5221
+ *
5222
+ * Needs a storefront secret key: available on `createEcomwebServerSdk` and `createEcomwebProxiedSdk`, never on `createEcomwebSdk`.
5223
+ */
5224
+ declare class PromotionsServerApi extends PromotionsApi {
5225
+ private privateHttp;
5226
+ constructor(publicHttp: IHttpClient, privateHttp: IHttpClient);
5227
+ /**
5228
+ * Checks a promotion code against a cart.
5229
+ *
5230
+ * @param storeRef - the store's ref or handle
5231
+ * @param data - the code and the cart details
5232
+ * @returns The validation result; throws {@link ApiClientError} when the API answers with an error
5233
+ */
5234
+ validate(storeRef: string, data: ValidatePromotionCodeRequest): Promise<ValidatePromotionCodeResponse>;
5235
+ }
4844
5236
 
4845
5237
  interface BankAccount {
4846
5238
  id: number;
@@ -4867,9 +5259,18 @@ interface PaymentMethod {
4867
5259
  provider_code?: string | null;
4868
5260
  }
4869
5261
 
5262
+ /**
5263
+ * The payment methods a store accepts, reached through `sdk.paymentMethods`.
5264
+ */
4870
5265
  declare class PaymentMethodsApi {
4871
5266
  private http;
4872
5267
  constructor(http: IHttpClient);
5268
+ /**
5269
+ * Lists the payment methods the store has turned on.
5270
+ *
5271
+ * @param storeRef - the store's ref or handle
5272
+ * @returns The enabled payment methods; throws {@link ApiClientError} when the API answers with an error
5273
+ */
4873
5274
  getEnabled(storeRef: string): Promise<PaymentMethod[]>;
4874
5275
  }
4875
5276
 
@@ -4914,14 +5315,12 @@ interface PaymentCredentialStatus {
4914
5315
  * since the dashboard talks to it directly and this SDK must never carry a
4915
5316
  * plaintext credential shape.
4916
5317
  *
4917
- * Both endpoints sit behind StorefrontApiKeyGuard, so both go through the
4918
- * public HTTP client — the same one `PaymentMethodsApi` uses — never the
4919
- * authenticated one.
5318
+ * Both endpoints need a storefront secret key, so both go through the one
5319
+ * private HTTP client (the server SDK's, or the proxy's), never the public one.
4920
5320
  */
4921
5321
  declare class PaymentsApi {
4922
- private publicHttp;
4923
- private authHttp;
4924
- constructor(publicHttp: IHttpClient, authHttp: IHttpClient);
5322
+ private privateHttp;
5323
+ constructor(privateHttp: IHttpClient);
4925
5324
  /**
4926
5325
  * Start a gateway charge attempt for an order. Keyed by `order_code`,
4927
5326
  * never `order_id` — the API route was deliberately re-keyed away from a
@@ -4975,13 +5374,65 @@ interface BatchOrderReviewInvitationsResult {
4975
5374
  [order_number: string]: OrderReviewInvitationSummary[];
4976
5375
  }
4977
5376
 
5377
+ /**
5378
+ * Product reviews and the invitations that ask customers to write them, reached through `sdk.reviews`.
5379
+ */
4978
5380
  declare class ReviewsApi {
4979
- private http;
4980
- constructor(http: IHttpClient);
5381
+ /** Client for the public routes, sent with the publishable key. */
5382
+ protected publicHttp: IHttpClient;
5383
+ constructor(publicHttp: IHttpClient);
5384
+ /**
5385
+ * Lists the published reviews of a product.
5386
+ *
5387
+ * @param storeRef - the store's ref or handle
5388
+ * @param productId - the product id
5389
+ * @param query - filters and paging
5390
+ * @returns A page of reviews; throws {@link ApiClientError} when the API answers with an error
5391
+ */
4981
5392
  getProductReviews(storeRef: string, productId: string | number, query?: Omit<ProductReviewFilters, "product_id">): Promise<PaginatedReviewsResponse>;
5393
+ }
5394
+ /**
5395
+ * The review invitation calls, reached through `sdk.reviews` on the server and proxied SDKs.
5396
+ *
5397
+ * Needs a storefront secret key: available on `createEcomwebServerSdk` and `createEcomwebProxiedSdk`, never on `createEcomwebSdk`.
5398
+ */
5399
+ declare class ReviewsServerApi extends ReviewsApi {
5400
+ private privateHttp;
5401
+ constructor(publicHttp: IHttpClient, privateHttp: IHttpClient);
5402
+ /**
5403
+ * Gets the public details behind a review invitation link.
5404
+ *
5405
+ * @param storeRef - the store's ref or handle
5406
+ * @param token - the token from the invitation link
5407
+ * @returns The invitation details; throws {@link ApiClientError} when the API answers with an error
5408
+ */
4982
5409
  getReviewInvitation(storeRef: string, token: string): Promise<ReviewInvitationPublicData>;
5410
+ /**
5411
+ * Lists the review invitations for one order.
5412
+ *
5413
+ * @param storeRef - the store's ref or handle
5414
+ * @param orderNumber - the order number
5415
+ * @param email - the email address on the order
5416
+ * @returns The invitation summaries; throws {@link ApiClientError} when the API answers with an error
5417
+ */
4983
5418
  getOrderReviewInvitations(storeRef: string, orderNumber: number | string, email: string): Promise<OrderReviewInvitationSummary[]>;
5419
+ /**
5420
+ * Lists the review invitations for several orders at once.
5421
+ *
5422
+ * @param storeRef - the store's ref or handle
5423
+ * @param orderNumbers - the order numbers
5424
+ * @param email - the email address on the orders
5425
+ * @returns The invitations grouped by order; throws {@link ApiClientError} when the API answers with an error
5426
+ */
4984
5427
  getBatchOrderReviewInvitations(storeRef: string, orderNumbers: (number | string)[], email: string): Promise<BatchOrderReviewInvitationsResult>;
5428
+ /**
5429
+ * Submits a review through an invitation link.
5430
+ *
5431
+ * @param storeRef - the store's ref or handle
5432
+ * @param token - the token from the invitation link
5433
+ * @param payload - the rating and review text
5434
+ * @returns The API's answer; throws {@link ApiClientError} when the API answers with an error
5435
+ */
4985
5436
  submitReviewInvitation(storeRef: string, token: string, payload: SubmitReviewInvitationPayload): Promise<any>;
4986
5437
  }
4987
5438
 
@@ -5011,9 +5462,19 @@ interface UpsertCustomerForAuthPayload {
5011
5462
  avatar_url?: string | null;
5012
5463
  }
5013
5464
 
5465
+ /**
5466
+ * The signed-in customer's profile record, reached through `sdk.customers`.
5467
+ */
5014
5468
  declare class CustomersApi {
5015
5469
  private http;
5016
5470
  constructor(http: IHttpClient);
5471
+ /**
5472
+ * Creates the customer record for a newly signed-in user, or updates it when it exists.
5473
+ *
5474
+ * @param storeRef - the store's ref or handle
5475
+ * @param payload - the identity fields to store
5476
+ * @returns The customer, as the raw {@link ApiResponse}; it does not throw, so check `success`
5477
+ */
5017
5478
  upsertForAuth(storeRef: string, payload: UpsertCustomerForAuthPayload): Promise<ApiResponse<Customer>>;
5018
5479
  /** The signed-in customer's metafields with customer access (spec §6.6). */
5019
5480
  getMetafields(storeRef: string): Promise<StorefrontMetafields>;
@@ -5061,14 +5522,59 @@ interface CreateAddressDto {
5061
5522
  interface UpdateAddressDto extends Partial<CreateAddressDto> {
5062
5523
  }
5063
5524
 
5525
+ /**
5526
+ * Saved delivery addresses of the signed-in customer, reached through `sdk.addresses`.
5527
+ */
5064
5528
  declare class AddressesApi {
5065
5529
  private http;
5066
5530
  constructor(http: IHttpClient);
5531
+ /**
5532
+ * Lists the signed-in customer's saved addresses.
5533
+ *
5534
+ * @param storeRef - the store's ref or handle
5535
+ * @returns The addresses, or `null` when it is not found; throws {@link ApiClientError} on any other API error
5536
+ */
5067
5537
  list(storeRef: string): Promise<Address[] | null>;
5538
+ /**
5539
+ * Gets one of the signed-in customer's saved addresses.
5540
+ *
5541
+ * @param storeRef - the store's ref or handle
5542
+ * @param addressId - the address id
5543
+ * @returns The address, or `null` when it is not found; throws {@link ApiClientError} on any other API error
5544
+ */
5068
5545
  getById(storeRef: string, addressId: number): Promise<Address | null>;
5546
+ /**
5547
+ * Saves a new address for the signed-in customer.
5548
+ *
5549
+ * @param storeRef - the store's ref or handle
5550
+ * @param data - the address fields
5551
+ * @returns The created address, or `null` when it is not found; throws {@link ApiClientError} on any other API error
5552
+ */
5069
5553
  create(storeRef: string, data: CreateAddressDto): Promise<Address | null>;
5554
+ /**
5555
+ * Updates one of the signed-in customer's saved addresses.
5556
+ *
5557
+ * @param storeRef - the store's ref or handle
5558
+ * @param addressId - the address id
5559
+ * @param data - the fields to change
5560
+ * @returns The updated address, or `null` when it is not found; throws {@link ApiClientError} on any other API error
5561
+ */
5070
5562
  update(storeRef: string, addressId: number, data: UpdateAddressDto): Promise<Address | null>;
5563
+ /**
5564
+ * Deletes one of the signed-in customer's saved addresses.
5565
+ *
5566
+ * @param storeRef - the store's ref or handle
5567
+ * @param addressId - the address id
5568
+ * @returns `true` when the API accepted the deletion, `false` otherwise; it does not throw
5569
+ */
5071
5570
  delete(storeRef: string, addressId: number): Promise<boolean>;
5571
+ /**
5572
+ * Makes a saved address the customer's default.
5573
+ *
5574
+ * @param storeRef - the store's ref or handle
5575
+ * @param addressId - the address id
5576
+ * @returns The updated address, or `null` when it is not found; throws {@link ApiClientError} on any other API error
5577
+ */
5072
5578
  setDefault(storeRef: string, addressId: number): Promise<Address | null>;
5073
5579
  }
5074
5580
 
@@ -5081,10 +5587,27 @@ interface WithSeoMetadata {
5081
5587
  }
5082
5588
  type ContentPage = ContentPage$1 & WithSeoMetadata & WithMetafields;
5083
5589
 
5590
+ /**
5591
+ * Static content pages of a store, such as About or Shipping policy, reached through `sdk.contentPages`.
5592
+ */
5084
5593
  declare class ContentPagesApi {
5085
5594
  private http;
5086
5595
  constructor(http: IHttpClient);
5596
+ /**
5597
+ * Lists the published content pages.
5598
+ *
5599
+ * @param storeRef - the store's ref or handle
5600
+ * @returns A page of content pages; throws {@link ApiClientError} when the API answers with an error
5601
+ */
5087
5602
  getPublished(storeRef: string): Promise<PaginatedResponse<ContentPage>>;
5603
+ /**
5604
+ * Gets one published content page by slug.
5605
+ *
5606
+ * @param storeRef - the store's ref or handle
5607
+ * @param slug - the page slug
5608
+ * @param query - `include_seo_metadata` adds the SEO fields
5609
+ * @returns The page; throws {@link ApiClientError} when the API answers with an error
5610
+ */
5088
5611
  getBySlug(storeRef: string, slug: string, query?: {
5089
5612
  include_seo_metadata?: boolean;
5090
5613
  }): Promise<ContentPage>;
@@ -5115,9 +5638,20 @@ type StoreMenu = {
5115
5638
  menu_items?: StoreMenuItem[];
5116
5639
  };
5117
5640
 
5641
+ /**
5642
+ * Navigation menus of a store, reached through `sdk.menus`.
5643
+ */
5118
5644
  declare class MenusApi {
5119
5645
  private http;
5120
5646
  constructor(http: IHttpClient);
5647
+ /**
5648
+ * Gets a navigation menu by its ref.
5649
+ *
5650
+ * @param storeRef - the store's ref or handle
5651
+ * @param ref - the menu ref
5652
+ * @param includeItems - `true` (the default) includes the menu items
5653
+ * @returns The menu, or `null` when it is not found; throws {@link ApiClientError} on any other API error
5654
+ */
5121
5655
  getByRef(storeRef: string, ref: string, includeItems?: boolean): Promise<StoreMenu | null>;
5122
5656
  }
5123
5657
 
@@ -5133,6 +5667,9 @@ interface UrlRedirect {
5133
5667
  updated_at: string;
5134
5668
  }
5135
5669
 
5670
+ /**
5671
+ * URL redirects a store has set up, reached through `sdk.redirects`.
5672
+ */
5136
5673
  declare class RedirectsApi {
5137
5674
  private http;
5138
5675
  constructor(http: IHttpClient);
@@ -5255,9 +5792,9 @@ type AuthErrorCode = "AUTH_INVALID_CREDENTIALS" | "AUTH_ACCOUNT_LOCKED"
5255
5792
  /**
5256
5793
  * One store's auth surface.
5257
5794
  *
5258
- * Two prefixes, not one: `public/` routes are unauthenticated and throttled,
5259
- * `tenant/` routes require an access token and assert that the token's
5260
- * store_id matches the route's store.
5795
+ * Every route lives under `/storefront/stores/<ref>/auth/`. Token routes
5796
+ * (`me`, `logout`, ...) require an access token and assert that the token's
5797
+ * store_id matches the route's store; the rest are unauthenticated and throttled.
5261
5798
  *
5262
5799
  * This class does not supply `x-storefront-api-key` — StorefrontApiKeyGuard
5263
5800
  * requires it on every route, and the injected IHttpClient owns that header.
@@ -5271,7 +5808,19 @@ declare class AuthApi {
5271
5808
  private auth;
5272
5809
  /** Never returns tokens: a new email and an existing one respond identically. */
5273
5810
  register(payload: RegisterPayload): Promise<ApiResponse<RegisterResult>>;
5811
+ /**
5812
+ * Signs a customer in with email and password.
5813
+ *
5814
+ * @param payload - the login credentials
5815
+ * @returns The auth result with the token pair, as the raw {@link ApiResponse}; it does not throw, so check `success`
5816
+ */
5274
5817
  login(payload: LoginPayload): Promise<ApiResponse<AuthResult>>;
5818
+ /**
5819
+ * Exchanges a refresh token for a new token pair. The old refresh token stops working.
5820
+ *
5821
+ * @param refresh_token - the customer's current refresh token
5822
+ * @returns The new token pair, as the raw {@link ApiResponse}; it does not throw, so check `success`
5823
+ */
5275
5824
  refresh(refresh_token: string): Promise<ApiResponse<AuthResult>>;
5276
5825
  /**
5277
5826
  * `binding` is the register response's `verification_binding`, when this
@@ -5279,22 +5828,100 @@ declare class AuthApi {
5279
5828
  * set at registration is dropped.
5280
5829
  */
5281
5830
  verifyEmail(token: string, binding?: string): Promise<ApiResponse<VerifiedResult>>;
5831
+ /**
5832
+ * Sends the email-verification message again.
5833
+ *
5834
+ * @param email - the address to verify
5835
+ * @returns The send result, as the raw {@link ApiResponse}; it does not throw, so check `success`
5836
+ */
5282
5837
  resendVerification(email: string): Promise<ApiResponse<SentResult>>;
5838
+ /**
5839
+ * Starts a password reset by emailing a reset link.
5840
+ *
5841
+ * @param email - the account's email address
5842
+ * @returns The send result, as the raw {@link ApiResponse}; it does not throw, so check `success`
5843
+ */
5283
5844
  forgotPassword(email: string): Promise<ApiResponse<SentResult>>;
5845
+ /**
5846
+ * Sets a new password using the token from the reset email.
5847
+ *
5848
+ * @param payload - the reset token and the new password
5849
+ * @returns The reset result, as the raw {@link ApiResponse}; it does not throw, so check `success`
5850
+ */
5284
5851
  resetPassword(payload: ResetPasswordPayload): Promise<ApiResponse<ResetResult>>;
5285
5852
  /** `binding` is the change-email response's `confirmation_binding`. */
5286
5853
  confirmEmailChange(token: string, binding?: string): Promise<ApiResponse<ChangedResult>>;
5854
+ /**
5855
+ * Emails a one-time sign-in code.
5856
+ *
5857
+ * @param email - the account's email address
5858
+ * @returns The send result, as the raw {@link ApiResponse}; it does not throw, so check `success`
5859
+ */
5287
5860
  requestOtp(email: string): Promise<ApiResponse<SentResult>>;
5861
+ /**
5862
+ * Signs a customer in with the one-time code from the email.
5863
+ *
5864
+ * @param payload - the email and the code
5865
+ * @returns The auth result with the token pair, as the raw {@link ApiResponse}; it does not throw, so check `success`
5866
+ */
5288
5867
  verifyOtp(payload: VerifyOtpPayload): Promise<ApiResponse<AuthResult>>;
5868
+ /**
5869
+ * Starts an anonymous (guest) session.
5870
+ *
5871
+ * @returns The auth result with the token pair, as the raw {@link ApiResponse}; it does not throw, so check `success`
5872
+ */
5289
5873
  anonymous(): Promise<ApiResponse<AuthResult>>;
5874
+ /**
5875
+ * Gets the URL that starts Google sign-in.
5876
+ *
5877
+ * @param redirect_to - where to send the customer after sign-in, `/` by default
5878
+ * @returns The Google sign-in URL, as the raw {@link ApiResponse}; it does not throw, so check `success`
5879
+ */
5290
5880
  getGoogleUrl(redirect_to?: string): Promise<ApiResponse<GoogleAuthUrl>>;
5881
+ /**
5882
+ * Completes Google sign-in by exchanging the authorization code.
5883
+ *
5884
+ * @param code - the authorization code Google returned
5885
+ * @returns The auth result with the token pair, as the raw {@link ApiResponse}; it does not throw, so check `success`
5886
+ */
5291
5887
  exchangeGoogleCode(code: string): Promise<ApiResponse<AuthResult>>;
5888
+ /**
5889
+ * Reads which sign-in methods this store has turned on.
5890
+ *
5891
+ * @returns The public auth configuration, as the raw {@link ApiResponse}; it does not throw, so check `success`
5892
+ */
5292
5893
  getAuthConfig(): Promise<ApiResponse<PublicAuthConfig>>;
5894
+ /**
5895
+ * Reads the signed-in customer's identity.
5896
+ *
5897
+ * @param access_token - the signed-in customer's access token
5898
+ * @returns The current identity, as the raw {@link ApiResponse}; it does not throw, so check `success`
5899
+ */
5293
5900
  me(access_token: string): Promise<ApiResponse<CurrentIdentity | null>>;
5294
5901
  /** Revokes one session. The refresh token identifies which. */
5295
5902
  logout(access_token: string, refresh_token: string): Promise<ApiResponse<unknown>>;
5903
+ /**
5904
+ * Signs the customer out of every session.
5905
+ *
5906
+ * @param access_token - the signed-in customer's access token
5907
+ * @returns The API's answer, as the raw {@link ApiResponse}; it does not throw, so check `success`
5908
+ */
5296
5909
  logoutAll(access_token: string): Promise<ApiResponse<unknown>>;
5910
+ /**
5911
+ * Changes the signed-in customer's password.
5912
+ *
5913
+ * @param access_token - the signed-in customer's access token
5914
+ * @param payload - the current and the new password
5915
+ * @returns The API's answer, as the raw {@link ApiResponse}; it does not throw, so check `success`
5916
+ */
5297
5917
  changePassword(access_token: string, payload: ChangePasswordPayload): Promise<ApiResponse<unknown>>;
5918
+ /**
5919
+ * Starts an email change; the new address must be confirmed from the message sent to it.
5920
+ *
5921
+ * @param access_token - the signed-in customer's access token
5922
+ * @param payload - the new email address and the current password
5923
+ * @returns The change-email result, as the raw {@link ApiResponse}; it does not throw, so check `success`
5924
+ */
5298
5925
  changeEmail(access_token: string, payload: ChangeEmailPayload): Promise<ApiResponse<ChangeEmailResult>>;
5299
5926
  }
5300
5927
 
@@ -5314,8 +5941,21 @@ interface TokenStorage {
5314
5941
  declare class MemoryTokenStorage implements TokenStorage {
5315
5942
  private tokens;
5316
5943
  constructor(initial?: AuthTokens | null);
5944
+ /**
5945
+ * Reads the stored token pair.
5946
+ *
5947
+ * @returns The stored tokens, or `null` when none are stored
5948
+ */
5317
5949
  get(): Promise<AuthTokens | null>;
5950
+ /**
5951
+ * Stores a token pair, replacing any earlier one.
5952
+ *
5953
+ * @param tokens - the access and refresh tokens
5954
+ */
5318
5955
  set(tokens: AuthTokens): Promise<void>;
5956
+ /**
5957
+ * Forgets the stored token pair.
5958
+ */
5319
5959
  clear(): Promise<void>;
5320
5960
  }
5321
5961
 
@@ -5333,8 +5973,15 @@ interface Options {
5333
5973
  */
5334
5974
  declare function createAuthAwareHttpClient(inner: IHttpClient, { storage, auth }: Options): IHttpClient;
5335
5975
 
5976
+ /** What {@link createEcomwebSdk} needs: the two HTTP clients, and optional client info. */
5336
5977
  interface EcomwebSdkOptions {
5978
+ /**
5979
+ * Client for the public API routes and the calls that need no shopper
5980
+ * session. {@link createEcomwebSdk} sends it as is (with a publishable key);
5981
+ * {@link createEcomwebServerSdk} adds the secret key to it.
5982
+ */
5337
5983
  publicHttp: IHttpClient;
5984
+ /** Client for the routes that need the signed-in customer's credentials. */
5338
5985
  authHttp: IHttpClient;
5339
5986
  /**
5340
5987
  * Tokens put before this SDK's own in the `X-Ecomweb-Client` header
@@ -5342,28 +5989,132 @@ interface EcomwebSdkOptions {
5342
5989
  */
5343
5990
  clientInfo?: string;
5344
5991
  }
5345
- declare function createEcomwebSdk(options: EcomwebSdkOptions): {
5992
+ /** What {@link createEcomwebServerSdk} needs: the public options plus the storefront secret key. */
5993
+ type EcomwebServerSdkOptions = EcomwebSdkOptions & {
5994
+ /** The store's storefront secret key (`sk_storefront_...`). Server only; never ship it to a browser. */
5995
+ secretKey: string;
5996
+ };
5997
+ /** What {@link createEcomwebProxiedSdk} needs: a direct client for public routes and one that reaches a same-origin proxy. */
5998
+ interface EcomwebProxiedSdkOptions {
5999
+ /** Client for the public API routes, called directly with the publishable key. */
6000
+ publicHttp: IHttpClient;
6001
+ /** Client that sends private calls to a same-origin proxy, which holds the secret key. */
6002
+ proxyHttp: IHttpClient;
6003
+ /**
6004
+ * Tokens put before this SDK's own in the `X-Ecomweb-Client` header
6005
+ * (space-separated `name/version`).
6006
+ */
6007
+ clientInfo?: string;
6008
+ }
6009
+ /** The public SDK: catalog and content reads, safe with a publishable key. */
6010
+ interface EcomwebSdk {
6011
+ /** Products. */
5346
6012
  products: ProductsApi;
6013
+ /** Collections. */
5347
6014
  collections: CollectionsApi;
6015
+ /** Categories. */
5348
6016
  categories: CategoriesApi;
5349
- cart: CartApi;
5350
- orders: OrdersApi;
6017
+ /** Published blog posts, categories, tags and comments. */
5351
6018
  blog: BlogApi;
6019
+ /** Stores. */
5352
6020
  stores: StoresApi;
6021
+ /** Themes. */
5353
6022
  themes: ThemesApi;
6023
+ /** Metaobject entries. */
5354
6024
  metaobjects: MetaobjectsApi;
6025
+ /** Search. */
5355
6026
  search: SearchApi;
6027
+ /** Shipping locations. */
5356
6028
  shipping: ShippingApi;
6029
+ /** Promotion suggestions. */
5357
6030
  promotions: PromotionsApi;
6031
+ /** Payment methods a store accepts. */
5358
6032
  paymentMethods: PaymentMethodsApi;
5359
- payments: PaymentsApi;
6033
+ /** Product reviews (reads). */
5360
6034
  reviews: ReviewsApi;
5361
- customers: CustomersApi;
5362
- addresses: AddressesApi;
6035
+ /** Content pages. */
5363
6036
  contentPages: ContentPagesApi;
6037
+ /** Menus. */
5364
6038
  menus: MenusApi;
6039
+ /** URL redirects. */
5365
6040
  redirects: RedirectsApi;
5366
- };
5367
- type EcomwebSdk = ReturnType<typeof createEcomwebSdk>;
6041
+ }
6042
+ /** The server SDK: everything on {@link EcomwebSdk} plus the private modules. */
6043
+ interface EcomwebServerSdk extends Omit<EcomwebSdk, "blog" | "reviews" | "shipping" | "promotions"> {
6044
+ /** Blog, with comment submission. */
6045
+ blog: BlogServerApi;
6046
+ /** Reviews, with submission and invitations. */
6047
+ reviews: ReviewsServerApi;
6048
+ /** Shipping, with rate calculation. */
6049
+ shipping: ShippingServerApi;
6050
+ /** Promotions, with code validation. */
6051
+ promotions: PromotionsServerApi;
6052
+ /** Carts. */
6053
+ cart: CartApi;
6054
+ /** Orders. */
6055
+ orders: OrdersApi;
6056
+ /** Payments. */
6057
+ payments: PaymentsApi;
6058
+ /** Customers. */
6059
+ customers: CustomersApi;
6060
+ /** Customer addresses. */
6061
+ addresses: AddressesApi;
6062
+ }
6063
+ /**
6064
+ * Creates the public SDK. It reads the catalog and content only (products,
6065
+ * collections, categories, blog, stores, themes, search and so on) and is safe
6066
+ * to use in a browser with a publishable key. For carts, orders, payments,
6067
+ * customers and the private methods of other modules, use
6068
+ * {@link createEcomwebServerSdk} on a server or {@link createEcomwebProxiedSdk}
6069
+ * in a browser.
6070
+ *
6071
+ * @example
6072
+ * ```ts
6073
+ * const sdk = createEcomwebSdk({ publicHttp, authHttp });
6074
+ * const product = await sdk.products.getBySlug("my-store", "blue-shirt");
6075
+ * ```
6076
+ *
6077
+ * @param options - the HTTP clients, and optional client info for the `X-Ecomweb-Client` header
6078
+ * @returns An object with one API class per public resource
6079
+ */
6080
+ declare function createEcomwebSdk(options: EcomwebSdkOptions): EcomwebSdk;
6081
+ /**
6082
+ * Creates the server SDK: the public modules plus carts, orders, payments,
6083
+ * customers, addresses and the private methods of blog, reviews, shipping and
6084
+ * promotions. Every request carries the secret in `x-storefront-api-key`, and
6085
+ * a key header set by the caller is overridden. Run it on a server only.
6086
+ *
6087
+ * @example
6088
+ * ```ts
6089
+ * const sdk = createEcomwebServerSdk({
6090
+ * publicHttp,
6091
+ * authHttp,
6092
+ * secretKey: process.env.ECOMWEB_SECRET_KEY!,
6093
+ * });
6094
+ * const cart = await sdk.cart.getCart("my-store", sessionId, false);
6095
+ * ```
6096
+ *
6097
+ * @param options - the HTTP clients, the storefront secret key, and optional client info
6098
+ * @returns The public modules and the private ones
6099
+ * @throws Error when `secretKey` is blank or is a publishable key (`pk_...`), or when called in a browser; the message never includes the key
6100
+ */
6101
+ declare function createEcomwebServerSdk(options: EcomwebServerSdkOptions): EcomwebServerSdk;
6102
+ /**
6103
+ * Creates the SDK for browser code that needs private modules. Public calls go
6104
+ * straight to the API with the publishable key; private ones (cart, orders,
6105
+ * payments, customers, addresses and the private methods of other modules) go
6106
+ * to `proxyHttp`, a same-origin proxy that holds the secret key. No secret
6107
+ * reaches the browser.
6108
+ *
6109
+ * @example
6110
+ * ```ts
6111
+ * const sdk = createEcomwebProxiedSdk({ publicHttp, proxyHttp });
6112
+ * const cart = await sdk.cart.getCart("my-store", sessionId, false);
6113
+ * ```
6114
+ *
6115
+ * @param options - the direct client, the proxy client, and optional client info
6116
+ * @returns The same shape as {@link createEcomwebServerSdk}
6117
+ */
6118
+ declare function createEcomwebProxiedSdk(options: EcomwebProxiedSdkOptions): EcomwebServerSdk;
5368
6119
 
5369
- export { ADJUSTABLE_STATES, ADMIN_ORDER_SOURCES, type AddToCartRequest, type Address, AddressesApi, type AdjustQuantitiesRequest, type AdjustableState, type AdminOrderSource, ApiClientError, type ApiError, type ApiResponse, type AppliedPromotion, type AttributeLink, AuthApi, type AuthErrorCode, type AuthIdentity, type AuthResult, type AuthTokens, type AutocompleteParams, type BankAccount, type BaseDeleteOptions, type BaseDeleteResult, type BaseQueryParams, type BatchOrderReviewInvitationsResult, BlogApi, type BlogCategory, type BlogCategoryQueryParams, type BlogComment, type BlogCommentWithReplies, type BlogPost, type BlogPostCategory, type BlogPostQueryParams, type BlogPostStatus, type BlogPostTag, type BlogPostWithRelations, type BlogSearchParams, type BlogSearchResponse, type BlogSettings, type BlogTag, type BlogTagQueryParams, CLIENT_HEADER, COLLECTION_RULE_MATRIX, CONDITION_TYPE_LABELS, CartApi, type CartApiItem, type CartApiResponse, CategoriesApi, type Category, type CategoryQueryParams, type CategorySearchResponse, type CategoryTree, type CategoryWithChildren, type ChangeEmailPayload, type ChangeEmailResult, type ChangePasswordPayload, type ChangedResult, type Collection, type CollectionQueryParams, type CollectionRule, type CollectionRuleSet, type CollectionRuleSetCriteria, type CollectionSearchCriteria, CollectionsApi, ConditionType, ConditionTypeSchema, type ConditionTypeType, type ContentPage, ContentPagesApi, type CreateAddressDto, type CreateBlogCategory, type CreateBlogComment, type CreateBlogPost, type CreateBlogSettings, type CreateBlogTag, type CreateCategory, type CreateContentPage, type CreateEmbeddedScript, type CreateOrder, type CreateOrderItem, type CreateOrderItemRequest, type CreateOrderRequest, type CreateProduct, type CreateProductReview, type CreateProductReviewReply, type CreateProductVariant, type CreatePromotion, CreatePromotionSchema, type CreateStore, type CreateStoreConfig, type CreateStoreSettings, type CreateVariantOption, type CreateVariantOptionValue, type CurrentIdentity, type Customer, type CustomerAccess, type CustomerOrderFilter, type CustomerOrderSummary, CustomersApi, DEFAULT_BUCKET, DISCOUNT_METHOD_LABELS, type DeleteApiFunction, type DeletedAt, DiscountMethod, DiscountMethodSchema, type DiscountMethodType, EMAIL_COLOR_PATTERN, EMAIL_PALETTE_DEFAULTS, ENTRY_HANDLE_PATTERN, type EcomwebSdk, type EcomwebSdkOptions, type EmbeddedScript, type EmbeddedScriptPlacement, type EngineResult, FILTERABLE_TYPES, type FileKind, type FulfillmentStatus, type GoogleAuthUrl, type GuestOrderLookupParams, type IHttpClient, INVENTORY_ADJUSTMENT_REASONS, INVENTORY_ERROR_CODES, INVENTORY_POLICIES, INVENTORY_STATES, INVENTORY_STATUS_LABELS, type Id, type ImageFormat, type ImageTransformOptions, type InitiatePaymentResult, type InsufficientInventoryItem, type IntegrationStatus, type InventoryActor, type InventoryAdjustmentReason, type InventoryErrorCode, type InventoryHistoryEntry, type InventoryImportResponse, type InventoryLevelRow, type InventoryLocation, type InventoryPolicy, type InventoryQuantities, type InventoryState, InventoryStatus, KNOWN_PAYMENT_METHODS, LEGACY_STATUS_MIGRATION_MAP, LEVEL_PROVINCE, LEVEL_WARD, type LegacyOrderStatus, type LegacyProductStatus, type LinkValue, type LocationArea, type LocationAreaQuery, type LocationAreasResponse, type LoginPayload, MAX_RULES_PER_SET, MAX_RULE_VALUE_ENTRIES, MEASUREMENT_UNITS, MEDIA_TYPES, MERCHANT_ADJUSTMENT_REASONS, METAFIELD_BASE_TYPES, METAFIELD_KEY_PATTERN, METAFIELD_LIMITS, METAFIELD_OWNER_TYPES, METAFIELD_TYPE_GROUPS, METAOBJECT_REFERENCE_TYPES, METAOBJECT_TYPE_PATTERN, type MeasurementType, type MeasurementValue, MemoryTokenStorage, MenusApi, type MerchantAdjustmentReason, type MessageOutboxStatus, type MetafieldBaseType, type MetafieldBound, type MetafieldContext, type MetafieldDefinitionShape, type MetafieldIssue, type MetafieldIssueCode, type MetafieldListType, type MetafieldOwnerType, type MetafieldType, type MetafieldTypeGroup, type MetafieldValidationKey, type MetafieldValidations, type MetafieldWrite, type MetaobjectDefinitionShape, type MetaobjectFieldShape, type MetaobjectListParams, type MetaobjectListResult, MetaobjectsApi, type MoneyValue, type MoveQuantitiesRequest, type MutationApiFunction, OBJECT_PREFIX, ORDER_ACTOR_TYPES, ORDER_EVENT_TYPES, ORDER_SHIPMENT_ERROR_CODES, ORDER_SOURCES, type OptionalTimestamp, type Order, type OrderActorType, type OrderCommentMutationResult, type OrderCreatedBy, type OrderEventType, type OrderItem, type PaymentMethod$1 as OrderPaymentMethod, type OrderReviewInvitationSummary, type OrderShipmentEvent, type OrderShipmentSummary, type OrderSource, type OrderStatus, type OrderTimelineActor, type OrderTimelineComment, type OrderTimelineCommentAuthor, type OrderTimelineEntry, type OrderTimelineEvent, type OrderTimelineResponse, type OrderWithItems, OrdersApi, PAGINATION_DEFAULTS, PRIVATE_REFERENCE_TYPES, PRODUCT_STATUS_LABELS, PROMOTION_MODE_COLORS, PROMOTION_MODE_LABELS, PROMOTION_STATUS_COLORS, PROMOTION_STATUS_LABELS, PROMOTION_TYPE_COLORS, PROMOTION_TYPE_LABELS, type PaginatedApiFunction, type PaginatedPromotionsResponse, PaginatedPromotionsResponseSchema, type PaginatedResponse, type PaginatedReviewsResponse, type PaginationMeta, type PasswordPolicy, type PaymentCredentialStatus, type PaymentMethod$1 as PaymentMethod, PaymentMethodsApi, type PaymentStateResult, type PaymentStatus, PaymentsApi, type Product, type ProductDetail, type ProductImage, type ProductQueryParams, type ProductReview, type ProductReviewFilters, type ProductReviewReply, type ProductReviewReplyFilters, type ProductReviewStats, type ProductReviewWithReplies, type ProductSearchParams, type ProductSearchResponse, type ProductService, ProductStatus, type ProductVariant, type ProductVariantCombination, type ProductVariantCombinationEntry, type ProductVariantWithCombinations, type ProductVideo, type ProductWithReviewStats, type ProductWithVariants, ProductsApi, type Promotion, type PromotionData, PromotionMode, PromotionModeSchema, type PromotionModeType, type PromotionQueryParams, PromotionQueryParamsSchema, PromotionSchema, type PromotionStatistics, PromotionStatisticsSchema, PromotionStatus, PromotionStatusSchema, type PromotionStatusType, type PromotionSuggestion, type PromotionSuggestionsResponse, PromotionType, PromotionTypeSchema, type PromotionTypeType, type PromotionWithDiscount, PromotionWithDiscountSchema, PromotionsApi, type PublicAuthConfig, type PublishedStoreTheme, type QuantitiesResponse, RENDER_PREFIX, RESOURCE_REFERENCE_TYPES, RULE_FIELDS, type RatingValue, RedirectsApi, type RegisterPayload, type RegisterResult, type RequestOptions, type ResetPasswordPayload, type ResetResult, type ResizeMode, type ResolvedAsset, type ResolvedBlogPostRef, type ResolvedCollectionRef, type ResolvedImage, type ResolvedMetaobjectRef, type ResolvedMetaobjectStub, type ResolvedPageRef, type ResolvedProductRef, type ResolvedVariantRef, type ReviewInvitationPublicData, type ReviewStatus, ReviewsApi, type RichTextBlock, type RichTextHeading, type RichTextInline, type RichTextLink, type RichTextList, type RichTextListItem, type RichTextNode, type RichTextParagraph, type RichTextRoot, type RichTextText, type RuleField, type RuleFieldSpec, type RuleOperator, type RuleOperatorSpec, type RuleValueKind, SDK_CLIENT_TOKEN, SDK_VERSION, SHIPMENT_STATUSES, SHIPPING_CONDITION_TYPES, SHIPPING_DELIVERY_TYPES, SHIPPING_ERROR_CODES, SHIPPING_RATE_TYPES, SearchApi, type SearchCategory, type SearchProduct, type SentResult, type SeoMetadata$3 as SeoMetadata, type ServerComputedOrderAmounts, type SetQuantitiesRequest, type SetQuantitiesResponse, type ShipmentStatus, ShippingApi, type ShippingCalculationRequest, type ShippingConditionType, type ShippingDeliveryType, type ShippingOption, type ShippingQuoteChangedDetails, type ShippingRate, type ShippingRateType, type ShippingStatus, type ShippingZone, type SingleEntityApiFunction, type StaleQuantity, type Store, type StoreByDomainInfo, type StoreConfig, type StoreConfigurationInfo, type StoreEmailBrandingSettings, type StoreMenu, type StoreMenuItem, type PaymentMethod as StorePaymentMethod, type StoreSettings, type StoreStatus, type StoreWithRelations, type StorefrontMetafield, type StorefrontMetafields, type StorefrontMetaobjectEntry, StoresApi, type SubmitReviewInvitationPayload, THEME_HEX_COLOR, type ThemeDisplayItem, type ThemeMigration, type ThemeMigrationReport, type ThemeMigrationStep, type ThemeSchema, type ThemeSchemaGroup, type ThemeSchemaItem, type ThemeSetting, type ThemeSettingType, type ThemeSettingsOf, type ThemeValue, type ThemeValueError, type ThemeValues, type ThemeVisibleIf, ThemesApi, type Timestamp, type TocItem, type TokenStorage, UNAVAILABLE_STATES, type UnavailableState, type UpdateAddressDto, type UpdateBlogCategory, type UpdateBlogComment, type UpdateBlogPost, type UpdateBlogSettings, type UpdateBlogTag, type UpdateCartItemRequest, type UpdateCategory, type UpdateContentPage, type UpdateEmbeddedScript, type UpdateOrder, type UpdateOrderItem, type UpdateProduct, type UpdateProductReview, type UpdateProductReviewReply, type UpdateProductVariant, type UpdatePromotion, UpdatePromotionSchema, type UpdateStore, type UpdateStoreConfig, type UpdateStoreSettings, type UpdateVariantOption, type UpdateVariantOptionValue, type UpsertCustomerForAuthPayload, type UrlRedirect, VALIDATION_KEYS, type ValidatePromotionCodeRequest, type ValidatePromotionCodeResponse, type VariantOption, type VariantOptionValue, type VariantStatus, type VerifiedResult, type VerifyOtpPayload, type WithMetafields, type WithSeoMetadata$3 as WithSeoMetadata, allowedCustomerAccess, allowedFileKinds, allowedValuesFor, appliedPromotionSchema, applyThemeMigration, assetBaseUrl, attributeLinkSchema, attributeLinkValueSchema, baseDeleteOptionsSchema, baseDeleteResultSchema, baseQueryParamsSchema, baseTypeOf, blogCategorySchema, blogCommentSchema, blogCommentWithRepliesSchema, blogPostCategorySchema, blogPostSchema, blogPostStatusSchema, blogPostTagSchema, blogPostWithRelationsSchema, blogSettingsSchema, blogTagSchema, buildTransformQuery, categorySchema, categoryTreeSchema, categoryWithChildrenSchema, checkMetaobjectFieldChanges, clientHeaderValue, colorSchema, compareDecimal, contentPageSchema, createAuthAwareHttpClient, createBlogCategorySchema, createBlogCommentSchema, createBlogPostSchema, createBlogSettingsSchema, createBlogTagSchema, createCategorySchema, createContentPageSchema, createEcomwebSdk, createEmbeddedScriptSchema, createOrderItemSchema, createOrderSchema, createProductReviewReplySchema, createProductReviewSchema, createProductSchema, createProductVariantSchema, createStoreConfigSchema, createStoreSchema, createStoreSettingsSchema, createVariantOptionSchema, createVariantOptionValueSchema, customerOrderSummarySchema, decimalSchema, deletedAtSchema, dimensionsSchema, emailBrandingSchema, emailBrandingShape, emailSchema, embeddedScriptPlacementSchema, embeddedScriptSchema, ensureSuccess, entryDisplayName, fromObjectPublicUrlToRender, fulfillmentStatusSchema, idSchema, integrationStatusSchema, inventoryStatusSchema, isBlankValue, isBlankValueFor, isEditableStatus, isListType, isMetafieldType, isPublishableStatus, isRuleField, isSafeRegex, isSettingVisible, isUnpublishedStatus, isValidEntryHandle, jsonSchema, legacyOrderStatusSchema, legacyProductStatusSchema, legalLinksSchema, measurementInBaseUnit, messageOutboxStatusSchema, metafieldIdentifier, moneySchema, normalizeDate, normalizeDateTime, normalizeDecimal, normalizeId, onHand, operatorsForField, optionalTimestampSchema, optionalUrlSchema, orderItemSchema, orderSchema, orderStatusSchema, orderWithItemsSchema, paginatedResponseSchema, paginationMetaSchema, paginationSchema, parseMetafieldIdentifier, parseStorageUrl, parseThemeMigration, parseThemeSchema, paymentMethodSchema, paymentStatusSchema, phoneSchema, positionOrderSchema, productReviewFiltersSchema, productReviewReplyFiltersSchema, productReviewReplySchema, productReviewSchema, productReviewStatsSchema, productReviewWithRepliesSchema, productSchema, productStatusSchema, productVariantCombinationEntrySchema, productVariantCombinationSchema, productVariantSchema, productVariantWithCombinationsSchema, productWithReviewStatsSchema, productWithVariantsAndReviewStatsSchema, productWithVariantsSchema, resolveAssetUrl, resolveThemeSettings, reviewStatusSchema, rewriteSupabaseUrl, richTextLength, safeParseBaseQueryParams, safeParsePaginationMeta, shippingStatusSchema, slugSchema, sortOrderSchema, storeConfigSchema, storeIdSchema, storeSchema, storeSettingsSchema, storeStatusSchema, storeWithRelationsSchema, storefrontAccessAllowed, strictUrlSchema, themeDefaults, themeMajor, themeMigrationSchema, themeSchemaSchema, themeSettings, timestampSchema, toEntryHandle, toMetafieldKey, toObjectUrl, toRenderUrl, tocItemSchema, transformationsEnabled, unavailable, unwrap, unwrapOrNull, updateBlogCategorySchema, updateBlogCommentSchema, updateBlogPostSchema, updateBlogSettingsSchema, updateBlogTagSchema, updateCategorySchema, updateContentPageSchema, updateEmbeddedScriptSchema, updateOrderItemSchema, updateOrderSchema, updateProductReviewReplySchema, updateProductReviewSchema, updateProductSchema, updateProductVariantSchema, updateStoreConfigSchema, updateStoreSchema, updateStoreSettingsSchema, updateVariantOptionSchema, updateVariantOptionValueSchema, urlSchema, uuidSchema, validateMetafieldDefinition, validateMetafieldValue, validateMetaobjectDefinition, validateMetaobjectEntry, validatePaginationMeta, validateRichText, validateThemeValues, validateValidations, valueKindFor, variantOptionSchema, variantOptionValueSchema, variantStatusSchema, withClientHeader };
6120
+ export { ADJUSTABLE_STATES, ADMIN_ORDER_SOURCES, type AddToCartRequest, type Address, AddressesApi, type AdjustQuantitiesRequest, type AdjustableState, type AdminOrderSource, ApiClientError, type ApiError, type ApiResponse, type AppliedPromotion, type AttributeLink, AuthApi, type AuthErrorCode, type AuthIdentity, type AuthResult, type AuthTokens, type AutocompleteParams, type BankAccount, type BaseDeleteOptions, type BaseDeleteResult, type BaseQueryParams, type BatchOrderReviewInvitationsResult, BlogApi, type BlogCategory, type BlogCategoryQueryParams, type BlogComment, type BlogCommentWithReplies, type BlogPost, type BlogPostCategory, type BlogPostQueryParams, type BlogPostStatus, type BlogPostTag, type BlogPostWithRelations, type BlogSearchParams, type BlogSearchResponse, BlogServerApi, type BlogSettings, type BlogTag, type BlogTagQueryParams, CLIENT_HEADER, COLLECTION_RULE_MATRIX, CONDITION_TYPE_LABELS, CartApi, type CartApiItem, type CartApiResponse, CategoriesApi, type Category, type CategoryQueryParams, type CategorySearchResponse, type CategoryTree, type CategoryWithChildren, type ChangeEmailPayload, type ChangeEmailResult, type ChangePasswordPayload, type ChangedResult, type Collection, type CollectionQueryParams, type CollectionRule, type CollectionRuleSet, type CollectionRuleSetCriteria, type CollectionSearchCriteria, CollectionsApi, ConditionType, ConditionTypeSchema, type ConditionTypeType, type ContentPage, ContentPagesApi, type CreateAddressDto, type CreateBlogCategory, type CreateBlogComment, type CreateBlogPost, type CreateBlogSettings, type CreateBlogTag, type CreateCategory, type CreateContentPage, type CreateEmbeddedScript, type CreateOrder, type CreateOrderItem, type CreateOrderItemRequest, type CreateOrderRequest, type CreateProduct, type CreateProductReview, type CreateProductReviewReply, type CreateProductVariant, type CreatePromotion, CreatePromotionSchema, type CreateStore, type CreateStoreConfig, type CreateStoreSettings, type CreateVariantOption, type CreateVariantOptionValue, type CurrentIdentity, type Customer, type CustomerAccess, type CustomerOrderFilter, type CustomerOrderSummary, CustomersApi, DEFAULT_BUCKET, DISCOUNT_METHOD_LABELS, type DeleteApiFunction, type DeletedAt, DiscountMethod, DiscountMethodSchema, type DiscountMethodType, EMAIL_COLOR_PATTERN, EMAIL_PALETTE_DEFAULTS, ENTRY_HANDLE_PATTERN, type EcomwebProxiedSdkOptions, type EcomwebSdk, type EcomwebSdkOptions, type EcomwebServerSdk, type EcomwebServerSdkOptions, type EmbeddedScript, type EmbeddedScriptPlacement, type EngineResult, FILTERABLE_TYPES, type FileKind, type FulfillmentStatus, type GoogleAuthUrl, type GuestOrderLookupParams, type IHttpClient, INVENTORY_ADJUSTMENT_REASONS, INVENTORY_ERROR_CODES, INVENTORY_POLICIES, INVENTORY_STATES, INVENTORY_STATUS_LABELS, type Id, type ImageFormat, type ImageTransformOptions, type InitiatePaymentResult, type InsufficientInventoryItem, type IntegrationStatus, type InventoryActor, type InventoryAdjustmentReason, type InventoryErrorCode, type InventoryHistoryEntry, type InventoryImportResponse, type InventoryLevelRow, type InventoryLocation, type InventoryPolicy, type InventoryQuantities, type InventoryState, InventoryStatus, KNOWN_PAYMENT_METHODS, LEGACY_STATUS_MIGRATION_MAP, LEVEL_PROVINCE, LEVEL_WARD, type LegacyOrderStatus, type LegacyProductStatus, type LinkValue, type LocationArea, type LocationAreaQuery, type LocationAreasResponse, type LoginPayload, MAX_RULES_PER_SET, MAX_RULE_VALUE_ENTRIES, MEASUREMENT_UNITS, MEDIA_TYPES, MERCHANT_ADJUSTMENT_REASONS, METAFIELD_BASE_TYPES, METAFIELD_KEY_PATTERN, METAFIELD_LIMITS, METAFIELD_OWNER_TYPES, METAFIELD_TYPE_GROUPS, METAOBJECT_REFERENCE_TYPES, METAOBJECT_TYPE_PATTERN, type MeasurementType, type MeasurementValue, MemoryTokenStorage, MenusApi, type MerchantAdjustmentReason, type MessageOutboxStatus, type MetafieldBaseType, type MetafieldBound, type MetafieldContext, type MetafieldDefinitionShape, type MetafieldIssue, type MetafieldIssueCode, type MetafieldListType, type MetafieldOwnerType, type MetafieldType, type MetafieldTypeGroup, type MetafieldValidationKey, type MetafieldValidations, type MetafieldWrite, type MetaobjectDefinitionShape, type MetaobjectFieldShape, type MetaobjectListParams, type MetaobjectListResult, MetaobjectsApi, type MoneyValue, type MoveQuantitiesRequest, type MutationApiFunction, OBJECT_PREFIX, ORDER_ACTOR_TYPES, ORDER_EVENT_TYPES, ORDER_SHIPMENT_ERROR_CODES, ORDER_SOURCES, type OptionalTimestamp, type Order, type OrderActorType, type OrderCommentMutationResult, type OrderCreatedBy, type OrderEventType, type OrderItem, type PaymentMethod$1 as OrderPaymentMethod, type OrderReviewInvitationSummary, type OrderShipmentEvent, type OrderShipmentSummary, type OrderSource, type OrderStatus, type OrderTimelineActor, type OrderTimelineComment, type OrderTimelineCommentAuthor, type OrderTimelineEntry, type OrderTimelineEvent, type OrderTimelineResponse, type OrderWithItems, OrdersApi, PAGINATION_DEFAULTS, PRIVATE_REFERENCE_TYPES, PRODUCT_STATUS_LABELS, PROMOTION_MODE_COLORS, PROMOTION_MODE_LABELS, PROMOTION_STATUS_COLORS, PROMOTION_STATUS_LABELS, PROMOTION_TYPE_COLORS, PROMOTION_TYPE_LABELS, type PaginatedApiFunction, type PaginatedPromotionsResponse, PaginatedPromotionsResponseSchema, type PaginatedResponse, type PaginatedReviewsResponse, type PaginationMeta, type PasswordPolicy, type PaymentCredentialStatus, type PaymentMethod$1 as PaymentMethod, PaymentMethodsApi, type PaymentStateResult, type PaymentStatus, PaymentsApi, type Product, type ProductDetail, type ProductImage, type ProductQueryParams, type ProductReview, type ProductReviewFilters, type ProductReviewReply, type ProductReviewReplyFilters, type ProductReviewStats, type ProductReviewWithReplies, type ProductSearchParams, type ProductSearchResponse, type ProductService, ProductStatus, type ProductVariant, type ProductVariantCombination, type ProductVariantCombinationEntry, type ProductVariantWithCombinations, type ProductVideo, type ProductWithReviewStats, type ProductWithVariants, ProductsApi, type Promotion, type PromotionData, PromotionMode, PromotionModeSchema, type PromotionModeType, type PromotionQueryParams, PromotionQueryParamsSchema, PromotionSchema, type PromotionStatistics, PromotionStatisticsSchema, PromotionStatus, PromotionStatusSchema, type PromotionStatusType, type PromotionSuggestion, type PromotionSuggestionsResponse, PromotionType, PromotionTypeSchema, type PromotionTypeType, type PromotionWithDiscount, PromotionWithDiscountSchema, PromotionsApi, PromotionsServerApi, type PublicAuthConfig, type PublishedStoreTheme, type QuantitiesResponse, RENDER_PREFIX, RESOURCE_REFERENCE_TYPES, RULE_FIELDS, type RatingValue, RedirectsApi, type RegisterPayload, type RegisterResult, type RequestOptions, type ResetPasswordPayload, type ResetResult, type ResizeMode, type ResolvedAsset, type ResolvedBlogPostRef, type ResolvedCollectionRef, type ResolvedImage, type ResolvedMetaobjectRef, type ResolvedMetaobjectStub, type ResolvedPageRef, type ResolvedProductRef, type ResolvedVariantRef, type ReviewInvitationPublicData, type ReviewStatus, ReviewsApi, ReviewsServerApi, type RichTextBlock, type RichTextHeading, type RichTextInline, type RichTextLink, type RichTextList, type RichTextListItem, type RichTextNode, type RichTextParagraph, type RichTextRoot, type RichTextText, type RuleField, type RuleFieldSpec, type RuleOperator, type RuleOperatorSpec, type RuleValueKind, SDK_CLIENT_TOKEN, SDK_VERSION, SHIPMENT_STATUSES, SHIPPING_CONDITION_TYPES, SHIPPING_DELIVERY_TYPES, SHIPPING_ERROR_CODES, SHIPPING_RATE_TYPES, SearchApi, type SearchCategory, type SearchProduct, type SentResult, type SeoMetadata$3 as SeoMetadata, type ServerComputedOrderAmounts, type SetQuantitiesRequest, type SetQuantitiesResponse, type ShipmentStatus, ShippingApi, type ShippingCalculationRequest, type ShippingConditionType, type ShippingDeliveryType, type ShippingOption, type ShippingQuoteChangedDetails, type ShippingRate, type ShippingRateType, ShippingServerApi, type ShippingStatus, type ShippingZone, type SingleEntityApiFunction, type StaleQuantity, type Store, type StoreByDomainInfo, type StoreConfig, type StoreConfigurationInfo, type StoreEmailBrandingSettings, type StoreMenu, type StoreMenuItem, type PaymentMethod as StorePaymentMethod, type StoreSettings, type StoreStatus, type StoreWithRelations, type StorefrontMetafield, type StorefrontMetafields, type StorefrontMetaobjectEntry, StoresApi, type SubmitReviewInvitationPayload, THEME_HEX_COLOR, type ThemeDisplayItem, type ThemeMigration, type ThemeMigrationReport, type ThemeMigrationStep, type ThemeSchema, type ThemeSchemaGroup, type ThemeSchemaItem, type ThemeSetting, type ThemeSettingType, type ThemeSettingsOf, type ThemeValue, type ThemeValueError, type ThemeValues, type ThemeVisibleIf, ThemesApi, type Timestamp, type TocItem, type TokenStorage, UNAVAILABLE_STATES, type UnavailableState, type UpdateAddressDto, type UpdateBlogCategory, type UpdateBlogComment, type UpdateBlogPost, type UpdateBlogSettings, type UpdateBlogTag, type UpdateCartItemRequest, type UpdateCategory, type UpdateContentPage, type UpdateEmbeddedScript, type UpdateOrder, type UpdateOrderItem, type UpdateProduct, type UpdateProductReview, type UpdateProductReviewReply, type UpdateProductVariant, type UpdatePromotion, UpdatePromotionSchema, type UpdateStore, type UpdateStoreConfig, type UpdateStoreSettings, type UpdateVariantOption, type UpdateVariantOptionValue, type UpsertCustomerForAuthPayload, type UrlRedirect, VALIDATION_KEYS, type ValidatePromotionCodeRequest, type ValidatePromotionCodeResponse, type VariantOption, type VariantOptionValue, type VariantStatus, type VerifiedResult, type VerifyOtpPayload, type WithMetafields, type WithSeoMetadata$3 as WithSeoMetadata, allowedCustomerAccess, allowedFileKinds, allowedValuesFor, appliedPromotionSchema, applyThemeMigration, assetBaseUrl, attributeLinkSchema, attributeLinkValueSchema, baseDeleteOptionsSchema, baseDeleteResultSchema, baseQueryParamsSchema, baseTypeOf, blogCategorySchema, blogCommentSchema, blogCommentWithRepliesSchema, blogPostCategorySchema, blogPostSchema, blogPostStatusSchema, blogPostTagSchema, blogPostWithRelationsSchema, blogSettingsSchema, blogTagSchema, buildTransformQuery, categorySchema, categoryTreeSchema, categoryWithChildrenSchema, checkMetaobjectFieldChanges, clientHeaderValue, colorSchema, compareDecimal, contentPageSchema, createAuthAwareHttpClient, createBlogCategorySchema, createBlogCommentSchema, createBlogPostSchema, createBlogSettingsSchema, createBlogTagSchema, createCategorySchema, createContentPageSchema, createEcomwebProxiedSdk, createEcomwebSdk, createEcomwebServerSdk, createEmbeddedScriptSchema, createOrderItemSchema, createOrderSchema, createProductReviewReplySchema, createProductReviewSchema, createProductSchema, createProductVariantSchema, createStoreConfigSchema, createStoreSchema, createStoreSettingsSchema, createVariantOptionSchema, createVariantOptionValueSchema, customerOrderSummarySchema, decimalSchema, deletedAtSchema, dimensionsSchema, emailBrandingSchema, emailBrandingShape, emailSchema, embeddedScriptPlacementSchema, embeddedScriptSchema, ensureSuccess, entryDisplayName, fromObjectPublicUrlToRender, fulfillmentStatusSchema, idSchema, integrationStatusSchema, inventoryStatusSchema, isBlankValue, isBlankValueFor, isEditableStatus, isListType, isMetafieldType, isPublishableStatus, isRuleField, isSafeRegex, isSettingVisible, isUnpublishedStatus, isValidEntryHandle, jsonSchema, legacyOrderStatusSchema, legacyProductStatusSchema, legalLinksSchema, measurementInBaseUnit, messageOutboxStatusSchema, metafieldIdentifier, moneySchema, normalizeDate, normalizeDateTime, normalizeDecimal, normalizeId, onHand, operatorsForField, optionalTimestampSchema, optionalUrlSchema, orderItemSchema, orderSchema, orderStatusSchema, orderWithItemsSchema, paginatedResponseSchema, paginationMetaSchema, paginationSchema, parseMetafieldIdentifier, parseStorageUrl, parseThemeMigration, parseThemeSchema, paymentMethodSchema, paymentStatusSchema, phoneSchema, positionOrderSchema, productReviewFiltersSchema, productReviewReplyFiltersSchema, productReviewReplySchema, productReviewSchema, productReviewStatsSchema, productReviewWithRepliesSchema, productSchema, productStatusSchema, productVariantCombinationEntrySchema, productVariantCombinationSchema, productVariantSchema, productVariantWithCombinationsSchema, productWithReviewStatsSchema, productWithVariantsAndReviewStatsSchema, productWithVariantsSchema, resolveAssetUrl, resolveThemeSettings, reviewStatusSchema, rewriteSupabaseUrl, richTextLength, safeParseBaseQueryParams, safeParsePaginationMeta, shippingStatusSchema, slugSchema, sortOrderSchema, storeConfigSchema, storeIdSchema, storeSchema, storeSettingsSchema, storeStatusSchema, storeWithRelationsSchema, storefrontAccessAllowed, strictUrlSchema, themeDefaults, themeMajor, themeMigrationSchema, themeSchemaSchema, themeSettings, timestampSchema, toEntryHandle, toMetafieldKey, toObjectUrl, toRenderUrl, tocItemSchema, transformationsEnabled, unavailable, unwrap, unwrapOrNull, updateBlogCategorySchema, updateBlogCommentSchema, updateBlogPostSchema, updateBlogSettingsSchema, updateBlogTagSchema, updateCategorySchema, updateContentPageSchema, updateEmbeddedScriptSchema, updateOrderItemSchema, updateOrderSchema, updateProductReviewReplySchema, updateProductReviewSchema, updateProductSchema, updateProductVariantSchema, updateStoreConfigSchema, updateStoreSchema, updateStoreSettingsSchema, updateVariantOptionSchema, updateVariantOptionValueSchema, urlSchema, uuidSchema, validateMetafieldDefinition, validateMetafieldValue, validateMetaobjectDefinition, validateMetaobjectEntry, validatePaginationMeta, validateRichText, validateThemeValues, validateValidations, valueKindFor, variantOptionSchema, variantOptionValueSchema, variantStatusSchema, withClientHeader };