@amityco/ts-sdk 7.6.1-2841ad2c.0 → 7.6.1-8ef2910.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.
Files changed (189) hide show
  1. package/dist/@types/core/events.d.ts +1 -6
  2. package/dist/@types/core/events.d.ts.map +1 -1
  3. package/dist/@types/core/payload.d.ts +1 -26
  4. package/dist/@types/core/payload.d.ts.map +1 -1
  5. package/dist/@types/domains/channel.d.ts +0 -6
  6. package/dist/@types/domains/channel.d.ts.map +1 -1
  7. package/dist/@types/domains/content.d.ts +8 -2
  8. package/dist/@types/domains/content.d.ts.map +1 -1
  9. package/dist/@types/domains/feed.d.ts +2 -1
  10. package/dist/@types/domains/feed.d.ts.map +1 -1
  11. package/dist/@types/domains/file.d.ts +3 -1
  12. package/dist/@types/domains/file.d.ts.map +1 -1
  13. package/dist/@types/domains/post.d.ts +3 -3
  14. package/dist/@types/domains/post.d.ts.map +1 -1
  15. package/dist/@types/domains/stream.d.ts +1 -9
  16. package/dist/@types/domains/stream.d.ts.map +1 -1
  17. package/dist/@types/index.d.ts +0 -1
  18. package/dist/@types/index.d.ts.map +1 -1
  19. package/dist/channelRepository/api/createChannel.d.ts +1 -3
  20. package/dist/channelRepository/api/createChannel.d.ts.map +1 -1
  21. package/dist/channelRepository/channelMembership/observers/getMembers/ChannelMemberLiveCollectionController.d.ts.map +1 -1
  22. package/dist/channelRepository/events/index.d.ts +1 -1
  23. package/dist/channelRepository/events/index.d.ts.map +1 -1
  24. package/dist/channelRepository/events/onChannelMuted.d.ts +2 -0
  25. package/dist/channelRepository/events/onChannelMuted.d.ts.map +1 -0
  26. package/dist/channelRepository/internalApi/getChannel.d.ts.map +1 -1
  27. package/dist/channelRepository/observers/getChannels/ChannelLiveCollectionController.d.ts.map +1 -1
  28. package/dist/client/api/login.d.ts.map +1 -1
  29. package/dist/communityRepository/api/getCommunity.d.ts +1 -1
  30. package/dist/communityRepository/api/getCommunity.d.ts.map +1 -1
  31. package/dist/core/events.d.ts +3 -3
  32. package/dist/core/events.d.ts.map +1 -1
  33. package/dist/core/subscription.d.ts +1 -2
  34. package/dist/core/subscription.d.ts.map +1 -1
  35. package/dist/feedRepository/api/getCustomRankingGlobalFeed.d.ts +1 -1
  36. package/dist/feedRepository/api/getCustomRankingGlobalFeed.d.ts.map +1 -1
  37. package/dist/feedRepository/api/queryGlobalFeed.d.ts.map +1 -1
  38. package/dist/fileRepository/api/index.d.ts +1 -0
  39. package/dist/fileRepository/api/index.d.ts.map +1 -1
  40. package/dist/fileRepository/api/uploadClip.d.ts +17 -0
  41. package/dist/fileRepository/api/uploadClip.d.ts.map +1 -0
  42. package/dist/index.cjs.js +5660 -6239
  43. package/dist/index.d.ts +0 -1
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.esm.js +5763 -6340
  46. package/dist/index.umd.js +3 -3
  47. package/dist/liveStreamPlayer/utils/eventRegister.d.ts +1 -2
  48. package/dist/liveStreamPlayer/utils/eventRegister.d.ts.map +1 -1
  49. package/dist/messagePreview/utils/getChannelMessagePreviewWithUser.d.ts +0 -4
  50. package/dist/messagePreview/utils/getChannelMessagePreviewWithUser.d.ts.map +1 -1
  51. package/dist/messagePreview/utils/getSubChannelMessagePreviewWithUser.d.ts +1 -1
  52. package/dist/messageRepository/api/deleteMessage.d.ts.map +1 -1
  53. package/dist/messageRepository/observers/getMessage.d.ts.map +1 -1
  54. package/dist/messageRepository/observers/getMessages/MessageLiveCollectionController.d.ts.map +1 -1
  55. package/dist/messageRepository/observers/getMessages/MessageQueryStreamController.d.ts.map +1 -1
  56. package/dist/postRepository/api/createClipPost.d.ts +32 -0
  57. package/dist/postRepository/api/createClipPost.d.ts.map +1 -0
  58. package/dist/postRepository/api/createPost.d.ts.map +1 -1
  59. package/dist/postRepository/api/index.d.ts +1 -0
  60. package/dist/postRepository/api/index.d.ts.map +1 -1
  61. package/dist/postRepository/utils/payload.d.ts.map +1 -1
  62. package/dist/streamRepository/api/createStream.d.ts +1 -1
  63. package/dist/streamRepository/api/createStream.d.ts.map +1 -1
  64. package/dist/streamRepository/api/index.d.ts +0 -1
  65. package/dist/streamRepository/api/index.d.ts.map +1 -1
  66. package/dist/streamRepository/api/updateStream.d.ts +1 -4
  67. package/dist/streamRepository/api/updateStream.d.ts.map +1 -1
  68. package/dist/streamRepository/events/index.d.ts +0 -2
  69. package/dist/streamRepository/events/index.d.ts.map +1 -1
  70. package/dist/streamRepository/internalApi/getStream.d.ts +2 -2
  71. package/dist/streamRepository/internalApi/getStream.d.ts.map +1 -1
  72. package/dist/streamRepository/observers/getStreamById.d.ts.map +1 -1
  73. package/dist/streamRepository/observers/getStreams/GetStreamsLiveCollectionController.d.ts.map +1 -1
  74. package/dist/utils/linkedObject/channelLinkedObject.d.ts.map +1 -1
  75. package/dist/utils/linkedObject/postLinkedObject.d.ts.map +1 -1
  76. package/dist/utils/linkedObject/streamLinkedObject.d.ts.map +1 -1
  77. package/dist/utils/postTypePredicate.d.ts +4 -5
  78. package/dist/utils/postTypePredicate.d.ts.map +1 -1
  79. package/dist/utils/tests/dummy/comment.d.ts +1 -1
  80. package/package.json +1 -1
  81. package/src/@types/core/events.ts +1 -10
  82. package/src/@types/core/payload.ts +1 -33
  83. package/src/@types/domains/channel.ts +0 -9
  84. package/src/@types/domains/content.ts +10 -0
  85. package/src/@types/domains/feed.ts +2 -1
  86. package/src/@types/domains/file.ts +5 -0
  87. package/src/@types/domains/post.ts +4 -4
  88. package/src/@types/domains/stream.ts +1 -13
  89. package/src/@types/index.ts +0 -1
  90. package/src/channelRepository/api/createChannel.ts +8 -11
  91. package/src/channelRepository/channelMembership/observers/getMembers/ChannelMemberLiveCollectionController.ts +0 -2
  92. package/src/channelRepository/events/index.ts +1 -1
  93. package/src/channelRepository/events/onChannelMuted.ts +39 -0
  94. package/src/channelRepository/internalApi/getChannel.ts +1 -0
  95. package/src/channelRepository/observers/getChannel.ts +2 -2
  96. package/src/channelRepository/observers/getChannels/ChannelLiveCollectionController.ts +2 -2
  97. package/src/channelRepository/utils/constructChannelObject.ts +2 -2
  98. package/src/client/api/login.ts +0 -2
  99. package/src/communityRepository/api/getCommunity.ts +0 -9
  100. package/src/core/events.ts +1 -4
  101. package/src/core/subscription.ts +6 -10
  102. package/src/feedRepository/api/getCustomRankingGlobalFeed.ts +1 -1
  103. package/src/feedRepository/api/queryGlobalFeed.ts +3 -1
  104. package/src/fileRepository/api/index.ts +1 -0
  105. package/src/fileRepository/api/uploadClip.ts +71 -0
  106. package/src/index.ts +0 -2
  107. package/src/liveStreamPlayer/api/getPlayer.ts +1 -1
  108. package/src/liveStreamPlayer/utils/eventRegister.ts +1 -16
  109. package/src/messageRepository/api/deleteMessage.ts +0 -16
  110. package/src/messageRepository/observers/getMessage.ts +0 -2
  111. package/src/messageRepository/observers/getMessages/MessageLiveCollectionController.ts +0 -2
  112. package/src/messageRepository/observers/getMessages/MessageQueryStreamController.ts +0 -13
  113. package/src/postRepository/api/createClipPost.ts +62 -0
  114. package/src/postRepository/api/createPost.ts +2 -3
  115. package/src/postRepository/api/index.ts +2 -0
  116. package/src/postRepository/api/queryPosts.ts +1 -1
  117. package/src/postRepository/observers/getPosts/PostPaginationController.ts +1 -1
  118. package/src/postRepository/utils/payload.ts +1 -37
  119. package/src/streamRepository/api/createStream.ts +1 -4
  120. package/src/streamRepository/api/index.ts +0 -1
  121. package/src/streamRepository/api/updateStream.ts +1 -8
  122. package/src/streamRepository/events/index.ts +0 -2
  123. package/src/streamRepository/internalApi/getStream.ts +3 -3
  124. package/src/streamRepository/observers/getStreamById.ts +0 -2
  125. package/src/streamRepository/observers/getStreams/GetStreamsLiveCollectionController.ts +1 -5
  126. package/src/utils/linkedObject/channelLinkedObject.ts +0 -3
  127. package/src/utils/linkedObject/postLinkedObject.ts +6 -25
  128. package/src/utils/linkedObject/streamLinkedObject.ts +0 -4
  129. package/src/utils/postTypePredicate.ts +7 -20
  130. package/dist/@types/domains/liveReaction.d.ts +0 -20
  131. package/dist/@types/domains/liveReaction.d.ts.map +0 -1
  132. package/dist/channelRepository/events/onChannelSetMuted.d.ts +0 -2
  133. package/dist/channelRepository/events/onChannelSetMuted.d.ts.map +0 -1
  134. package/dist/channelRepository/events/onChannelSetUserMuted.d.ts +0 -2
  135. package/dist/channelRepository/events/onChannelSetUserMuted.d.ts.map +0 -1
  136. package/dist/channelRepository/internalApi/getMyMembership.d.ts +0 -11
  137. package/dist/channelRepository/internalApi/getMyMembership.d.ts.map +0 -1
  138. package/dist/channelRepository/observers/getMyMembership.d.ts +0 -2
  139. package/dist/channelRepository/observers/getMyMembership.d.ts.map +0 -1
  140. package/dist/liveReactionRepository/api/createReaction.d.ts +0 -20
  141. package/dist/liveReactionRepository/api/createReaction.d.ts.map +0 -1
  142. package/dist/liveReactionRepository/api/index.d.ts +0 -2
  143. package/dist/liveReactionRepository/api/index.d.ts.map +0 -1
  144. package/dist/liveReactionRepository/events/index.d.ts +0 -2
  145. package/dist/liveReactionRepository/events/index.d.ts.map +0 -1
  146. package/dist/liveReactionRepository/events/onLiveReactionCreated.d.ts +0 -17
  147. package/dist/liveReactionRepository/events/onLiveReactionCreated.d.ts.map +0 -1
  148. package/dist/liveReactionRepository/events/onLiveReactionCreatedLocal.d.ts +0 -17
  149. package/dist/liveReactionRepository/events/onLiveReactionCreatedLocal.d.ts.map +0 -1
  150. package/dist/liveReactionRepository/index.d.ts +0 -4
  151. package/dist/liveReactionRepository/index.d.ts.map +0 -1
  152. package/dist/liveReactionRepository/internalApi/createLiveReaction.d.ts +0 -20
  153. package/dist/liveReactionRepository/internalApi/createLiveReaction.d.ts.map +0 -1
  154. package/dist/liveReactionRepository/observers/getReactions.d.ts +0 -19
  155. package/dist/liveReactionRepository/observers/getReactions.d.ts.map +0 -1
  156. package/dist/liveReactionRepository/observers/index.d.ts +0 -2
  157. package/dist/liveReactionRepository/observers/index.d.ts.map +0 -1
  158. package/dist/liveReactionRepository/service/ReactionSyncEngine.d.ts +0 -26
  159. package/dist/liveReactionRepository/service/ReactionSyncEngine.d.ts.map +0 -1
  160. package/dist/liveReactionRepository/utils/ReactionSyncEngineOnLoginHandler.d.ts +0 -3
  161. package/dist/liveReactionRepository/utils/ReactionSyncEngineOnLoginHandler.d.ts.map +0 -1
  162. package/dist/streamRepository/api/editStream.d.ts +0 -18
  163. package/dist/streamRepository/api/editStream.d.ts.map +0 -1
  164. package/dist/streamRepository/events/onStreamViewerBanned.d.ts +0 -17
  165. package/dist/streamRepository/events/onStreamViewerBanned.d.ts.map +0 -1
  166. package/dist/streamRepository/events/onStreamViewerUnbanned.d.ts +0 -17
  167. package/dist/streamRepository/events/onStreamViewerUnbanned.d.ts.map +0 -1
  168. package/dist/streamRepository/internalApi/getLiveChat.d.ts +0 -16
  169. package/dist/streamRepository/internalApi/getLiveChat.d.ts.map +0 -1
  170. package/src/@types/domains/liveReaction.ts +0 -25
  171. package/src/channelRepository/events/onChannelSetMuted.ts +0 -48
  172. package/src/channelRepository/events/onChannelSetUserMuted.ts +0 -65
  173. package/src/channelRepository/internalApi/getMyMembership.ts +0 -37
  174. package/src/channelRepository/observers/getMyMembership.ts +0 -98
  175. package/src/liveReactionRepository/api/createReaction.ts +0 -58
  176. package/src/liveReactionRepository/api/index.ts +0 -1
  177. package/src/liveReactionRepository/events/index.ts +0 -1
  178. package/src/liveReactionRepository/events/onLiveReactionCreated.ts +0 -37
  179. package/src/liveReactionRepository/events/onLiveReactionCreatedLocal.ts +0 -29
  180. package/src/liveReactionRepository/index.ts +0 -3
  181. package/src/liveReactionRepository/internalApi/createLiveReaction.ts +0 -42
  182. package/src/liveReactionRepository/observers/getReactions.ts +0 -59
  183. package/src/liveReactionRepository/observers/index.ts +0 -1
  184. package/src/liveReactionRepository/service/ReactionSyncEngine.ts +0 -138
  185. package/src/liveReactionRepository/utils/ReactionSyncEngineOnLoginHandler.ts +0 -19
  186. package/src/streamRepository/api/editStream.ts +0 -51
  187. package/src/streamRepository/events/onStreamViewerBanned.ts +0 -58
  188. package/src/streamRepository/events/onStreamViewerUnbanned.ts +0 -47
  189. package/src/streamRepository/internalApi/getLiveChat.ts +0 -59
