mkfashion-sdk 1.3.1 → 1.3.3

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/index.html CHANGED
@@ -37,7 +37,7 @@
37
37
 
38
38
  <script>
39
39
  // 1. Verifica disponibilidade e configura botão
40
- mkfashion.isAvailable('698601899f905cb2adc13160', '0101').then(function (disponivel) {
40
+ mkfashion.isAvailable('309728').then(function (disponivel) {
41
41
  if (disponivel) {
42
42
 
43
43
  // 2. Registra callback do carrinho (ANTES de abrir)
@@ -52,8 +52,8 @@
52
52
 
53
53
  btn.onclick = function () {
54
54
  mkfashion.open({
55
- projectId: '698601899f905cb2adc13160',
56
- identifier: '0101'
55
+ store: 'gregory',
56
+ identifier: '309728'
57
57
  });
58
58
  };
59
59
  } else {
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mkfashion-sdk",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
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
@@ -26,12 +26,12 @@ const mkfashion = {
26
26
 
27
27
  // ============ CONFIGURACAO ============
28
28
  //PROD
29
- //appUrl: 'https://metakosmoslab.com/demos/mk-fashion-plus/',
30
- //apiUrl: 'https://mkfashion-api.mk3dlabs.com',
29
+ appUrl: 'https://mkfashion.mk3dlabs.com/visualizer/',
30
+ apiUrl: 'https://mkfashion-new-api.mk3dlabs.com',
31
31
 
32
32
  //DEV
33
- appUrl: 'http://localhost:5174',
34
- apiUrl: 'http://localhost:3007',
33
+ //appUrl: 'http://localhost:5174',
34
+ //apiUrl: 'http://localhost:3007',
35
35
 
36
36
  debug: false,
37
37
 
@@ -63,7 +63,9 @@ const mkfashion = {
63
63
  }
64
64
 
65
65
  // Normaliza opcoes (compatibilidade com nomes alternativos)
66
- const projectId = options.projectId || options.projectid || options.store || '6984b95a0d3521a9587049c7'
66
+ const storeAliases = { 'gregory': '698c7e791d3129430f15dddd' }
67
+ const raw = options.projectId || options.projectid || options.store
68
+ const projectId = storeAliases[raw] || raw || '698c7e791d3129430f15dddd'
67
69
  const identifier = options.identifier || options.sku
68
70
 
69
71
  // Valida opcoes obrigatorias
@@ -231,6 +233,11 @@ const mkfashion = {
231
233
  * @returns {Promise<boolean>} - true se disponivel, false caso contrario
232
234
  */
233
235
  async isAvailable(projectId, identifier) {
236
+ // Se apenas 1 parametro, assume que e o identifier
237
+ if (!identifier) {
238
+ identifier = projectId
239
+ projectId = '698c7e791d3129430f15dddd'
240
+ }
234
241
  try {
235
242
  const data = await this.getAvailability(projectId, identifier)
236
243
  return data.available === true