@shaxpir/duiduidui-models 1.6.14 → 1.6.16
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/models/Profile.js +3 -3
- package/dist/repo/ShareSync.d.ts +2 -0
- package/dist/repo/ShareSync.js +28 -0
- package/package.json +1 -1
package/dist/models/Profile.js
CHANGED
|
@@ -148,15 +148,15 @@ class Profile extends Content_1.Content {
|
|
|
148
148
|
}
|
|
149
149
|
// Allow a wide range of characters for international names
|
|
150
150
|
// - Letters from any language (Unicode letters)
|
|
151
|
-
// - Spaces, hyphens, apostrophes, periods (common in names)
|
|
151
|
+
// - Spaces, hyphens, apostrophes, periods, commas (common in names)
|
|
152
152
|
// - Chinese characters (CJK Unified Ideographs)
|
|
153
153
|
// Reject control characters, emojis, and other special characters
|
|
154
|
-
const validPattern = /^[\p{L}\p{M}\s'
|
|
154
|
+
const validPattern = /^[\p{L}\p{M}\s'\-\.,]+$/u;
|
|
155
155
|
if (!validPattern.test(fullName)) {
|
|
156
156
|
return {
|
|
157
157
|
isValid: false,
|
|
158
158
|
reason: 'invalid_characters',
|
|
159
|
-
message: 'Full name contains invalid characters. Only letters, spaces, hyphens, apostrophes, and
|
|
159
|
+
message: 'Full name contains invalid characters. Only letters, spaces, hyphens, apostrophes, periods, and commas are allowed'
|
|
160
160
|
};
|
|
161
161
|
}
|
|
162
162
|
// Check for reasonable structure (not just whitespace/punctuation)
|
package/dist/repo/ShareSync.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export declare class ShareSyncFactory {
|
|
|
29
29
|
private static INSTANCE;
|
|
30
30
|
static initialize(encryption: Encryption, options: ShareSyncOptions): void;
|
|
31
31
|
static get(): ShareSync;
|
|
32
|
+
static shutdown(): void;
|
|
32
33
|
}
|
|
33
34
|
export declare class ShareSync {
|
|
34
35
|
private _debug;
|
|
@@ -78,4 +79,5 @@ export declare class ShareSync {
|
|
|
78
79
|
setAutoBatchEnabled(enabled: boolean): void;
|
|
79
80
|
isAutoBatchEnabled(): boolean;
|
|
80
81
|
flush(): void;
|
|
82
|
+
shutdown(): void;
|
|
81
83
|
}
|
package/dist/repo/ShareSync.js
CHANGED
|
@@ -67,6 +67,12 @@ class ShareSyncFactory {
|
|
|
67
67
|
static get() {
|
|
68
68
|
return ShareSyncFactory.INSTANCE;
|
|
69
69
|
}
|
|
70
|
+
static shutdown() {
|
|
71
|
+
if (ShareSyncFactory.INSTANCE) {
|
|
72
|
+
ShareSyncFactory.INSTANCE.shutdown();
|
|
73
|
+
ShareSyncFactory.INSTANCE = null;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
70
76
|
}
|
|
71
77
|
exports.ShareSyncFactory = ShareSyncFactory;
|
|
72
78
|
ShareSyncFactory.INSTANCE = null;
|
|
@@ -464,5 +470,27 @@ class ShareSync {
|
|
|
464
470
|
this._durableStore.flush();
|
|
465
471
|
}
|
|
466
472
|
}
|
|
473
|
+
shutdown() {
|
|
474
|
+
console.log('[ShareSync] Shutting down...');
|
|
475
|
+
// Close the WebSocket connection
|
|
476
|
+
if (this._socket) {
|
|
477
|
+
this._socket.close();
|
|
478
|
+
this._socket = null;
|
|
479
|
+
}
|
|
480
|
+
// Close the ShareDB connection
|
|
481
|
+
if (this._connection) {
|
|
482
|
+
this._connection.close();
|
|
483
|
+
this._connection = null;
|
|
484
|
+
}
|
|
485
|
+
// Clear the model cache
|
|
486
|
+
if (this._modelCache) {
|
|
487
|
+
this._modelCache.clear();
|
|
488
|
+
}
|
|
489
|
+
// Clear DurableStore references
|
|
490
|
+
this._storage = null;
|
|
491
|
+
this._durableStore = null;
|
|
492
|
+
this._storageFactory = null;
|
|
493
|
+
console.log('[ShareSync] Shutdown complete');
|
|
494
|
+
}
|
|
467
495
|
}
|
|
468
496
|
exports.ShareSync = ShareSync;
|