@@ -3,5 +3,3 @@ export { onStreamStopped } from './onStreamStopped';
3
3
  export { onStreamRecorded } from './onStreamRecorded';
4
4
  export { onStreamFlagged } from './onStreamFlagged';
5
5
  export { onStreamTerminated } from './onStreamTerminated';
6
- export { onStreamViewerBanned } from './onStreamViewerBanned';
7
- export { onStreamViewerUnbanned } from './onStreamViewerUnbanned';
@@ -22,7 +22,7 @@ import { ingestInCache } from '~/cache/api/ingestInCache';
22
22
  */
23
23
  export const getStream = async (
24
24
  streamId: Amity.Stream['streamId'],
25
- ): Promise<Amity.Cached<Amity.InternalStream>> => {
25
+ ): Promise<Amity.Cached<Amity.Stream>> => {
26
26
  const client = getActiveClient();
27
27
  client.log('stream/getStream', streamId);
28
28
 
@@ -57,13 +57,13 @@ export const getStream = async (
57
57
  */
58
58
  getStream.locally = (
59
59
  streamId: Amity.Stream['streamId'],
60
- ): Amity.Cached<Amity.InternalStream> | undefined => {
60
+ ): Amity.Cached<Amity.Stream> | undefined => {
61
61
  const client = getActiveClient();
62
62
  client.log('stream/getStream', streamId);
63
63
 
64
64
  if (!client.cache) return;
65
65
 
66
- const cached = pullFromCache<Amity.InternalStream>(['stream', 'get', streamId]);
66
+ const cached = pullFromCache<Amity.Stream>(['stream', 'get', streamId]);
67
67
 
68
68
  if (!cached) return;
69
69
 
@@ -8,7 +8,6 @@ import { onStreamTerminated } from '~/streamRepository/events/onStreamTerminated
8
8
  import { LinkedObject } from '~/utils/linkedObject';
9
9
  import { getStream as _getStream } from '../internalApi/getStream';
10
10
  import { onStreamRecorded, onStreamStarted, onStreamStopped } from '../events';
11
- import { onStreamViewerBanned } from '../events/onStreamViewerBanned';
12
11
 
13
12
  /* begin_public_function
14
13
  id: stream.get
@@ -46,7 +45,6 @@ export const getStreamById = (
46
45
  onStreamStopped,
47
46
  onStreamFlagged,
48
47
  onStreamTerminated,
49
- onStreamViewerBanned,
50
48
  ]);
51
49
  };
52
50
  /* end_public_function */
@@ -12,8 +12,6 @@ import {
12
12
  } from '~/streamRepository/events';
13
13
  import { GetStreamsPageController } from '~/streamRepository/observers/getStreams/GetStreamsPageController';
14
14
  import { GetStreamsQueryStreamController } from '~/streamRepository/observers/getStreams/GetStreamsQueryStreamController';
15
- import { onStreamViewerBanned } from '~/streamRepository/events/onStreamViewerBanned';
16
- import { onStreamViewerUnbanned } from '~/streamRepository/events/onStreamViewerUnbanned';
17
15
 
18
16
  export class GetStreamsLiveCollectionController extends LiveCollectionController<
19
17
  'stream',
@@ -79,8 +77,6 @@ export class GetStreamsLiveCollectionController extends LiveCollectionController
79
77
  { fn: onStreamStopped, action: 'onStreamStopped' },
80
78
  { fn: onStreamFlagged, action: 'onStreamFlagged' },
81
79
  { fn: onStreamTerminated, action: 'onStreamTerminated' },
82
- { fn: onStreamViewerBanned, action: 'onStreamViewerBanned' },
83
- { fn: onStreamViewerUnbanned, action: 'onStreamViewerUnbanned' },
84
80
  ]);
85
81
  }
