@preference-sl/prefconfigurator-wasm 5.1.5 → 5.2.0-2
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/_framework/{PrefConfigurator.Abstractions.par9u01xip.wasm → PrefConfigurator.Abstractions.l7x26yca84.wasm} +0 -0
- package/_framework/PrefConfigurator.Abstractions.l7x26yca84.wasm.br +0 -0
- package/_framework/PrefConfigurator.Abstractions.l7x26yca84.wasm.gz +0 -0
- package/_framework/PrefConfigurator.Application.3xgwjeriaz.wasm +0 -0
- package/_framework/PrefConfigurator.Application.3xgwjeriaz.wasm.br +0 -0
- package/_framework/PrefConfigurator.Application.3xgwjeriaz.wasm.gz +0 -0
- package/_framework/{PrefConfigurator.Domain.cyp8shjljj.wasm → PrefConfigurator.Domain.nm4rcojbji.wasm} +0 -0
- package/_framework/PrefConfigurator.Domain.nm4rcojbji.wasm.br +0 -0
- package/_framework/PrefConfigurator.Domain.nm4rcojbji.wasm.gz +0 -0
- package/_framework/PrefConfigurator.Infrastructure.d7q7yg05rn.wasm +0 -0
- package/_framework/PrefConfigurator.Infrastructure.d7q7yg05rn.wasm.br +0 -0
- package/_framework/PrefConfigurator.Infrastructure.d7q7yg05rn.wasm.gz +0 -0
- package/_framework/{PrefConfigurator.Wasm.d4q4twzt80.wasm → PrefConfigurator.Wasm.wgx40s42dl.wasm} +0 -0
- package/_framework/PrefConfigurator.Wasm.wgx40s42dl.wasm.br +0 -0
- package/_framework/PrefConfigurator.Wasm.wgx40s42dl.wasm.gz +0 -0
- package/_framework/blazor.boot.json +11 -11
- package/_framework/blazor.boot.json.br +0 -0
- package/_framework/blazor.boot.json.gz +0 -0
- package/js/gltf-storage.js +127 -127
- package/package.json +1 -1
- package/_framework/PrefConfigurator.Abstractions.par9u01xip.wasm.br +0 -0
- package/_framework/PrefConfigurator.Abstractions.par9u01xip.wasm.gz +0 -0
- package/_framework/PrefConfigurator.Application.bffjy6nrqu.wasm +0 -0
- package/_framework/PrefConfigurator.Application.bffjy6nrqu.wasm.br +0 -0
- package/_framework/PrefConfigurator.Application.bffjy6nrqu.wasm.gz +0 -0
- package/_framework/PrefConfigurator.Domain.cyp8shjljj.wasm.br +0 -0
- package/_framework/PrefConfigurator.Domain.cyp8shjljj.wasm.gz +0 -0
- package/_framework/PrefConfigurator.Infrastructure.09lnnv5oxy.wasm +0 -0
- package/_framework/PrefConfigurator.Infrastructure.09lnnv5oxy.wasm.br +0 -0
- package/_framework/PrefConfigurator.Infrastructure.09lnnv5oxy.wasm.gz +0 -0
- package/_framework/PrefConfigurator.Wasm.d4q4twzt80.wasm.br +0 -0
- package/_framework/PrefConfigurator.Wasm.d4q4twzt80.wasm.gz +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/_framework/{PrefConfigurator.Wasm.d4q4twzt80.wasm → PrefConfigurator.Wasm.wgx40s42dl.wasm}
RENAMED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"mainAssemblyName": "PrefConfigurator.Wasm",
|
|
3
3
|
"resources": {
|
|
4
|
-
"hash": "sha256-
|
|
4
|
+
"hash": "sha256-wdjC0BqcC7Xl64Dnz74P4PJOjowS8PcxQyLinlsLMWo=",
|
|
5
5
|
"fingerprinting": {
|
|
6
6
|
"Microsoft.CSharp.wdyr58w263.wasm": "Microsoft.CSharp.wasm",
|
|
7
7
|
"Microsoft.Extensions.Caching.Abstractions.9tfokavdri.wasm": "Microsoft.Extensions.Caching.Abstractions.wasm",
|
|
@@ -34,11 +34,11 @@
|
|
|
34
34
|
"Microsoft.Extensions.Options.c9gmov336d.wasm": "Microsoft.Extensions.Options.wasm",
|
|
35
35
|
"Microsoft.Extensions.Primitives.ii8zcoqmmf.wasm": "Microsoft.Extensions.Primitives.wasm",
|
|
36
36
|
"Newtonsoft.Json.ou6h2ikg0u.wasm": "Newtonsoft.Json.wasm",
|
|
37
|
-
"PrefConfigurator.Abstractions.
|
|
38
|
-
"PrefConfigurator.Application.
|
|
39
|
-
"PrefConfigurator.Domain.
|
|
40
|
-
"PrefConfigurator.Infrastructure.
|
|
41
|
-
"PrefConfigurator.Wasm.
|
|
37
|
+
"PrefConfigurator.Abstractions.l7x26yca84.wasm": "PrefConfigurator.Abstractions.wasm",
|
|
38
|
+
"PrefConfigurator.Application.3xgwjeriaz.wasm": "PrefConfigurator.Application.wasm",
|
|
39
|
+
"PrefConfigurator.Domain.nm4rcojbji.wasm": "PrefConfigurator.Domain.wasm",
|
|
40
|
+
"PrefConfigurator.Infrastructure.d7q7yg05rn.wasm": "PrefConfigurator.Infrastructure.wasm",
|
|
41
|
+
"PrefConfigurator.Wasm.wgx40s42dl.wasm": "PrefConfigurator.Wasm.wasm",
|
|
42
42
|
"Preference.Hydra.OpenApi.oba396x8m7.wasm": "Preference.Hydra.OpenApi.wasm",
|
|
43
43
|
"System.f0t8bkq7p2.wasm": "System.wasm",
|
|
44
44
|
"System.Collections.Concurrent.3x28nluuwn.wasm": "System.Collections.Concurrent.wasm",
|
|
@@ -135,11 +135,11 @@
|
|
|
135
135
|
"Microsoft.Extensions.Options.c9gmov336d.wasm": "sha256-0N/ionjXj1tzE4oM9Wt55U0WDRfW6CCbnq2+PbQfUBc=",
|
|
136
136
|
"Microsoft.Extensions.Primitives.ii8zcoqmmf.wasm": "sha256-Jt5QBSXSDEahiZ89Pn1MhJ9A3C/ftN8ZXaBGV9JgqwQ=",
|
|
137
137
|
"Newtonsoft.Json.ou6h2ikg0u.wasm": "sha256-8EZ4H5Mb5yxuavrUzuw5k75ewxJQbdU+Y1rksETqPVo=",
|
|
138
|
-
"PrefConfigurator.Abstractions.
|
|
139
|
-
"PrefConfigurator.Application.
|
|
140
|
-
"PrefConfigurator.Domain.
|
|
141
|
-
"PrefConfigurator.Infrastructure.
|
|
142
|
-
"PrefConfigurator.Wasm.
|
|
138
|
+
"PrefConfigurator.Abstractions.l7x26yca84.wasm": "sha256-Xx1vWurtTk6lBLcinvCIrQVt38Gxy05flto7QXVB+VA=",
|
|
139
|
+
"PrefConfigurator.Application.3xgwjeriaz.wasm": "sha256-Wcd/VgvmfjmZJOVoAbe2zocKOzKVYezH+sZzxheyeCU=",
|
|
140
|
+
"PrefConfigurator.Domain.nm4rcojbji.wasm": "sha256-0dPjf3EZNlOBgq3EE+sgUltDj10S/Sy3/f7nqSXE2ug=",
|
|
141
|
+
"PrefConfigurator.Infrastructure.d7q7yg05rn.wasm": "sha256-l50qLg3L3w2CY5ht0RigLxXuYcwL5YOHr+iECknqviU=",
|
|
142
|
+
"PrefConfigurator.Wasm.wgx40s42dl.wasm": "sha256-kM1IDOo8UUOEXJDVwZKrmacc+xKGbwueVoBtsaM93iA=",
|
|
143
143
|
"Preference.Hydra.OpenApi.oba396x8m7.wasm": "sha256-BOitG9XqTGoVdagU40GvNefDuOylKCPs3Gp5VG0M3oY=",
|
|
144
144
|
"System.f0t8bkq7p2.wasm": "sha256-319B7WIXJ7ZD6SZ1l7es3CoglOLgv5lKWx0Ew9mli1c=",
|
|
145
145
|
"System.Collections.Concurrent.3x28nluuwn.wasm": "sha256-xwvOotzdpOgojZxJSPpPCqC1ZclGeXX5Gb5BO3q0GTw=",
|
|
Binary file
|
|
Binary file
|
package/js/gltf-storage.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// wwwroot/js/gltf-storage.js
|
|
2
2
|
|
|
3
|
-
// Public, inspectable namespace
|
|
4
|
-
const PC = (globalThis.PrefConfigurator ??= {});
|
|
5
|
-
PC.version = PC.version ?? "1.0.1"; // bump if your schema changes!!
|
|
6
|
-
PC.db = PC.db ?? null;
|
|
7
|
-
PC.dbName = PC.dbName ?? null;
|
|
8
|
-
PC.storeName = PC.storeName ?? null;
|
|
3
|
+
// Public, inspectable namespace
|
|
4
|
+
const PC = (globalThis.PrefConfigurator ??= {});
|
|
5
|
+
PC.version = PC.version ?? "1.0.1"; // bump if your schema changes!!
|
|
6
|
+
PC.db = PC.db ?? null;
|
|
7
|
+
PC.dbName = PC.dbName ?? null;
|
|
8
|
+
PC.storeName = PC.storeName ?? null;
|
|
9
9
|
|
|
10
10
|
function _getDbOrThrow() {
|
|
11
11
|
const db = PC.db;
|
|
@@ -13,66 +13,66 @@ function _getDbOrThrow() {
|
|
|
13
13
|
return db;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
// --- internal helpers -------------------------------------------------------
|
|
17
|
-
function _openEnsuringStore(dbName, storeName) {
|
|
18
|
-
return new Promise((resolve, reject) => {
|
|
19
|
-
const open = indexedDB.open(dbName, 5);
|
|
16
|
+
// --- internal helpers -------------------------------------------------------
|
|
17
|
+
function _openEnsuringStore(dbName, storeName) {
|
|
18
|
+
return new Promise((resolve, reject) => {
|
|
19
|
+
const open = indexedDB.open(dbName, 5);
|
|
20
20
|
|
|
21
21
|
open.onblocked = () => reject(new Error("Open blocked by another tab or worker"));
|
|
22
22
|
open.onerror = () => reject(open.error);
|
|
23
23
|
open.onsuccess = (e) => {
|
|
24
24
|
resolve(e.target.result);
|
|
25
25
|
}
|
|
26
|
-
open.onupgradeneeded = (ev) => {
|
|
27
|
-
const upgradeDb = ev.target.result;
|
|
28
|
-
const tx = ev.target.transaction;
|
|
29
|
-
|
|
30
|
-
let store;
|
|
31
|
-
if (!upgradeDb.objectStoreNames.contains(storeName)) {
|
|
32
|
-
store = upgradeDb.createObjectStore(storeName, { keyPath: 'id' });
|
|
33
|
-
} else if (tx) {
|
|
34
|
-
store = tx.objectStore(storeName);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if (store && !store.indexNames.contains('expirationTimeStamp')) {
|
|
38
|
-
store.createIndex('expirationTimeStamp', 'expirationTimeStamp', { unique: false });
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function _isRecoverableDbError(err) {
|
|
45
|
-
const msg = String(err?.message ?? err ?? "");
|
|
46
|
-
if (!msg) return false;
|
|
47
|
-
return msg.includes("Database not initialized") ||
|
|
48
|
-
msg.includes("The database connection is closing") ||
|
|
49
|
-
msg.includes("InvalidStateError") ||
|
|
50
|
-
msg.includes("NotFoundError");
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
async function _withDbRetry(work) {
|
|
54
|
-
try {
|
|
55
|
-
return await work(_getDbOrThrow());
|
|
56
|
-
} catch (e) {
|
|
57
|
-
if (!_isRecoverableDbError(e) || !PC.dbName || !PC.storeName) {
|
|
58
|
-
throw e;
|
|
59
|
-
}
|
|
60
|
-
await initDb(PC.dbName, PC.storeName);
|
|
61
|
-
return await work(_getDbOrThrow());
|
|
62
|
-
}
|
|
63
|
-
}
|
|
26
|
+
open.onupgradeneeded = (ev) => {
|
|
27
|
+
const upgradeDb = ev.target.result;
|
|
28
|
+
const tx = ev.target.transaction;
|
|
29
|
+
|
|
30
|
+
let store;
|
|
31
|
+
if (!upgradeDb.objectStoreNames.contains(storeName)) {
|
|
32
|
+
store = upgradeDb.createObjectStore(storeName, { keyPath: 'id' });
|
|
33
|
+
} else if (tx) {
|
|
34
|
+
store = tx.objectStore(storeName);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (store && !store.indexNames.contains('expirationTimeStamp')) {
|
|
38
|
+
store.createIndex('expirationTimeStamp', 'expirationTimeStamp', { unique: false });
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function _isRecoverableDbError(err) {
|
|
45
|
+
const msg = String(err?.message ?? err ?? "");
|
|
46
|
+
if (!msg) return false;
|
|
47
|
+
return msg.includes("Database not initialized") ||
|
|
48
|
+
msg.includes("The database connection is closing") ||
|
|
49
|
+
msg.includes("InvalidStateError") ||
|
|
50
|
+
msg.includes("NotFoundError");
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
async function _withDbRetry(work) {
|
|
54
|
+
try {
|
|
55
|
+
return await work(_getDbOrThrow());
|
|
56
|
+
} catch (e) {
|
|
57
|
+
if (!_isRecoverableDbError(e) || !PC.dbName || !PC.storeName) {
|
|
58
|
+
throw e;
|
|
59
|
+
}
|
|
60
|
+
await initDb(PC.dbName, PC.storeName);
|
|
61
|
+
return await work(_getDbOrThrow());
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
64
|
|
|
65
65
|
// --- public API -------------------------------------------------------------
|
|
66
66
|
|
|
67
67
|
// Inicializar IndexedDB y dejar el handle en PrefConfigurator.db (público)
|
|
68
|
-
export async function initDb(dbName, storeName) {
|
|
69
|
-
PC.dbName = dbName;
|
|
70
|
-
PC.storeName = storeName;
|
|
71
|
-
|
|
72
|
-
const db = await _openEnsuringStore(dbName, storeName);
|
|
73
|
-
// Close any previous handle to avoid versionchange blocking
|
|
74
|
-
try { PC.db?.close?.(); } catch { }
|
|
75
|
-
PC.db = db;
|
|
68
|
+
export async function initDb(dbName, storeName) {
|
|
69
|
+
PC.dbName = dbName;
|
|
70
|
+
PC.storeName = storeName;
|
|
71
|
+
|
|
72
|
+
const db = await _openEnsuringStore(dbName, storeName);
|
|
73
|
+
// Close any previous handle to avoid versionchange blocking
|
|
74
|
+
try { PC.db?.close?.(); } catch { }
|
|
75
|
+
PC.db = db;
|
|
76
76
|
|
|
77
77
|
// If another tab upgrades, close gracefully so next call can re-init
|
|
78
78
|
db.onversionchange = () => {
|
|
@@ -83,38 +83,38 @@ export async function initDb(dbName, storeName) {
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
// Guardar modelo
|
|
86
|
-
export async function saveModel(modelDataStr, storeName) {
|
|
87
|
-
return _withDbRetry((db) => new Promise((resolve, reject) => {
|
|
88
|
-
let modelData;
|
|
89
|
-
try { modelData = JSON.parse(modelDataStr); }
|
|
90
|
-
catch (e) { reject(new Error("saveModel: modelDataStr is not valid JSON")); return; }
|
|
91
|
-
|
|
92
|
-
const dataToStore = {
|
|
93
|
-
...modelData,
|
|
94
|
-
data: modelData.data,
|
|
95
|
-
size: (modelData?.data?.length ?? 0)
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
const tx = db.transaction([storeName], "readwrite");
|
|
99
|
-
const store = tx.objectStore(storeName);
|
|
100
|
-
const req = store.put(dataToStore);
|
|
101
|
-
|
|
102
|
-
req.onerror = () => reject(req.error);
|
|
103
|
-
req.onsuccess = () => resolve();
|
|
104
|
-
}));
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// Cargar modelo
|
|
108
|
-
export function loadModel(modelId, storeName) {
|
|
109
|
-
return _withDbRetry((db) => new Promise((resolve, reject) => {
|
|
110
|
-
const tx = db.transaction([storeName], "readonly");
|
|
111
|
-
const store = tx.objectStore(storeName);
|
|
112
|
-
const req = store.get(modelId);
|
|
113
|
-
|
|
114
|
-
req.onerror = () => reject(req.error);
|
|
115
|
-
req.onsuccess = () => resolve(req.result
|
|
116
|
-
}));
|
|
117
|
-
}
|
|
86
|
+
export async function saveModel(modelDataStr, storeName) {
|
|
87
|
+
return _withDbRetry((db) => new Promise((resolve, reject) => {
|
|
88
|
+
let modelData;
|
|
89
|
+
try { modelData = JSON.parse(modelDataStr); }
|
|
90
|
+
catch (e) { reject(new Error("saveModel: modelDataStr is not valid JSON")); return; }
|
|
91
|
+
|
|
92
|
+
const dataToStore = {
|
|
93
|
+
...modelData,
|
|
94
|
+
data: modelData.data,
|
|
95
|
+
size: (modelData?.data?.length ?? 0)
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const tx = db.transaction([storeName], "readwrite");
|
|
99
|
+
const store = tx.objectStore(storeName);
|
|
100
|
+
const req = store.put(dataToStore);
|
|
101
|
+
|
|
102
|
+
req.onerror = () => reject(req.error);
|
|
103
|
+
req.onsuccess = () => resolve();
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Cargar modelo
|
|
108
|
+
export function loadModel(modelId, storeName) {
|
|
109
|
+
return _withDbRetry((db) => new Promise((resolve, reject) => {
|
|
110
|
+
const tx = db.transaction([storeName], "readonly");
|
|
111
|
+
const store = tx.objectStore(storeName);
|
|
112
|
+
const req = store.get(modelId);
|
|
113
|
+
|
|
114
|
+
req.onerror = () => reject(req.error);
|
|
115
|
+
req.onsuccess = () => resolve(req.result ? JSON.stringify(req.result) : "");
|
|
116
|
+
}));
|
|
117
|
+
}
|
|
118
118
|
|
|
119
119
|
// Descargar archivo desde base64
|
|
120
120
|
export function downloadFileFromBytes(fileName, bytesBase64, mimeType) {
|
|
@@ -127,11 +127,11 @@ export function downloadFileFromBytes(fileName, bytesBase64, mimeType) {
|
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
// Obtener todos los modelos (solo metadata)
|
|
130
|
-
export async function getAllModels(storeName) {
|
|
131
|
-
return _withDbRetry((db) => new Promise((resolve, reject) => {
|
|
132
|
-
const tx = db.transaction([storeName], "readonly");
|
|
133
|
-
const store = tx.objectStore(storeName);
|
|
134
|
-
const req = store.getAll();
|
|
130
|
+
export async function getAllModels(storeName) {
|
|
131
|
+
return _withDbRetry((db) => new Promise((resolve, reject) => {
|
|
132
|
+
const tx = db.transaction([storeName], "readonly");
|
|
133
|
+
const store = tx.objectStore(storeName);
|
|
134
|
+
const req = store.getAll();
|
|
135
135
|
|
|
136
136
|
req.onerror = () => reject(req.error);
|
|
137
137
|
req.onsuccess = () => {
|
|
@@ -142,41 +142,41 @@ export async function getAllModels(storeName) {
|
|
|
142
142
|
timeStamp: item.timeStamp,
|
|
143
143
|
size: item.size
|
|
144
144
|
}));
|
|
145
|
-
// keep old behavior: return JSON string
|
|
146
|
-
resolve(JSON.stringify(results));
|
|
147
|
-
};
|
|
148
|
-
}));
|
|
149
|
-
}
|
|
145
|
+
// keep old behavior: return JSON string
|
|
146
|
+
resolve(JSON.stringify(results));
|
|
147
|
+
};
|
|
148
|
+
}));
|
|
149
|
+
}
|
|
150
150
|
|
|
151
151
|
// Eliminar modelo por id
|
|
152
|
-
export async function deleteModel(modelId, storeName) {
|
|
153
|
-
return _withDbRetry((db) => new Promise((resolve, reject) => {
|
|
154
|
-
const tx = db.transaction([storeName], "readwrite");
|
|
155
|
-
const store = tx.objectStore(storeName);
|
|
156
|
-
const req = store.delete(modelId);
|
|
157
|
-
|
|
158
|
-
req.onerror = () => reject(req.error);
|
|
159
|
-
req.onsuccess = () => resolve();
|
|
160
|
-
}));
|
|
161
|
-
}
|
|
152
|
+
export async function deleteModel(modelId, storeName) {
|
|
153
|
+
return _withDbRetry((db) => new Promise((resolve, reject) => {
|
|
154
|
+
const tx = db.transaction([storeName], "readwrite");
|
|
155
|
+
const store = tx.objectStore(storeName);
|
|
156
|
+
const req = store.delete(modelId);
|
|
157
|
+
|
|
158
|
+
req.onerror = () => reject(req.error);
|
|
159
|
+
req.onsuccess = () => resolve();
|
|
160
|
+
}));
|
|
161
|
+
}
|
|
162
162
|
|
|
163
163
|
// Limpiar toda la store
|
|
164
|
-
export async function clearAll(storeName) {
|
|
165
|
-
return _withDbRetry((db) => new Promise((resolve, reject) => {
|
|
166
|
-
const tx = db.transaction([storeName], "readwrite");
|
|
167
|
-
const store = tx.objectStore(storeName);
|
|
168
|
-
const req = store.clear();
|
|
169
|
-
|
|
170
|
-
req.onerror = () => reject(req.error);
|
|
171
|
-
req.onsuccess = () => resolve();
|
|
172
|
-
}));
|
|
173
|
-
}
|
|
164
|
+
export async function clearAll(storeName) {
|
|
165
|
+
return _withDbRetry((db) => new Promise((resolve, reject) => {
|
|
166
|
+
const tx = db.transaction([storeName], "readwrite");
|
|
167
|
+
const store = tx.objectStore(storeName);
|
|
168
|
+
const req = store.clear();
|
|
169
|
+
|
|
170
|
+
req.onerror = () => reject(req.error);
|
|
171
|
+
req.onsuccess = () => resolve();
|
|
172
|
+
}));
|
|
173
|
+
}
|
|
174
174
|
|
|
175
175
|
// Borrar modelos expirados usando el índice "expirationTimeStamp"
|
|
176
|
-
export async function cleanExpiredModels(storeName) {
|
|
177
|
-
return _withDbRetry((db) => new Promise((resolve, reject) => {
|
|
178
|
-
const tx = db.transaction([storeName], "readwrite");
|
|
179
|
-
const store = tx.objectStore(storeName);
|
|
176
|
+
export async function cleanExpiredModels(storeName) {
|
|
177
|
+
return _withDbRetry((db) => new Promise((resolve, reject) => {
|
|
178
|
+
const tx = db.transaction([storeName], "readwrite");
|
|
179
|
+
const store = tx.objectStore(storeName);
|
|
180
180
|
|
|
181
181
|
const index = store.index("expirationTimeStamp");
|
|
182
182
|
const now = Date.now();
|
|
@@ -191,11 +191,11 @@ export async function cleanExpiredModels(storeName) {
|
|
|
191
191
|
cursor.continue();
|
|
192
192
|
}
|
|
193
193
|
};
|
|
194
|
-
|
|
195
|
-
tx.oncomplete = () => resolve();
|
|
196
|
-
tx.onerror = () => reject(tx.error);
|
|
197
|
-
}));
|
|
198
|
-
}
|
|
194
|
+
|
|
195
|
+
tx.oncomplete = () => resolve();
|
|
196
|
+
tx.onerror = () => reject(tx.error);
|
|
197
|
+
}));
|
|
198
|
+
}
|
|
199
199
|
|
|
200
200
|
// Utilidades opcionales y visibles (por si las quieres usar en consola)
|
|
201
201
|
export function closeDb() {
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
},
|
|
5
5
|
"description": ".NET WebAssembly runtime package that centralizes logic for building product configurators, exposing a simple API for integration into ecommerce platforms.",
|
|
6
6
|
"types": "main.d.ts",
|
|
7
|
-
"version": "5.
|
|
7
|
+
"version": "5.2.0-2",
|
|
8
8
|
"files": [
|
|
9
9
|
"_framework/**",
|
|
10
10
|
"**/*.js",
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|