@shaxpir/duiduidui-models 1.6.7 → 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.
@@ -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[];
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shaxpir/duiduidui-models",
3
- "version": "1.6.7",
3
+ "version": "1.6.8",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/shaxpir/duiduidui-models"