@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.
- package/dist/@types/domains/content.d.ts +5 -2
- package/dist/@types/domains/content.d.ts.map +1 -1
- package/dist/@types/domains/pinnedPost.d.ts +1 -1
- package/dist/@types/domains/pinnedPost.d.ts.map +1 -1
- package/dist/@types/index.d.ts +2 -0
- package/dist/@types/index.d.ts.map +1 -1
- package/dist/client/api/enableUnreadCount.d.ts.map +1 -1
- package/dist/client/api/login.d.ts.map +1 -1
- package/dist/client/utils/markerSyncEngine.d.ts +1 -1
- package/dist/client/utils/markerSyncEngine.d.ts.map +1 -1
- package/dist/index.cjs.js +320 -431
- package/dist/index.esm.js +320 -431
- package/dist/index.umd.js +1 -1
- package/dist/messagePreview/utils/getSubChannelMessagePreviewWithUser.d.ts +1 -1
- package/dist/utils/tests/dummy/comment.d.ts +2 -2
- package/dist/utils/tests/dummy/post.d.ts +3 -3
- package/package.json +1 -1
- package/src/@types/domains/content.ts +15 -1
- package/src/@types/domains/pinnedPost.ts +1 -1
- package/src/@types/index.ts +2 -0
- package/src/client/api/enableUnreadCount.ts +0 -22
- package/src/client/api/login.ts +0 -4
- package/src/client/utils/markerSyncEngine.ts +3 -24
- package/src/reactionRepository/api/addReaction.ts +1 -1
|
@@ -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: "
|
|
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>, "
|
|
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>, "
|
|
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>, "
|
|
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
|
@@ -24,7 +24,15 @@ declare global {
|
|
|
24
24
|
| Exclude<`${ContentFlagReasonEnum}`, `${ContentFlagReasonEnum.Others}`>
|
|
25
25
|
| (string & {});
|
|
26
26
|
|
|
27
|
-
type ContentType =
|
|
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
|
package/src/@types/index.ts
CHANGED
|
@@ -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
|
};
|
package/src/client/api/login.ts
CHANGED
|
@@ -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
|
-
|
|
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
|