@amityco/ts-sdk 7.5.3-5f273be.0 → 7.5.3-69a90234.0

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.
@@ -3,7 +3,7 @@ export declare const getSubChannelMessagePreviewWithUser: (subChannel: Amity.Sub
3
3
  user: Amity.InternalUser | undefined;
4
4
  messagePreviewId: string;
5
5
  subChannelName: string;
6
- data?: string | Amity.ContentDataText | Amity.ContentDataFile | Amity.ContentDataImage | Amity.ContentDataVideo | Amity.ContentDataPoll | Record<string, unknown> | undefined;
6
+ data?: string | Amity.ContentDataText | Amity.ContentDataFile | Amity.ContentDataImage | Amity.ContentDataVideo | Amity.ContentDataPoll | Amity.ContentDataStream | Record<string, unknown> | undefined;
7
7
  dataType?: any;
8
8
  channelId: string;
9
9
  subChannelId: string;
@@ -18,12 +18,12 @@ export declare const generateComment: (params?: Partial<Amity.InternalComment>)
18
18
  editedAt: string;
19
19
  attachments?: Amity.Attachment[] | undefined;
20
20
  targetId: string;
21
- targetType: "user" | "community" | "content";
21
+ targetType: "community" | "user" | "content";
22
22
  referenceId: string;
23
23
  referenceType: Amity.CommentReferenceType;
24
24
  dataType?: any;
25
25
  dataTypes?: any[] | undefined;
26
- data?: string | Record<string, unknown> | Amity.ContentDataText | Amity.ContentDataFile | Amity.ContentDataImage | Amity.ContentDataVideo | Amity.ContentDataPoll | undefined;
26
+ data?: string | Record<string, unknown> | Amity.ContentDataText | Amity.ContentDataFile | Amity.ContentDataImage | Amity.ContentDataVideo | Amity.ContentDataPoll | Amity.ContentDataStream | undefined;
27
27
  metadata?: Record<string, any> | undefined;
28
28
  flagCount: number;
29
29
  hashFlag: {
@@ -28,21 +28,21 @@ export declare const emptyPostPayload: {
28
28
  files: never[];
29
29
  };
30
30
  export declare const postQueryResponse: {
31
- data: Omit<Amity.PostPayload<any>, "communities" | "communityUsers" | "posts"> & {
31
+ data: Omit<Amity.PostPayload<any>, "communityUsers" | "communities" | "posts"> & {
32
32
  posts: Amity.InternalPost<any>[];
33
33
  communities: Amity.InternalCommunity[];
34
34
  communityUsers: Amity.Membership<"community">[];
35
35
  } & Amity.Pagination;
36
36
  };
37
37
  export declare const postQueryResponse2: {
38
- data: Omit<Amity.PostPayload<any>, "communities" | "communityUsers" | "posts"> & {
38
+ data: Omit<Amity.PostPayload<any>, "communityUsers" | "communities" | "posts"> & {
39
39
  posts: Amity.InternalPost<any>[];
40
40
  communities: Amity.InternalCommunity[];
41
41
  communityUsers: Amity.Membership<"community">[];
42
42
  } & Amity.Pagination;
43
43
  };
44
44
  export declare const postQueryResponsePage2: {
45
- data: Omit<Amity.PostPayload<any>, "communities" | "communityUsers" | "posts"> & {
45
+ data: Omit<Amity.PostPayload<any>, "communityUsers" | "communities" | "posts"> & {
46
46
  posts: Amity.InternalPost<any>[];
47
47
  communities: Amity.InternalCommunity[];
48
48
  communityUsers: Amity.Membership<"community">[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amityco/ts-sdk",
3
- "version": "7.5.3-5f273be.0",
3
+ "version": "7.5.3-69a90234.0",
4
4
  "license": "CC-BY-ND-4.0",
5
5
  "author": "amity.co <developers@amity.co> (https://amity.co)",
6
6
  "description": "Amity Social Cloud Typescript SDK",
@@ -24,7 +24,15 @@ declare global {
24
24
  | Exclude<`${ContentFlagReasonEnum}`, `${ContentFlagReasonEnum.Others}`>
25
25
  | (string & {});
26
26
 
27
- type ContentType = 'text' | 'image' | 'file' | 'video' | 'poll' | 'json' | string;
27
+ type ContentType =
28
+ | 'text'
29
+ | 'image'
30
+ | 'file'
31
+ | 'video'
32
+ | 'poll'
33
+ | 'json'
34
+ | 'liveStream'
35
+ | string;
28
36
 
29
37
  type ContentFeedType = ValueOf<typeof ContentFeedType>;
30
38
 
@@ -58,6 +66,10 @@ declare global {
58
66
  pollId: Amity.Poll['pollId'];
59
67
  };
60
68
 
69
+ type ContentDataStream = {
70
+ streamId: Amity.Stream['streamId'];
71
+ };
72
+
61
73
  type ContentData<T extends ContentType> = T extends 'text'
62
74
  ? ContentDataText
63
75
  : T extends 'file'
@@ -68,6 +80,8 @@ declare global {
68
80
  ? ContentDataVideo
69
81
  : T extends 'poll'
70
82
  ? ContentDataPoll
83
+ : T extends 'liveStream'
84
+ ? ContentDataStream
71
85
  : T extends 'json'
72
86
  ? Record<string, unknown>
73
87
  : T extends string
@@ -32,6 +32,6 @@ declare global {
32
32
  pinnedAt: Date;
33
33
  };
34
34
 
35
- type GlobalPinnedPostLiveCollection = Amity.LiveCollectionParams<Record<string, never>>;
35
+ type GlobalPinnedPostLiveCollection = Amity.LiveCollectionParams<{}>;
36
36
  }
37
37
  }
@@ -41,3 +41,5 @@ export * from './domains/notification';
41
41
  export * from './domains/client';
42
42
  export * from './domains/invitation';
43
43
  export * from './domains/joinRequest';
44
+ export * from './domains/pin';
45
+ export * from './domains/pinnedPost';
@@ -1,25 +1,3 @@
1
- import { ASCError } from '~/core/errors';
2
- import { getActiveClient } from './activeClient';
3
-
4
1
  export const enableUnreadCount = () => {
5
- const client = getActiveClient();
6
-
7
- client.log('client/api/isUnreadCountEnabled', client.isUnreadCountEnabled);
8
-
9
- if (!client) {
10
- throw new ASCError(
11
- 'There is no active client',
12
- Amity.ClientError.UNKNOWN_ERROR,
13
- Amity.ErrorLevel.FATAL,
14
- );
15
- }
16
-
17
- if (client.isUnreadCountEnabled) return false;
18
-
19
- client.isUnreadCountEnabled = true;
20
- client.useLegacyUnreadCount = false;
21
-
22
- client.emitter.emit('unreadCountEnabled', true);
23
-
24
2
  return true;
25
3
  };
@@ -26,7 +26,6 @@ import { onTokenTerminated } from '../events/onTokenTerminated';
26
26
  import { setClientToken } from '../utils/setClientToken';
27
27
  import { removeChannelMarkerCache } from '../utils/removeChannelMarkerCache';
28
28
  import { initializeMessagePreviewSetting } from '../utils/messagePreviewEngine';
29
- import { startMarkerSync } from '../utils/markerSyncEngine';
30
29
  import { ASCError } from '~/core/errors';
31
30
  import SessionWatcher from '../utils/SessionWatcher';
32
31
 
@@ -207,9 +206,6 @@ export const login = async (
207
206
  if (client.useLegacyUnreadCount) {
208
207
  subscriptions.push(readReceiptSyncEngineOnLoginHandler());
209
208
  } else subscriptions.push(legacyReadReceiptSyncEngineOnLoginHandler());
210
-
211
- const markerSyncUnsubscriber = await startMarkerSync();
212
- subscriptions.push(markerSyncUnsubscriber);
213
209
  }
214
210
 
215
211
  return true;
@@ -14,7 +14,6 @@ import { onSubChannelDeleted } from '~/subChannelRepository/events/onSubChannelD
14
14
  import { isUnreadCountSupport } from '~/subChannelRepository/utils';
15
15
 
16
16
  import { markerSync } from '../api/markerSync';
17
- import { enableUnreadCount } from '../api/enableUnreadCount';
18
17
 
19
18
  import { onOnline } from './onOnline';
20
19
  import { onUserFeedMarkerUpdated } from '~/marker/events/onUserFeedMarkerUpdated';
@@ -27,7 +26,7 @@ let isSyncRunning = false;
27
26
  let disposers: (() => void)[] = [];
28
27
  let isWaitingForResponse = false;
29
28
 
30
- let isConsistentMode = true;
29
+ const isConsistentMode = true;
31
30
  let deviceLastSyncAt: Date | null = null;
32
31
 
33
32
  const getDeviceLastSyncAt = () => {
@@ -178,17 +177,7 @@ const unRegisterEventListeners = () => {
178
177
  disposers = [];
179
178
  };
180
179
 
181
- export const startMarkerSync = async () => {
182
- await fetchDeviceLastSyncAt();
183
- pushMarkerSyncEvent(Amity.MarkerSyncEvent.START_SYNCING);
184
-
185
- isConsistentMode = true;
186
- isSyncRunning = true;
187
-
188
- registerEventListeners();
189
-
190
- return unRegisterEventListeners;
191
- };
180
+ export const startMarkerSync = async () => Promise.resolve();
192
181
 
193
182
  /**
194
183
  ```js
@@ -201,17 +190,7 @@ export const startMarkerSync = async () => {
201
190
  *
202
191
  * @category Marker API
203
192
  */
204
- export const startUnreadSync = async () => {
205
- await fetchDeviceLastSyncAt();
206
- pushMarkerSyncEvent(Amity.MarkerSyncEvent.START_SYNCING);
207
-
208
- enableUnreadCount();
209
-
210
- isConsistentMode = false;
211
- isSyncRunning = true;
212
-
213
- registerEventListeners();
214
- };
193
+ export const startUnreadSync = async () => Promise.resolve();
215
194
 
216
195
  /**
217
196
  ```js
@@ -59,7 +59,7 @@ export const addReaction = async (
59
59
  referenceId,
60
60
  ]);
61
61
 
62
- if (!model) return true;
62
+ if (!model || model.data.myReactions?.includes(reactionName)) return true;
63
63
 
64
64
  const updatedModel = {
65
65
  ...model.data,