86
82
 
@@ -106,7 +102,7 @@ export class GetStreamsLiveCollectionController extends LiveCollectionController
106
102
  this.queryStreamController.appendToQueryStream(response, direction, refresh);
107
103
  }
108
104
 
109
- private applyFilter = (data: Amity.Stream[]): Amity.Stream[] => {
105
+ private applyFilter = (data: Amity.InternalStream[]): Amity.InternalStream[] => {
110
106
  let streams = filterByPropEquality(data, 'isDeleted', this.query.isDeleted);
111
107
 
112
108
  streams = streams.sort(
@@ -2,7 +2,6 @@ import { markAsRead } from '~/channelRepository/internalApi/markAsRead';
2
2
  import { shallowClone } from '../shallowClone';
3
3
  import { queryCache } from '~/cache/api';
4
4
  import { channelMemberLinkedObject } from './channelMemberLinkedObject';
5
- import { getMyMembership } from '~/channelRepository/observers/getMyMembership';
6
5
 
7
6
  export const channelLinkedObject = (channel: Amity.InternalChannel): Amity.Channel => {
8
7
  let previewMembers: Amity.Membership<'channel'>[] = [];
@@ -24,7 +23,5 @@ export const channelLinkedObject = (channel: Amity.InternalChannel): Amity.Chann
24
23
  return shallowClone(channel, {
25
24
  markAsRead: () => markAsRead(channel.channelInternalId),
26
25
  previewMembers,
27
- myMembership: (callback: Amity.LiveObjectCallback<Amity.Membership<'channel'> | undefined>) =>
28
- getMyMembership(channel.channelId, callback),
29
26
  });
30
27
  };
@@ -3,22 +3,16 @@ import { commentLinkedObject } from '~/utils/linkedObject/commentLinkedObject';
3
3
  import AnalyticsEngine from '../../analytic/service/analytic/AnalyticsEngine';
4
4
  import { userLinkedObject } from './userLinkedObject';
5
5
  import {
6
+ isAmityClipPost,
6
7
  isAmityFilePost,
7
8
  isAmityImagePost,
8
- isAmityLivestreamPost,
9
- isAmityPollPost,
10
9
  isAmityVideoPost,
11
10
  } from '../postTypePredicate';
12
- import { streamLinkedObject } from './streamLinkedObject';
13
- import { isNonNullable } from '..';
14
11
 
15
12
  export const postLinkedObject = (post: Amity.InternalPost): Amity.Post => {
16
13
  return {
17
14
  ...post,
18
- childrenPosts: post.children
19
- .map(childPost => pullFromCache<Amity.InternalPost>(['post', 'get', childPost])?.data)
20
- .filter(isNonNullable)
21
- .map(postLinkedObject),
15
+
22
16
  analytics: {
23
17
  markAsViewed: () => {
24
18
  const analyticsEngineInstance = AnalyticsEngine.getInstance();
@@ -76,23 +70,10 @@ export const postLinkedObject = (post: Amity.InternalPost): Amity.Post => {
76
70
  : undefined;
77
71
  },
78
72
 
79
- getLivestreamInfo(): Amity.Stream | undefined {
80
- if (!isAmityLivestreamPost(post)) return;
81
- const cache = pullFromCache<Amity.InternalStream>([
82
- 'stream',
83
- 'get',
84
- post?.data?.streamId,
85
- ])?.data;
86
- if (!cache) return;
87
-
88
- return streamLinkedObject(cache);
89
- },
90
-
91
- getPollInfo(): Amity.Poll | undefined {
92
- if (!isAmityPollPost(post)) return;
93
- const cache = pullFromCache<Amity.Poll>(['poll', 'get', post?.data?.pollId])?.data;
94
- if (!cache) return;
95
- return cache;
73
+ getClipInfo(): Amity.File<'clip'> | undefined {
74
+ return isAmityClipPost(post)
75
+ ? pullFromCache<Amity.File<'clip'>>(['file', 'get', post?.data?.fileId])?.data
76
+ : undefined;
96
77
  },
97
78
  };
98
79
  };
@@ -1,5 +1,4 @@
1
1
  import { pullFromCache } from '~/cache/api';
2
- import { getLiveChat as _getLiveChat } from '~/streamRepository/internalApi/getLiveChat';
3
2
 
4
3
  export const streamLinkedObject = (stream: Amity.InternalStream): Amity.Stream => {
5
4
  return {
@@ -19,8 +18,5 @@ export const streamLinkedObject = (stream: Amity.InternalStream): Amity.Stream =
19
18
  get user() {
20
19
  return pullFromCache<Amity.User>(['user', 'get', stream.userId])?.data;
21
20
  },
22
- getLiveChat: () => _getLiveChat(stream),
23
- isBanned: !stream.watcherUrl,
24
- watcherUrl: null,
25
21
  };
26
22
  };
@@ -1,6 +1,5 @@
1
- export function isAmityImagePost(post?: Amity.InternalPost): post is Amity.Post<'image'> {
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?: Amity.InternalPost): post is Amity.Post<'file'> {
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?: Amity.InternalPost): post is Amity.Post<'video'> {
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,12 @@ export function isAmityVideoPost(post?: Amity.InternalPost): post is Amity.Post<
29
26
  );
30
27
  }
31
28
 
32
- export function isAmityLivestreamPost(post?: Amity.InternalPost): post is Amity.Post<'liveStream'> {
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
- 'streamId' in post.data &&
38
- post.dataType === 'liveStream'
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
+ 'thumbnailFileId' in post.data &&
35
+ post.dataType === 'clip'
49
36
  );
50
37
  }
@@ -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,2 +0,0 @@
1
- export declare const onChannelSetMuted: (callback: Amity.Listener<Amity.StaticInternalChannel>) => () => void;
2
- //# sourceMappingURL=onChannelSetMuted.d.ts.map
@@ -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,2 +0,0 @@
1
- export declare const onChannelSetUserMuted: (callback: (channel: Amity.StaticInternalChannel, member: Amity.Membership<'channel'>) => void) => Amity.Unsubscriber;
2
- //# sourceMappingURL=onChannelSetUserMuted.d.ts.map
@@ -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,2 +0,0 @@
1
- export declare const getMyMembership: (channelId: string, callback: Amity.LiveObjectCallback<Amity.Membership<'channel'> | undefined>) => Amity.Unsubscriber;
2
- //# sourceMappingURL=getMyMembership.d.ts.map
@@ -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,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,2 +0,0 @@
1
- export * from './createReaction';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/liveReactionRepository/api/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './onLiveReactionCreated';
2
- //# sourceMappingURL=index.d.ts.map
@@ -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,4 +0,0 @@
1
- export * from './api';
2
- export * from './events';
3
- export * from './observers';
4
- //# sourceMappingURL=index.d.ts.map
@@ -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,2 +0,0 @@
1
- export * from './getReactions';
2
- //# sourceMappingURL=index.d.ts.map
@@ -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,3 +0,0 @@
1
- declare const _default: () => () => void;
2
- export default _default;
3
- //# sourceMappingURL=ReactionSyncEngineOnLoginHandler.d.ts.map
@@ -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
- }