@shaxpir/duiduidui-models 1.6.6 → 1.6.8
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/Manifest.js
CHANGED
package/dist/models/Social.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Doc } from '@shaxpir/sharedb/lib/client';
|
|
2
|
-
import { CompactDateTime } from '@shaxpir/shaxpir-common';
|
|
2
|
+
import { CompactDateTime, MultiTime } from '@shaxpir/shaxpir-common';
|
|
3
3
|
import { ShareSync } from '../repo';
|
|
4
4
|
import { Content, ContentBody, ContentId, ContentMeta } from "./Content";
|
|
5
5
|
export declare enum FriendRequestStatus {
|
|
@@ -43,7 +43,7 @@ export interface SocialBody extends ContentBody {
|
|
|
43
43
|
}
|
|
44
44
|
export declare class Social extends Content {
|
|
45
45
|
static makeSocialId(userId: ContentId): ContentId;
|
|
46
|
-
static create(userId: ContentId): Social;
|
|
46
|
+
static create(userId: ContentId, createdAt?: MultiTime): Social;
|
|
47
47
|
constructor(doc: Doc, shouldAcquire: boolean, shareSync: ShareSync);
|
|
48
48
|
get payload(): SocialPayload;
|
|
49
49
|
getOutgoingRequests(): FriendRequest[];
|
package/dist/models/Social.js
CHANGED
|
@@ -16,8 +16,8 @@ class Social extends Content_1.Content {
|
|
|
16
16
|
static makeSocialId(userId) {
|
|
17
17
|
return shaxpir_common_1.CachingHasher.makeMd5Base62Hash(userId + "-" + ContentKind_1.ContentKind.SOCIAL);
|
|
18
18
|
}
|
|
19
|
-
static create(userId) {
|
|
20
|
-
const now = shaxpir_common_1.ClockService.getClock().now();
|
|
19
|
+
static create(userId, createdAt) {
|
|
20
|
+
const now = createdAt ?? shaxpir_common_1.ClockService.getClock().now();
|
|
21
21
|
const socialId = Social.makeSocialId(userId);
|
|
22
22
|
return repo_1.ShareSyncFactory.get().createContent({
|
|
23
23
|
meta: {
|
package/dist/repo/ShareSync.js
CHANGED
|
@@ -431,6 +431,9 @@ class ShareSync {
|
|
|
431
431
|
else if (kind === ContentKind_1.ContentKind.SESSION) {
|
|
432
432
|
return new Session_1.Session(doc, shouldAcquire, shareSync);
|
|
433
433
|
}
|
|
434
|
+
else if (kind === ContentKind_1.ContentKind.SOCIAL) {
|
|
435
|
+
return new models_1.Social(doc, shouldAcquire, shareSync);
|
|
436
|
+
}
|
|
434
437
|
else if (kind === ContentKind_1.ContentKind.TERM) {
|
|
435
438
|
return new models_1.Term(doc, shouldAcquire, shareSync);
|
|
436
439
|
}
|