@amityco/ts-sdk 0.0.1-beta.25 → 0.0.1-beta.28
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/.eslintrc.json +5 -1
- package/dist/@types/core/events.d.ts +7 -7
- package/dist/@types/core/events.d.ts.map +1 -1
- package/dist/@types/core/live.d.ts +23 -0
- package/dist/@types/core/live.d.ts.map +1 -0
- package/dist/@types/core/paging.d.ts +1 -1
- package/dist/@types/core/paging.d.ts.map +1 -1
- package/dist/@types/core/payload.d.ts +15 -15
- package/dist/@types/core/payload.d.ts.map +1 -1
- package/dist/@types/domains/channel.d.ts +5 -1
- package/dist/@types/domains/channel.d.ts.map +1 -1
- package/dist/@types/domains/client.d.ts +13 -0
- package/dist/@types/domains/client.d.ts.map +1 -1
- package/dist/@types/domains/comment.d.ts +14 -0
- package/dist/@types/domains/comment.d.ts.map +1 -1
- package/dist/@types/domains/content.d.ts +26 -3
- package/dist/@types/domains/content.d.ts.map +1 -1
- package/dist/@types/domains/file.d.ts +36 -3
- package/dist/@types/domains/file.d.ts.map +1 -1
- package/dist/@types/domains/follow.d.ts +13 -1
- package/dist/@types/domains/follow.d.ts.map +1 -1
- package/dist/@types/domains/group.d.ts +1 -0
- package/dist/@types/domains/group.d.ts.map +1 -1
- package/dist/@types/domains/message.d.ts +13 -0
- package/dist/@types/domains/message.d.ts.map +1 -1
- package/dist/@types/domains/post.d.ts +17 -0
- package/dist/@types/domains/post.d.ts.map +1 -1
- package/dist/@types/domains/reaction.d.ts +10 -0
- package/dist/@types/domains/reaction.d.ts.map +1 -1
- package/dist/@types/global.d.ts +1 -0
- package/dist/@types/global.d.ts.map +1 -1
- package/dist/@types/index.d.ts +3 -2
- package/dist/@types/index.d.ts.map +1 -1
- package/dist/cache/api/ingestInCache.d.ts +1 -1
- package/dist/cache/api/ingestInCache.d.ts.map +1 -1
- package/dist/cache/api/mergeInCache.d.ts +1 -1
- package/dist/cache/api/mergeInCache.d.ts.map +1 -1
- package/dist/category/api/queryCategories.d.ts +3 -3
- package/dist/category/api/queryCategories.d.ts.map +1 -1
- package/dist/channel/api/addChannelMembers.d.ts.map +1 -1
- package/dist/channel/api/addChannelMembersRole.d.ts.map +1 -1
- package/dist/channel/api/banChannelMembers.d.ts +16 -0
- package/dist/channel/api/banChannelMembers.d.ts.map +1 -0
- package/dist/channel/api/createChannel.d.ts.map +1 -1
- package/dist/channel/api/getChannel.d.ts.map +1 -1
- package/dist/channel/api/getChannels.d.ts.map +1 -1
- package/dist/channel/api/index.d.ts +2 -0
- package/dist/channel/api/index.d.ts.map +1 -1
- package/dist/channel/api/joinChannel.d.ts.map +1 -1
- package/dist/channel/api/leaveChannel.d.ts.map +1 -1
- package/dist/channel/api/queryChannelMembers.d.ts.map +1 -1
- package/dist/channel/api/queryChannels.d.ts +6 -6
- package/dist/channel/api/queryChannels.d.ts.map +1 -1
- package/dist/channel/api/removeChannelMembers.d.ts.map +1 -1
- package/dist/channel/api/removeChannelMembersRole.d.ts.map +1 -1
- package/dist/channel/api/unbanChannelMembers.d.ts +16 -0
- package/dist/channel/api/unbanChannelMembers.d.ts.map +1 -0
- package/dist/channel/api/updateChannel.d.ts.map +1 -1
- package/dist/channel/events/index.d.ts +1 -0
- package/dist/channel/events/index.d.ts.map +1 -1
- package/dist/channel/events/onChannelCreated.d.ts.map +1 -1
- package/dist/channel/events/onChannelDeleted.d.ts.map +1 -1
- package/dist/channel/events/onChannelJoined.d.ts.map +1 -1
- package/dist/channel/events/onChannelLeft.d.ts.map +1 -1
- package/dist/channel/events/onChannelMemberAdded.d.ts.map +1 -1
- package/dist/channel/events/onChannelMemberRemoved.d.ts.map +1 -1
- package/dist/channel/events/onChannelUpdated.d.ts.map +1 -1
- package/dist/channel/observers/index.d.ts +1 -0
- package/dist/channel/observers/index.d.ts.map +1 -1
- package/dist/channel/observers/observeChannel.d.ts +1 -1
- package/dist/channel/observers/observeChannel.d.ts.map +1 -1
- package/dist/channel/observers/observeChannels.d.ts +17 -0
- package/dist/channel/observers/observeChannels.d.ts.map +1 -0
- package/dist/channel/tests/utils/prepareChannelPayload.test.d.ts +2 -0
- package/dist/channel/tests/utils/prepareChannelPayload.test.d.ts.map +1 -0
- package/dist/channel/utils/index.d.ts +2 -0
- package/dist/channel/utils/index.d.ts.map +1 -0
- package/dist/channel/utils/prepareChannelPayload.d.ts +3 -0
- package/dist/channel/utils/prepareChannelPayload.d.ts.map +1 -0
- package/dist/client/api/connectClient.d.ts +1 -8
- package/dist/client/api/connectClient.d.ts.map +1 -1
- package/dist/client/api/createClient.d.ts +8 -1
- package/dist/client/api/createClient.d.ts.map +1 -1
- package/dist/client/api/getFeedSettings.d.ts +16 -0
- package/dist/client/api/getFeedSettings.d.ts.map +1 -0
- package/dist/client/api/index.d.ts +1 -0
- package/dist/client/api/index.d.ts.map +1 -1
- package/dist/comment/api/queryComments.d.ts +1 -9
- package/dist/comment/api/queryComments.d.ts.map +1 -1
- package/dist/comment/observers/index.d.ts +1 -0
- package/dist/comment/observers/index.d.ts.map +1 -1
- package/dist/comment/observers/liveComments.d.ts +22 -0
- package/dist/comment/observers/liveComments.d.ts.map +1 -0
- package/dist/comment/observers/observeComments.d.ts.map +1 -1
- package/dist/community/api/getRecommendedCommunities.d.ts +1 -1
- package/dist/community/api/getRecommendedCommunities.d.ts.map +1 -1
- package/dist/community/api/getTopTrendingCommunities.d.ts +1 -1
- package/dist/community/api/getTopTrendingCommunities.d.ts.map +1 -1
- package/dist/community/api/queryCommunities.d.ts +7 -7
- package/dist/community/api/queryCommunities.d.ts.map +1 -1
- package/dist/core/debug.d.ts +1 -1
- package/dist/core/debug.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/query/paging.d.ts +2 -2
- package/dist/core/query/paging.d.ts.map +1 -1
- package/dist/core/query/query.d.ts +2 -2
- package/dist/core/query/query.d.ts.map +1 -1
- package/dist/core/tests/query/filtering.test.d.ts +2 -0
- package/dist/core/tests/query/filtering.test.d.ts.map +1 -0
- package/dist/core/tests/query/query/runQuery.test.d.ts +2 -0
- package/dist/core/tests/query/query/runQuery.test.d.ts.map +1 -0
- package/dist/core/tests/query/query.test.d.ts +2 -0
- package/dist/core/tests/query/query.test.d.ts.map +1 -0
- package/dist/core/transports/ws.d.ts +1 -1
- package/dist/core/transports/ws.d.ts.map +1 -1
- package/dist/external/api/createUserToken.d.ts +1 -1
- package/dist/external/api/createUserToken.d.ts.map +1 -1
- package/dist/feed/api/queryGlobalFeed.d.ts +4 -4
- package/dist/feed/api/queryGlobalFeed.d.ts.map +1 -1
- package/dist/file/api/createVideo.d.ts +2 -1
- package/dist/file/api/createVideo.d.ts.map +1 -1
- package/dist/follow/api/follow.d.ts.map +1 -1
- package/dist/follow/api/getFollowInfo.d.ts.map +1 -1
- package/dist/follow/api/queryFollowers.d.ts +2 -6
- package/dist/follow/api/queryFollowers.d.ts.map +1 -1
- package/dist/follow/api/queryFollowings.d.ts +2 -6
- package/dist/follow/api/queryFollowings.d.ts.map +1 -1
- package/dist/follow/api/utils.d.ts +4 -4
- package/dist/follow/api/utils.d.ts.map +1 -1
- package/dist/follow/events/utils.d.ts.map +1 -1
- package/dist/follow/observers/index.d.ts +2 -0
- package/dist/follow/observers/index.d.ts.map +1 -1
- package/dist/follow/observers/liveFollowers.d.ts +20 -0
- package/dist/follow/observers/liveFollowers.d.ts.map +1 -0
- package/dist/follow/observers/liveFollowings.d.ts +20 -0
- package/dist/follow/observers/liveFollowings.d.ts.map +1 -0
- package/dist/index.cjs.js +18706 -17726
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +18688 -17727
- package/dist/index.umd.js +4 -19
- package/dist/message/api/queryMessages.d.ts +1 -10
- package/dist/message/api/queryMessages.d.ts.map +1 -1
- package/dist/message/observers/index.d.ts +1 -0
- package/dist/message/observers/index.d.ts.map +1 -1
- package/dist/message/observers/liveMessages.d.ts +20 -0
- package/dist/message/observers/liveMessages.d.ts.map +1 -0
- package/dist/message/observers/observeMessages.d.ts +0 -1
- package/dist/message/observers/observeMessages.d.ts.map +1 -1
- package/dist/message/observers/tests/liveMessages.test.d.ts +2 -0
- package/dist/message/observers/tests/liveMessages.test.d.ts.map +1 -0
- package/dist/post/api/queryPosts.d.ts +1 -12
- package/dist/post/api/queryPosts.d.ts.map +1 -1
- package/dist/post/observers/index.d.ts +1 -0
- package/dist/post/observers/index.d.ts.map +1 -1
- package/dist/post/observers/livePosts.d.ts +22 -0
- package/dist/post/observers/livePosts.d.ts.map +1 -0
- package/dist/post/observers/observePosts.d.ts.map +1 -1
- package/dist/post/tests/api/getPost.test.d.ts +2 -0
- package/dist/post/tests/api/getPost.test.d.ts.map +1 -0
- package/dist/post/tests/api/queryPosts.test.d.ts +2 -0
- package/dist/post/tests/api/queryPosts.test.d.ts.map +1 -0
- package/dist/reaction/api/queryReactions.d.ts +1 -6
- package/dist/reaction/api/queryReactions.d.ts.map +1 -1
- package/dist/reaction/events/index.d.ts +3 -0
- package/dist/reaction/events/index.d.ts.map +1 -1
- package/dist/reaction/events/onReactorAdded.d.ts +19 -0
- package/dist/reaction/events/onReactorAdded.d.ts.map +1 -0
- package/dist/reaction/events/onReactorRemoved.d.ts +19 -0
- package/dist/reaction/events/onReactorRemoved.d.ts.map +1 -0
- package/dist/reaction/observers/index.d.ts +2 -0
- package/dist/reaction/observers/index.d.ts.map +1 -0
- package/dist/reaction/observers/liveReactions.d.ts +22 -0
- package/dist/reaction/observers/liveReactions.d.ts.map +1 -0
- package/dist/role/api/queryRoles.d.ts +4 -4
- package/dist/role/api/queryRoles.d.ts.map +1 -1
- package/dist/stream/api/queryStreams.d.ts +6 -6
- package/dist/stream/api/queryStreams.d.ts.map +1 -1
- package/dist/utils/constants.d.ts +4 -0
- package/dist/utils/constants.d.ts.map +1 -0
- package/dist/utils/tests/client.d.ts +6 -0
- package/dist/utils/tests/client.d.ts.map +1 -0
- package/dist/utils/tests/dummy/channel.d.ts +10 -0
- package/dist/utils/tests/dummy/channel.d.ts.map +1 -0
- package/dist/utils/tests/dummy/index.d.ts +10 -0
- package/dist/utils/tests/dummy/index.d.ts.map +1 -0
- package/dist/utils/tests/dummy/message.d.ts +8 -0
- package/dist/utils/tests/dummy/message.d.ts.map +1 -0
- package/dist/utils/tests/dummy/post.d.ts +9 -0
- package/dist/utils/tests/dummy/post.d.ts.map +1 -0
- package/dist/utils/tests/dummy/user.d.ts +2 -0
- package/dist/utils/tests/dummy/user.d.ts.map +1 -0
- package/dist/utils/tests/index.d.ts +3 -0
- package/dist/utils/tests/index.d.ts.map +1 -0
- package/jest.config.ts +15 -0
- package/package.json +21 -16
- package/src/@types/core/events.ts +7 -7
- package/src/@types/core/live.ts +28 -0
- package/src/@types/core/paging.ts +1 -1
- package/src/@types/core/payload.ts +21 -16
- package/src/@types/domains/channel.ts +16 -1
- package/src/@types/domains/client.ts +17 -0
- package/src/@types/domains/comment.ts +31 -0
- package/src/@types/domains/content.ts +34 -3
- package/src/@types/domains/file.ts +42 -3
- package/src/@types/domains/follow.ts +31 -1
- package/src/@types/domains/group.ts +1 -0
- package/src/@types/domains/message.ts +20 -0
- package/src/@types/domains/post.ts +37 -0
- package/src/@types/domains/reaction.ts +17 -0
- package/src/@types/global.ts +2 -0
- package/src/@types/index.ts +4 -2
- package/src/channel/api/addChannelMembers.ts +6 -5
- package/src/channel/api/addChannelMembersRole.ts +5 -1
- package/src/channel/api/banChannelMembers.ts +45 -0
- package/src/channel/api/createChannel.ts +6 -2
- package/src/channel/api/getChannel.ts +5 -1
- package/src/channel/api/getChannels.ts +5 -1
- package/src/channel/api/index.ts +3 -0
- package/src/channel/api/joinChannel.ts +5 -1
- package/src/channel/api/leaveChannel.ts +5 -1
- package/src/channel/api/queryChannelMembers.ts +16 -12
- package/src/channel/api/queryChannels.ts +9 -4
- package/src/channel/api/removeChannelMembers.ts +6 -5
- package/src/channel/api/removeChannelMembersRole.ts +5 -1
- package/src/channel/api/unbanChannelMembers.ts +45 -0
- package/src/channel/api/updateChannel.ts +5 -1
- package/src/channel/events/index.ts +1 -0
- package/src/channel/events/onChannelCreated.ts +6 -2
- package/src/channel/events/onChannelDeleted.ts +6 -2
- package/src/channel/events/onChannelJoined.ts +6 -2
- package/src/channel/events/onChannelLeft.ts +6 -2
- package/src/channel/events/onChannelMemberAdded.ts +6 -2
- package/src/channel/events/onChannelMemberRemoved.ts +6 -2
- package/src/channel/events/onChannelUpdated.ts +6 -2
- package/src/channel/observers/index.ts +1 -0
- package/src/channel/observers/observeChannel.ts +1 -11
- package/src/channel/observers/observeChannels.ts +59 -0
- package/src/channel/tests/utils/prepareChannelPayload.test.ts +120 -0
- package/src/channel/utils/index.ts +1 -0
- package/src/channel/utils/prepareChannelPayload.ts +31 -0
- package/src/client/api/connectClient.ts +4 -9
- package/src/client/api/createClient.ts +19 -4
- package/src/client/api/getFeedSettings.ts +29 -0
- package/src/client/api/index.ts +2 -0
- package/src/comment/api/queryComments.ts +3 -9
- package/src/comment/observers/index.ts +1 -0
- package/src/comment/observers/liveComments.ts +172 -0
- package/src/comment/observers/observeComments.ts +1 -11
- package/src/core/events.ts +2 -1
- package/src/core/query/query.ts +16 -3
- package/src/core/tests/query/filtering.test.ts +11 -0
- package/src/core/tests/query/query/runQuery.test.ts +182 -0
- package/src/core/tests/query/query.test.ts +19 -0
- package/src/file/api/createVideo.ts +6 -0
- package/src/follow/api/acceptFollower.ts +1 -1
- package/src/follow/api/declineFollower.ts +1 -1
- package/src/follow/api/follow.ts +1 -4
- package/src/follow/api/getFollowInfo.ts +8 -5
- package/src/follow/api/queryFollowers.ts +5 -6
- package/src/follow/api/queryFollowings.ts +5 -6
- package/src/follow/api/unfollow.ts +1 -1
- package/src/follow/api/utils.ts +17 -13
- package/src/follow/events/utils.ts +9 -6
- package/src/follow/observers/index.ts +3 -0
- package/src/follow/observers/liveFollowers.ts +149 -0
- package/src/follow/observers/liveFollowings.ts +149 -0
- package/src/index.ts +2 -1
- package/src/message/api/queryMessages.ts +3 -10
- package/src/message/observers/index.ts +1 -0
- package/src/message/observers/liveMessages.ts +141 -0
- package/src/message/observers/observeMessages.ts +0 -1
- package/src/message/observers/tests/liveMessages.test.ts +133 -0
- package/src/post/api/queryPosts.ts +3 -12
- package/src/post/observers/index.ts +1 -0
- package/src/post/observers/livePosts.ts +171 -0
- package/src/post/observers/observePosts.ts +1 -13
- package/src/post/tests/api/getPost.test.ts +88 -0
- package/src/post/tests/api/queryPosts.test.ts +23 -0
- package/src/reaction/api/queryReactions.ts +14 -14
- package/src/reaction/events/index.ts +4 -0
- package/src/reaction/events/onReactorAdded.ts +80 -0
- package/src/reaction/events/onReactorRemoved.ts +85 -0
- package/src/reaction/observers/index.ts +1 -0
- package/src/reaction/observers/liveReactions.ts +142 -0
- package/src/utils/constants.ts +3 -0
- package/src/utils/tests/client.ts +33 -0
- package/src/utils/tests/dummy/channel.ts +52 -0
- package/src/utils/tests/dummy/index.ts +7 -0
- package/src/utils/tests/dummy/message.ts +21 -0
- package/src/utils/tests/dummy/post.ts +31 -0
- package/src/utils/tests/dummy/user.ts +11 -0
- package/src/utils/tests/index.ts +2 -0
- package/tsconfig.json +23 -22
|
@@ -13,16 +13,7 @@
|
|
|
13
13
|
* @async
|
|
14
14
|
*/
|
|
15
15
|
export declare const queryMessages: {
|
|
16
|
-
(query:
|
|
17
|
-
channelId: Amity.Channel['channelId'];
|
|
18
|
-
type?: Amity.MessageContentType;
|
|
19
|
-
parentId?: Amity.Message['parentId'];
|
|
20
|
-
filterByParentId?: boolean;
|
|
21
|
-
isDeleted?: boolean;
|
|
22
|
-
tags?: Amity.Taggable['tags'];
|
|
23
|
-
excludeTags?: Amity.Taggable['tags'];
|
|
24
|
-
page?: Amity.Page;
|
|
25
|
-
}): Promise<Amity.Cached<Amity.Paged<Amity.Message>>>;
|
|
16
|
+
(query: Amity.QueryMessages): Promise<Amity.Cached<Amity.Paged<Amity.Message>>>;
|
|
26
17
|
/**
|
|
27
18
|
* ```js
|
|
28
19
|
* import { queryMessages } from '@amityco/ts-sdk'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryMessages.d.ts","sourceRoot":"","sources":["../../../src/message/api/queryMessages.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,aAAa;
|
|
1
|
+
{"version":3,"file":"queryMessages.d.ts","sourceRoot":"","sources":["../../../src/message/api/queryMessages.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,aAAa;YACjB,MAAM,aAAa,GACzB,QAAQ,MAAM,MAAM,CAAC,MAAM,KAAK,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC;IA+CpD;;;;;;;;;;;;OAYG;mBAEM,WAAW,oBAAoB,CAAC,CAAC,CAAC,CAAC,GACzC,MAAM,MAAM,CAAC,MAAM,KAAK,CAAC,MAAM,OAAO,CAAC,CAAC,GAAG,SAAS;CAjBtD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/message/observers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/message/observers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ```js
|
|
3
|
+
* import { liveMessages } from '@amityco/ts-sdk'
|
|
4
|
+
*
|
|
5
|
+
* let messages = []
|
|
6
|
+
* const unsub = liveMessages({
|
|
7
|
+
* channelId: Amity.Channel['channelId'];
|
|
8
|
+
* }, response => merge(messages, response.data))
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* Observe all mutations on a list of {@link Amity.Message} for a given target object
|
|
12
|
+
*
|
|
13
|
+
* @param params for querying memssages from a channel
|
|
14
|
+
* @param callback the function to call when new data are available
|
|
15
|
+
* @returns An {@link Amity.Unsubscriber} function to run when willing to stop observing the messages
|
|
16
|
+
*
|
|
17
|
+
* @category Messages Live Collection
|
|
18
|
+
*/
|
|
19
|
+
export declare const liveMessages: (params: Amity.MessagesLiveCollection, callback: Amity.LiveCollectionCallback<Amity.Message>, config?: Amity.LiveCollectionConfig) => Amity.Unsubscriber;
|
|
20
|
+
//# sourceMappingURL=liveMessages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"liveMessages.d.ts","sourceRoot":"","sources":["../../../src/message/observers/liveMessages.ts"],"names":[],"mappings":"AAeA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,YAAY,WACf,MAAM,sBAAsB,YAC1B,MAAM,sBAAsB,CAAC,MAAM,OAAO,CAAC,WAC5C,MAAM,oBAAoB,KAClC,MAAM,YAuGR,CAAC"}
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Observe all mutations on a list of {@link Amity.Message} for a given {@link Amity.Channel} object
|
|
10
10
|
*
|
|
11
|
-
* @param client the client to observe the message with
|
|
12
11
|
* @param channelId the ID of the channel where to observe the messages
|
|
13
12
|
* @param callback the function to call when new data are available
|
|
14
13
|
* @returns An {@link Amity.Unsubscriber} function to run when willing to stop observing the messages
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observeMessages.d.ts","sourceRoot":"","sources":["../../../src/message/observers/observeMessages.ts"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"observeMessages.d.ts","sourceRoot":"","sources":["../../../src/message/observers/observeMessages.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,eAAe,cACf,MAAM,OAAO,CAAC,WAAW,CAAC,YAC3B,MAAM,cAAc,CAC5B,MAAM,QAAQ,CAAC,MAAM,OAAO,CAAC,EAC7B;IAAC,UAAU;IAAE,UAAU;IAAE,UAAU;CAAC,CACrC,KACA,MAAM,YA8BR,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"liveMessages.test.d.ts","sourceRoot":"","sources":["../../../../src/message/observers/tests/liveMessages.test.ts"],"names":[],"mappings":""}
|
|
@@ -13,18 +13,7 @@
|
|
|
13
13
|
* @async
|
|
14
14
|
*/
|
|
15
15
|
export declare const queryPosts: {
|
|
16
|
-
(query:
|
|
17
|
-
targetId: string;
|
|
18
|
-
targetType: Amity.Post['targetType'];
|
|
19
|
-
sortBy?: 'lastCreated' | 'firstCreated' | 'lastUpdated' | 'firstUpdated';
|
|
20
|
-
dataType?: string;
|
|
21
|
-
isDeleted?: Amity.Post['isDeleted'];
|
|
22
|
-
hasFlag?: boolean;
|
|
23
|
-
feedType?: 'reviewing' | 'published';
|
|
24
|
-
tags?: Amity.Taggable['tags'];
|
|
25
|
-
matchingOnlyParentPost?: boolean;
|
|
26
|
-
page?: Amity.PageRaw;
|
|
27
|
-
}): Promise<Amity.Cached<Amity.Paged<Amity.Post, Amity.PageRaw>>>;
|
|
16
|
+
(query: Amity.QueryPosts): Promise<Amity.Cached<Amity.Paged<Amity.Post, Amity.PageRaw>>>;
|
|
28
17
|
/**
|
|
29
18
|
* ```js
|
|
30
19
|
* import { queryPosts } from '@amityco/ts-sdk'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryPosts.d.ts","sourceRoot":"","sources":["../../../src/post/api/queryPosts.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,UAAU;
|
|
1
|
+
{"version":3,"file":"queryPosts.d.ts","sourceRoot":"","sources":["../../../src/post/api/queryPosts.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,UAAU;YACd,MAAM,UAAU,GACtB,QAAQ,MAAM,MAAM,CAAC,MAAM,KAAK,CAAC,MAAM,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC;IAuChE;;;;;;;;;;;;OAYG;mBAEM,WAAW,iBAAiB,CAAC,CAAC,CAAC,CAAC,GACtC,MAAM,MAAM,CAAC,MAAM,KAAK,CAAC,MAAM,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,GAAG,SAAS;CAjBlE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/post/observers/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/post/observers/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ```js
|
|
3
|
+
* import { livePosts } from '@amityco/ts-sdk'
|
|
4
|
+
*
|
|
5
|
+
* let posts = []
|
|
6
|
+
* const unsub = livePosts({
|
|
7
|
+
* targetType: Amity.PostTargetType,
|
|
8
|
+
* targetId: Amity.Post['targetId'],
|
|
9
|
+
* }, response => merge(posts, response.data))
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* Observe all mutations on a list of {@link Amity.Post} for a given target object
|
|
13
|
+
*
|
|
14
|
+
* @param targetType the type of the target
|
|
15
|
+
* @param targetId the ID of the target
|
|
16
|
+
* @param callback the function to call when new data are available
|
|
17
|
+
* @returns An {@link Amity.Unsubscriber} function to run when willing to stop observing the messages
|
|
18
|
+
*
|
|
19
|
+
* @category Posts Live Collection
|
|
20
|
+
*/
|
|
21
|
+
export declare const livePosts: (params: Amity.PostLiveCollection, callback: Amity.LiveCollectionCallback<Amity.Post>, config?: Amity.LiveCollectionConfig) => Amity.Unsubscriber;
|
|
22
|
+
//# sourceMappingURL=livePosts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"livePosts.d.ts","sourceRoot":"","sources":["../../../src/post/observers/livePosts.ts"],"names":[],"mappings":"AAgCA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,SAAS,WACZ,MAAM,kBAAkB,YACtB,MAAM,sBAAsB,CAAC,MAAM,IAAI,CAAC,WACzC,MAAM,oBAAoB,KAClC,MAAM,YAkHR,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observePosts.d.ts","sourceRoot":"","sources":["../../../src/post/observers/observePosts.ts"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,YAAY,WACf;IACN,UAAU,EAAE,MAAM,cAAc,CAAC;IACjC,QAAQ,EAAE,MAAM,IAAI,CAAC,UAAU,CAAC,CAAC;CAClC,YACS,MAAM,cAAc,CAC5B,MAAM,IAAI,EACV;IACE,UAAU;IACV,UAAU;IACV,UAAU;IACV,YAAY;IACZ,YAAY;IACZ,WAAW;IACX,aAAa;IACb,iBAAiB;IACjB,mBAAmB;CACpB,CACF,KACA,MAAM,
|
|
1
|
+
{"version":3,"file":"observePosts.d.ts","sourceRoot":"","sources":["../../../src/post/observers/observePosts.ts"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,YAAY,WACf;IACN,UAAU,EAAE,MAAM,cAAc,CAAC;IACjC,QAAQ,EAAE,MAAM,IAAI,CAAC,UAAU,CAAC,CAAC;CAClC,YACS,MAAM,cAAc,CAC5B,MAAM,IAAI,EACV;IACE,UAAU;IACV,UAAU;IACV,UAAU;IACV,YAAY;IACZ,YAAY;IACZ,WAAW;IACX,aAAa;IACb,iBAAiB;IACjB,mBAAmB;CACpB,CACF,KACA,MAAM,YAiCR,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getPost.test.d.ts","sourceRoot":"","sources":["../../../../src/post/tests/api/getPost.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queryPosts.test.d.ts","sourceRoot":"","sources":["../../../../src/post/tests/api/queryPosts.test.ts"],"names":[],"mappings":""}
|
|
@@ -15,10 +15,5 @@
|
|
|
15
15
|
* @reaction Reaction API
|
|
16
16
|
* @async
|
|
17
17
|
* */
|
|
18
|
-
export declare const queryReactions: (query:
|
|
19
|
-
referenceId: Amity.Reaction['referenceId'];
|
|
20
|
-
referenceType: Amity.Reaction['referenceType'];
|
|
21
|
-
reactionName?: Amity.Reaction['reactionName'];
|
|
22
|
-
page?: Amity.Page;
|
|
23
|
-
}) => Promise<Amity.Paged<Amity.ReactionQuery, Amity.Page>>;
|
|
18
|
+
export declare const queryReactions: (query: Amity.QueryReactions) => Promise<Amity.Paged<Amity.ReactionQuery, Amity.Page<string>>>;
|
|
24
19
|
//# sourceMappingURL=queryReactions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryReactions.d.ts","sourceRoot":"","sources":["../../../src/reaction/api/queryReactions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"queryReactions.d.ts","sourceRoot":"","sources":["../../../src/reaction/api/queryReactions.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;KAgBK;AACL,eAAO,MAAM,cAAc,UAClB,MAAM,cAAc,KAC1B,QAAQ,MAAM,KAAK,CAAC,MAAM,aAAa,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,CAAC,CA2B9D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/reaction/events/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/reaction/events/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AAEpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ```js
|
|
3
|
+
* import { onReactorAdded } from '@amityco/ts-sdk'
|
|
4
|
+
* const dispose = onReactorAdded('post', postId, reactor => {
|
|
5
|
+
* // ...
|
|
6
|
+
* })
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* Fired when an {@link Amity.Reactor} has been added
|
|
10
|
+
*
|
|
11
|
+
* @param {@link Amity.ReactableType} referenceType
|
|
12
|
+
* @param {string} referenceId
|
|
13
|
+
* @param callback The function to call when the event was fired
|
|
14
|
+
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
15
|
+
*
|
|
16
|
+
* @category Events
|
|
17
|
+
* */
|
|
18
|
+
export declare const onReactorAdded: (referenceType: Amity.ReactableType, referenceId: Amity.Reaction['referenceId'], callback: Amity.Listener<Amity.Reactor>) => Amity.Unsubscriber;
|
|
19
|
+
//# sourceMappingURL=onReactorAdded.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onReactorAdded.d.ts","sourceRoot":"","sources":["../../../src/reaction/events/onReactorAdded.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;KAgBK;AACL,eAAO,MAAM,cAAc,kBACV,MAAM,aAAa,eACrB,MAAM,QAAQ,CAAC,aAAa,CAAC,YAChC,MAAM,QAAQ,CAAC,MAAM,OAAO,CAAC,KACtC,MAAM,YAsDR,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ```js
|
|
3
|
+
* import { onReactorRemoved } from '@amityco/ts-sdk'
|
|
4
|
+
* const dispose = onReactorRemoved('post', postId, reactor => {
|
|
5
|
+
* // ...
|
|
6
|
+
* })
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* Fired when an {@link Amity.Reactor} has been removed
|
|
10
|
+
*
|
|
11
|
+
* @param {@link Amity.ReactableType} referenceType
|
|
12
|
+
* @param {string} referenceId
|
|
13
|
+
* @param callback The function to call when the event was fired
|
|
14
|
+
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
15
|
+
*
|
|
16
|
+
* @category Events
|
|
17
|
+
* */
|
|
18
|
+
export declare const onReactorRemoved: (referenceType: Amity.ReactableType, referenceId: Amity.Reaction['referenceId'], callback: Amity.Listener<Amity.Reactor>) => Amity.Unsubscriber;
|
|
19
|
+
//# sourceMappingURL=onReactorRemoved.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onReactorRemoved.d.ts","sourceRoot":"","sources":["../../../src/reaction/events/onReactorRemoved.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;KAgBK;AACL,eAAO,MAAM,gBAAgB,kBACZ,MAAM,aAAa,eACrB,MAAM,QAAQ,CAAC,aAAa,CAAC,YAChC,MAAM,QAAQ,CAAC,MAAM,OAAO,CAAC,KACtC,MAAM,YA2DR,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/reaction/observers/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ```js
|
|
3
|
+
* import { liveReactions } from '@amityco/ts-sdk'
|
|
4
|
+
*
|
|
5
|
+
* let reactions = []
|
|
6
|
+
* const unsub = liveReactions({
|
|
7
|
+
* referenceId: Amity.Reaction['referenceId'],
|
|
8
|
+
* referenceType: Amity.Reaction['referenceType'],
|
|
9
|
+
* }, response => merge(reactions, response.data))
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* Observe all mutations on a list of {@link Amity.Reaction} for a given target object
|
|
13
|
+
*
|
|
14
|
+
* @param referenceType the type of the target
|
|
15
|
+
* @param referenceId the ID of the target
|
|
16
|
+
* @param callback the function to call when new data are available
|
|
17
|
+
* @returns An {@link Amity.Unsubscriber} function to run when willing to stop observing the messages
|
|
18
|
+
*
|
|
19
|
+
* @category Reactions Live Collection
|
|
20
|
+
*/
|
|
21
|
+
export declare const liveReactions: (params: Amity.ReactionLiveCollection, callback: Amity.LiveCollectionCallback<Amity.Reactor>, config?: Amity.LiveCollectionConfig) => Amity.Unsubscriber;
|
|
22
|
+
//# sourceMappingURL=liveReactions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"liveReactions.d.ts","sourceRoot":"","sources":["../../../src/reaction/observers/liveReactions.ts"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,aAAa,WAChB,MAAM,sBAAsB,YAC1B,MAAM,sBAAsB,CAAC,MAAM,OAAO,CAAC,WAC5C,MAAM,oBAAoB,KAClC,MAAM,YAuGR,CAAC"}
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
*/
|
|
16
16
|
export declare const queryRoles: {
|
|
17
17
|
(query?: {
|
|
18
|
-
displayName?:
|
|
19
|
-
sortBy?:
|
|
20
|
-
page?: Amity.Page
|
|
21
|
-
}
|
|
18
|
+
displayName?: Amity.Role['displayName'];
|
|
19
|
+
sortBy?: 'displayName' | 'firstCreated' | 'lastCreated';
|
|
20
|
+
page?: Amity.Page;
|
|
21
|
+
}): Promise<Amity.Cached<Amity.Paged<Amity.Role>>>;
|
|
22
22
|
/**
|
|
23
23
|
* ```js
|
|
24
24
|
* import { queryRoles } from '@amityco/ts-sdk'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryRoles.d.ts","sourceRoot":"","sources":["../../../src/role/api/queryRoles.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,UAAU
|
|
1
|
+
{"version":3,"file":"queryRoles.d.ts","sourceRoot":"","sources":["../../../src/role/api/queryRoles.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,UAAU;aAAkB;QACvC,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC,aAAa,CAAC,CAAC;QACxC,MAAM,CAAC,EAAE,aAAa,GAAG,cAAc,GAAG,aAAa,CAAC;QACxD,IAAI,CAAC,EAAE,MAAM,IAAI,CAAC;KACnB,GAAG,QAAQ,MAAM,MAAM,CAAC,MAAM,KAAK,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC;IA8BlD;;;;;;;;;;;;;OAaG;mBAC0B,WAAW,iBAAiB,CAAC,CAAC,CAAC,CAAC;CAhB5D,CAAC"}
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
*/
|
|
15
15
|
export declare const queryStreams: {
|
|
16
16
|
(query?: {
|
|
17
|
-
isLive?: boolean
|
|
18
|
-
statuses?: Amity.StreamStatus[]
|
|
19
|
-
userPublicIds?:
|
|
20
|
-
sortBy?:
|
|
17
|
+
isLive?: boolean;
|
|
18
|
+
statuses?: Amity.StreamStatus[];
|
|
19
|
+
userPublicIds?: Amity.User['userId'][];
|
|
20
|
+
sortBy?: 'lastCreated' | 'firstCreated';
|
|
21
21
|
isDeleted?: Amity.Stream['isDeleted'];
|
|
22
|
-
page?: Amity.Page
|
|
23
|
-
}
|
|
22
|
+
page?: Amity.Page;
|
|
23
|
+
}): Promise<Amity.Cached<Amity.Paged<Amity.Stream>>>;
|
|
24
24
|
/**
|
|
25
25
|
* ```js
|
|
26
26
|
* import { queryStreams } from '@amityco/ts-sdk'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queryStreams.d.ts","sourceRoot":"","sources":["../../../src/stream/api/queryStreams.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"queryStreams.d.ts","sourceRoot":"","sources":["../../../src/stream/api/queryStreams.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,YAAY;aAAkB;QACzC,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,YAAY,EAAE,CAAC;QAChC,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QACvC,MAAM,CAAC,EAAE,aAAa,GAAG,cAAc,CAAC;QACxC,SAAS,CAAC,EAAE,MAAM,MAAM,CAAC,WAAW,CAAC,CAAC;QACtC,IAAI,CAAC,EAAE,MAAM,IAAI,CAAC;KACnB,GAAG,QAAQ,MAAM,MAAM,CAAC,MAAM,KAAK,CAAC,MAAM,MAAM,CAAC,CAAC,CAAC;IAgCpD;;;;;;;;;;;;OAYG;mBAC4B,WAAW,mBAAmB,CAAC,CAAC,CAAC,CAAC;CAfhE,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const COLLECTION_DEFAULT_PAGINATION_LIMIT = 5;
|
|
2
|
+
export declare const COLLECTION_DEFAULT_CACHING_POLICY: Amity.QueryPolicy;
|
|
3
|
+
export declare const ENABLE_CACHE_MESSAGE = "For using Live Collection feature you need to enable Cache!";
|
|
4
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mCAAmC,IAAI,CAAC;AACrD,eAAO,MAAM,iCAAiC,EAAE,KAAK,CAAC,WAAiC,CAAC;AACxF,eAAO,MAAM,oBAAoB,gEAAgE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/utils/tests/client.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,MAAM,cAA4B,CAAC;AAEhD,eAAO,MAAM,aAAa,qBAgBzB,CAAC;AAEF,eAAO,MAAM,gBAAgB,qBAE5B,CAAC;;AAEF,wBAAkB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const channelRaw1: Amity.ChannelRaw;
|
|
2
|
+
export declare const channelRaw2: Amity.ChannelRaw;
|
|
3
|
+
export declare const channel11: Amity.Channel;
|
|
4
|
+
export declare const channel12: Amity.Channel;
|
|
5
|
+
export declare const channelUser1: Amity.Membership<'channel'>;
|
|
6
|
+
export declare const channelUser2: Amity.Membership<'channel'>;
|
|
7
|
+
export declare const channels: {
|
|
8
|
+
page1: string[];
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=channel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channel.d.ts","sourceRoot":"","sources":["../../../../src/utils/tests/dummy/channel.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,UAK/B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,UAK/B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,OAI7B,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,OAI7B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,UAAU,CAAC,SAAS,CAYpD,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,UAAU,CAAC,SAAS,CAKpD,CAAC;AAEF,eAAO,MAAM,QAAQ;;CAEpB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const date: string;
|
|
2
|
+
export declare const rolesAndPermissions: {
|
|
3
|
+
roles: never[];
|
|
4
|
+
permissions: never[];
|
|
5
|
+
};
|
|
6
|
+
export * from './user';
|
|
7
|
+
export * from './post';
|
|
8
|
+
export * from './channel';
|
|
9
|
+
export * from './message';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/tests/dummy/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,IAAI,QAA2B,CAAC;AAC7C,eAAO,MAAM,mBAAmB;;;CAAiC,CAAC;AAElE,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../src/utils/tests/dummy/message.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,OAW3B,CAAC;AAEF,eAAO,MAAM,QAAQ;;;;;CAKpB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"post.d.ts","sourceRoot":"","sources":["../../../../src/utils/tests/dummy/post.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,IAoBzB,CAAC;AAEF,eAAO,MAAM,KAAK;;;;;;CAMjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../../src/utils/tests/dummy/user.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,IAQ1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/tests/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
|
package/jest.config.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
clearMocks: true,
|
|
3
|
+
collectCoverageFrom: ['**/*.ts', '!**/*.test.ts'],
|
|
4
|
+
coverageDirectory: '../coverage',
|
|
5
|
+
coveragePathIgnorePatterns: ['/node_modules/', '/dist/', '/@types/'],
|
|
6
|
+
coverageReporters: ['lcov', 'text', 'text-summary'],
|
|
7
|
+
globals: {
|
|
8
|
+
'ts-jest': {
|
|
9
|
+
useESM: true,
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
moduleNameMapper: { '~/(.*)$': '<rootDir>/$1' },
|
|
13
|
+
preset: 'ts-jest/presets/default-esm',
|
|
14
|
+
rootDir: 'src',
|
|
15
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amityco/ts-sdk",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.28",
|
|
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",
|
|
@@ -28,34 +28,39 @@
|
|
|
28
28
|
"prebuild": "yarn run clean",
|
|
29
29
|
"build": "rollup -c ./rollup.config.js",
|
|
30
30
|
"prewatch": "yarn run clean",
|
|
31
|
-
"watch": "rollup -w -c ./rollup.config.js"
|
|
31
|
+
"watch": "rollup -w -c ./rollup.config.js",
|
|
32
|
+
"test": "jest",
|
|
33
|
+
"test:coverage": "jest --coverage --silent"
|
|
32
34
|
},
|
|
33
35
|
"devDependencies": {
|
|
34
|
-
"@rollup/plugin-commonjs": "^
|
|
35
|
-
"@rollup/plugin-node-resolve": "^13.0
|
|
36
|
+
"@rollup/plugin-commonjs": "^22.0.2",
|
|
37
|
+
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
36
38
|
"@rollup/plugin-replace": "^4.0.0",
|
|
37
39
|
"@types/axios": "^0.14.0",
|
|
38
|
-
"@types/debug": "^4.1.
|
|
39
|
-
"@types/
|
|
40
|
+
"@types/debug": "^4.1.7",
|
|
41
|
+
"@types/jest": "^27.5.1",
|
|
42
|
+
"@types/node": "^18.6.4",
|
|
40
43
|
"@types/socket.io-client": "^1.4.34",
|
|
41
44
|
"chalk": "^4.1.2",
|
|
42
45
|
"concurrently": "^6.1.0",
|
|
46
|
+
"jest": "^28.1.0",
|
|
43
47
|
"rimraf": "^3.0.2",
|
|
44
|
-
"rollup": "^2.
|
|
48
|
+
"rollup": "^2.77.2",
|
|
45
49
|
"rollup-plugin-terser": "^7.0.2",
|
|
46
|
-
"rollup-plugin-typescript2": "^0.
|
|
47
|
-
"tslib": "^2.
|
|
48
|
-
"typescript": "^4.
|
|
50
|
+
"rollup-plugin-typescript2": "^0.32.1",
|
|
51
|
+
"tslib": "^2.4.0",
|
|
52
|
+
"typescript": "^4.7.4"
|
|
49
53
|
},
|
|
50
54
|
"dependencies": {
|
|
51
|
-
"@react-native-async-storage/async-storage": "^1.
|
|
52
|
-
"agentkeepalive": "^4.1
|
|
55
|
+
"@react-native-async-storage/async-storage": "^1.17.7",
|
|
56
|
+
"agentkeepalive": "^4.2.1",
|
|
53
57
|
"axios": "0.21.1",
|
|
54
|
-
"debug": "^4.3.
|
|
55
|
-
"js-base64": "^3.
|
|
58
|
+
"debug": "^4.3.4",
|
|
59
|
+
"js-base64": "^3.7.2",
|
|
56
60
|
"mitt": "^3.0.0",
|
|
57
|
-
"mqtt": "^4.
|
|
61
|
+
"mqtt": "^4.3.7",
|
|
58
62
|
"react-native-uuid": "^2.0.1",
|
|
59
|
-
"socket.io-client": "2.2.0"
|
|
63
|
+
"socket.io-client": "2.2.0",
|
|
64
|
+
"ts-jest": "^28.0.3"
|
|
60
65
|
}
|
|
61
66
|
}
|
|
@@ -101,13 +101,13 @@ declare global {
|
|
|
101
101
|
};
|
|
102
102
|
|
|
103
103
|
type MqttFollowMessageEvents = {
|
|
104
|
-
'follow.created': Amity.
|
|
105
|
-
'follow.requested': Amity.
|
|
106
|
-
'follow.accepted': Amity.
|
|
107
|
-
'follow.unfollowed': Amity.
|
|
108
|
-
'follow.requestCanceled': Amity.
|
|
109
|
-
'follow.requestDeclined': Amity.
|
|
110
|
-
'follow.followerDeleted': Amity.
|
|
104
|
+
'follow.created': Amity.FollowersPayload | Amity.FollowStatusPayload;
|
|
105
|
+
'follow.requested': Amity.FollowersPayload | Amity.FollowStatusPayload;
|
|
106
|
+
'follow.accepted': Amity.FollowersPayload | Amity.FollowStatusPayload;
|
|
107
|
+
'follow.unfollowed': Amity.FollowersPayload | Amity.FollowStatusPayload;
|
|
108
|
+
'follow.requestCanceled': Amity.FollowersPayload | Amity.FollowStatusPayload;
|
|
109
|
+
'follow.requestDeclined': Amity.FollowersPayload | Amity.FollowStatusPayload;
|
|
110
|
+
'follow.followerDeleted': Amity.FollowersPayload | Amity.FollowStatusPayload;
|
|
111
111
|
};
|
|
112
112
|
|
|
113
113
|
type MqttMessageEvents = MqttCommunityMessageEvents &
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
|
|
3
|
+
declare global {
|
|
4
|
+
namespace Amity {
|
|
5
|
+
type LiveCollection<T extends any> = {
|
|
6
|
+
data: T[];
|
|
7
|
+
onNextPage: () => void;
|
|
8
|
+
hasNextPage: boolean;
|
|
9
|
+
error?: any;
|
|
10
|
+
loading: boolean;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
type LiveCollectionCallback<T extends any> = Amity.Listener<LiveCollection<T>>;
|
|
14
|
+
|
|
15
|
+
type LiveCollectionConfig = {
|
|
16
|
+
policy?: Exclude<Amity.QueryPolicy, 'no_fetch'>;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
type LiveCollectionParams<T extends any> = T & {
|
|
20
|
+
limit?: number;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
type LiveCollectionCache<T extends any, U extends any> = Pick<
|
|
24
|
+
LiveCollection<T>,
|
|
25
|
+
'data' | 'error' | 'loading'
|
|
26
|
+
> & { params: U };
|
|
27
|
+
}
|
|
28
|
+
}
|