@amityco/ts-sdk 7.4.1-b7aa4210.0 → 7.4.1-c116567e.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@types/core/events.d.ts +3 -0
- package/dist/@types/core/events.d.ts.map +1 -1
- package/dist/@types/core/model.d.ts +3 -1
- package/dist/@types/core/model.d.ts.map +1 -1
- package/dist/@types/core/payload.d.ts +11 -4
- package/dist/@types/core/payload.d.ts.map +1 -1
- package/dist/@types/domains/client.d.ts +10 -0
- package/dist/@types/domains/client.d.ts.map +1 -1
- package/dist/@types/domains/community.d.ts +10 -1
- package/dist/@types/domains/community.d.ts.map +1 -1
- package/dist/@types/domains/invitation.d.ts +72 -0
- package/dist/@types/domains/invitation.d.ts.map +1 -0
- package/dist/@types/index.d.ts +2 -0
- package/dist/@types/index.d.ts.map +1 -1
- package/dist/communityRepository/api/createCommunity.d.ts +2 -2
- package/dist/communityRepository/api/createCommunity.d.ts.map +1 -1
- package/dist/communityRepository/api/getCommunities.d.ts +1 -1
- package/dist/communityRepository/api/getCommunities.d.ts.map +1 -1
- package/dist/communityRepository/api/getCommunity.d.ts.map +1 -1
- package/dist/communityRepository/api/getRecommendedCommunities.d.ts +3 -1
- package/dist/communityRepository/api/getRecommendedCommunities.d.ts.map +1 -1
- package/dist/communityRepository/api/getTrendingCommunities.d.ts +3 -1
- package/dist/communityRepository/api/getTrendingCommunities.d.ts.map +1 -1
- package/dist/communityRepository/api/queryCommunities.d.ts.map +1 -1
- package/dist/communityRepository/api/updateCommunity.d.ts +2 -2
- package/dist/communityRepository/api/updateCommunity.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityJoined.d.ts +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityJoined.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityLeft.d.ts +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityLeft.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityUserAdded.d.ts +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityUserAdded.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityUserBanned.d.ts +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityUserBanned.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityUserChanged.d.ts +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityUserChanged.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityUserRemoved.d.ts +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityUserRemoved.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityUserRoleAdded.d.ts +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityUserRoleAdded.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityUserRoleRemoved.d.ts +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityUserRoleRemoved.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityUserUnbanned.d.ts +1 -1
- package/dist/communityRepository/communityMembership/events/onCommunityUserUnbanned.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/onLocalCommunityJoined.d.ts +1 -1
- package/dist/communityRepository/communityMembership/events/onLocalCommunityJoined.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/onLocalCommunityLeft.d.ts +1 -1
- package/dist/communityRepository/communityMembership/events/onLocalCommunityLeft.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/onLocalCommunityUserAdded.d.ts +1 -1
- package/dist/communityRepository/communityMembership/events/onLocalCommunityUserAdded.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/onLocalCommunityUserRemoved.d.ts +1 -1
- package/dist/communityRepository/communityMembership/events/onLocalCommunityUserRemoved.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/onUserDeleted.d.ts +1 -1
- package/dist/communityRepository/communityMembership/events/onUserDeleted.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/events/utils.d.ts +2 -2
- package/dist/communityRepository/communityMembership/events/utils.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/observers/getMembers/CommunityMembersQueryStreamController.d.ts +2 -2
- package/dist/communityRepository/communityMembership/observers/getMembers/CommunityMembersQueryStreamController.d.ts.map +1 -1
- package/dist/communityRepository/communityMembership/observers/searchMembers/SearchCommunityMembersQueryStreamController.d.ts +2 -2
- package/dist/communityRepository/communityMembership/observers/searchMembers/SearchCommunityMembersQueryStreamController.d.ts.map +1 -1
- package/dist/communityRepository/communityModeration/events/onLocalCommunityRoleAdded.d.ts +1 -1
- package/dist/communityRepository/communityModeration/events/onLocalCommunityRoleAdded.d.ts.map +1 -1
- package/dist/communityRepository/communityModeration/events/onLocalCommunityRoleRemoved.d.ts +1 -1
- package/dist/communityRepository/communityModeration/events/onLocalCommunityRoleRemoved.d.ts.map +1 -1
- package/dist/communityRepository/events/onCommunityCreated.d.ts +1 -1
- package/dist/communityRepository/events/onCommunityCreated.d.ts.map +1 -1
- package/dist/communityRepository/events/onCommunityDeleted.d.ts +1 -1
- package/dist/communityRepository/events/onCommunityDeleted.d.ts.map +1 -1
- package/dist/communityRepository/events/onCommunityUpdated.d.ts +1 -1
- package/dist/communityRepository/events/onCommunityUpdated.d.ts.map +1 -1
- package/dist/communityRepository/events/utils.d.ts +1 -1
- package/dist/communityRepository/events/utils.d.ts.map +1 -1
- package/dist/communityRepository/observers/getCommunities/CommunitiesQueryStreamController.d.ts +2 -2
- package/dist/communityRepository/observers/getCommunities/CommunitiesQueryStreamController.d.ts.map +1 -1
- package/dist/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesQueryStreamController.d.ts +2 -2
- package/dist/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesQueryStreamController.d.ts.map +1 -1
- package/dist/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesQueryStreamController.d.ts +2 -2
- package/dist/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesQueryStreamController.d.ts.map +1 -1
- package/dist/communityRepository/observers/searchCommunities/SearchCommunitiesQueryStreamController.d.ts +2 -2
- package/dist/communityRepository/observers/searchCommunities/SearchCommunitiesQueryStreamController.d.ts.map +1 -1
- package/dist/communityRepository/observers/semanticSearch/SemanticSearchCommunityQueryStreamController.d.ts +2 -2
- package/dist/communityRepository/observers/semanticSearch/SemanticSearchCommunityQueryStreamController.d.ts.map +1 -1
- package/dist/communityRepository/utils/communityWithMembership.d.ts +1 -1
- package/dist/communityRepository/utils/communityWithMembership.d.ts.map +1 -1
- package/dist/communityRepository/utils/payload.d.ts +1 -1
- package/dist/communityRepository/utils/payload.d.ts.map +1 -1
- package/dist/core/events.d.ts +3 -3
- package/dist/core/events.d.ts.map +1 -1
- package/dist/core/model/idResolvers.d.ts.map +1 -1
- package/dist/core/model/index.d.ts.map +1 -1
- package/dist/index.cjs.js +2935 -2421
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +2283 -1770
- package/dist/index.umd.js +4 -4
- package/dist/invitationRepository/events/index.d.ts +4 -0
- package/dist/invitationRepository/events/index.d.ts.map +1 -0
- package/dist/invitationRepository/events/onLocalInvitationCreated.d.ts +17 -0
- package/dist/invitationRepository/events/onLocalInvitationCreated.d.ts.map +1 -0
- package/dist/invitationRepository/events/onLocalInvitationDeleted.d.ts +17 -0
- package/dist/invitationRepository/events/onLocalInvitationDeleted.d.ts.map +1 -0
- package/dist/invitationRepository/events/onLocalInvitationUpdated.d.ts +17 -0
- package/dist/invitationRepository/events/onLocalInvitationUpdated.d.ts.map +1 -0
- package/dist/invitationRepository/index.d.ts +2 -0
- package/dist/invitationRepository/index.d.ts.map +1 -0
- package/dist/invitationRepository/internalApi/acceptInvitation.d.ts +16 -0
- package/dist/invitationRepository/internalApi/acceptInvitation.d.ts.map +1 -0
- package/dist/invitationRepository/internalApi/cancelInvitation.d.ts +16 -0
- package/dist/invitationRepository/internalApi/cancelInvitation.d.ts.map +1 -0
- package/dist/invitationRepository/internalApi/createInvitations.d.ts +21 -0
- package/dist/invitationRepository/internalApi/createInvitations.d.ts.map +1 -0
- package/dist/invitationRepository/internalApi/index.d.ts +5 -0
- package/dist/invitationRepository/internalApi/index.d.ts.map +1 -0
- package/dist/invitationRepository/internalApi/rejectInvitation.d.ts +16 -0
- package/dist/invitationRepository/internalApi/rejectInvitation.d.ts.map +1 -0
- package/dist/invitationRepository/observers/getInvitations/InvitationsLiveCollectionController.d.ts +14 -0
- package/dist/invitationRepository/observers/getInvitations/InvitationsLiveCollectionController.d.ts.map +1 -0
- package/dist/invitationRepository/observers/getInvitations/InvitationsPaginationController.d.ts +5 -0
- package/dist/invitationRepository/observers/getInvitations/InvitationsPaginationController.d.ts.map +1 -0
- package/dist/invitationRepository/observers/getInvitations/InvitationsQueryStreamController.d.ts +15 -0
- package/dist/invitationRepository/observers/getInvitations/InvitationsQueryStreamController.d.ts.map +1 -0
- package/dist/invitationRepository/observers/getInvitations/enums.d.ts +6 -0
- package/dist/invitationRepository/observers/getInvitations/enums.d.ts.map +1 -0
- package/dist/invitationRepository/observers/getInvitations.d.ts +12 -0
- package/dist/invitationRepository/observers/getInvitations.d.ts.map +1 -0
- package/dist/invitationRepository/utils/index.d.ts +2 -0
- package/dist/invitationRepository/utils/index.d.ts.map +1 -0
- package/dist/invitationRepository/utils/prepareInvitationPayload.d.ts +2 -0
- package/dist/invitationRepository/utils/prepareInvitationPayload.d.ts.map +1 -0
- package/dist/utils/linkedObject/communityLinkedObject.d.ts +2 -0
- package/dist/utils/linkedObject/communityLinkedObject.d.ts.map +1 -0
- package/dist/utils/linkedObject/index.d.ts +2 -0
- package/dist/utils/linkedObject/index.d.ts.map +1 -1
- package/dist/utils/linkedObject/invitationLinkedObject.d.ts +2 -0
- package/dist/utils/linkedObject/invitationLinkedObject.d.ts.map +1 -0
- package/dist/utils/tests/dummy/post.d.ts +3 -3
- package/package.json +1 -1
- package/src/@types/core/events.ts +4 -0
- package/src/@types/core/model.ts +5 -1
- package/src/@types/core/payload.ts +13 -4
- package/src/@types/domains/client.ts +12 -0
- package/src/@types/domains/community.ts +18 -1
- package/src/@types/domains/invitation.ts +92 -0
- package/src/@types/index.ts +2 -0
- package/src/communityRepository/api/createCommunity.ts +5 -2
- package/src/communityRepository/api/getCommunities.ts +7 -2
- package/src/communityRepository/api/getCommunity.ts +4 -1
- package/src/communityRepository/api/getRecommendedCommunities.ts +11 -4
- package/src/communityRepository/api/getTrendingCommunities.ts +11 -4
- package/src/communityRepository/api/queryCommunities.ts +6 -1
- package/src/communityRepository/api/updateCommunity.ts +13 -3
- package/src/communityRepository/communityMembership/events/onCommunityJoined.ts +1 -1
- package/src/communityRepository/communityMembership/events/onCommunityLeft.ts +1 -1
- package/src/communityRepository/communityMembership/events/onCommunityUserAdded.ts +1 -1
- package/src/communityRepository/communityMembership/events/onCommunityUserBanned.ts +1 -1
- package/src/communityRepository/communityMembership/events/onCommunityUserChanged.ts +1 -1
- package/src/communityRepository/communityMembership/events/onCommunityUserRemoved.ts +1 -1
- package/src/communityRepository/communityMembership/events/onCommunityUserRoleAdded.ts +1 -1
- package/src/communityRepository/communityMembership/events/onCommunityUserRoleRemoved.ts +1 -1
- package/src/communityRepository/communityMembership/events/onCommunityUserUnbanned.ts +1 -1
- package/src/communityRepository/communityMembership/events/onLocalCommunityJoined.ts +1 -1
- package/src/communityRepository/communityMembership/events/onLocalCommunityLeft.ts +1 -1
- package/src/communityRepository/communityMembership/events/onLocalCommunityUserAdded.ts +1 -1
- package/src/communityRepository/communityMembership/events/onLocalCommunityUserRemoved.ts +1 -1
- package/src/communityRepository/communityMembership/events/onUserDeleted.ts +3 -1
- package/src/communityRepository/communityMembership/events/utils.ts +2 -2
- package/src/communityRepository/communityMembership/observers/getMembers/CommunityMembersQueryStreamController.ts +8 -2
- package/src/communityRepository/communityMembership/observers/searchMembers/SearchCommunityMembersQueryStreamController.ts +8 -2
- package/src/communityRepository/communityModeration/events/onLocalCommunityRoleAdded.ts +1 -1
- package/src/communityRepository/communityModeration/events/onLocalCommunityRoleRemoved.ts +1 -1
- package/src/communityRepository/events/onCommunityCreated.ts +1 -1
- package/src/communityRepository/events/onCommunityDeleted.ts +1 -1
- package/src/communityRepository/events/onCommunityUpdated.ts +1 -1
- package/src/communityRepository/events/utils.ts +1 -1
- package/src/communityRepository/observers/getCommunities/CommunitiesQueryStreamController.ts +2 -2
- package/src/communityRepository/observers/getRecommendedCommunities/RecommendedCommunitiesQueryStreamController.ts +2 -2
- package/src/communityRepository/observers/getTrendingCommunities/TrendingCommunitiesQueryStreamController.ts +2 -2
- package/src/communityRepository/observers/searchCommunities/SearchCommunitiesQueryStreamController.ts +2 -2
- package/src/communityRepository/observers/semanticSearch/SemanticSearchCommunityQueryStreamController.ts +2 -2
- package/src/communityRepository/utils/communityWithMembership.ts +8 -4
- package/src/communityRepository/utils/payload.ts +1 -1
- package/src/core/liveCollection/PaginationController.ts +1 -1
- package/src/core/liveCollection/PaginationNoPageController.ts +1 -1
- package/src/core/model/idResolvers.ts +2 -0
- package/src/core/model/index.ts +2 -0
- package/src/index.ts +2 -0
- package/src/invitationRepository/events/index.ts +3 -0
- package/src/invitationRepository/events/onLocalInvitationCreated.ts +33 -0
- package/src/invitationRepository/events/onLocalInvitationDeleted.ts +33 -0
- package/src/invitationRepository/events/onLocalInvitationUpdated.ts +33 -0
- package/src/invitationRepository/index.ts +1 -0
- package/src/invitationRepository/internalApi/acceptInvitation.ts +45 -0
- package/src/invitationRepository/internalApi/cancelInvitation.ts +44 -0
- package/src/invitationRepository/internalApi/createInvitations.ts +52 -0
- package/src/invitationRepository/internalApi/index.ts +4 -0
- package/src/invitationRepository/internalApi/rejectInvitation.ts +45 -0
- package/src/invitationRepository/observers/getInvitations/InvitationsLiveCollectionController.ts +148 -0
- package/src/invitationRepository/observers/getInvitations/InvitationsPaginationController.ts +19 -0
- package/src/invitationRepository/observers/getInvitations/InvitationsQueryStreamController.ts +97 -0
- package/src/invitationRepository/observers/getInvitations/enums.ts +5 -0
- package/src/invitationRepository/observers/getInvitations.ts +44 -0
- package/src/invitationRepository/utils/index.ts +1 -0
- package/src/invitationRepository/utils/prepareInvitationPayload.ts +11 -0
- package/src/messagePreview/utils/getChannelMessagePreviewWithUser.ts +3 -3
- package/src/utils/linkedObject/communityLinkedObject.ts +29 -0
- package/src/utils/linkedObject/index.ts +4 -0
- package/src/utils/linkedObject/invitationLinkedObject.ts +44 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/invitationRepository/events/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ```js
|
|
3
|
+
* import { onLocalInvitationCreated } from '@amityco/ts-sdk'
|
|
4
|
+
* const dispose = onLocalInvitationCreated(data => {
|
|
5
|
+
* // ...
|
|
6
|
+
* })
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* Fired when an {@link Amity.InvitationPayload} 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 Invitation Events
|
|
15
|
+
*/
|
|
16
|
+
export declare const onLocalInvitationCreated: (callback: Amity.Listener<Amity.InternalInvitation[]>) => Amity.Unsubscriber;
|
|
17
|
+
//# sourceMappingURL=onLocalInvitationCreated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onLocalInvitationCreated.d.ts","sourceRoot":"","sources":["../../../src/invitationRepository/events/onLocalInvitationCreated.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,wBAAwB,aACzB,MAAM,QAAQ,CAAC,MAAM,kBAAkB,EAAE,CAAC,KACnD,MAAM,YAYR,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ```js
|
|
3
|
+
* import { onLocalInvitationDeleted } from '@amityco/ts-sdk'
|
|
4
|
+
* const dispose = onLocalInvitationDeleted(data => {
|
|
5
|
+
* // ...
|
|
6
|
+
* })
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* Fired when an {@link Amity.InvitationPayload} has been deleted
|
|
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 Invitation Events
|
|
15
|
+
*/
|
|
16
|
+
export declare const onLocalInvitationDeleted: (callback: Amity.Listener<Amity.InternalInvitation[]>) => Amity.Unsubscriber;
|
|
17
|
+
//# sourceMappingURL=onLocalInvitationDeleted.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onLocalInvitationDeleted.d.ts","sourceRoot":"","sources":["../../../src/invitationRepository/events/onLocalInvitationDeleted.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,wBAAwB,aACzB,MAAM,QAAQ,CAAC,MAAM,kBAAkB,EAAE,CAAC,KACnD,MAAM,YAYR,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ```js
|
|
3
|
+
* import { onLocalInvitationUpdated } from '@amityco/ts-sdk'
|
|
4
|
+
* const dispose = onLocalInvitationUpdated(data => {
|
|
5
|
+
* // ...
|
|
6
|
+
* })
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* Fired when an {@link Amity.InvitationPayload} has been updated
|
|
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 Invitation Events
|
|
15
|
+
*/
|
|
16
|
+
export declare const onLocalInvitationUpdated: (callback: Amity.Listener<Amity.InternalInvitation[]>) => Amity.Unsubscriber;
|
|
17
|
+
//# sourceMappingURL=onLocalInvitationUpdated.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onLocalInvitationUpdated.d.ts","sourceRoot":"","sources":["../../../src/invitationRepository/events/onLocalInvitationUpdated.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,wBAAwB,aACzB,MAAM,QAAQ,CAAC,MAAM,kBAAkB,EAAE,CAAC,KACnD,MAAM,YAYR,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/invitationRepository/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ```js
|
|
3
|
+
* import { acceptInvitation } from '@amityco/ts-sdk'
|
|
4
|
+
* const isAccepted = await acceptInvitation(invitationId)
|
|
5
|
+
* ```
|
|
6
|
+
*
|
|
7
|
+
* Accepts a {@link Amity.Invitation} object
|
|
8
|
+
*
|
|
9
|
+
* @param invitationId the {@link Amity.Invitation} to accept
|
|
10
|
+
* @returns A success boolean if the {@link Amity.Invitation} was accepted
|
|
11
|
+
*
|
|
12
|
+
* @category Invitation API
|
|
13
|
+
* @async
|
|
14
|
+
*/
|
|
15
|
+
export declare const acceptInvitation: (invitationId: Amity.Invitation['_id']) => Promise<boolean>;
|
|
16
|
+
//# sourceMappingURL=acceptInvitation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acceptInvitation.d.ts","sourceRoot":"","sources":["../../../src/invitationRepository/internalApi/acceptInvitation.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,iBAAwB,MAAM,UAAU,CAAC,KAAK,CAAC,KAAG,QAAQ,OAAO,CAqB7F,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ```js
|
|
3
|
+
* import { cancelInvitation } from '@amityco/ts-sdk'
|
|
4
|
+
* const isCanceled = await cancelInvitation(invitationId)
|
|
5
|
+
* ```
|
|
6
|
+
*
|
|
7
|
+
* Cancels a {@link Amity.Invitation} object
|
|
8
|
+
*
|
|
9
|
+
* @param invitationId the {@link Amity.Invitation} to cancel
|
|
10
|
+
* @returns A success boolean if the {@link Amity.Invitation} was canceled
|
|
11
|
+
*
|
|
12
|
+
* @category Invitation API
|
|
13
|
+
* @async
|
|
14
|
+
*/
|
|
15
|
+
export declare const cancelInvitation: (invitationId: Amity.Invitation['_id']) => Promise<boolean>;
|
|
16
|
+
//# sourceMappingURL=cancelInvitation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cancelInvitation.d.ts","sourceRoot":"","sources":["../../../src/invitationRepository/internalApi/cancelInvitation.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,iBAAwB,MAAM,UAAU,CAAC,KAAK,CAAC,KAAG,QAAQ,OAAO,CAqB7F,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ```js
|
|
3
|
+
* import { createInvitations } from '@amityco/ts-sdk'
|
|
4
|
+
* const created = await createInvitations({
|
|
5
|
+
* type: string,
|
|
6
|
+
* targetType: string,
|
|
7
|
+
* targetId: string,
|
|
8
|
+
* userIds: string[]
|
|
9
|
+
* }))
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
* Creates an {@link Amity.Invitation}
|
|
13
|
+
*
|
|
14
|
+
* @param bundle The data necessary to create a new {@link Amity.Invitation}
|
|
15
|
+
* @returns The newly created {@link Amity.Invitation}
|
|
16
|
+
*
|
|
17
|
+
* @category Invitation API
|
|
18
|
+
* @async
|
|
19
|
+
*/
|
|
20
|
+
export declare const createInvitations: (bundle: Amity.CreateInvitations) => Promise<Amity.Cached<Amity.InternalInvitation[]>>;
|
|
21
|
+
//# sourceMappingURL=createInvitations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createInvitations.d.ts","sourceRoot":"","sources":["../../../src/invitationRepository/internalApi/createInvitations.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,iBAAiB,WACpB,MAAM,iBAAiB,KAC9B,QAAQ,MAAM,MAAM,CAAC,MAAM,kBAAkB,EAAE,CAAC,CAqBlD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/invitationRepository/internalApi/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ```js
|
|
3
|
+
* import { rejectInvitation } from '@amityco/ts-sdk'
|
|
4
|
+
* const isRejected = await rejectInvitation(invitationId)
|
|
5
|
+
* ```
|
|
6
|
+
*
|
|
7
|
+
* Rejects a {@link Amity.Invitation} object
|
|
8
|
+
*
|
|
9
|
+
* @param invitationId the {@link Amity.Invitation} to reject
|
|
10
|
+
* @returns A success boolean if the {@link Amity.Invitation} was rejected
|
|
11
|
+
*
|
|
12
|
+
* @category Invitation API
|
|
13
|
+
* @async
|
|
14
|
+
*/
|
|
15
|
+
export declare const rejectInvitation: (invitationId: Amity.Invitation['_id']) => Promise<boolean>;
|
|
16
|
+
//# sourceMappingURL=rejectInvitation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rejectInvitation.d.ts","sourceRoot":"","sources":["../../../src/invitationRepository/internalApi/rejectInvitation.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,iBAAwB,MAAM,UAAU,CAAC,KAAK,CAAC,KAAG,QAAQ,OAAO,CAqB7F,CAAC"}
|
package/dist/invitationRepository/observers/getInvitations/InvitationsLiveCollectionController.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { InvitationsPaginationController } from './InvitationsPaginationController';
|
|
2
|
+
import { LiveCollectionController } from '~/core/liveCollection/LiveCollectionController';
|
|
3
|
+
export declare class InvitationsLiveCollectionController extends LiveCollectionController<'invitation', Amity.InvitationLiveCollection, Amity.Invitation, InvitationsPaginationController> {
|
|
4
|
+
private queryStreamController;
|
|
5
|
+
private query;
|
|
6
|
+
constructor(query: Amity.InvitationLiveCollection, callback: Amity.LiveCollectionCallback<Amity.Invitation>);
|
|
7
|
+
protected setup(): void;
|
|
8
|
+
protected persistModel(queryPayload: Amity.InvitationPayload & Amity.Pagination): Promise<void>;
|
|
9
|
+
protected persistQueryStream({ response, direction, refresh, }: Amity.LiveCollectionPersistQueryStreamParams<'invitation'>): void;
|
|
10
|
+
startSubscription(): Amity.Unsubscriber[];
|
|
11
|
+
notifyChange({ origin, loading, error }: Amity.LiveCollectionNotifyParams): void;
|
|
12
|
+
applyFilter(data: Amity.Invitation[]): Amity.Invitation[];
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=InvitationsLiveCollectionController.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InvitationsLiveCollectionController.d.ts","sourceRoot":"","sources":["../../../../src/invitationRepository/observers/getInvitations/InvitationsLiveCollectionController.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AAEpF,OAAO,EAAE,wBAAwB,EAAE,MAAM,gDAAgD,CAAC;AAQ1F,qBAAa,mCAAoC,SAAQ,wBAAwB,CAC/E,YAAY,EACZ,KAAK,CAAC,wBAAwB,EAC9B,KAAK,CAAC,UAAU,EAChB,+BAA+B,CAChC;IACC,OAAO,CAAC,qBAAqB,CAAmC;IAEhE,OAAO,CAAC,KAAK,CAAiC;gBAG5C,KAAK,EAAE,KAAK,CAAC,wBAAwB,EACrC,QAAQ,EAAE,KAAK,CAAC,sBAAsB,CAAC,KAAK,CAAC,UAAU,CAAC;IAoB1D,SAAS,CAAC,KAAK;cAUC,YAAY,CAAC,YAAY,EAAE,KAAK,CAAC,iBAAiB,GAAG,KAAK,CAAC,UAAU;IAIrF,SAAS,CAAC,kBAAkB,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,OAAO,GACR,EAAE,KAAK,CAAC,sCAAsC,CAAC,YAAY,CAAC;IAI7D,iBAAiB;IAiBjB,YAAY,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,CAAC,0BAA0B;IAsBzE,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,UAAU,EAAE;CAsCrC"}
|
package/dist/invitationRepository/observers/getInvitations/InvitationsPaginationController.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { PaginationController } from '~/core/liveCollection/PaginationController';
|
|
2
|
+
export declare class InvitationsPaginationController extends PaginationController<'invitation', Amity.InvitationLiveCollection> {
|
|
3
|
+
getRequest(queryParams: Amity.InvitationLiveCollection, token: string | undefined): Promise<Amity.InvitationPayload & Amity.Pagination>;
|
|
4
|
+
}
|
|
5
|
+
//# sourceMappingURL=InvitationsPaginationController.d.ts.map
|
package/dist/invitationRepository/observers/getInvitations/InvitationsPaginationController.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InvitationsPaginationController.d.ts","sourceRoot":"","sources":["../../../../src/invitationRepository/observers/getInvitations/InvitationsPaginationController.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAElF,qBAAa,+BAAgC,SAAQ,oBAAoB,CACvE,YAAY,EACZ,KAAK,CAAC,wBAAwB,CAC/B;IACO,UAAU,CAAC,WAAW,EAAE,KAAK,CAAC,wBAAwB,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS;CAWxF"}
|
package/dist/invitationRepository/observers/getInvitations/InvitationsQueryStreamController.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { InvitationActionsEnum } from './enums';
|
|
2
|
+
import { QueryStreamController } from '~/core/liveCollection/QueryStreamController';
|
|
3
|
+
export declare class InvitationsQueryStreamController extends QueryStreamController<Amity.InvitationPayload, Amity.InvitationLiveCollection> {
|
|
4
|
+
private notifyChange;
|
|
5
|
+
private preparePayload;
|
|
6
|
+
constructor(query: Amity.InvitationLiveCollection, cacheKey: string[], notifyChange: (params: Amity.LiveCollectionNotifyParams) => void, preparePayload: (response: Amity.InvitationPayload) => Amity.ProcessedInvitationPayload);
|
|
7
|
+
saveToMainDB(response: Amity.InvitationPayload): Promise<void>;
|
|
8
|
+
appendToQueryStream(response: Amity.InvitationPayload & Partial<Amity.Pagination>, direction: Amity.LiveCollectionPageDirection, refresh?: boolean): void;
|
|
9
|
+
reactor(action: InvitationActionsEnum): (invitations: Amity.InternalInvitation[]) => void;
|
|
10
|
+
subscribeRTE(createSubscriber: {
|
|
11
|
+
fn: (reactor: Amity.Listener<Amity.InternalInvitation[]>) => Amity.Unsubscriber;
|
|
12
|
+
action: InvitationActionsEnum;
|
|
13
|
+
}[]): Amity.Unsubscriber[];
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=InvitationsQueryStreamController.d.ts.map
|
package/dist/invitationRepository/observers/getInvitations/InvitationsQueryStreamController.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InvitationsQueryStreamController.d.ts","sourceRoot":"","sources":["../../../../src/invitationRepository/observers/getInvitations/InvitationsQueryStreamController.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAGhD,OAAO,EAAE,qBAAqB,EAAE,MAAM,6CAA6C,CAAC;AAEpF,qBAAa,gCAAiC,SAAQ,qBAAqB,CACzE,KAAK,CAAC,iBAAiB,EACvB,KAAK,CAAC,wBAAwB,CAC/B;IACC,OAAO,CAAC,YAAY,CAAqD;IAEzE,OAAO,CAAC,cAAc,CAA0E;gBAG9F,KAAK,EAAE,KAAK,CAAC,wBAAwB,EACrC,QAAQ,EAAE,MAAM,EAAE,EAClB,YAAY,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,0BAA0B,KAAK,IAAI,EAChE,cAAc,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC,iBAAiB,KAAK,KAAK,CAAC,0BAA0B;IAOnF,YAAY,CAAC,QAAQ,EAAE,KAAK,CAAC,iBAAiB;IAWpD,mBAAmB,CACjB,QAAQ,EAAE,KAAK,CAAC,iBAAiB,GAAG,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,EAC7D,SAAS,EAAE,KAAK,CAAC,2BAA2B,EAC5C,OAAO,UAAQ;IAoBjB,OAAO,CAAC,MAAM,EAAE,qBAAqB,iBACd,MAAM,kBAAkB,EAAE;IA2BjD,YAAY,CACV,gBAAgB,EAAE;QAChB,EAAE,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,kBAAkB,EAAE,CAAC,KAAK,KAAK,CAAC,YAAY,CAAC;QAChF,MAAM,EAAE,qBAAqB,CAAC;KAC/B,EAAE;CAIN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../../../src/invitationRepository/observers/getInvitations/enums.ts"],"names":[],"mappings":"AAAA,oBAAY,qBAAqB;IAC/B,wBAAwB,6BAA6B;IACrD,wBAAwB,6BAA6B;IACrD,wBAAwB,6BAA6B;CACtD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get invitations
|
|
3
|
+
*
|
|
4
|
+
* @param params the query parameters
|
|
5
|
+
* @param callback the callback to be called when the invitations are updated
|
|
6
|
+
* @returns invitations
|
|
7
|
+
*
|
|
8
|
+
* @category Invitation Live Collection
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
export declare const getInvitations: (params: Amity.InvitationLiveCollection, callback: Amity.LiveCollectionCallback<Amity.Invitation>, config?: Amity.LiveCollectionConfig) => () => void;
|
|
12
|
+
//# sourceMappingURL=getInvitations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getInvitations.d.ts","sourceRoot":"","sources":["../../../src/invitationRepository/observers/getInvitations.ts"],"names":[],"mappings":"AAKA;;;;;;;;;GASG;AACH,eAAO,MAAM,cAAc,WACjB,MAAM,wBAAwB,YAC5B,MAAM,sBAAsB,CAAC,MAAM,UAAU,CAAC,WAC/C,MAAM,oBAAoB,eAyBpC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/invitationRepository/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepareInvitationPayload.d.ts","sourceRoot":"","sources":["../../../src/invitationRepository/utils/prepareInvitationPayload.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,eACvB,MAAM,iBAAiB,KAClC,MAAM,0BAQR,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"communityLinkedObject.d.ts","sourceRoot":"","sources":["../../../src/utils/linkedObject/communityLinkedObject.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,qBAAqB,cAAe,MAAM,iBAAiB,KAAG,MAAM,SAwBhF,CAAC"}
|
|
@@ -12,5 +12,7 @@ export declare const LinkedObject: {
|
|
|
12
12
|
channel: (channel: Amity.InternalChannel<any>) => Amity.Channel<any>;
|
|
13
13
|
pinnedPost: (pinnedPost: Amity.RawPin) => Amity.PinnedPost;
|
|
14
14
|
notificationTray: (noti: Amity.RawNotificationTrayItem) => Amity.NotificationTrayItem;
|
|
15
|
+
community: (community: Amity.InternalCommunity) => Amity.Community;
|
|
16
|
+
invitation: (invitation: Amity.InternalInvitation) => Amity.Invitation;
|
|
15
17
|
};
|
|
16
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/linkedObject/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/linkedObject/index.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;CAgBxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invitationLinkedObject.d.ts","sourceRoot":"","sources":["../../../src/utils/linkedObject/invitationLinkedObject.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,sBAAsB,eAAgB,MAAM,kBAAkB,KAAG,MAAM,UAmCnF,CAAC"}
|
|
@@ -30,21 +30,21 @@ export declare const emptyPostPayload: {
|
|
|
30
30
|
export declare const postQueryResponse: {
|
|
31
31
|
data: Omit<Amity.PostPayload<any>, "communityUsers" | "communities" | "posts"> & {
|
|
32
32
|
posts: Amity.InternalPost<any>[];
|
|
33
|
-
communities: Amity.
|
|
33
|
+
communities: Amity.InternalCommunity[];
|
|
34
34
|
communityUsers: Amity.Membership<"community">[];
|
|
35
35
|
} & Amity.Pagination;
|
|
36
36
|
};
|
|
37
37
|
export declare const postQueryResponse2: {
|
|
38
38
|
data: Omit<Amity.PostPayload<any>, "communityUsers" | "communities" | "posts"> & {
|
|
39
39
|
posts: Amity.InternalPost<any>[];
|
|
40
|
-
communities: Amity.
|
|
40
|
+
communities: Amity.InternalCommunity[];
|
|
41
41
|
communityUsers: Amity.Membership<"community">[];
|
|
42
42
|
} & Amity.Pagination;
|
|
43
43
|
};
|
|
44
44
|
export declare const postQueryResponsePage2: {
|
|
45
45
|
data: Omit<Amity.PostPayload<any>, "communityUsers" | "communities" | "posts"> & {
|
|
46
46
|
posts: Amity.InternalPost<any>[];
|
|
47
|
-
communities: Amity.
|
|
47
|
+
communities: Amity.InternalCommunity[];
|
|
48
48
|
communityUsers: Amity.Membership<"community">[];
|
|
49
49
|
} & Amity.Pagination;
|
|
50
50
|
};
|
package/package.json
CHANGED
|
@@ -261,6 +261,10 @@ declare global {
|
|
|
261
261
|
notificationTrayItems: Amity.InternalNotificationTrayItem[];
|
|
262
262
|
};
|
|
263
263
|
|
|
264
|
+
'local.invitation.created': Amity.InternalInvitation[];
|
|
265
|
+
'local.invitation.updated': Amity.InternalInvitation[];
|
|
266
|
+
'local.invitation.deleted': Amity.InternalInvitation[];
|
|
267
|
+
|
|
264
268
|
sessionStateChange: Amity.SessionStates;
|
|
265
269
|
// used by accessTokenExpiryWatcher
|
|
266
270
|
tokenExpired: Amity.SessionStates.TOKEN_EXPIRED;
|
package/src/@types/core/model.ts
CHANGED
|
@@ -33,7 +33,7 @@ declare global {
|
|
|
33
33
|
feedMarker: Amity.FeedMarker;
|
|
34
34
|
userMarker: Amity.UserMarker;
|
|
35
35
|
|
|
36
|
-
community: Amity.
|
|
36
|
+
community: Amity.InternalCommunity;
|
|
37
37
|
category: Amity.InternalCategory;
|
|
38
38
|
communityUsers: Amity.Membership<'community'>;
|
|
39
39
|
post: Amity.InternalPost;
|
|
@@ -60,6 +60,8 @@ declare global {
|
|
|
60
60
|
|
|
61
61
|
notificationTrayItem: Amity.InternalNotificationTrayItem;
|
|
62
62
|
notificationTraySeen: Amity.InternalNotificationTraySeen;
|
|
63
|
+
|
|
64
|
+
invitation: Amity.InternalInvitation;
|
|
63
65
|
};
|
|
64
66
|
|
|
65
67
|
type Model = ValueOf<Models>;
|
|
@@ -124,6 +126,8 @@ declare global {
|
|
|
124
126
|
|
|
125
127
|
notificationTrayItem: Pick<Amity.InternalNotificationTrayItem, '_id'>;
|
|
126
128
|
notificationTraySeen: Pick<Amity.InternalNotificationTraySeen, 'userId'>;
|
|
129
|
+
|
|
130
|
+
invitation: Pick<Amity.InternalInvitation, '_id'>;
|
|
127
131
|
};
|
|
128
132
|
}
|
|
129
133
|
}
|
|
@@ -27,6 +27,7 @@ declare global {
|
|
|
27
27
|
semanticSearchPost: Amity.SemanticSearchPostPayload;
|
|
28
28
|
semanticSearchCommunity: Amity.SemanticSearchCommunityPayload;
|
|
29
29
|
notificationTrayItem: Amity.NotificationTrayPayload;
|
|
30
|
+
invitation: Amity.InvitationPayload;
|
|
30
31
|
};
|
|
31
32
|
|
|
32
33
|
type UserPayload = {
|
|
@@ -306,7 +307,7 @@ declare global {
|
|
|
306
307
|
* - communityUsers: `Amity.RawMembership` -> `Amity.Membership` (Add user getter prop)
|
|
307
308
|
*/
|
|
308
309
|
type ProcessedCommunityPayload = Omit<CommunityPayload, 'communities' | 'communityUsers'> & {
|
|
309
|
-
communities: Amity.
|
|
310
|
+
communities: Amity.InternalCommunity[];
|
|
310
311
|
communityUsers: Amity.Membership<'community'>[];
|
|
311
312
|
};
|
|
312
313
|
|
|
@@ -333,7 +334,7 @@ declare global {
|
|
|
333
334
|
CommunityMembershipPayload,
|
|
334
335
|
'communities' | 'communityUsers'
|
|
335
336
|
> & {
|
|
336
|
-
communities: Amity.
|
|
337
|
+
communities: Amity.InternalCommunity[];
|
|
337
338
|
communityUsers: Amity.Membership<'community'>[];
|
|
338
339
|
};
|
|
339
340
|
|
|
@@ -383,7 +384,7 @@ declare global {
|
|
|
383
384
|
Amity.StoryTargetPayload;
|
|
384
385
|
|
|
385
386
|
type ProcessedGlobalStoryFeed = Omit<GlobalStoryFeedPayload, 'communities'> & {
|
|
386
|
-
communities: Amity.
|
|
387
|
+
communities: Amity.InternalCommunity[];
|
|
387
388
|
};
|
|
388
389
|
|
|
389
390
|
// Original Payload form BE
|
|
@@ -436,7 +437,7 @@ declare global {
|
|
|
436
437
|
*/
|
|
437
438
|
type ProcessedPostPayload = Omit<PostPayload, 'communities' | 'communityUsers' | 'posts'> & {
|
|
438
439
|
posts: Amity.InternalPost[];
|
|
439
|
-
communities: Amity.
|
|
440
|
+
communities: Amity.InternalCommunity[];
|
|
440
441
|
communityUsers: Amity.Membership<'community'>[];
|
|
441
442
|
};
|
|
442
443
|
|
|
@@ -545,5 +546,13 @@ declare global {
|
|
|
545
546
|
Amity.Flaggable &
|
|
546
547
|
Amity.Taggable &
|
|
547
548
|
Amity.Timestamps;
|
|
549
|
+
|
|
550
|
+
type InvitationPayload = {
|
|
551
|
+
invitations: Amity.RawInvitation[];
|
|
552
|
+
};
|
|
553
|
+
|
|
554
|
+
type ProcessedInvitationPayload = {
|
|
555
|
+
invitations: Amity.InternalInvitation[];
|
|
556
|
+
};
|
|
548
557
|
}
|
|
549
558
|
}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
2
|
import { Emitter } from 'mitt';
|
|
3
3
|
|
|
4
|
+
export const enum MembershipAcceptanceTypeEnum {
|
|
5
|
+
AUTOMATIC = 'automatic',
|
|
6
|
+
INVITATION = 'invitation',
|
|
7
|
+
}
|
|
8
|
+
|
|
4
9
|
declare global {
|
|
5
10
|
namespace Amity {
|
|
6
11
|
type Logger = (topic: string, ...args: any[]) => void;
|
|
7
12
|
|
|
13
|
+
type MembershipAcceptanceType = MembershipAcceptanceTypeEnum;
|
|
14
|
+
|
|
8
15
|
const enum TokenTerminationReason {
|
|
9
16
|
GLOBAL_BAN = 'globalBan',
|
|
10
17
|
USER_DELETED = 'userDeleted',
|
|
@@ -124,7 +131,12 @@ declare global {
|
|
|
124
131
|
showMyPost: boolean;
|
|
125
132
|
showOnlyMyFeed: boolean;
|
|
126
133
|
};
|
|
134
|
+
story: {
|
|
135
|
+
allowAllUserToCreateStory: boolean;
|
|
136
|
+
expiryTimeMinutes: number;
|
|
137
|
+
};
|
|
127
138
|
userPrivacySetting: 'public' | 'private';
|
|
139
|
+
membershipAcceptance: Amity.MembershipAcceptanceType;
|
|
128
140
|
};
|
|
129
141
|
|
|
130
142
|
type ConnectClientParams = {
|
|
@@ -95,17 +95,25 @@ declare global {
|
|
|
95
95
|
hasFlaggedPost: boolean;
|
|
96
96
|
|
|
97
97
|
allowCommentInStory?: boolean;
|
|
98
|
+
|
|
99
|
+
isDiscoverable: boolean;
|
|
100
|
+
requiresJoinApproval: boolean;
|
|
98
101
|
} & Amity.Taggable &
|
|
99
102
|
Amity.Metadata &
|
|
100
103
|
Amity.Timestamps &
|
|
101
104
|
Amity.SoftDelete &
|
|
102
105
|
Amity.Subscribable;
|
|
103
106
|
|
|
104
|
-
type
|
|
107
|
+
type InternalCommunity = Omit<
|
|
108
|
+
Amity.RawCommunity,
|
|
109
|
+
'onlyAdminCanPost' | 'needApprovalOnPostCreation'
|
|
110
|
+
> &
|
|
105
111
|
Amity.CommunityStorySettings & {
|
|
106
112
|
postSetting?: ValueOf<typeof CommunityPostSettings>;
|
|
107
113
|
};
|
|
108
114
|
|
|
115
|
+
type Community = Amity.InternalCommunity & Amity.CommunityLinkedObject;
|
|
116
|
+
|
|
109
117
|
type QueryCommunities = {
|
|
110
118
|
membership?: 'all' | 'member' | 'notMember';
|
|
111
119
|
categoryId?: Amity.InternalCategory['categoryId'];
|
|
@@ -125,6 +133,7 @@ declare global {
|
|
|
125
133
|
sortBy?: Amity.SearchCommunitySortBy | Amity.SearchCommunitySortByEnum;
|
|
126
134
|
page?: string;
|
|
127
135
|
limit?: number;
|
|
136
|
+
includeDiscoverablePrivateCommunity?: boolean;
|
|
128
137
|
};
|
|
129
138
|
|
|
130
139
|
type CommunityLiveCollection = Amity.LiveCollectionParams<Omit<QueryCommunities, 'page'>>;
|
|
@@ -197,6 +206,7 @@ declare global {
|
|
|
197
206
|
token?: string;
|
|
198
207
|
};
|
|
199
208
|
tags?: string[];
|
|
209
|
+
includeDiscoverablePrivateCommunity?: boolean;
|
|
200
210
|
};
|
|
201
211
|
|
|
202
212
|
type SemanticSearchCommunityLiveCollection = Amity.LiveCollectionParams<
|
|
@@ -209,5 +219,12 @@ declare global {
|
|
|
209
219
|
Amity.Community['communityId'], // communityId:score
|
|
210
220
|
QuerySemanticSearchCommunity
|
|
211
221
|
>;
|
|
222
|
+
|
|
223
|
+
type CommunityLinkedObject = {
|
|
224
|
+
createInvitations: (userIds: string[]) => Promise<void>;
|
|
225
|
+
getMemberInvitations: (
|
|
226
|
+
callback: Amity.LiveCollectionCallback<Amity.Invitation>,
|
|
227
|
+
) => Amity.Unsubscriber;
|
|
228
|
+
};
|
|
212
229
|
}
|
|
213
230
|
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
|
|
3
|
+
export const enum InvitationTypeEnum {
|
|
4
|
+
CommunityMemberInvite = 'communityMemberInvite',
|
|
5
|
+
LivestreamInvite = 'livestreamInvite',
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const enum InvitationStatusEnum {
|
|
9
|
+
Pending = 'pending',
|
|
10
|
+
Approved = 'approved',
|
|
11
|
+
Rejected = 'rejected',
|
|
12
|
+
Cancelled = 'cancelled',
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const enum InvitationSortByEnum {
|
|
16
|
+
FirstCreated = 'firstCreated',
|
|
17
|
+
LastCreated = 'lastCreated',
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare global {
|
|
21
|
+
namespace Amity {
|
|
22
|
+
type InvitationType = InvitationTypeEnum;
|
|
23
|
+
|
|
24
|
+
type InvitationStatus = InvitationStatusEnum;
|
|
25
|
+
|
|
26
|
+
type InvitationTargetType = Extract<Amity.Domain, 'community'>;
|
|
27
|
+
|
|
28
|
+
type InvitationTargetMap = {
|
|
29
|
+
community: Amity.InternalCommunity;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
type InvitationTarget<T extends InvitationTargetType> = InvitationTargetMap[T];
|
|
33
|
+
|
|
34
|
+
type InvitationSortBy = InvitationSortByEnum;
|
|
35
|
+
|
|
36
|
+
type RawInvitation = {
|
|
37
|
+
_id: string;
|
|
38
|
+
networkId: string;
|
|
39
|
+
type: Amity.InvitationType;
|
|
40
|
+
targetId: string;
|
|
41
|
+
targetType: Amity.InvitationTargetType;
|
|
42
|
+
userId: string;
|
|
43
|
+
status: Amity.InvitationStatus;
|
|
44
|
+
respondedAt: Amity.timestamp;
|
|
45
|
+
createdBy: string;
|
|
46
|
+
} & Amity.Timestamps;
|
|
47
|
+
|
|
48
|
+
type InternalInvitation = Omit<RawInvitation, 'createdBy'> & {
|
|
49
|
+
invitationId: string;
|
|
50
|
+
createdById: string;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
type Invitation = Omit<Amity.InternalInvitation, 'createdBy'> &
|
|
54
|
+
Amity.InvitationLinkedObject & {
|
|
55
|
+
user?: Amity.User;
|
|
56
|
+
createdById: string;
|
|
57
|
+
createdBy?: Amity.User;
|
|
58
|
+
invitationId: string;
|
|
59
|
+
target?: Amity.InvitationTarget<Amity.InvitationTargetType>;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
type QueryInvitations = {
|
|
63
|
+
targetId: string;
|
|
64
|
+
statuses?: string[];
|
|
65
|
+
token?: Amity.Token;
|
|
66
|
+
type: Amity.InvitationType;
|
|
67
|
+
sortBy?: Amity.InvitationSortBy;
|
|
68
|
+
limit?: Amity.PageLimit['limit'];
|
|
69
|
+
targetType: Amity.InvitationTargetType;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
type InvitationLiveCollection = Amity.LiveCollectionParams<Omit<QueryInvitations, 'limit'>>;
|
|
73
|
+
|
|
74
|
+
type InvitationLiveCollectionCache = Amity.LiveCollectionCache<
|
|
75
|
+
Amity.InternalInvitation['_id'],
|
|
76
|
+
Pick<QueryInvitations, 'limit'>
|
|
77
|
+
>;
|
|
78
|
+
|
|
79
|
+
type InvitationLinkedObject = {
|
|
80
|
+
accept: () => Promise<void>;
|
|
81
|
+
reject: () => Promise<void>;
|
|
82
|
+
cancel: () => Promise<void>;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
type CreateInvitations = {
|
|
86
|
+
type: Amity.InvitationType;
|
|
87
|
+
targetType: Amity.InvitationTargetType;
|
|
88
|
+
targetId: string;
|
|
89
|
+
userIds: string[];
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
}
|