mindcache 3.5.1 → 3.5.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/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 +16 -5
- package/dist/index.d.ts +16 -5
- package/dist/index.js +82 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +82 -6
- 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
|
@@ -592,6 +592,10 @@ declare class CloudAdapter {
|
|
|
592
592
|
private handleOffline;
|
|
593
593
|
private _synced;
|
|
594
594
|
constructor(config: CloudConfig);
|
|
595
|
+
/**
|
|
596
|
+
* Validate configuration and warn about common mistakes
|
|
597
|
+
*/
|
|
598
|
+
private validateConfig;
|
|
595
599
|
/** Browser network status - instantly updated via navigator.onLine */
|
|
596
600
|
get isOnline(): boolean;
|
|
597
601
|
private setupNetworkDetection;
|
|
@@ -592,6 +592,10 @@ declare class CloudAdapter {
|
|
|
592
592
|
private handleOffline;
|
|
593
593
|
private _synced;
|
|
594
594
|
constructor(config: CloudConfig);
|
|
595
|
+
/**
|
|
596
|
+
* Validate configuration and warn about common mistakes
|
|
597
|
+
*/
|
|
598
|
+
private validateConfig;
|
|
595
599
|
/** Browser network status - instantly updated via navigator.onLine */
|
|
596
600
|
get isOnline(): boolean;
|
|
597
601
|
private setupNetworkDetection;
|
package/dist/cloud/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as MindCache, C as CloudConfig, a as CloudAdapter } from '../CloudAdapter-
|
|
2
|
-
export { d as ClearOperation, c as CloudAdapterEvents, b as ConnectionState, D as DeleteOperation, O as Operation, S as SetOperation } from '../CloudAdapter-
|
|
1
|
+
import { M as MindCache, C as CloudConfig, a as CloudAdapter } from '../CloudAdapter-DK4YecbV.mjs';
|
|
2
|
+
export { d as ClearOperation, c as CloudAdapterEvents, b as ConnectionState, D as DeleteOperation, O as Operation, S as SetOperation } from '../CloudAdapter-DK4YecbV.mjs';
|
|
3
3
|
import 'yjs';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/cloud/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { M as MindCache, C as CloudConfig, a as CloudAdapter } from '../CloudAdapter-
|
|
2
|
-
export { d as ClearOperation, c as CloudAdapterEvents, b as ConnectionState, D as DeleteOperation, O as Operation, S as SetOperation } from '../CloudAdapter-
|
|
1
|
+
import { M as MindCache, C as CloudConfig, a as CloudAdapter } from '../CloudAdapter-DK4YecbV.js';
|
|
2
|
+
export { d as ClearOperation, c as CloudAdapterEvents, b as ConnectionState, D as DeleteOperation, O as Operation, S as SetOperation } from '../CloudAdapter-DK4YecbV.js';
|
|
3
3
|
import 'yjs';
|
|
4
4
|
|
|
5
5
|
/**
|
package/dist/cloud/index.js
CHANGED
|
@@ -211,6 +211,7 @@ var init_CloudAdapter = __esm({
|
|
|
211
211
|
if (!config.baseUrl) {
|
|
212
212
|
throw new Error("MindCache Cloud: baseUrl is required. Please provide the cloud API URL in your configuration.");
|
|
213
213
|
}
|
|
214
|
+
this.validateConfig(config);
|
|
214
215
|
this.setupNetworkDetection();
|
|
215
216
|
}
|
|
216
217
|
ws = null;
|
|
@@ -226,6 +227,43 @@ var init_CloudAdapter = __esm({
|
|
|
226
227
|
handleOnline = null;
|
|
227
228
|
handleOffline = null;
|
|
228
229
|
_synced = false;
|
|
230
|
+
/**
|
|
231
|
+
* Validate configuration and warn about common mistakes
|
|
232
|
+
*/
|
|
233
|
+
validateConfig(config) {
|
|
234
|
+
const baseUrl = config.baseUrl;
|
|
235
|
+
if (!baseUrl) {
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
console.log("\u2601\uFE0F MindCache Cloud Config:", {
|
|
239
|
+
baseUrl,
|
|
240
|
+
instanceId: config.instanceId,
|
|
241
|
+
hasTokenProvider: !!config.tokenProvider,
|
|
242
|
+
hasApiKey: !!config.apiKey
|
|
243
|
+
});
|
|
244
|
+
try {
|
|
245
|
+
const url = new URL(baseUrl);
|
|
246
|
+
if (url.hostname === "mindcache.dev") {
|
|
247
|
+
console.error(
|
|
248
|
+
'\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)."
|
|
249
|
+
);
|
|
250
|
+
}
|
|
251
|
+
if (url.protocol === "ws:" || url.protocol === "wss:") {
|
|
252
|
+
console.warn(
|
|
253
|
+
"\u26A0\uFE0F MindCache Cloud: baseUrl uses WebSocket protocol (" + url.protocol + "). Consider using http:// or https:// - CloudAdapter will handle the WebSocket upgrade automatically."
|
|
254
|
+
);
|
|
255
|
+
}
|
|
256
|
+
if (url.hostname === "localhost" && url.port !== "8787" && url.port !== "3000") {
|
|
257
|
+
console.warn(
|
|
258
|
+
"\u26A0\uFE0F MindCache Cloud: localhost URL detected with non-standard port " + url.port + ". Default MindCache dev server runs on port 8787."
|
|
259
|
+
);
|
|
260
|
+
}
|
|
261
|
+
const wsUrl = baseUrl.replace("https://", "wss://").replace("http://", "ws://");
|
|
262
|
+
console.log("\u2601\uFE0F WebSocket will connect to:", wsUrl + "/sync/" + config.instanceId);
|
|
263
|
+
} catch (e) {
|
|
264
|
+
console.error("\u26A0\uFE0F MindCache Cloud: Invalid baseUrl format:", baseUrl);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
229
267
|
/** Browser network status - instantly updated via navigator.onLine */
|
|
230
268
|
get isOnline() {
|
|
231
269
|
return this._isOnline;
|