@haex-space/vault-sdk 2.2.7 → 2.3.0

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
@@ -218,22 +218,30 @@ function installHistoryPolyfill() {
218
218
  }
219
219
  }
220
220
 
221
+ // src/messages.ts
222
+ var HAEXSPACE_MESSAGE_TYPES = {
223
+ /** Debug message for development/troubleshooting */
224
+ DEBUG: "haexspace:debug",
225
+ /** Console forwarding from extension iframe */
226
+ CONSOLE_FORWARD: "console.forward"
227
+ };
228
+
221
229
  // src/polyfills/debug.ts
222
230
  function installDebugDiagnostics() {
223
231
  if (typeof window === "undefined") {
224
232
  return;
225
233
  }
226
234
  const hasParent = window.parent && window.parent !== window;
227
- console.log("[HaexHub] hasParent:", hasParent);
235
+ console.log("[HaexSpace] hasParent:", hasParent);
228
236
  if (hasParent) {
229
- console.log("[HaexHub] Attempting to send debug message to parent...");
237
+ console.log("[HaexSpace] Attempting to send debug message to parent...");
230
238
  window.parent.postMessage({
231
- type: "haexhub:debug",
239
+ type: HAEXSPACE_MESSAGE_TYPES.DEBUG,
232
240
  data: `[Polyfills] window.parent test: exists=${!!window.parent}, different=${hasParent}, selfIsTop=${window.self === window.top}`
233
241
  }, "*");
234
- console.log("[HaexHub] Debug message sent!");
242
+ console.log("[HaexSpace] Debug message sent!");
235
243
  } else {
236
- console.log("[HaexHub] No parent window or parent === window");
244
+ console.log("[HaexSpace] No parent window or parent === window");
237
245
  }
238
246
  }
239
247
 
@@ -309,7 +317,7 @@ function interceptConsole(level) {
309
317
  const timestamp = (/* @__PURE__ */ new Date()).toLocaleTimeString();
310
318
  window.parent.postMessage(
311
319
  {
312
- type: "console.forward",
320
+ type: HAEXSPACE_MESSAGE_TYPES.CONSOLE_FORWARD,
313
321
  data: {
314
322
  timestamp,
315
323
  level,
@@ -1268,7 +1276,7 @@ window.parent === window: ${window.parent === window}
1268
1276
  window.self === window.top: ${window.self === window.top}`;
1269
1277
  try {
1270
1278
  window.parent.postMessage({
1271
- type: "haexhub:debug",
1279
+ type: HAEXSPACE_MESSAGE_TYPES.DEBUG,
1272
1280
  data: debugInfo
1273
1281
  }, "*");
1274
1282
  } catch (e) {
@@ -1427,6 +1435,6 @@ function createHaexVaultClient(config = {}) {
1427
1435
  return new HaexVaultClient(config);
1428
1436
  }
1429
1437
 
1430
- export { DEFAULT_TIMEOUT, DatabaseAPI, ErrorCode, FilesystemAPI, HAEXTENSION_EVENTS, HAEXTENSION_METHODS, HaexHubError, HaexVaultClient, PermissionStatus, PermissionsAPI, TABLE_SEPARATOR, WebAPI, createHaexVaultClient, getTableName, installBaseTag, installCookiePolyfill, installHistoryPolyfill, installLocalStoragePolyfill, installPolyfills, installSessionStoragePolyfill };
1438
+ export { DEFAULT_TIMEOUT, DatabaseAPI, ErrorCode, FilesystemAPI, HAEXSPACE_MESSAGE_TYPES, HAEXTENSION_EVENTS, HAEXTENSION_METHODS, HaexHubError, HaexVaultClient, PermissionStatus, PermissionsAPI, TABLE_SEPARATOR, WebAPI, createHaexVaultClient, getTableName, installBaseTag, installCookiePolyfill, installHistoryPolyfill, installLocalStoragePolyfill, installPolyfills, installSessionStoragePolyfill };
1431
1439
  //# sourceMappingURL=index.mjs.map
1432
1440
  //# sourceMappingURL=index.mjs.map