@commercengine/storefront-sdk 0.13.3 → 0.13.4

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.mjs CHANGED
@@ -1121,7 +1121,7 @@ var CatalogClient = class extends StorefrontAPIClient {
1121
1121
  /**
1122
1122
  * Get details for a specific product
1123
1123
  *
1124
- * @param pathParams - The path parameters (product ID or slug)
1124
+ * @param pathParams - The path parameters. Accepts product ID or product slug.
1125
1125
  * @param headers - Optional header parameters (customer_group_id, etc.)
1126
1126
  * @returns Promise with product details
1127
1127
  *
@@ -1129,7 +1129,7 @@ var CatalogClient = class extends StorefrontAPIClient {
1129
1129
  * ```typescript
1130
1130
  * // Get product by ID
1131
1131
  * const { data, error } = await sdk.catalog.getProductDetail(
1132
- * { product_id_or_slug: "prod_123" }
1132
+ * { product_id: "prod_123" }
1133
1133
  * );
1134
1134
  *
1135
1135
  * if (error) {
@@ -1141,14 +1141,15 @@ var CatalogClient = class extends StorefrontAPIClient {
1141
1141
  * console.log("Price:", data.product.pricing?.selling_price);
1142
1142
  * console.log("Description:", data.product.short_description);
1143
1143
  *
1144
- * // Get product by slug
1144
+ * // Get product by slug (also accepted in place of product_id)
1145
1145
  * const { data: slugData, error: slugError } = await sdk.catalog.getProductDetail({
1146
- * product_id_or_slug: "detox-candy"
1146
+ * product_id: "detox-candy"
1147
1147
  * });
1148
1148
  *
1149
1149
  * // Override customer group ID for this specific request
1150
1150
  * const { data: overrideData, error: overrideError } = await sdk.catalog.getProductDetail(
1151
- * { product_id_or_slug: "detox-candy" },
1151
+ * { product_id: "detox-candy" },
1152
+ * undefined,
1152
1153
  * {
1153
1154
  * "x-customer-group-id": "premium_customers" // Override default SDK config
1154
1155
  * }
@@ -1164,7 +1165,7 @@ var CatalogClient = class extends StorefrontAPIClient {
1164
1165
  */
1165
1166
  async getProductDetail(pathParams, options, headers) {
1166
1167
  const mergedHeaders = this.mergeHeaders(headers);
1167
- return this.executeRequest(() => this.client.GET("/catalog/products/{product_id_or_slug}", { params: {
1168
+ return this.executeRequest(() => this.client.GET("/catalog/products/{product_id}", { params: {
1168
1169
  path: pathParams,
1169
1170
  query: options,
1170
1171
  header: mergedHeaders
@@ -1173,12 +1174,13 @@ var CatalogClient = class extends StorefrontAPIClient {
1173
1174
  /**
1174
1175
  * List all variants for a specific product
1175
1176
  *
1176
- * @param pathParams - The path parameters (product ID)
1177
+ * @param pathParams - The path parameters. Accepts product ID or product slug.
1177
1178
  * @param headers - Optional header parameters (customer_group_id, etc.)
1178
1179
  * @returns Promise with product variants and pagination info
1179
1180
  *
1180
1181
  * @example
1181
1182
  * ```typescript
1183
+ * // By product ID
1182
1184
  * const { data, error } = await sdk.catalog.listProductVariants(
1183
1185
  * { product_id: "prod_123" }
1184
1186
  * );
@@ -1194,9 +1196,15 @@ var CatalogClient = class extends StorefrontAPIClient {
1194
1196
  * console.log(`Variant: ${variant.name} - SKU: ${variant.sku} - Price: ${variant.pricing?.selling_price}`);
1195
1197
  * });
1196
1198
  *
1199
+ * // By product slug (also accepted in place of product_id)
1200
+ * const { data: slugData, error: slugError } = await sdk.catalog.listProductVariants(
1201
+ * { product_id: "detox-candy" }
1202
+ * );
1203
+ *
1197
1204
  * // Override customer group ID for this specific request
1198
1205
  * const { data: overrideData, error: overrideError } = await sdk.catalog.listProductVariants(
1199
1206
  * { product_id: "prod_123" },
1207
+ * undefined,
1200
1208
  * {
1201
1209
  * "x-customer-group-id": "wholesale_customers" // Override default SDK config
1202
1210
  * }
@@ -1214,12 +1222,13 @@ var CatalogClient = class extends StorefrontAPIClient {
1214
1222
  /**
1215
1223
  * Get details for a specific product variant
1216
1224
  *
1217
- * @param pathParams - The path parameters (product ID and variant ID)
1225
+ * @param pathParams - The path parameters. Accepts product ID or slug for product_id, and variant ID or slug for variant_id.
1218
1226
  * @param headers - Optional header parameters (customer_group_id, etc.)
1219
1227
  * @returns Promise with variant details
1220
1228
  *
1221
1229
  * @example
1222
1230
  * ```typescript
1231
+ * // By product ID and variant ID
1223
1232
  * const { data, error } = await sdk.catalog.getVariantDetail(
1224
1233
  * {
1225
1234
  * product_id: "prod_123",
@@ -1236,6 +1245,14 @@ var CatalogClient = class extends StorefrontAPIClient {
1236
1245
  * console.log("SKU:", data.variant.sku);
1237
1246
  * console.log("Price:", data.variant.pricing?.selling_price);
1238
1247
  * console.log("Stock available:", data.variant.stock_available);
1248
+ *
1249
+ * // By product slug and variant slug (also accepted in place of IDs)
1250
+ * const { data: slugData, error: slugError } = await sdk.catalog.getVariantDetail(
1251
+ * {
1252
+ * product_id: "detox-candy",
1253
+ * variant_id: "detox-candy-100g"
1254
+ * }
1255
+ * );
1239
1256
  * ```
1240
1257
  */
1241
1258
  async getVariantDetail(pathParams, options, headers) {