mkfashion-sdk 2.3.6 → 2.3.8

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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mkfashion-sdk",
3
- "version": "2.3.6",
3
+ "version": "2.3.8",
4
4
  "description": "SDK para integrar o provador virtual mKFashion com suporte a Wake Commerce",
5
5
  "main": "src/mkfashion.js",
6
6
  "scripts": {
package/src/mkfashion.js CHANGED
@@ -251,7 +251,7 @@ const mkfashion = {
251
251
  this._log('Verificando disponibilidade', { projectId: resolved, identifier })
252
252
 
253
253
  try {
254
- const url = `${this.apiUrl}/availability/${resolved}/${identifier}`
254
+ const url = `${this.apiUrl}/availability/${resolved}/${encodeURIComponent(identifier)}`
255
255
  const response = await fetch(url)
256
256
 
257
257
  if (!response.ok) {
@@ -341,14 +341,14 @@ const mkfashion = {
341
341
  this._log('Buscando produto', { projectId: resolved, identifier })
342
342
 
343
343
  try {
344
- const url = `${this.apiUrl}/products/${resolved}/${identifier}`
344
+ const url = `${this.apiUrl}/products/${resolved}/${encodeURIComponent(identifier)}`
345
345
  const response = await fetch(url)
346
346
 
347
347
  if (!response.ok) {
348
348
  // Fallback: tenta com productId do config caso caller tenha passado variantSku
349
349
  if (response.status === 404 && this._config?.identifier && this._config.identifier !== identifier) {
350
350
  this._log(`Identifier ${identifier} não encontrado, tentando com productId: ${this._config.identifier}`)
351
- const fallbackUrl = `${this.apiUrl}/products/${resolved}/${this._config.identifier}`
351
+ const fallbackUrl = `${this.apiUrl}/products/${resolved}/${encodeURIComponent(this._config.identifier)}`
352
352
  const fallbackResponse = await fetch(fallbackUrl)
353
353
  if (fallbackResponse.ok) {
354
354
  const data = await fallbackResponse.json()
@@ -409,7 +409,7 @@ const mkfashion = {
409
409
  },
410
410
 
411
411
  _buildUrl() {
412
- return `${this.appUrl}/${this._config.projectId}/${this._config.identifier}`
412
+ return `${this.appUrl}/${this._config.projectId}/${encodeURIComponent(this._config.identifier)}`
413
413
  },
414
414
 
415
415
  _openModal() {
@@ -676,6 +676,7 @@ const mkfashion = {
676
676
  price: product.price || null,
677
677
  sizePrice: product.sizePrice || null,
678
678
  selectedSize: data?.size || null,
679
+ produtoVarianteId: product.produtoVarianteId || null,
679
680
  productUrl: product.productUrl || null,
680
681
  tryonImageUrl: product.tryonImageUrl || null
681
682
  }
Binary file