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 +3 -3
- package/mkfashion-sdk-1.3.2.tgz +0 -0
- package/mkfashion-sdk-1.3.3.tgz +0 -0
- package/package.json +1 -1
- package/src/mkfashion.js +12 -5
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('
|
|
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
|
-
|
|
56
|
-
identifier: '
|
|
55
|
+
store: 'gregory',
|
|
56
|
+
identifier: '309728'
|
|
57
57
|
});
|
|
58
58
|
};
|
|
59
59
|
} else {
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
package/src/mkfashion.js
CHANGED
|
@@ -26,12 +26,12 @@ const mkfashion = {
|
|
|
26
26
|
|
|
27
27
|
// ============ CONFIGURACAO ============
|
|
28
28
|
//PROD
|
|
29
|
-
|
|
30
|
-
|
|
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
|
|
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
|