@amityco/ts-sdk 0.0.1-beta.40 → 0.0.1-beta.41.1
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/README.md +3 -1
- 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.map +1 -1
- package/dist/channel/api/createChannel.d.ts.map +1 -1
- package/dist/channel/api/getChannel.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.map +1 -1
- package/dist/channel/api/removeChannelMembers.d.ts.map +1 -1
- package/dist/channel/api/removeChannelMembersRole.d.ts +1 -1
- package/dist/channel/api/removeChannelMembersRole.d.ts.map +1 -1
- package/dist/channel/api/startReading.d.ts +3 -3
- package/dist/channel/api/startReading.d.ts.map +1 -1
- package/dist/channel/api/stopReading.d.ts +2 -2
- package/dist/channel/api/stopReading.d.ts.map +1 -1
- package/dist/channel/api/unbanChannelMembers.d.ts.map +1 -1
- package/dist/channel/api/updateChannel.d.ts.map +1 -1
- package/dist/client/api/connectClient.d.ts.map +1 -1
- package/dist/client/api/disconnectClient.d.ts.map +1 -1
- package/dist/client/api/renewal.d.ts.map +1 -1
- package/dist/comment/api/createComment.d.ts.map +1 -1
- package/dist/comment/api/deleteComment.d.ts.map +1 -1
- package/dist/comment/api/getComment.d.ts.map +1 -1
- package/dist/comment/api/getComments.d.ts.map +1 -1
- package/dist/comment/api/queryComments.d.ts.map +1 -1
- package/dist/comment/api/updateComment.d.ts.map +1 -1
- package/dist/community/api/addCommunityMembers.d.ts.map +1 -1
- package/dist/community/api/addCommunityMembersRoles.d.ts.map +1 -1
- package/dist/community/api/createCommunity.d.ts.map +1 -1
- package/dist/community/api/deleteCommunity.d.ts.map +1 -1
- package/dist/community/api/getCommunity.d.ts.map +1 -1
- package/dist/community/api/getRecommendedCommunities.d.ts.map +1 -1
- package/dist/community/api/getTopTrendingCommunities.d.ts.map +1 -1
- package/dist/community/api/joinCommunity.d.ts.map +1 -1
- package/dist/community/api/leaveCommunity.d.ts.map +1 -1
- package/dist/community/api/queryCommunities.d.ts.map +1 -1
- package/dist/community/api/queryCommunityMembers.d.ts.map +1 -1
- package/dist/community/api/removeCommunityMembers.d.ts.map +1 -1
- package/dist/community/api/removeCommunityMembersRoles.d.ts.map +1 -1
- package/dist/community/api/updateCommunity.d.ts.map +1 -1
- package/dist/core/transports/http.d.ts.map +1 -1
- package/dist/feed/api/queryGlobalFeed.d.ts.map +1 -1
- package/dist/file/api/createFile.d.ts.map +1 -1
- package/dist/file/api/createImage.d.ts.map +1 -1
- package/dist/file/api/createVideo.d.ts.map +1 -1
- package/dist/file/api/deleteFile.d.ts.map +1 -1
- package/dist/file/api/getFile.d.ts.map +1 -1
- package/dist/follow/api/acceptFollower.d.ts.map +1 -1
- package/dist/follow/api/declineFollower.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.map +1 -1
- package/dist/follow/api/queryFollowings.d.ts.map +1 -1
- package/dist/follow/api/unfollow.d.ts.map +1 -1
- package/dist/index.cjs.js +426 -67
- package/dist/index.esm.js +426 -67
- package/dist/index.umd.js +2 -2
- package/dist/message/api/createMessage.d.ts.map +1 -1
- package/dist/message/api/deleteMessage.d.ts.map +1 -1
- package/dist/message/api/getMessage.d.ts.map +1 -1
- package/dist/message/api/queryMessages.d.ts.map +1 -1
- package/dist/message/api/updateMessage.d.ts.map +1 -1
- package/dist/poll/api/closePoll.d.ts.map +1 -1
- package/dist/poll/api/createPoll.d.ts.map +1 -1
- package/dist/poll/api/deletePoll.d.ts.map +1 -1
- package/dist/poll/api/getPoll.d.ts.map +1 -1
- package/dist/poll/api/votePoll.d.ts.map +1 -1
- package/dist/post/api/approvePost.d.ts.map +1 -1
- package/dist/post/api/createPost.d.ts.map +1 -1
- package/dist/post/api/declinePost.d.ts.map +1 -1
- package/dist/post/api/deletePost.d.ts.map +1 -1
- package/dist/post/api/getPost.d.ts.map +1 -1
- package/dist/post/api/getPosts.d.ts.map +1 -1
- package/dist/post/api/queryPosts.d.ts.map +1 -1
- package/dist/post/api/updatePost.d.ts.map +1 -1
- package/dist/reaction/api/addReaction.d.ts.map +1 -1
- package/dist/reaction/api/queryReactions.d.ts.map +1 -1
- package/dist/reaction/api/removeReaction.d.ts.map +1 -1
- package/dist/report/api/createReport.d.ts.map +1 -1
- package/dist/report/api/deleteReport.d.ts.map +1 -1
- package/dist/report/api/isReportedByMe.d.ts.map +1 -1
- package/dist/stream/api/createStream.d.ts.map +1 -1
- package/dist/stream/api/deleteStream.d.ts.map +1 -1
- package/dist/stream/api/getStream.d.ts.map +1 -1
- package/dist/stream/api/queryStreams.d.ts.map +1 -1
- package/dist/stream/api/updateStream.d.ts.map +1 -1
- package/dist/subChannel/api/createSubChannel.d.ts.map +1 -1
- package/dist/subChannel/api/deleteSubChannel.d.ts.map +1 -1
- package/dist/subChannel/api/getSubChannel.d.ts.map +1 -1
- package/dist/subChannel/api/querySubChannels.d.ts.map +1 -1
- package/dist/subChannel/api/updateSubChannel.d.ts.map +1 -1
- package/dist/user/api/getUser.d.ts.map +1 -1
- package/dist/user/api/getUsers.d.ts.map +1 -1
- package/dist/user/api/queryUsers.d.ts.map +1 -1
- package/dist/user/api/updateUser.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/category/api/queryCategories.ts +3 -0
- package/src/channel/api/addChannelMembers.ts +4 -0
- package/src/channel/api/addChannelMembersRole.ts +4 -0
- package/src/channel/api/banChannelMembers.ts +4 -0
- package/src/channel/api/createChannel.ts +4 -0
- package/src/channel/api/getChannel.ts +4 -0
- package/src/channel/api/joinChannel.ts +4 -0
- package/src/channel/api/leaveChannel.ts +4 -0
- package/src/channel/api/queryChannelMembers.ts +4 -0
- package/src/channel/api/queryChannels.ts +4 -0
- package/src/channel/api/removeChannelMembers.ts +4 -0
- package/src/channel/api/removeChannelMembersRole.ts +5 -1
- package/src/channel/api/startReading.ts +7 -3
- package/src/channel/api/stopReading.ts +6 -2
- package/src/channel/api/unbanChannelMembers.ts +4 -0
- package/src/channel/api/updateChannel.ts +4 -0
- package/src/client/api/connectClient.ts +4 -0
- package/src/client/api/disconnectClient.ts +4 -0
- package/src/client/api/getToken.ts +1 -1
- package/src/client/api/renewal.ts +4 -0
- package/src/client/api/tests/getToken.test.ts +2 -2
- package/src/comment/api/createComment.ts +4 -0
- package/src/comment/api/deleteComment.ts +4 -0
- package/src/comment/api/getComment.ts +4 -0
- package/src/comment/api/getComments.ts +4 -0
- package/src/comment/api/queryComments.ts +4 -0
- package/src/comment/api/updateComment.ts +4 -0
- package/src/community/api/addCommunityMembers.ts +4 -0
- package/src/community/api/addCommunityMembersRoles.ts +4 -0
- package/src/community/api/createCommunity.ts +4 -0
- package/src/community/api/deleteCommunity.ts +4 -0
- package/src/community/api/getCommunity.ts +4 -0
- package/src/community/api/getRecommendedCommunities.ts +4 -0
- package/src/community/api/getTopTrendingCommunities.ts +4 -0
- package/src/community/api/joinCommunity.ts +4 -0
- package/src/community/api/leaveCommunity.ts +4 -0
- package/src/community/api/queryCommunities.ts +4 -0
- package/src/community/api/queryCommunityMembers.ts +4 -0
- package/src/community/api/removeCommunityMembers.ts +4 -0
- package/src/community/api/removeCommunityMembersRoles.ts +4 -0
- package/src/community/api/updateCommunity.ts +4 -0
- package/src/core/transports/http.ts +5 -0
- package/src/core/transports/test/http.test.ts +12 -0
- package/src/feed/api/queryGlobalFeed.ts +4 -0
- package/src/file/api/createFile.ts +4 -0
- package/src/file/api/createImage.ts +4 -0
- package/src/file/api/createVideo.ts +4 -0
- package/src/file/api/deleteFile.ts +4 -0
- package/src/file/api/getFile.ts +4 -0
- package/src/follow/api/acceptFollower.ts +4 -0
- package/src/follow/api/declineFollower.ts +4 -0
- package/src/follow/api/follow.ts +4 -0
- package/src/follow/api/getFollowInfo.ts +4 -0
- package/src/follow/api/queryFollowers.ts +4 -0
- package/src/follow/api/queryFollowings.ts +4 -0
- package/src/follow/api/unfollow.ts +4 -0
- package/src/message/api/createMessage.ts +9 -4
- package/src/message/api/deleteMessage.ts +4 -0
- package/src/message/api/getMessage.ts +4 -0
- package/src/message/api/queryMessages.ts +4 -0
- package/src/message/api/tests/createMessage.test.ts +16 -0
- package/src/message/api/updateMessage.ts +4 -0
- package/src/message/observers/liveMessages.ts +1 -1
- package/src/poll/api/closePoll.ts +4 -0
- package/src/poll/api/createPoll.ts +4 -0
- package/src/poll/api/deletePoll.ts +4 -0
- package/src/poll/api/getPoll.ts +4 -0
- package/src/poll/api/votePoll.ts +4 -0
- package/src/post/api/approvePost.ts +4 -0
- package/src/post/api/createPost.ts +4 -0
- package/src/post/api/declinePost.ts +4 -0
- package/src/post/api/deletePost.ts +4 -0
- package/src/post/api/getPost.ts +4 -0
- package/src/post/api/getPosts.ts +3 -0
- package/src/post/api/queryPosts.ts +4 -0
- package/src/post/api/updatePost.ts +4 -0
- package/src/reaction/api/addReaction.ts +4 -0
- package/src/reaction/api/queryReactions.ts +4 -0
- package/src/reaction/api/removeReaction.ts +4 -0
- package/src/report/api/createReport.ts +4 -0
- package/src/report/api/deleteReport.ts +4 -0
- package/src/report/api/isReportedByMe.ts +4 -0
- package/src/stream/api/createStream.ts +4 -0
- package/src/stream/api/deleteStream.ts +3 -0
- package/src/stream/api/getStream.ts +4 -0
- package/src/stream/api/queryStreams.ts +4 -0
- package/src/stream/api/updateStream.ts +3 -0
- package/src/subChannel/api/createSubChannel.ts +4 -0
- package/src/subChannel/api/deleteSubChannel.ts +4 -0
- package/src/subChannel/api/getSubChannel.ts +4 -0
- package/src/subChannel/api/querySubChannels.ts +4 -0
- package/src/subChannel/api/updateSubChannel.ts +4 -0
- package/src/user/api/getUser.ts +4 -0
- package/src/user/api/getUsers.ts +3 -0
- package/src/user/api/queryUsers.ts +4 -0
- package/src/user/api/updateUser.ts +4 -0
|
@@ -3,6 +3,7 @@ import { disableCache, enableCache, pullFromCache, pushToCache } from '~/cache/a
|
|
|
3
3
|
|
|
4
4
|
import { client, generateRawMessage, pause } from '~/utils/tests';
|
|
5
5
|
|
|
6
|
+
import { createQuery, runQuery } from '~/core/query';
|
|
6
7
|
import { convertFromRaw } from '../../utils';
|
|
7
8
|
import { onMessageCreated } from '../../events';
|
|
8
9
|
import { createMessage } from '../createMessage';
|
|
@@ -192,4 +193,19 @@ describe('uniqueId / referenceId', () => {
|
|
|
192
193
|
}),
|
|
193
194
|
);
|
|
194
195
|
});
|
|
196
|
+
|
|
197
|
+
it('should pass referenceId if cache is turned off', async () => {
|
|
198
|
+
disableCache();
|
|
199
|
+
client.http.post = jest.fn().mockResolvedValue({ data: { messages: [rawMessageToCreate] } });
|
|
200
|
+
|
|
201
|
+
runQuery(createQuery(createMessage, bundle));
|
|
202
|
+
await pause();
|
|
203
|
+
|
|
204
|
+
expect(client.http.post).toHaveBeenCalledWith(
|
|
205
|
+
expect.anything(),
|
|
206
|
+
expect.objectContaining({
|
|
207
|
+
referenceId: expect.stringMatching(/LOCAL_/),
|
|
208
|
+
}),
|
|
209
|
+
);
|
|
210
|
+
});
|
|
195
211
|
});
|
|
@@ -5,6 +5,9 @@ import { pullFromCache, upsertInCache } from '~/cache/api';
|
|
|
5
5
|
import { fireEvent } from '~/core/events';
|
|
6
6
|
import { convertParams, convertResponseFromRaw } from '../utils';
|
|
7
7
|
|
|
8
|
+
/* begin_public_function
|
|
9
|
+
id: message.edit
|
|
10
|
+
*/
|
|
8
11
|
/**
|
|
9
12
|
* ```js
|
|
10
13
|
* import { updateMessage } from '@amityco/ts-sdk'
|
|
@@ -93,3 +96,4 @@ updateMessage.optimistically = (
|
|
|
93
96
|
cachedAt,
|
|
94
97
|
};
|
|
95
98
|
};
|
|
99
|
+
/* end_public_function */
|
|
@@ -3,6 +3,9 @@ import { getActiveClient } from '~/client/api';
|
|
|
3
3
|
|
|
4
4
|
import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
5
5
|
|
|
6
|
+
/* begin_public_function
|
|
7
|
+
id: poll.close
|
|
8
|
+
*/
|
|
6
9
|
/**
|
|
7
10
|
* ```js
|
|
8
11
|
* import { closePoll } from '@amityco/ts-sdk'
|
|
@@ -40,3 +43,4 @@ export const closePoll = async (
|
|
|
40
43
|
cachedAt,
|
|
41
44
|
};
|
|
42
45
|
};
|
|
46
|
+
/* end_public_function */
|
|
@@ -2,6 +2,9 @@ import { getActiveClient } from '~/client/api';
|
|
|
2
2
|
|
|
3
3
|
import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
4
4
|
|
|
5
|
+
/* begin_public_function
|
|
6
|
+
id: poll.create
|
|
7
|
+
*/
|
|
5
8
|
/**
|
|
6
9
|
* ```js
|
|
7
10
|
* import { createPoll } from '@amityco/ts-sdk'
|
|
@@ -43,3 +46,4 @@ export const createPoll = async (
|
|
|
43
46
|
cachedAt,
|
|
44
47
|
};
|
|
45
48
|
};
|
|
49
|
+
/* end_public_function */
|
|
@@ -5,6 +5,9 @@ import { upsertInCache } from '~/cache/api';
|
|
|
5
5
|
|
|
6
6
|
import { getPoll } from './getPoll';
|
|
7
7
|
|
|
8
|
+
/* begin_public_function
|
|
9
|
+
id: poll.delete
|
|
10
|
+
*/
|
|
8
11
|
/**
|
|
9
12
|
* ```js
|
|
10
13
|
* import { deletePoll } from '@amityco/ts-sdk'
|
|
@@ -37,3 +40,4 @@ export const deletePoll = async (pollId: Amity.Poll['pollId']): Promise<boolean>
|
|
|
37
40
|
|
|
38
41
|
return success;
|
|
39
42
|
};
|
|
43
|
+
/* end_public_function */
|
package/src/poll/api/getPoll.ts
CHANGED
|
@@ -3,6 +3,9 @@ import { getActiveClient } from '~/client/api';
|
|
|
3
3
|
import { pullFromCache } from '~/cache/api';
|
|
4
4
|
import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
5
5
|
|
|
6
|
+
/* begin_public_function
|
|
7
|
+
id: poll.get
|
|
8
|
+
*/
|
|
6
9
|
/**
|
|
7
10
|
* ```js
|
|
8
11
|
* import { getPoll } from '@amityco/ts-sdk'
|
|
@@ -33,6 +36,7 @@ export const getPoll = async (pollId: Amity.Poll['pollId']): Promise<Amity.Cache
|
|
|
33
36
|
cachedAt,
|
|
34
37
|
};
|
|
35
38
|
};
|
|
39
|
+
/* end_public_function */
|
|
36
40
|
|
|
37
41
|
/**
|
|
38
42
|
* ```js
|
package/src/poll/api/votePoll.ts
CHANGED
|
@@ -3,6 +3,9 @@ import { getActiveClient } from '~/client/api';
|
|
|
3
3
|
|
|
4
4
|
import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
5
5
|
|
|
6
|
+
/* begin_public_function
|
|
7
|
+
id: poll.vote
|
|
8
|
+
*/
|
|
6
9
|
/**
|
|
7
10
|
* ```js
|
|
8
11
|
* import { votePoll } from '@amityco/ts-sdk'
|
|
@@ -42,3 +45,4 @@ export const votePoll = async (
|
|
|
42
45
|
cachedAt,
|
|
43
46
|
};
|
|
44
47
|
};
|
|
48
|
+
/* end_public_function */
|
|
@@ -4,6 +4,9 @@ import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
|
4
4
|
import { fireEvent } from '~/core/events';
|
|
5
5
|
import { prepareMembershipPayload } from '~/group/utils';
|
|
6
6
|
|
|
7
|
+
/* begin_public_function
|
|
8
|
+
id: post.approve
|
|
9
|
+
*/
|
|
7
10
|
/**
|
|
8
11
|
* ```js
|
|
9
12
|
* import { approvePost } from '@amityco/ts-sdk'
|
|
@@ -46,3 +49,4 @@ export const approvePost = async (
|
|
|
46
49
|
cachedAt,
|
|
47
50
|
};
|
|
48
51
|
};
|
|
52
|
+
/* end_public_function */
|
|
@@ -4,6 +4,9 @@ import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
|
4
4
|
import { fireEvent } from '~/core/events';
|
|
5
5
|
import { prepareMembershipPayload } from '~/group/utils';
|
|
6
6
|
|
|
7
|
+
/* begin_public_function
|
|
8
|
+
id: post.create.text_post, post.create.image_post, post.create.file_post, post.create.video_post, post.create.poll_post, post.create.livestream_post, post.create.custom_post
|
|
9
|
+
*/
|
|
7
10
|
/**
|
|
8
11
|
* ```js
|
|
9
12
|
* import { createPost } from '@amityco/ts-sdk'
|
|
@@ -54,3 +57,4 @@ export const createPost = async <T extends Amity.PostContentType | string>(
|
|
|
54
57
|
cachedAt,
|
|
55
58
|
};
|
|
56
59
|
};
|
|
60
|
+
/* end_public_function */
|
|
@@ -4,6 +4,9 @@ import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
|
4
4
|
import { fireEvent } from '~/core/events';
|
|
5
5
|
import { prepareMembershipPayload } from '~/group/utils';
|
|
6
6
|
|
|
7
|
+
/* begin_public_function
|
|
8
|
+
id: post.decline
|
|
9
|
+
*/
|
|
7
10
|
/**
|
|
8
11
|
* ```js
|
|
9
12
|
* import { declinePost } from '@amityco/ts-sdk'
|
|
@@ -46,3 +49,4 @@ export const declinePost = async (
|
|
|
46
49
|
cachedAt,
|
|
47
50
|
};
|
|
48
51
|
};
|
|
52
|
+
/* end_public_function */
|
|
@@ -7,6 +7,9 @@ import { pushToTombstone } from '~/cache/api/pushToTombstone';
|
|
|
7
7
|
|
|
8
8
|
import { getPost } from './getPost';
|
|
9
9
|
|
|
10
|
+
/* begin_public_function
|
|
11
|
+
id: post.soft_delete, post.hard_delete
|
|
12
|
+
*/
|
|
10
13
|
/**
|
|
11
14
|
* ```js
|
|
12
15
|
* import { deletePost } from '@amityco/ts-sdk'
|
|
@@ -79,3 +82,4 @@ export const deletePost = async (
|
|
|
79
82
|
|
|
80
83
|
return deleted;
|
|
81
84
|
};
|
|
85
|
+
/* end_public_function */
|
package/src/post/api/getPost.ts
CHANGED
|
@@ -7,6 +7,9 @@ import { checkIfShouldGoesToTombstone } from '~/cache/utils';
|
|
|
7
7
|
import { pushToTombstone } from '~/cache/api/pushToTombstone';
|
|
8
8
|
import { prepareMembershipPayload } from '~/group/utils';
|
|
9
9
|
|
|
10
|
+
/* begin_public_function
|
|
11
|
+
id: post.get
|
|
12
|
+
*/
|
|
10
13
|
/**
|
|
11
14
|
* ```js
|
|
12
15
|
* import { getPost } from '@amityco/ts-sdk'
|
|
@@ -55,6 +58,7 @@ export const getPost = async (postId: Amity.Post['postId']): Promise<Amity.Cache
|
|
|
55
58
|
cachedAt,
|
|
56
59
|
};
|
|
57
60
|
};
|
|
61
|
+
/* end_public_function */
|
|
58
62
|
|
|
59
63
|
/**
|
|
60
64
|
* ```js
|
package/src/post/api/getPosts.ts
CHANGED
|
@@ -4,6 +4,9 @@ import { pullFromCache } from '~/cache/api';
|
|
|
4
4
|
import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
5
5
|
import { prepareMembershipPayload } from '~/group/utils';
|
|
6
6
|
|
|
7
|
+
/* begin_public_function
|
|
8
|
+
id: post.get_by_ids
|
|
9
|
+
*/
|
|
7
10
|
/**
|
|
8
11
|
* ```js
|
|
9
12
|
* import { getPosts } from '@amityco/ts-sdk'
|
|
@@ -7,6 +7,9 @@ import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
|
7
7
|
import { getResolver } from '~/core/model';
|
|
8
8
|
import { prepareMembershipPayload } from '~/group/utils';
|
|
9
9
|
|
|
10
|
+
/* begin_public_function
|
|
11
|
+
id: post.query, feed.query.community_feed, feed.query.user_feed
|
|
12
|
+
*/
|
|
10
13
|
/**
|
|
11
14
|
* ```js
|
|
12
15
|
* import { queryPosts } from '@amityco/ts-sdk'
|
|
@@ -71,6 +74,7 @@ export const queryPosts = async (
|
|
|
71
74
|
|
|
72
75
|
return { data: posts, cachedAt, prevPage, nextPage };
|
|
73
76
|
};
|
|
77
|
+
/* end_public_function */
|
|
74
78
|
|
|
75
79
|
/**
|
|
76
80
|
* ```js
|
|
@@ -4,6 +4,9 @@ import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
|
4
4
|
import { fireEvent } from '~/core/events';
|
|
5
5
|
import { prepareMembershipPayload } from '~/group/utils';
|
|
6
6
|
|
|
7
|
+
/* begin_public_function
|
|
8
|
+
id: post.edit
|
|
9
|
+
*/
|
|
7
10
|
/**
|
|
8
11
|
* ```js
|
|
9
12
|
* import { updatePost } from '@amityco/ts-sdk'
|
|
@@ -52,3 +55,4 @@ export const updatePost = async (
|
|
|
52
55
|
cachedAt,
|
|
53
56
|
};
|
|
54
57
|
};
|
|
58
|
+
/* end_public_function */
|
|
@@ -5,6 +5,9 @@ import { upsertInCache, pullFromCache, pushToCache } from '~/cache/api';
|
|
|
5
5
|
import { UNSYNCED_OBJECT_CACHED_AT_VALUE } from '~/utils/constants';
|
|
6
6
|
import { dispatchReactable } from '../utils';
|
|
7
7
|
|
|
8
|
+
/* begin_public_function
|
|
9
|
+
id: reaction.add
|
|
10
|
+
*/
|
|
8
11
|
/**
|
|
9
12
|
* ```js
|
|
10
13
|
* import { addReaction } from '@amityco/ts-sdk'
|
|
@@ -53,6 +56,7 @@ export const addReaction = async (
|
|
|
53
56
|
|
|
54
57
|
return true;
|
|
55
58
|
};
|
|
59
|
+
/* end_public_function */
|
|
56
60
|
|
|
57
61
|
/**
|
|
58
62
|
* ```js
|
|
@@ -3,6 +3,9 @@ import { getActiveClient } from '~/client/api/activeClient';
|
|
|
3
3
|
import { toToken, toPageRaw } from '~/core/query';
|
|
4
4
|
import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
5
5
|
|
|
6
|
+
/* begin_public_function
|
|
7
|
+
id: reaction.query
|
|
8
|
+
*/
|
|
6
9
|
/**
|
|
7
10
|
* ```js
|
|
8
11
|
* import { queryReactions } from '@amityco/ts-sdk'
|
|
@@ -52,3 +55,4 @@ export const queryReactions = async (
|
|
|
52
55
|
|
|
53
56
|
return { data: reactions, prevPage, nextPage };
|
|
54
57
|
};
|
|
58
|
+
/* end_public_function */
|
|
@@ -6,6 +6,9 @@ import { UNSYNCED_OBJECT_CACHED_AT_VALUE } from '~/utils/constants';
|
|
|
6
6
|
|
|
7
7
|
import { dispatchReactable } from '../utils';
|
|
8
8
|
|
|
9
|
+
/* begin_public_function
|
|
10
|
+
id: reaction.remove
|
|
11
|
+
*/
|
|
9
12
|
/**
|
|
10
13
|
* ```js
|
|
11
14
|
* import { deleteReaction } from '@amityco/ts-sdk'
|
|
@@ -56,6 +59,7 @@ export const removeReaction = async (
|
|
|
56
59
|
|
|
57
60
|
return true;
|
|
58
61
|
};
|
|
62
|
+
/* end_public_function */
|
|
59
63
|
|
|
60
64
|
/**
|
|
61
65
|
* ```js
|
|
@@ -7,6 +7,9 @@ import { prepareMembershipPayload } from '~/group/utils';
|
|
|
7
7
|
import { prepareMessagePayload } from '~/message/utils';
|
|
8
8
|
import REFERENCE_TYPES from '../constants/referenceTypes';
|
|
9
9
|
|
|
10
|
+
/* begin_public_function
|
|
11
|
+
id: user.flag, message.flag, post.flag, comment.flag
|
|
12
|
+
*/
|
|
10
13
|
/**
|
|
11
14
|
* ```js
|
|
12
15
|
* import { createReport } from '@amityco/ts-sdk'
|
|
@@ -59,3 +62,4 @@ export const createReport = async (
|
|
|
59
62
|
|
|
60
63
|
return !!payload;
|
|
61
64
|
};
|
|
65
|
+
/* end_public_function */
|
|
@@ -7,6 +7,9 @@ import { prepareMembershipPayload } from '~/group/utils';
|
|
|
7
7
|
import { prepareMessagePayload } from '~/message/utils';
|
|
8
8
|
import REFERENCE_TYPES from '../constants/referenceTypes';
|
|
9
9
|
|
|
10
|
+
/* begin_public_function
|
|
11
|
+
id: user.unflag, message.unflag, post.unflag, comment.unflag
|
|
12
|
+
*/
|
|
10
13
|
/**
|
|
11
14
|
* ```js
|
|
12
15
|
* import { deleteReport } from '@amityco/ts-sdk'
|
|
@@ -60,3 +63,4 @@ export const deleteReport = async (
|
|
|
60
63
|
|
|
61
64
|
return !!payload;
|
|
62
65
|
};
|
|
66
|
+
/* end_public_function */
|
|
@@ -2,6 +2,9 @@ import { getActiveClient } from '~/client/api/activeClient';
|
|
|
2
2
|
import { synchronousWSCall } from '~/core/transports';
|
|
3
3
|
import REFERENCE_TYPES from '../constants/referenceTypes';
|
|
4
4
|
|
|
5
|
+
/* begin_public_function
|
|
6
|
+
id: user.check_flag_by_me, message.check_flag_by_me, post.check_flag_by_me, comment.check_flag_by_me
|
|
7
|
+
*/
|
|
5
8
|
/**
|
|
6
9
|
* ```js
|
|
7
10
|
* import { isReportedByMe } from '@amityco/ts-sdk'
|
|
@@ -42,3 +45,4 @@ export const isReportedByMe = async (
|
|
|
42
45
|
|
|
43
46
|
return result ?? isFlagByMe ?? false;
|
|
44
47
|
};
|
|
48
|
+
/* end_public_function */
|
|
@@ -2,6 +2,9 @@ import { getActiveClient } from '~/client/api';
|
|
|
2
2
|
|
|
3
3
|
import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
4
4
|
|
|
5
|
+
/* begin_public_function
|
|
6
|
+
id: stream.create
|
|
7
|
+
*/
|
|
5
8
|
/**
|
|
6
9
|
* ```js
|
|
7
10
|
* import { createStream } from '@amityco/ts-sdk'
|
|
@@ -34,3 +37,4 @@ export const createStream = async (
|
|
|
34
37
|
cachedAt,
|
|
35
38
|
};
|
|
36
39
|
};
|
|
40
|
+
/* end_public_function */
|
|
@@ -3,6 +3,9 @@ import { getActiveClient } from '~/client/api';
|
|
|
3
3
|
import { pullFromCache } from '~/cache/api';
|
|
4
4
|
import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
5
5
|
|
|
6
|
+
/* begin_public_function
|
|
7
|
+
id: stream.get
|
|
8
|
+
*/
|
|
6
9
|
/**
|
|
7
10
|
* ```js
|
|
8
11
|
* import { getStream } from '@amityco/ts-sdk'
|
|
@@ -37,6 +40,7 @@ export const getStream = async (
|
|
|
37
40
|
cachedAt,
|
|
38
41
|
};
|
|
39
42
|
};
|
|
43
|
+
/* end_public_function */
|
|
40
44
|
|
|
41
45
|
/**
|
|
42
46
|
* ```js
|
|
@@ -3,6 +3,9 @@ import { getActiveClient } from '~/client/api';
|
|
|
3
3
|
import { toPage, toToken } from '~/core/query';
|
|
4
4
|
import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
5
5
|
|
|
6
|
+
/* begin_public_function
|
|
7
|
+
id: stream.query
|
|
8
|
+
*/
|
|
6
9
|
/**
|
|
7
10
|
* ```js
|
|
8
11
|
* import { queryStreams } from '@amityco/ts-sdk'
|
|
@@ -55,6 +58,7 @@ export const queryStreams = async (query?: {
|
|
|
55
58
|
|
|
56
59
|
return { data: videoStreamings, cachedAt, prevPage, nextPage };
|
|
57
60
|
};
|
|
61
|
+
/* end_public_function */
|
|
58
62
|
|
|
59
63
|
/**
|
|
60
64
|
* ```js
|
|
@@ -3,6 +3,9 @@ import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
|
3
3
|
import { fireEvent } from '~/core/events';
|
|
4
4
|
import { prepareSubChannelPayload } from '../utils';
|
|
5
5
|
|
|
6
|
+
/* begin_public_function
|
|
7
|
+
id: subchannel.create
|
|
8
|
+
*/
|
|
6
9
|
/**
|
|
7
10
|
* ```js
|
|
8
11
|
* import { createSubChannel } from '@amityco/ts-sdk'
|
|
@@ -39,3 +42,4 @@ export const createSubChannel = async <T extends Amity.ChannelType>(
|
|
|
39
42
|
cachedAt,
|
|
40
43
|
};
|
|
41
44
|
};
|
|
45
|
+
/* end_public_function */
|
|
@@ -5,6 +5,9 @@ import { fireEvent } from '~/core/events';
|
|
|
5
5
|
import { getFutureDate } from '~/core/model';
|
|
6
6
|
import { getSubChannel } from './getSubChannel';
|
|
7
7
|
|
|
8
|
+
/* begin_public_function
|
|
9
|
+
id: subchannel.soft_delete, subchannel.hard_delete
|
|
10
|
+
*/
|
|
8
11
|
/**
|
|
9
12
|
* ```js
|
|
10
13
|
* import { deleteSubChannel } from '@amityco/ts-sdk'
|
|
@@ -51,3 +54,4 @@ export const deleteSubChannel = async (
|
|
|
51
54
|
|
|
52
55
|
return deleted;
|
|
53
56
|
};
|
|
57
|
+
/* end_public_function */
|
|
@@ -7,6 +7,9 @@ import { getActiveClient } from '~/client/api';
|
|
|
7
7
|
import { fireEvent } from '~/core/events';
|
|
8
8
|
import { prepareSubChannelPayload } from '../utils';
|
|
9
9
|
|
|
10
|
+
/* begin_public_function
|
|
11
|
+
id: subchannel.get
|
|
12
|
+
*/
|
|
10
13
|
/**
|
|
11
14
|
* ```js
|
|
12
15
|
* import { getSubChannel } from '@amityco/ts-sdk'
|
|
@@ -52,6 +55,7 @@ export const getSubChannel = async (
|
|
|
52
55
|
throw error;
|
|
53
56
|
}
|
|
54
57
|
};
|
|
58
|
+
/* end_public_function */
|
|
55
59
|
|
|
56
60
|
/**
|
|
57
61
|
* ```js
|
|
@@ -6,6 +6,9 @@ import { toPage, toToken } from '~/core/query';
|
|
|
6
6
|
import { fireEvent } from '~/core/events';
|
|
7
7
|
import { convertQueryParams, prepareSubChannelPayload } from '../utils';
|
|
8
8
|
|
|
9
|
+
/* begin_public_function
|
|
10
|
+
id: subchannel.query
|
|
11
|
+
*/
|
|
9
12
|
/**
|
|
10
13
|
* ```js
|
|
11
14
|
* import { querySubChannels } from '@amityco/ts-sdk'
|
|
@@ -63,6 +66,7 @@ export const querySubChannels = async (
|
|
|
63
66
|
|
|
64
67
|
return { data: subChannels, cachedAt, prevPage, nextPage };
|
|
65
68
|
};
|
|
69
|
+
/* end_public_function */
|
|
66
70
|
|
|
67
71
|
/**
|
|
68
72
|
* ```js
|
|
@@ -3,6 +3,9 @@ import { getActiveClient } from '~/client/api';
|
|
|
3
3
|
import { fireEvent } from '~/core/events';
|
|
4
4
|
import { prepareSubChannelPayload } from '../utils';
|
|
5
5
|
|
|
6
|
+
/* begin_public_function
|
|
7
|
+
id: subchannel.update
|
|
8
|
+
*/
|
|
6
9
|
/**
|
|
7
10
|
* ```js
|
|
8
11
|
* import { updateSubChannel } from '@amityco/ts-sdk'
|
|
@@ -41,3 +44,4 @@ export const updateSubChannel = async (
|
|
|
41
44
|
cachedAt,
|
|
42
45
|
};
|
|
43
46
|
};
|
|
47
|
+
/* end_public_function */
|
package/src/user/api/getUser.ts
CHANGED
|
@@ -8,6 +8,9 @@ import { isInTombstone } from '~/cache/api/isInTombstone';
|
|
|
8
8
|
import { checkIfShouldGoesToTombstone } from '~/cache/utils';
|
|
9
9
|
import { pushToTombstone } from '~/cache/api/pushToTombstone';
|
|
10
10
|
|
|
11
|
+
/* begin_public_function
|
|
12
|
+
id: user.get
|
|
13
|
+
*/
|
|
11
14
|
/**
|
|
12
15
|
* ```js
|
|
13
16
|
* import { getUser } from '@amityco/ts-sdk'
|
|
@@ -63,6 +66,7 @@ export const getUser = async (
|
|
|
63
66
|
cachedAt,
|
|
64
67
|
};
|
|
65
68
|
};
|
|
69
|
+
/* end_public_function */
|
|
66
70
|
|
|
67
71
|
/**
|
|
68
72
|
* ```js
|
package/src/user/api/getUsers.ts
CHANGED
|
@@ -4,6 +4,9 @@ import { pullFromCache } from '~/cache/api';
|
|
|
4
4
|
import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
5
5
|
import { fireEvent } from '~/core/events';
|
|
6
6
|
|
|
7
|
+
/* begin_public_function
|
|
8
|
+
id: user.get_by_ids
|
|
9
|
+
*/
|
|
7
10
|
/**
|
|
8
11
|
* ```js
|
|
9
12
|
* import { getUsers } from '@amityco/ts-sdk'
|
|
@@ -7,6 +7,9 @@ import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
|
7
7
|
import { getResolver } from '~/core/model';
|
|
8
8
|
import { fireEvent } from '~/core/events';
|
|
9
9
|
|
|
10
|
+
/* begin_public_function
|
|
11
|
+
id: user.query, user.search
|
|
12
|
+
*/
|
|
10
13
|
/**
|
|
11
14
|
* ```js
|
|
12
15
|
* import { queryUsers } from '@amityco/ts-sdk'
|
|
@@ -72,6 +75,7 @@ export const queryUsers = async (
|
|
|
72
75
|
|
|
73
76
|
return { data: users, cachedAt, prevPage, nextPage };
|
|
74
77
|
};
|
|
78
|
+
/* end_public_function */
|
|
75
79
|
|
|
76
80
|
/**
|
|
77
81
|
* ```js
|
|
@@ -3,6 +3,9 @@ import { getActiveClient } from '~/client/api';
|
|
|
3
3
|
import { fireEvent } from '~/core/events';
|
|
4
4
|
import { ingestInCache } from '~/cache/api/ingestInCache';
|
|
5
5
|
|
|
6
|
+
/* begin_public_function
|
|
7
|
+
id: client.update_user
|
|
8
|
+
*/
|
|
6
9
|
/**
|
|
7
10
|
* ```js
|
|
8
11
|
* import { updateUser } from '@amityco/ts-sdk'
|
|
@@ -53,3 +56,4 @@ export const updateUser = async (
|
|
|
53
56
|
cachedAt,
|
|
54
57
|
};
|
|
55
58
|
};
|
|
59
|
+
/* end_public_function */
|