@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.d.mts CHANGED
@@ -121,6 +121,21 @@ declare const HAEXTENSION_METHODS: {
121
121
  type DeepValues<T> = T extends object ? T[keyof T] extends string ? T[keyof T] : T[keyof T] extends object ? DeepValues<T[keyof T]> : never : never;
122
122
  type HaextensionMethod = DeepValues<typeof HAEXTENSION_METHODS>;
123
123
 
124
+ /**
125
+ * Central message type definitions for HaexSpace SDK
126
+ *
127
+ * Message Naming Schema: haexspace:{subject}
128
+ *
129
+ * These are used for internal communication between extensions and HaexSpace
130
+ */
131
+ declare const HAEXSPACE_MESSAGE_TYPES: {
132
+ /** Debug message for development/troubleshooting */
133
+ readonly DEBUG: "haexspace:debug";
134
+ /** Console forwarding from extension iframe */
135
+ readonly CONSOLE_FORWARD: "console.forward";
136
+ };
137
+ type HaexspaceMessageType = (typeof HAEXSPACE_MESSAGE_TYPES)[keyof typeof HAEXSPACE_MESSAGE_TYPES];
138
+
124
139
  declare function createHaexVaultClient(config?: HaexHubConfig): HaexVaultClient;
125
140
 
126
- export { HAEXTENSION_METHODS, HaexHubConfig, HaexVaultClient, type HaextensionMethod, createHaexVaultClient, installBaseTag, installCookiePolyfill, installHistoryPolyfill, installLocalStoragePolyfill, installPolyfills, installSessionStoragePolyfill };
141
+ export { HAEXSPACE_MESSAGE_TYPES, HAEXTENSION_METHODS, HaexHubConfig, HaexVaultClient, type HaexspaceMessageType, type HaextensionMethod, createHaexVaultClient, installBaseTag, installCookiePolyfill, installHistoryPolyfill, installLocalStoragePolyfill, installPolyfills, installSessionStoragePolyfill };
package/dist/index.d.ts CHANGED
@@ -121,6 +121,21 @@ declare const HAEXTENSION_METHODS: {
121
121
  type DeepValues<T> = T extends object ? T[keyof T] extends string ? T[keyof T] : T[keyof T] extends object ? DeepValues<T[keyof T]> : never : never;
122
122
  type HaextensionMethod = DeepValues<typeof HAEXTENSION_METHODS>;
123
123
 
124
+ /**
125
+ * Central message type definitions for HaexSpace SDK
126
+ *
127
+ * Message Naming Schema: haexspace:{subject}
128
+ *
129
+ * These are used for internal communication between extensions and HaexSpace
130
+ */
131
+ declare const HAEXSPACE_MESSAGE_TYPES: {
132
+ /** Debug message for development/troubleshooting */
133
+ readonly DEBUG: "haexspace:debug";
134
+ /** Console forwarding from extension iframe */
135
+ readonly CONSOLE_FORWARD: "console.forward";
136
+ };
137
+ type HaexspaceMessageType = (typeof HAEXSPACE_MESSAGE_TYPES)[keyof typeof HAEXSPACE_MESSAGE_TYPES];
138
+
124
139
  declare function createHaexVaultClient(config?: HaexHubConfig): HaexVaultClient;
125
140
 
126
- export { HAEXTENSION_METHODS, HaexHubConfig, HaexVaultClient, type HaextensionMethod, createHaexVaultClient, installBaseTag, installCookiePolyfill, installHistoryPolyfill, installLocalStoragePolyfill, installPolyfills, installSessionStoragePolyfill };
141
+ export { HAEXSPACE_MESSAGE_TYPES, HAEXTENSION_METHODS, HaexHubConfig, HaexVaultClient, type HaexspaceMessageType, type HaextensionMethod, createHaexVaultClient, installBaseTag, installCookiePolyfill, installHistoryPolyfill, installLocalStoragePolyfill, installPolyfills, installSessionStoragePolyfill };
package/dist/index.js CHANGED
@@ -220,22 +220,30 @@ function installHistoryPolyfill() {
220
220
  }
221
221
  }
222
222
 
223
+ // src/messages.ts
224
+ var HAEXSPACE_MESSAGE_TYPES = {
225
+ /** Debug message for development/troubleshooting */
226
+ DEBUG: "haexspace:debug",
227
+ /** Console forwarding from extension iframe */
228
+ CONSOLE_FORWARD: "console.forward"
229
+ };
230
+
223
231
  // src/polyfills/debug.ts
224
232
  function installDebugDiagnostics() {
225
233
  if (typeof window === "undefined") {
226
234
  return;
227
235
  }
228
236
  const hasParent = window.parent && window.parent !== window;
229
- console.log("[HaexHub] hasParent:", hasParent);
237
+ console.log("[HaexSpace] hasParent:", hasParent);
230
238
  if (hasParent) {
231
- console.log("[HaexHub] Attempting to send debug message to parent...");
239
+ console.log("[HaexSpace] Attempting to send debug message to parent...");
232
240
  window.parent.postMessage({
233
- type: "haexhub:debug",
241
+ type: HAEXSPACE_MESSAGE_TYPES.DEBUG,
234
242
  data: `[Polyfills] window.parent test: exists=${!!window.parent}, different=${hasParent}, selfIsTop=${window.self === window.top}`
235
243
  }, "*");
236
- console.log("[HaexHub] Debug message sent!");
244
+ console.log("[HaexSpace] Debug message sent!");
237
245
  } else {
238
- console.log("[HaexHub] No parent window or parent === window");
246
+ console.log("[HaexSpace] No parent window or parent === window");
239
247
  }
240
248
  }
241
249
 
@@ -311,7 +319,7 @@ function interceptConsole(level) {
311
319
  const timestamp = (/* @__PURE__ */ new Date()).toLocaleTimeString();
312
320
  window.parent.postMessage(
313
321
  {
314
- type: "console.forward",
322
+ type: HAEXSPACE_MESSAGE_TYPES.CONSOLE_FORWARD,
315
323
  data: {
316
324
  timestamp,
317
325
  level,
@@ -1270,7 +1278,7 @@ window.parent === window: ${window.parent === window}
1270
1278
  window.self === window.top: ${window.self === window.top}`;
1271
1279
  try {
1272
1280
  window.parent.postMessage({
1273
- type: "haexhub:debug",
1281
+ type: HAEXSPACE_MESSAGE_TYPES.DEBUG,
1274
1282
  data: debugInfo
1275
1283
  }, "*");
1276
1284
  } catch (e) {
@@ -1433,6 +1441,7 @@ exports.DEFAULT_TIMEOUT = DEFAULT_TIMEOUT;
1433
1441
  exports.DatabaseAPI = DatabaseAPI;
1434
1442
  exports.ErrorCode = ErrorCode;
1435
1443
  exports.FilesystemAPI = FilesystemAPI;
1444
+ exports.HAEXSPACE_MESSAGE_TYPES = HAEXSPACE_MESSAGE_TYPES;
1436
1445
  exports.HAEXTENSION_EVENTS = HAEXTENSION_EVENTS;
1437
1446
  exports.HAEXTENSION_METHODS = HAEXTENSION_METHODS;
1438
1447
  exports.HaexHubError = HaexHubError;