@amityco/ts-sdk 7.6.1-2841ad2c.0 → 7.6.1-63bd9d56.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/core/events.d.ts +1 -6
- package/dist/@types/core/events.d.ts.map +1 -1
- package/dist/@types/core/payload.d.ts +1 -26
- package/dist/@types/core/payload.d.ts.map +1 -1
- package/dist/@types/domains/channel.d.ts +0 -6
- package/dist/@types/domains/channel.d.ts.map +1 -1
- package/dist/@types/domains/content.d.ts +8 -2
- package/dist/@types/domains/content.d.ts.map +1 -1
- package/dist/@types/domains/feed.d.ts +6 -1
- package/dist/@types/domains/feed.d.ts.map +1 -1
- package/dist/@types/domains/file.d.ts +3 -1
- package/dist/@types/domains/file.d.ts.map +1 -1
- package/dist/@types/domains/post.d.ts +3 -3
- package/dist/@types/domains/post.d.ts.map +1 -1
- package/dist/@types/domains/stream.d.ts +1 -9
- package/dist/@types/domains/stream.d.ts.map +1 -1
- package/dist/@types/index.d.ts +0 -1
- package/dist/@types/index.d.ts.map +1 -1
- package/dist/channelRepository/api/createChannel.d.ts +1 -3
- package/dist/channelRepository/api/createChannel.d.ts.map +1 -1
- package/dist/channelRepository/channelMembership/observers/getMembers/ChannelMemberLiveCollectionController.d.ts.map +1 -1
- package/dist/channelRepository/events/index.d.ts +1 -1
- package/dist/channelRepository/events/index.d.ts.map +1 -1
- package/dist/channelRepository/events/onChannelMuted.d.ts +2 -0
- package/dist/channelRepository/events/onChannelMuted.d.ts.map +1 -0
- package/dist/channelRepository/internalApi/getChannel.d.ts.map +1 -1
- package/dist/channelRepository/observers/getChannels/ChannelLiveCollectionController.d.ts.map +1 -1
- package/dist/client/api/login.d.ts.map +1 -1
- package/dist/communityRepository/api/getCommunity.d.ts +1 -1
- package/dist/communityRepository/api/getCommunity.d.ts.map +1 -1
- package/dist/core/events.d.ts +3 -3
- package/dist/core/events.d.ts.map +1 -1
- package/dist/core/model/index.d.ts.map +1 -1
- package/dist/core/subscription.d.ts +1 -2
- package/dist/core/subscription.d.ts.map +1 -1
- package/dist/feedRepository/api/index.d.ts +0 -1
- package/dist/feedRepository/api/index.d.ts.map +1 -1
- package/dist/feedRepository/api/queryGlobalFeed.d.ts +3 -0
- package/dist/feedRepository/api/queryGlobalFeed.d.ts.map +1 -1
- package/dist/feedRepository/index.d.ts +2 -1
- package/dist/feedRepository/index.d.ts.map +1 -1
- package/dist/feedRepository/observers/getCustomRankingGlobalFeed/LiveCollectionController.d.ts +13 -0
- package/dist/feedRepository/observers/getCustomRankingGlobalFeed/LiveCollectionController.d.ts.map +1 -0
- package/dist/feedRepository/observers/getCustomRankingGlobalFeed/PaginationController.d.ts +5 -0
- package/dist/feedRepository/observers/getCustomRankingGlobalFeed/PaginationController.d.ts.map +1 -0
- package/dist/feedRepository/observers/getCustomRankingGlobalFeed/QueryStreamController.d.ts +15 -0
- package/dist/feedRepository/observers/getCustomRankingGlobalFeed/QueryStreamController.d.ts.map +1 -0
- package/dist/feedRepository/observers/getCustomRankingGlobalFeed.d.ts +22 -0
- package/dist/feedRepository/observers/getCustomRankingGlobalFeed.d.ts.map +1 -0
- package/dist/feedRepository/observers/getGlobalFeed/LiveCollectionController.d.ts +13 -0
- package/dist/feedRepository/observers/getGlobalFeed/LiveCollectionController.d.ts.map +1 -0
- package/dist/feedRepository/observers/getGlobalFeed/PaginationController.d.ts +5 -0
- package/dist/feedRepository/observers/getGlobalFeed/PaginationController.d.ts.map +1 -0
- package/dist/feedRepository/observers/getGlobalFeed/QueryStreamController.d.ts +15 -0
- package/dist/feedRepository/observers/getGlobalFeed/QueryStreamController.d.ts.map +1 -0
- package/dist/feedRepository/observers/getGlobalFeed.d.ts +22 -0
- package/dist/feedRepository/observers/getGlobalFeed.d.ts.map +1 -0
- package/dist/feedRepository/observers/index.d.ts +3 -0
- package/dist/feedRepository/observers/index.d.ts.map +1 -0
- package/dist/feedRepository/observers/utils.d.ts +6 -0
- package/dist/feedRepository/observers/utils.d.ts.map +1 -0
- package/dist/fileRepository/api/index.d.ts +1 -0
- package/dist/fileRepository/api/index.d.ts.map +1 -1
- package/dist/fileRepository/api/uploadClip.d.ts +17 -0
- package/dist/fileRepository/api/uploadClip.d.ts.map +1 -0
- package/dist/index.cjs.js +7215 -7438
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +7289 -7510
- package/dist/index.umd.js +3 -3
- package/dist/liveStreamPlayer/utils/eventRegister.d.ts +1 -2
- package/dist/liveStreamPlayer/utils/eventRegister.d.ts.map +1 -1
- package/dist/messagePreview/utils/getChannelMessagePreviewWithUser.d.ts +0 -4
- package/dist/messagePreview/utils/getChannelMessagePreviewWithUser.d.ts.map +1 -1
- package/dist/messagePreview/utils/getSubChannelMessagePreviewWithUser.d.ts +1 -1
- package/dist/messageRepository/api/deleteMessage.d.ts.map +1 -1
- package/dist/messageRepository/observers/getMessage.d.ts.map +1 -1
- package/dist/messageRepository/observers/getMessages/MessageLiveCollectionController.d.ts.map +1 -1
- package/dist/messageRepository/observers/getMessages/MessageQueryStreamController.d.ts.map +1 -1
- package/dist/postRepository/api/createClipPost.d.ts +32 -0
- package/dist/postRepository/api/createClipPost.d.ts.map +1 -0
- package/dist/postRepository/api/createPost.d.ts.map +1 -1
- package/dist/postRepository/api/index.d.ts +1 -0
- package/dist/postRepository/api/index.d.ts.map +1 -1
- package/dist/postRepository/events/utils.d.ts.map +1 -1
- package/dist/postRepository/observers/getGlobalPinnedPosts/GlobalPinnedPostLiveCollectionController.d.ts.map +1 -1
- package/dist/postRepository/observers/getPinnedPosts/PinnedPostLiveCollectionController.d.ts.map +1 -1
- package/dist/postRepository/observers/getPinnedPosts/PinnedPostQueryStreamController.d.ts +6 -0
- package/dist/postRepository/observers/getPinnedPosts/PinnedPostQueryStreamController.d.ts.map +1 -1
- package/dist/postRepository/observers/getPosts/PostLiveCollectionController.d.ts.map +1 -1
- package/dist/postRepository/observers/utils.d.ts +13 -0
- package/dist/postRepository/observers/utils.d.ts.map +1 -0
- package/dist/postRepository/utils/payload.d.ts.map +1 -1
- package/dist/reactionRepository/api/addReaction.d.ts.map +1 -1
- package/dist/reactionRepository/api/removeReaction.d.ts.map +1 -1
- package/dist/streamRepository/api/createStream.d.ts +1 -1
- package/dist/streamRepository/api/createStream.d.ts.map +1 -1
- package/dist/streamRepository/api/index.d.ts +0 -1
- package/dist/streamRepository/api/index.d.ts.map +1 -1
- package/dist/streamRepository/api/updateStream.d.ts +1 -4
- package/dist/streamRepository/api/updateStream.d.ts.map +1 -1
- package/dist/streamRepository/events/index.d.ts +0 -2
- package/dist/streamRepository/events/index.d.ts.map +1 -1
- package/dist/streamRepository/internalApi/getStream.d.ts +2 -2
- package/dist/streamRepository/internalApi/getStream.d.ts.map +1 -1
- package/dist/streamRepository/observers/getStreamById.d.ts.map +1 -1
- package/dist/streamRepository/observers/getStreams/GetStreamsLiveCollectionController.d.ts.map +1 -1
- package/dist/utils/linkedObject/channelLinkedObject.d.ts.map +1 -1
- package/dist/utils/linkedObject/postLinkedObject.d.ts.map +1 -1
- package/dist/utils/linkedObject/streamLinkedObject.d.ts.map +1 -1
- package/dist/utils/postTypePredicate.d.ts +4 -5
- package/dist/utils/postTypePredicate.d.ts.map +1 -1
- package/dist/utils/tests/dummy/comment.d.ts +1 -1
- package/package.json +1 -1
- package/src/@types/core/events.ts +1 -10
- package/src/@types/core/payload.ts +1 -33
- package/src/@types/domains/channel.ts +0 -9
- package/src/@types/domains/content.ts +10 -0
- package/src/@types/domains/feed.ts +18 -1
- package/src/@types/domains/file.ts +5 -0
- package/src/@types/domains/post.ts +4 -4
- package/src/@types/domains/stream.ts +1 -13
- package/src/@types/index.ts +0 -1
- package/src/channelRepository/api/createChannel.ts +8 -11
- package/src/channelRepository/channelMembership/observers/getMembers/ChannelMemberLiveCollectionController.ts +0 -2
- package/src/channelRepository/events/index.ts +1 -1
- package/src/channelRepository/events/onChannelMuted.ts +39 -0
- package/src/channelRepository/internalApi/getChannel.ts +1 -0
- package/src/channelRepository/observers/getChannel.ts +2 -2
- package/src/channelRepository/observers/getChannels/ChannelLiveCollectionController.ts +2 -2
- package/src/channelRepository/utils/constructChannelObject.ts +2 -2
- package/src/client/api/login.ts +0 -2
- package/src/commentRepository/api/deleteComment.ts +6 -6
- package/src/communityRepository/api/getCommunity.ts +0 -9
- package/src/core/events.ts +1 -4
- package/src/core/model/index.ts +2 -1
- package/src/core/subscription.ts +6 -10
- package/src/feedRepository/api/index.ts +0 -1
- package/src/feedRepository/api/queryGlobalFeed.ts +6 -1
- package/src/feedRepository/index.ts +2 -1
- package/src/feedRepository/observers/getCustomRankingGlobalFeed/LiveCollectionController.ts +95 -0
- package/src/feedRepository/observers/getCustomRankingGlobalFeed/PaginationController.ts +25 -0
- package/src/feedRepository/observers/getCustomRankingGlobalFeed/QueryStreamController.ts +101 -0
- package/src/feedRepository/observers/getCustomRankingGlobalFeed.ts +56 -0
- package/src/feedRepository/observers/getGlobalFeed/LiveCollectionController.ts +91 -0
- package/src/feedRepository/observers/getGlobalFeed/PaginationController.ts +23 -0
- package/src/feedRepository/observers/getGlobalFeed/QueryStreamController.ts +99 -0
- package/src/feedRepository/observers/getGlobalFeed.ts +56 -0
- package/src/feedRepository/observers/index.ts +2 -0
- package/src/feedRepository/observers/utils.ts +85 -0
- package/src/fileRepository/api/index.ts +1 -0
- package/src/fileRepository/api/uploadClip.ts +71 -0
- package/src/index.ts +0 -2
- package/src/liveStreamPlayer/api/getPlayer.ts +1 -1
- package/src/liveStreamPlayer/utils/eventRegister.ts +1 -16
- package/src/messageRepository/api/deleteMessage.ts +0 -16
- package/src/messageRepository/observers/getMessage.ts +0 -2
- package/src/messageRepository/observers/getMessages/MessageLiveCollectionController.ts +0 -2
- package/src/messageRepository/observers/getMessages/MessageQueryStreamController.ts +0 -13
- package/src/postRepository/api/createClipPost.ts +62 -0
- package/src/postRepository/api/createPost.ts +2 -3
- package/src/postRepository/api/index.ts +2 -0
- package/src/postRepository/api/queryPosts.ts +1 -1
- package/src/postRepository/events/utils.ts +35 -1
- package/src/postRepository/observers/getGlobalPinnedPosts/GlobalPinnedPostLiveCollectionController.ts +5 -0
- package/src/postRepository/observers/getPinnedPosts/PinnedPostLiveCollectionController.ts +7 -1
- package/src/postRepository/observers/getPinnedPosts/PinnedPostQueryStreamController.ts +27 -0
- package/src/postRepository/observers/getPosts/PostLiveCollectionController.ts +2 -74
- package/src/postRepository/observers/getPosts/PostPaginationController.ts +1 -1
- package/src/postRepository/observers/utils.ts +97 -0
- package/src/postRepository/utils/payload.ts +1 -37
- package/src/reactionRepository/api/addReaction.ts +1 -0
- package/src/reactionRepository/api/removeReaction.ts +1 -0
- package/src/streamRepository/api/createStream.ts +1 -4
- package/src/streamRepository/api/index.ts +0 -1
- package/src/streamRepository/api/updateStream.ts +1 -8
- package/src/streamRepository/events/index.ts +0 -2
- package/src/streamRepository/internalApi/getStream.ts +3 -3
- package/src/streamRepository/observers/getStreamById.ts +0 -2
- package/src/streamRepository/observers/getStreams/GetStreamsLiveCollectionController.ts +1 -5
- package/src/utils/linkedObject/channelLinkedObject.ts +0 -3
- package/src/utils/linkedObject/postLinkedObject.ts +8 -28
- package/src/utils/linkedObject/streamLinkedObject.ts +0 -4
- package/src/utils/postTypePredicate.ts +6 -20
- package/dist/@types/domains/liveReaction.d.ts +0 -20
- package/dist/@types/domains/liveReaction.d.ts.map +0 -1
- package/dist/channelRepository/events/onChannelSetMuted.d.ts +0 -2
- package/dist/channelRepository/events/onChannelSetMuted.d.ts.map +0 -1
- package/dist/channelRepository/events/onChannelSetUserMuted.d.ts +0 -2
- package/dist/channelRepository/events/onChannelSetUserMuted.d.ts.map +0 -1
- package/dist/channelRepository/internalApi/getMyMembership.d.ts +0 -11
- package/dist/channelRepository/internalApi/getMyMembership.d.ts.map +0 -1
- package/dist/channelRepository/observers/getMyMembership.d.ts +0 -2
- package/dist/channelRepository/observers/getMyMembership.d.ts.map +0 -1
- package/dist/feedRepository/api/getCustomRankingGlobalFeed.d.ts +0 -37
- package/dist/feedRepository/api/getCustomRankingGlobalFeed.d.ts.map +0 -1
- package/dist/liveReactionRepository/api/createReaction.d.ts +0 -20
- package/dist/liveReactionRepository/api/createReaction.d.ts.map +0 -1
- package/dist/liveReactionRepository/api/index.d.ts +0 -2
- package/dist/liveReactionRepository/api/index.d.ts.map +0 -1
- package/dist/liveReactionRepository/events/index.d.ts +0 -2
- package/dist/liveReactionRepository/events/index.d.ts.map +0 -1
- package/dist/liveReactionRepository/events/onLiveReactionCreated.d.ts +0 -17
- package/dist/liveReactionRepository/events/onLiveReactionCreated.d.ts.map +0 -1
- package/dist/liveReactionRepository/events/onLiveReactionCreatedLocal.d.ts +0 -17
- package/dist/liveReactionRepository/events/onLiveReactionCreatedLocal.d.ts.map +0 -1
- package/dist/liveReactionRepository/index.d.ts +0 -4
- package/dist/liveReactionRepository/index.d.ts.map +0 -1
- package/dist/liveReactionRepository/internalApi/createLiveReaction.d.ts +0 -20
- package/dist/liveReactionRepository/internalApi/createLiveReaction.d.ts.map +0 -1
- package/dist/liveReactionRepository/observers/getReactions.d.ts +0 -19
- package/dist/liveReactionRepository/observers/getReactions.d.ts.map +0 -1
- package/dist/liveReactionRepository/observers/index.d.ts +0 -2
- package/dist/liveReactionRepository/observers/index.d.ts.map +0 -1
- package/dist/liveReactionRepository/service/ReactionSyncEngine.d.ts +0 -26
- package/dist/liveReactionRepository/service/ReactionSyncEngine.d.ts.map +0 -1
- package/dist/liveReactionRepository/utils/ReactionSyncEngineOnLoginHandler.d.ts +0 -3
- package/dist/liveReactionRepository/utils/ReactionSyncEngineOnLoginHandler.d.ts.map +0 -1
- package/dist/streamRepository/api/editStream.d.ts +0 -18
- package/dist/streamRepository/api/editStream.d.ts.map +0 -1
- package/dist/streamRepository/events/onStreamViewerBanned.d.ts +0 -17
- package/dist/streamRepository/events/onStreamViewerBanned.d.ts.map +0 -1
- package/dist/streamRepository/events/onStreamViewerUnbanned.d.ts +0 -17
- package/dist/streamRepository/events/onStreamViewerUnbanned.d.ts.map +0 -1
- package/dist/streamRepository/internalApi/getLiveChat.d.ts +0 -16
- package/dist/streamRepository/internalApi/getLiveChat.d.ts.map +0 -1
- package/src/@types/domains/liveReaction.ts +0 -25
- package/src/channelRepository/events/onChannelSetMuted.ts +0 -48
- package/src/channelRepository/events/onChannelSetUserMuted.ts +0 -65
- package/src/channelRepository/internalApi/getMyMembership.ts +0 -37
- package/src/channelRepository/observers/getMyMembership.ts +0 -98
- package/src/feedRepository/api/getCustomRankingGlobalFeed.ts +0 -115
- package/src/liveReactionRepository/api/createReaction.ts +0 -58
- package/src/liveReactionRepository/api/index.ts +0 -1
- package/src/liveReactionRepository/events/index.ts +0 -1
- package/src/liveReactionRepository/events/onLiveReactionCreated.ts +0 -37
- package/src/liveReactionRepository/events/onLiveReactionCreatedLocal.ts +0 -29
- package/src/liveReactionRepository/index.ts +0 -3
- package/src/liveReactionRepository/internalApi/createLiveReaction.ts +0 -42
- package/src/liveReactionRepository/observers/getReactions.ts +0 -59
- package/src/liveReactionRepository/observers/index.ts +0 -1
- package/src/liveReactionRepository/service/ReactionSyncEngine.ts +0 -138
- package/src/liveReactionRepository/utils/ReactionSyncEngineOnLoginHandler.ts +0 -19
- package/src/streamRepository/api/editStream.ts +0 -51
- package/src/streamRepository/events/onStreamViewerBanned.ts +0 -58
- package/src/streamRepository/events/onStreamViewerUnbanned.ts +0 -47
- package/src/streamRepository/internalApi/getLiveChat.ts +0 -59
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export function isAmityImagePost(post
|
|
1
|
+
export function isAmityImagePost(post: Amity.InternalPost): post is Amity.Post<'image'> {
|
|
2
2
|
return !!(
|
|
3
|
-
post &&
|
|
4
3
|
post.data &&
|
|
5
4
|
typeof post.data !== 'string' &&
|
|
6
5
|
'fileId' in post.data &&
|
|
@@ -8,9 +7,8 @@ export function isAmityImagePost(post?: Amity.InternalPost): post is Amity.Post<
|
|
|
8
7
|
);
|
|
9
8
|
}
|
|
10
9
|
|
|
11
|
-
export function isAmityFilePost(post
|
|
10
|
+
export function isAmityFilePost(post: Amity.InternalPost): post is Amity.Post<'file'> {
|
|
12
11
|
return !!(
|
|
13
|
-
post &&
|
|
14
12
|
post.data &&
|
|
15
13
|
typeof post.data !== 'string' &&
|
|
16
14
|
'fileId' in post.data &&
|
|
@@ -18,9 +16,8 @@ export function isAmityFilePost(post?: Amity.InternalPost): post is Amity.Post<'
|
|
|
18
16
|
);
|
|
19
17
|
}
|
|
20
18
|
|
|
21
|
-
export function isAmityVideoPost(post
|
|
19
|
+
export function isAmityVideoPost(post: Amity.InternalPost): post is Amity.Post<'video'> {
|
|
22
20
|
return !!(
|
|
23
|
-
post &&
|
|
24
21
|
post.data &&
|
|
25
22
|
typeof post.data !== 'string' &&
|
|
26
23
|
'videoFileId' in post.data &&
|
|
@@ -29,22 +26,11 @@ export function isAmityVideoPost(post?: Amity.InternalPost): post is Amity.Post<
|
|
|
29
26
|
);
|
|
30
27
|
}
|
|
31
28
|
|
|
32
|
-
export function
|
|
29
|
+
export function isAmityClipPost(post: Amity.InternalPost): post is Amity.Post<'clip'> {
|
|
33
30
|
return !!(
|
|
34
|
-
post &&
|
|
35
31
|
post.data &&
|
|
36
32
|
typeof post.data !== 'string' &&
|
|
37
|
-
'
|
|
38
|
-
post.dataType === '
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export function isAmityPollPost(post?: Amity.InternalPost): post is Amity.Post<'poll'> {
|
|
43
|
-
return !!(
|
|
44
|
-
post &&
|
|
45
|
-
post.data &&
|
|
46
|
-
typeof post.data !== 'string' &&
|
|
47
|
-
'pollId' in post.data &&
|
|
48
|
-
post.dataType === 'poll'
|
|
33
|
+
'fileId' in post.data &&
|
|
34
|
+
post.dataType === 'clip'
|
|
49
35
|
);
|
|
50
36
|
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
declare global {
|
|
3
|
-
namespace Amity {
|
|
4
|
-
type RawLiveReaction = {
|
|
5
|
-
userId: string;
|
|
6
|
-
referenceId: string;
|
|
7
|
-
referencePublicId: string;
|
|
8
|
-
referenceType: string;
|
|
9
|
-
reactionName: string;
|
|
10
|
-
occurredAt: string;
|
|
11
|
-
};
|
|
12
|
-
type InternalLiveReaction = RawLiveReaction;
|
|
13
|
-
type LiveReaction = InternalLiveReaction;
|
|
14
|
-
type CreateLiveReactionRequest = Omit<RawLiveReaction, 'userId' | 'referenceId' | 'occurredAt'>;
|
|
15
|
-
type CreateLiveReactionResponse = {
|
|
16
|
-
addedIds: string[];
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=liveReaction.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"liveReaction.d.ts","sourceRoot":"","sources":["../../../src/@types/domains/liveReaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC;AAEV,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,KAAK,CAAC;QACd,KAAK,eAAe,GAAG;YACrB,MAAM,EAAE,MAAM,CAAC;YACf,WAAW,EAAE,MAAM,CAAC;YACpB,iBAAiB,EAAE,MAAM,CAAC;YAC1B,aAAa,EAAE,MAAM,CAAC;YACtB,YAAY,EAAE,MAAM,CAAC;YAErB,UAAU,EAAE,MAAM,CAAC;SACpB,CAAC;QAEF,KAAK,oBAAoB,GAAG,eAAe,CAAC;QAE5C,KAAK,YAAY,GAAG,oBAAoB,CAAC;QAEzC,KAAK,yBAAyB,GAAG,IAAI,CAAC,eAAe,EAAE,QAAQ,GAAG,aAAa,GAAG,YAAY,CAAC,CAAC;QAEhG,KAAK,0BAA0B,GAAG;YAChC,QAAQ,EAAE,MAAM,EAAE,CAAC;SACpB,CAAC;KACH;CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"onChannelSetMuted.d.ts","sourceRoot":"","sources":["../../../src/channelRepository/events/onChannelSetMuted.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,iBAAiB,aAAc,MAAM,QAAQ,CAAC,MAAM,qBAAqB,CAAC,eA6BtF,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"onChannelSetUserMuted.d.ts","sourceRoot":"","sources":["../../../src/channelRepository/events/onChannelSetUserMuted.ts"],"names":[],"mappings":"AAsBA,eAAO,MAAM,qBAAqB,uBACZ,MAAM,qBAAqB,UAAU,MAAM,UAAU,CAAC,SAAS,CAAC,KAAK,IAAI,KAC5F,MAAM,YAwCR,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* get current user's membership data
|
|
4
|
-
*
|
|
5
|
-
* @returns the {@link Amity.Membership<'channel'>} objects
|
|
6
|
-
*
|
|
7
|
-
* @category Channel API
|
|
8
|
-
* @async
|
|
9
|
-
*/
|
|
10
|
-
export declare const getMyMembership: (channelId: string) => Amity.Cached<Amity.Membership<'channel'>>;
|
|
11
|
-
//# sourceMappingURL=getMyMembership.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getMyMembership.d.ts","sourceRoot":"","sources":["../../../src/channelRepository/internalApi/getMyMembership.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,eAAO,MAAM,eAAe,cAAe,MAAM,KAAG,MAAM,MAAM,CAAC,MAAM,UAAU,CAAC,SAAS,CAAC,CAsB3F,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getMyMembership.d.ts","sourceRoot":"","sources":["../../../src/channelRepository/observers/getMyMembership.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,eAAe,cACf,MAAM,YACP,MAAM,kBAAkB,CAAC,MAAM,UAAU,CAAC,SAAS,CAAC,GAAG,SAAS,CAAC,KAC1E,MAAM,YAgFR,CAAC"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ```js
|
|
3
|
-
* import { FeedRepository } from '@amityco/ts-sdk'
|
|
4
|
-
* const posts = await FeedRepository.getCustomRankingGlobalFeed()
|
|
5
|
-
* ```
|
|
6
|
-
*
|
|
7
|
-
* Queries a paginable list of {@link Amity.Post} objects
|
|
8
|
-
*
|
|
9
|
-
* @param query The query parameters
|
|
10
|
-
* @returns A page of {@link Amity.Post} objects
|
|
11
|
-
*
|
|
12
|
-
* @category Feed API
|
|
13
|
-
* @async
|
|
14
|
-
* */
|
|
15
|
-
export declare const getCustomRankingGlobalFeed: {
|
|
16
|
-
(query?: {
|
|
17
|
-
dataTypes?: ('video' | 'image' | 'file' | 'liveStream')[];
|
|
18
|
-
limit?: number;
|
|
19
|
-
queryToken?: string;
|
|
20
|
-
}): Promise<Omit<Amity.Cached<Amity.Paged<Amity.Post>> & Amity.Pagination, 'nextPage' | 'prevPage'>>;
|
|
21
|
-
/**
|
|
22
|
-
* ```js
|
|
23
|
-
* import { FeedRepository } from '@amityco/ts-sdk'
|
|
24
|
-
* const posts = await FeedRepository.getCustomRankingGlobalFeed.locally()
|
|
25
|
-
* ```
|
|
26
|
-
*
|
|
27
|
-
* Queries a paginable list of {@link Amity.Post} objects from cache
|
|
28
|
-
*
|
|
29
|
-
* @param query The query parameters
|
|
30
|
-
* @returns A page of {@link Amity.Post} objects
|
|
31
|
-
*
|
|
32
|
-
* @category Feed API
|
|
33
|
-
* @async
|
|
34
|
-
* */
|
|
35
|
-
locally(query?: Parameters<typeof getCustomRankingGlobalFeed>[0]): Omit<Amity.Cached<Amity.Paged<Amity.Post>> & Amity.Pagination, 'nextPage' | 'prevPage'> | undefined;
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=getCustomRankingGlobalFeed.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getCustomRankingGlobalFeed.d.ts","sourceRoot":"","sources":["../../../src/feedRepository/api/getCustomRankingGlobalFeed.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;KAaK;AACL,eAAO,MAAM,0BAA0B;aAAkB;QACvD,SAAS,CAAC,EAAE,CAAC,OAAO,GAAG,OAAO,GAAG,MAAM,GAAG,YAAY,CAAC,EAAE,CAAC;QAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,GAAG,QACF,KAAK,MAAM,MAAM,CAAC,MAAM,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,MAAM,UAAU,EAAE,UAAU,GAAG,UAAU,CAAC,CACxF;IAyCD;;;;;;;;;;;;;SAaK;oBAEK,WAAW,iCAAiC,CAAC,CAAC,CAAC,CAAC,GAEtD,KAAK,MAAM,MAAM,CAAC,MAAM,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,MAAM,UAAU,EAAE,UAAU,GAAG,UAAU,CAAC,GACvF,SAAS;CArBZ,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ```js
|
|
3
|
-
* import { acceptInvitation } from '@amityco/ts-sdk'
|
|
4
|
-
* const isAccepted = await acceptInvitation(invitationId)
|
|
5
|
-
* ```
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* @param referenceId that is target post's ID linked with a livestream
|
|
9
|
-
* @param reactionName that is the reaction name
|
|
10
|
-
* @param streamId stream id
|
|
11
|
-
* @returns a success boolean if the reaction was added
|
|
12
|
-
*
|
|
13
|
-
* @category Live Reaction API
|
|
14
|
-
* @async
|
|
15
|
-
*/
|
|
16
|
-
export declare const createReaction: ({ referenceId, referenceType, reactionName, streamId, }: Pick<Amity.CreateLiveReactionRequest, "referenceType" | "reactionName"> & {
|
|
17
|
-
referenceId: string;
|
|
18
|
-
streamId: string;
|
|
19
|
-
}) => Promise<boolean>;
|
|
20
|
-
//# sourceMappingURL=createReaction.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createReaction.d.ts","sourceRoot":"","sources":["../../../src/liveReactionRepository/api/createReaction.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,cAAc;iBAMZ,MAAM;cACT,MAAM;MACd,QAAQ,OAAO,CAyBlB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/liveReactionRepository/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/liveReactionRepository/events/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ```js
|
|
3
|
-
* import { onLiveReactionCreated } from '@amityco/ts-sdk'
|
|
4
|
-
* const dispose = onLiveReactionCreated(reactions => {
|
|
5
|
-
* // ...
|
|
6
|
-
* })
|
|
7
|
-
* ```
|
|
8
|
-
*
|
|
9
|
-
* Fired when a batch of {@link Amity.LiveReaction} has been created
|
|
10
|
-
*
|
|
11
|
-
* @param callback The function to call when the event was fired
|
|
12
|
-
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
13
|
-
*
|
|
14
|
-
* @category Live Reaction Events
|
|
15
|
-
*/
|
|
16
|
-
export declare const onLiveReactionCreated: (callback: Amity.Listener<Amity.LiveReaction[]>) => Amity.Unsubscriber;
|
|
17
|
-
//# sourceMappingURL=onLiveReactionCreated.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"onLiveReactionCreated.d.ts","sourceRoot":"","sources":["../../../src/liveReactionRepository/events/onLiveReactionCreated.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,qBAAqB,aACtB,MAAM,QAAQ,CAAC,MAAM,YAAY,EAAE,CAAC,KAC7C,MAAM,YAiBR,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ```js
|
|
3
|
-
* import { onLiveReactionCreatedLocal } from '@amityco/ts-sdk'
|
|
4
|
-
* const dispose = onLiveReactionCreatedLocal(reactions => {
|
|
5
|
-
* // ...
|
|
6
|
-
* })
|
|
7
|
-
* ```
|
|
8
|
-
*
|
|
9
|
-
* Fired when a batch of {@link Amity.LiveReaction} has been created
|
|
10
|
-
*
|
|
11
|
-
* @param callback The function to call when the event was fired
|
|
12
|
-
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
13
|
-
*
|
|
14
|
-
* @category Live Reaction Events
|
|
15
|
-
*/
|
|
16
|
-
export declare const onLiveReactionCreatedLocal: (callback: Amity.Listener<Amity.LiveReaction[]>) => Amity.Unsubscriber;
|
|
17
|
-
//# sourceMappingURL=onLiveReactionCreatedLocal.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"onLiveReactionCreatedLocal.d.ts","sourceRoot":"","sources":["../../../src/liveReactionRepository/events/onLiveReactionCreatedLocal.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,0BAA0B,aAC3B,MAAM,QAAQ,CAAC,MAAM,YAAY,EAAE,CAAC,KAC7C,MAAM,YASR,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/liveReactionRepository/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ```js
|
|
3
|
-
* import { acceptInvitation } from '@amityco/ts-sdk'
|
|
4
|
-
* const isAccepted = await acceptInvitation(invitationId)
|
|
5
|
-
* ```
|
|
6
|
-
*
|
|
7
|
-
* Accepts array of {@link Amity.LiveReaction} object without userId
|
|
8
|
-
*
|
|
9
|
-
* @param reactions the array of {@link Amity.LiveReaction} to create
|
|
10
|
-
// TODO: confirm what is the ids in addedIds
|
|
11
|
-
* @returns An object addedIds contains array of reaction ID
|
|
12
|
-
*
|
|
13
|
-
* @category Live Reaction API
|
|
14
|
-
* @async
|
|
15
|
-
*/
|
|
16
|
-
export declare const createLiveReaction: ({ reactions, liveStreamId, }: {
|
|
17
|
-
reactions: Amity.CreateLiveReactionRequest[];
|
|
18
|
-
liveStreamId: string;
|
|
19
|
-
}) => Promise<Amity.CreateLiveReactionResponse>;
|
|
20
|
-
//# sourceMappingURL=createLiveReaction.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createLiveReaction.d.ts","sourceRoot":"","sources":["../../../src/liveReactionRepository/internalApi/createLiveReaction.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,kBAAkB;eAIlB,MAAM,yBAAyB,EAAE;kBAC9B,MAAM;MAClB,QAAQ,MAAM,0BAA0B,CAc3C,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* ```js
|
|
4
|
-
* import { getReactions } from '@amityco/ts-sdk';
|
|
5
|
-
*
|
|
6
|
-
* const unsubscribe = getReactions(response => {
|
|
7
|
-
* reactions = response.data
|
|
8
|
-
* });
|
|
9
|
-
* ```
|
|
10
|
-
*
|
|
11
|
-
* Observe live reactions {@link_Amity.LiveReaction} that have been created in a post linked with a stream
|
|
12
|
-
*
|
|
13
|
-
* @param callback the function to call when new data are available
|
|
14
|
-
* @returns An {@link Amity.Unsubscriber} function to run when willing to stop observing the events
|
|
15
|
-
*
|
|
16
|
-
* @category Live Reaction Observable
|
|
17
|
-
*/
|
|
18
|
-
export declare const getReactions: (postId: string, callback: Amity.Listener<Amity.LiveReaction[]>) => Amity.Unsubscriber;
|
|
19
|
-
//# sourceMappingURL=getReactions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getReactions.d.ts","sourceRoot":"","sources":["../../../src/liveReactionRepository/observers/getReactions.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;GAgBG;AAEH,eAAO,MAAM,YAAY,WACf,MAAM,YACJ,MAAM,QAAQ,CAAC,MAAM,YAAY,EAAE,CAAC,KAC7C,MAAM,YAgCR,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/liveReactionRepository/observers/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
declare class LiveReactionSyncEngine {
|
|
2
|
-
private readonly TIMER_INTERVAL_MS;
|
|
3
|
-
private buffer;
|
|
4
|
-
private timer;
|
|
5
|
-
private isSyncing;
|
|
6
|
-
private connectionListener;
|
|
7
|
-
private isConnected;
|
|
8
|
-
constructor();
|
|
9
|
-
startReactionsSync(): void;
|
|
10
|
-
stopReactionsSync(): void;
|
|
11
|
-
createLiveReaction(liveReaction: Amity.CreateLiveReactionRequest & {
|
|
12
|
-
streamId: string;
|
|
13
|
-
}): void;
|
|
14
|
-
private addConnectionListener;
|
|
15
|
-
private removeConnectionListener;
|
|
16
|
-
private syncLiveReactions;
|
|
17
|
-
private clearBuffer;
|
|
18
|
-
onSessionEstablished(): void;
|
|
19
|
-
onSessionDestroyed(): void;
|
|
20
|
-
onTokenExpired(): void;
|
|
21
|
-
}
|
|
22
|
-
declare const _default: {
|
|
23
|
-
getInstance: () => LiveReactionSyncEngine;
|
|
24
|
-
};
|
|
25
|
-
export default _default;
|
|
26
|
-
//# sourceMappingURL=ReactionSyncEngine.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReactionSyncEngine.d.ts","sourceRoot":"","sources":["../../../src/liveReactionRepository/service/ReactionSyncEngine.ts"],"names":[],"mappings":"AAKA,cAAM,sBAAsB;IAC1B,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAc;IAEhD,OAAO,CAAC,MAAM,CAAkE;IAEhF,OAAO,CAAC,KAAK,CAA2B;IAExC,OAAO,CAAC,SAAS,CAAS;IAE1B,OAAO,CAAC,kBAAkB,CAAsB;IAEhD,OAAO,CAAC,WAAW,CAAQ;;IAM3B,kBAAkB;IAQlB,iBAAiB;IAOjB,kBAAkB,CAAC,YAAY,EAAE,KAAK,CAAC,yBAAyB,GAAG;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE;IAIvF,OAAO,CAAC,qBAAqB;IAe7B,OAAO,CAAC,wBAAwB;IAOhC,OAAO,CAAC,iBAAiB;IAoCzB,OAAO,CAAC,WAAW;IAKnB,oBAAoB;IAKpB,kBAAkB;IAclB,cAAc;CAGf;;;;AAID,wBAOE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReactionSyncEngineOnLoginHandler.d.ts","sourceRoot":"","sources":["../../../src/liveReactionRepository/utils/ReactionSyncEngineOnLoginHandler.ts"],"names":[],"mappings":";AAGA,wBAeE"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* ```js
|
|
4
|
-
* import { StreamRepository } from '@amityco/ts-sdk'
|
|
5
|
-
* const updated = await StreamRepository.editStream(streamId, { title: 'foobar' })
|
|
6
|
-
* ```
|
|
7
|
-
*
|
|
8
|
-
* Updates an {@link Amity.Stream}
|
|
9
|
-
*
|
|
10
|
-
* @param streamId The ID of the {@link Amity.Stream} to edit
|
|
11
|
-
* @param patch The patch data to apply
|
|
12
|
-
* @returns the updated {@link Amity.Stream} object
|
|
13
|
-
*
|
|
14
|
-
* @category Stream API
|
|
15
|
-
* @async
|
|
16
|
-
*/
|
|
17
|
-
export declare const editStream: (streamId: Amity.Stream['streamId'], patch: Patch<Amity.Stream, 'title' | 'thumbnailFileId' | 'description' | 'metadata' | 'channelEnabled'>) => Promise<Amity.Cached<Amity.Stream>>;
|
|
18
|
-
//# sourceMappingURL=editStream.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"editStream.d.ts","sourceRoot":"","sources":["../../../src/streamRepository/api/editStream.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;GAeG;AAEH,eAAO,MAAM,UAAU,aACX,MAAM,MAAM,CAAC,UAAU,CAAC,SAC3B,MACL,MAAM,MAAM,EACZ,OAAO,GAAG,iBAAiB,GAAG,aAAa,GAAG,UAAU,GAAG,gBAAgB,CAC5E,KACA,QAAQ,MAAM,MAAM,CAAC,MAAM,MAAM,CAAC,CAkBpC,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ```js
|
|
3
|
-
* import { onStreamViewerBanned } from '@amityco/ts-sdk'
|
|
4
|
-
* const dispose = onStreamViewerBanned(stream => {
|
|
5
|
-
* // ...
|
|
6
|
-
* })
|
|
7
|
-
* ```
|
|
8
|
-
*
|
|
9
|
-
* Fired when a user in channel linked to stream has been banned
|
|
10
|
-
*
|
|
11
|
-
* @param callback The function to call when the event was fired
|
|
12
|
-
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
13
|
-
*
|
|
14
|
-
* @category Stream Events
|
|
15
|
-
*/
|
|
16
|
-
export declare const onStreamViewerBanned: (callback: Amity.Listener<Amity.InternalStream>) => Amity.Unsubscriber;
|
|
17
|
-
//# sourceMappingURL=onStreamViewerBanned.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"onStreamViewerBanned.d.ts","sourceRoot":"","sources":["../../../src/streamRepository/events/onStreamViewerBanned.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,oBAAoB,aACrB,MAAM,QAAQ,CAAC,MAAM,cAAc,CAAC,KAC7C,MAAM,YAoCR,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ```js
|
|
3
|
-
* import { onStreamViewerUnbanned } from '@amityco/ts-sdk'
|
|
4
|
-
* const dispose = onStreamViewerBanned(stream => {
|
|
5
|
-
* // ...
|
|
6
|
-
* })
|
|
7
|
-
* ```
|
|
8
|
-
*
|
|
9
|
-
* Fired when a user in channel linked to stream has been unbanned
|
|
10
|
-
*
|
|
11
|
-
* @param callback The function to call when the event was fired
|
|
12
|
-
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
13
|
-
*
|
|
14
|
-
* @category Stream Events
|
|
15
|
-
*/
|
|
16
|
-
export declare const onStreamViewerUnbanned: (callback: Amity.Listener<Amity.InternalStream>) => Amity.Unsubscriber;
|
|
17
|
-
//# sourceMappingURL=onStreamViewerUnbanned.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"onStreamViewerUnbanned.d.ts","sourceRoot":"","sources":["../../../src/streamRepository/events/onStreamViewerUnbanned.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,sBAAsB,aACvB,MAAM,QAAQ,CAAC,MAAM,cAAc,CAAC,KAC7C,MAAM,YAwBR,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ```js
|
|
3
|
-
* import { getStream } from '@amityco/ts-sdk'
|
|
4
|
-
* const stream = await getStream('foobar')
|
|
5
|
-
* ```
|
|
6
|
-
*
|
|
7
|
-
* Fetches a {@link Amity.Channel} object linked with a current stream
|
|
8
|
-
*
|
|
9
|
-
* @param stream {@link Amity.Stream} that has linked live channel
|
|
10
|
-
* @returns the associated {@link Amity.Channel<'live'>} object
|
|
11
|
-
*
|
|
12
|
-
* @category Stream API
|
|
13
|
-
* @async
|
|
14
|
-
*/
|
|
15
|
-
export declare const getLiveChat: (stream: Amity.InternalStream) => Promise<Amity.Channel<'live'> | undefined>;
|
|
16
|
-
//# sourceMappingURL=getLiveChat.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getLiveChat.d.ts","sourceRoot":"","sources":["../../../src/streamRepository/internalApi/getLiveChat.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,WAAW,WACd,MAAM,cAAc,KAC3B,QAAQ,MAAM,OAAO,CAAC,MAAM,CAAC,GAAG,SAAS,CAkC3C,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
|
|
3
|
-
declare global {
|
|
4
|
-
namespace Amity {
|
|
5
|
-
type RawLiveReaction = {
|
|
6
|
-
userId: string; // user's public ID
|
|
7
|
-
referenceId: string; // post's internal ID
|
|
8
|
-
referencePublicId: string; // post's public ID
|
|
9
|
-
referenceType: string; // 'post'
|
|
10
|
-
reactionName: string; // 'love
|
|
11
|
-
// date string in ISO format
|
|
12
|
-
occurredAt: string;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
type InternalLiveReaction = RawLiveReaction;
|
|
16
|
-
|
|
17
|
-
type LiveReaction = InternalLiveReaction;
|
|
18
|
-
|
|
19
|
-
type CreateLiveReactionRequest = Omit<RawLiveReaction, 'userId' | 'referenceId' | 'occurredAt'>;
|
|
20
|
-
|
|
21
|
-
type CreateLiveReactionResponse = {
|
|
22
|
-
addedIds: string[];
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { getActiveClient } from '~/client/api/activeClient';
|
|
2
|
-
import { createEventSubscriber } from '~/core/events';
|
|
3
|
-
import { pullFromCache, upsertInCache } from '~/cache/api';
|
|
4
|
-
|
|
5
|
-
type CallbackFn = Amity.Listener<Amity.StaticInternalChannel>;
|
|
6
|
-
const callbacks: CallbackFn[] = [];
|
|
7
|
-
let mainDisposer: (() => void) | null = null;
|
|
8
|
-
|
|
9
|
-
const dispose = (cb: CallbackFn) => {
|
|
10
|
-
const index = callbacks.indexOf(cb);
|
|
11
|
-
if (index > -1) {
|
|
12
|
-
callbacks.splice(index, 1);
|
|
13
|
-
}
|
|
14
|
-
if (callbacks.length === 0) {
|
|
15
|
-
mainDisposer?.();
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const onChannelSetMuted = (callback: Amity.Listener<Amity.StaticInternalChannel>) => {
|
|
20
|
-
if (callbacks.length === 0) {
|
|
21
|
-
const client = getActiveClient();
|
|
22
|
-
|
|
23
|
-
const filter = async (payloads: Amity.ChannelSetMutedPayload) => {
|
|
24
|
-
payloads.forEach(payload => {
|
|
25
|
-
upsertInCache(['channel', 'get', payload.channelId], {
|
|
26
|
-
// If muteTimeout > now => user is muted
|
|
27
|
-
// Otherwise => user is unmuted
|
|
28
|
-
isMuted: Date.parse(payload.muteTimeout) > Date.now(),
|
|
29
|
-
});
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
const channel = pullFromCache<Amity.StaticInternalChannel>([
|
|
33
|
-
'channel',
|
|
34
|
-
'get',
|
|
35
|
-
payloads[0].channelId,
|
|
36
|
-
])?.data;
|
|
37
|
-
|
|
38
|
-
if (channel) {
|
|
39
|
-
callbacks.forEach(cb => cb(channel));
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
mainDisposer = createEventSubscriber(client, 'onChannelMute', 'channel.setMuted', filter);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
callbacks.push(callback);
|
|
47
|
-
return () => dispose(callback);
|
|
48
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { getActiveClient } from '~/client/api/activeClient';
|
|
2
|
-
import { createEventSubscriber } from '~/core/events';
|
|
3
|
-
|
|
4
|
-
import { pullFromCache, upsertInCache } from '~/cache/api';
|
|
5
|
-
|
|
6
|
-
type CallbackFn = (
|
|
7
|
-
channel: Amity.StaticInternalChannel,
|
|
8
|
-
member: Amity.Membership<'channel'>,
|
|
9
|
-
) => void;
|
|
10
|
-
const callbacks: CallbackFn[] = [];
|
|
11
|
-
let mainDisposer: (() => void) | null = null;
|
|
12
|
-
|
|
13
|
-
const dispose = (cb: CallbackFn) => {
|
|
14
|
-
const index = callbacks.indexOf(cb);
|
|
15
|
-
if (index > -1) {
|
|
16
|
-
callbacks.splice(index, 1);
|
|
17
|
-
}
|
|
18
|
-
if (callbacks.length === 0) {
|
|
19
|
-
mainDisposer?.();
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const onChannelSetUserMuted = (
|
|
24
|
-
callback: (channel: Amity.StaticInternalChannel, member: Amity.Membership<'channel'>) => void,
|
|
25
|
-
): Amity.Unsubscriber => {
|
|
26
|
-
if (callbacks.length === 0) {
|
|
27
|
-
const client = getActiveClient();
|
|
28
|
-
|
|
29
|
-
const filter = async (payload: Amity.ChannelSetUserMutedPayload) => {
|
|
30
|
-
payload.userIds.forEach(userId =>
|
|
31
|
-
// If muteTimeout > now => user is muted
|
|
32
|
-
// Otherwise => user is unmuted
|
|
33
|
-
upsertInCache(['channelUsers', 'get', `${payload.channelId}#${userId}`], {
|
|
34
|
-
isMuted: Date.parse(payload.muteTimeout) > Date.now(),
|
|
35
|
-
}),
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
const channel = pullFromCache<Amity.StaticInternalChannel>([
|
|
39
|
-
'channel',
|
|
40
|
-
'get',
|
|
41
|
-
payload.channelId,
|
|
42
|
-
])?.data;
|
|
43
|
-
|
|
44
|
-
const channelUser = pullFromCache<Amity.Membership<'channel'>>([
|
|
45
|
-
'channelUsers',
|
|
46
|
-
'get',
|
|
47
|
-
`${payload.channelId}#${payload.userIds[0]}`,
|
|
48
|
-
])?.data;
|
|
49
|
-
|
|
50
|
-
if (channel && channelUser) {
|
|
51
|
-
callbacks.forEach(cb => cb(channel, channelUser));
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
mainDisposer = createEventSubscriber(
|
|
56
|
-
client,
|
|
57
|
-
'onChannelUserMute',
|
|
58
|
-
'channel.setMutedUsers',
|
|
59
|
-
filter,
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
callbacks.push(callback);
|
|
64
|
-
return () => dispose(callback);
|
|
65
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { pullFromCache } from '~/cache/api/pullFromCache';
|
|
2
|
-
import { getActiveClient } from '~/client/api/activeClient';
|
|
3
|
-
import { ASCApiError } from '~/core/errors';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
*
|
|
7
|
-
* get current user's membership data
|
|
8
|
-
*
|
|
9
|
-
* @returns the {@link Amity.Membership<'channel'>} objects
|
|
10
|
-
*
|
|
11
|
-
* @category Channel API
|
|
12
|
-
* @async
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
export const getMyMembership = (channelId: string): Amity.Cached<Amity.Membership<'channel'>> => {
|
|
16
|
-
const client = getActiveClient();
|
|
17
|
-
client.log('channel/getMyMembership.locally');
|
|
18
|
-
|
|
19
|
-
const cacheChannelUser = pullFromCache<Amity.Membership<'channel'>>([
|
|
20
|
-
'channelUsers',
|
|
21
|
-
'get',
|
|
22
|
-
`${channelId}#${client.userId}`,
|
|
23
|
-
]);
|
|
24
|
-
|
|
25
|
-
if (!cacheChannelUser) {
|
|
26
|
-
throw new ASCApiError(
|
|
27
|
-
'Item not found!',
|
|
28
|
-
Amity.ServerError.ITEM_NOT_FOUND,
|
|
29
|
-
Amity.ErrorLevel.ERROR,
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return {
|
|
34
|
-
data: cacheChannelUser.data,
|
|
35
|
-
cachedAt: cacheChannelUser.cachedAt,
|
|
36
|
-
};
|
|
37
|
-
};
|