mindcache 3.5.1 → 3.5.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/dist/{CloudAdapter-CM7nyJaG.d.mts → CloudAdapter-DK4YecbV.d.mts} +4 -0
- package/dist/{CloudAdapter-CM7nyJaG.d.ts → CloudAdapter-DK4YecbV.d.ts} +4 -0
- package/dist/cloud/index.d.mts +2 -2
- package/dist/cloud/index.d.ts +2 -2
- package/dist/cloud/index.js +38 -0
- package/dist/cloud/index.js.map +1 -1
- package/dist/cloud/index.mjs +38 -0
- package/dist/cloud/index.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +38 -0
- package/dist/index.mjs.map +1 -1
- package/dist/server.d.mts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +38 -0
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +38 -0
- package/dist/server.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { e as MindCacheOptions, M as MindCache } from './CloudAdapter-
|
|
2
|
-
export { A as AccessLevel, a as CloudAdapter, c as CloudAdapterEvents, C as CloudConfig, b as ConnectionState, h as ContextRules, n as DEFAULT_KEY_ATTRIBUTES, G as GlobalListener, H as HistoryEntry, k as HistoryOptions, K as KeyAttributes, j as KeyEntry, f as KeyType, L as Listener, l as MindCacheCloudOptions, m as MindCacheIndexedDBOptions, i as STM, j as STMEntry, g as SystemTag, o as SystemTagHelpers } from './CloudAdapter-
|
|
1
|
+
import { e as MindCacheOptions, M as MindCache } from './CloudAdapter-DK4YecbV.mjs';
|
|
2
|
+
export { A as AccessLevel, a as CloudAdapter, c as CloudAdapterEvents, C as CloudConfig, b as ConnectionState, h as ContextRules, n as DEFAULT_KEY_ATTRIBUTES, G as GlobalListener, H as HistoryEntry, k as HistoryOptions, K as KeyAttributes, j as KeyEntry, f as KeyType, L as Listener, l as MindCacheCloudOptions, m as MindCacheIndexedDBOptions, i as STM, j as STMEntry, g as SystemTag, o as SystemTagHelpers } from './CloudAdapter-DK4YecbV.mjs';
|
|
3
3
|
export { IndexedDBAdapter, IndexedDBConfig } from './server.mjs';
|
|
4
4
|
import 'yjs';
|
|
5
5
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { e as MindCacheOptions, M as MindCache } from './CloudAdapter-
|
|
2
|
-
export { A as AccessLevel, a as CloudAdapter, c as CloudAdapterEvents, C as CloudConfig, b as ConnectionState, h as ContextRules, n as DEFAULT_KEY_ATTRIBUTES, G as GlobalListener, H as HistoryEntry, k as HistoryOptions, K as KeyAttributes, j as KeyEntry, f as KeyType, L as Listener, l as MindCacheCloudOptions, m as MindCacheIndexedDBOptions, i as STM, j as STMEntry, g as SystemTag, o as SystemTagHelpers } from './CloudAdapter-
|
|
1
|
+
import { e as MindCacheOptions, M as MindCache } from './CloudAdapter-DK4YecbV.js';
|
|
2
|
+
export { A as AccessLevel, a as CloudAdapter, c as CloudAdapterEvents, C as CloudConfig, b as ConnectionState, h as ContextRules, n as DEFAULT_KEY_ATTRIBUTES, G as GlobalListener, H as HistoryEntry, k as HistoryOptions, K as KeyAttributes, j as KeyEntry, f as KeyType, L as Listener, l as MindCacheCloudOptions, m as MindCacheIndexedDBOptions, i as STM, j as STMEntry, g as SystemTag, o as SystemTagHelpers } from './CloudAdapter-DK4YecbV.js';
|
|
3
3
|
export { IndexedDBAdapter, IndexedDBConfig } from './server.js';
|
|
4
4
|
import 'yjs';
|
|
5
5
|
|
package/dist/index.js
CHANGED
|
@@ -212,6 +212,7 @@ var init_CloudAdapter = __esm({
|
|
|
212
212
|
if (!config.baseUrl) {
|
|
213
213
|
throw new Error("MindCache Cloud: baseUrl is required. Please provide the cloud API URL in your configuration.");
|
|
214
214
|
}
|
|
215
|
+
this.validateConfig(config);
|
|
215
216
|
this.setupNetworkDetection();
|
|
216
217
|
}
|
|
217
218
|
ws = null;
|
|
@@ -227,6 +228,43 @@ var init_CloudAdapter = __esm({
|
|
|
227
228
|
handleOnline = null;
|
|
228
229
|
handleOffline = null;
|
|
229
230
|
_synced = false;
|
|
231
|
+
/**
|
|
232
|
+
* Validate configuration and warn about common mistakes
|
|
233
|
+
*/
|
|
234
|
+
validateConfig(config) {
|
|
235
|
+
const baseUrl = config.baseUrl;
|
|
236
|
+
if (!baseUrl) {
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
console.log("\u2601\uFE0F MindCache Cloud Config:", {
|
|
240
|
+
baseUrl,
|
|
241
|
+
instanceId: config.instanceId,
|
|
242
|
+
hasTokenProvider: !!config.tokenProvider,
|
|
243
|
+
hasApiKey: !!config.apiKey
|
|
244
|
+
});
|
|
245
|
+
try {
|
|
246
|
+
const url = new URL(baseUrl);
|
|
247
|
+
if (url.hostname === "mindcache.dev") {
|
|
248
|
+
console.error(
|
|
249
|
+
'\u26A0\uFE0F MindCache Cloud WARNING: baseUrl is set to "mindcache.dev" but the API is at "api.mindcache.dev".\n Current: ' + baseUrl + "\n Expected: https://api.mindcache.dev\n This will cause WebSocket connection failures (404 errors)."
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
if (url.protocol === "ws:" || url.protocol === "wss:") {
|
|
253
|
+
console.warn(
|
|
254
|
+
"\u26A0\uFE0F MindCache Cloud: baseUrl uses WebSocket protocol (" + url.protocol + "). Consider using http:// or https:// - CloudAdapter will handle the WebSocket upgrade automatically."
|
|
255
|
+
);
|
|
256
|
+
}
|
|
257
|
+
if (url.hostname === "localhost" && url.port !== "8787" && url.port !== "3000") {
|
|
258
|
+
console.warn(
|
|
259
|
+
"\u26A0\uFE0F MindCache Cloud: localhost URL detected with non-standard port " + url.port + ". Default MindCache dev server runs on port 8787."
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
const wsUrl = baseUrl.replace("https://", "wss://").replace("http://", "ws://");
|
|
263
|
+
console.log("\u2601\uFE0F WebSocket will connect to:", wsUrl + "/sync/" + config.instanceId);
|
|
264
|
+
} catch (e) {
|
|
265
|
+
console.error("\u26A0\uFE0F MindCache Cloud: Invalid baseUrl format:", baseUrl);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
230
268
|
/** Browser network status - instantly updated via navigator.onLine */
|
|
231
269
|
get isOnline() {
|
|
232
270
|
return this._isOnline;
|