@amityco/ts-sdk 7.4.1-b9f48528.0 → 7.4.1-d23fab2f.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 +8 -4
- package/dist/@types/core/payload.d.ts.map +1 -1
- package/dist/@types/domains/community.d.ts +5 -1
- package/dist/@types/domains/community.d.ts.map +1 -1
- package/dist/@types/domains/invitation.d.ts +43 -0
- package/dist/@types/domains/invitation.d.ts.map +1 -0
- package/dist/@types/index.d.ts +1 -0
- package/dist/@types/index.d.ts.map +1 -1
- package/dist/communityRepository/api/createCommunity.d.ts.map +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.map +1 -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.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 +266 -51
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +248 -34
- package/dist/index.umd.js +4 -4
- package/dist/invitationRepository/events/index.d.ts +2 -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/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 +9 -4
- package/src/@types/domains/community.ts +10 -1
- package/src/@types/domains/invitation.ts +52 -0
- package/src/@types/index.ts +1 -0
- package/src/communityRepository/api/createCommunity.ts +2 -1
- package/src/communityRepository/api/getCommunities.ts +2 -1
- package/src/communityRepository/api/getCommunity.ts +4 -1
- package/src/communityRepository/api/getRecommendedCommunities.ts +2 -1
- package/src/communityRepository/api/getTrendingCommunities.ts +2 -1
- package/src/communityRepository/api/queryCommunities.ts +6 -1
- package/src/communityRepository/api/updateCommunity.ts +4 -1
- 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/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 +1 -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 +46 -0
- package/src/invitationRepository/internalApi/index.ts +4 -0
- package/src/invitationRepository/internalApi/rejectInvitation.ts +45 -0
- package/src/utils/linkedObject/communityLinkedObject.ts +16 -0
- package/src/utils/linkedObject/index.ts +4 -0
- package/src/utils/linkedObject/invitationLinkedObject.ts +20 -0
package/dist/index.esm.js
CHANGED
|
@@ -103,6 +103,19 @@ const PostContentType = Object.freeze({
|
|
|
103
103
|
POLL: 'poll',
|
|
104
104
|
});
|
|
105
105
|
|
|
106
|
+
var InvitationTypeEnum;
|
|
107
|
+
(function (InvitationTypeEnum) {
|
|
108
|
+
InvitationTypeEnum["CommunityMemberInvite"] = "communityMemberInvite";
|
|
109
|
+
InvitationTypeEnum["LivestreamInvite"] = "livestreamInvite";
|
|
110
|
+
})(InvitationTypeEnum || (InvitationTypeEnum = {}));
|
|
111
|
+
var InvitationStatusEnum;
|
|
112
|
+
(function (InvitationStatusEnum) {
|
|
113
|
+
InvitationStatusEnum["Pending"] = "pending";
|
|
114
|
+
InvitationStatusEnum["Approved"] = "approved";
|
|
115
|
+
InvitationStatusEnum["Rejected"] = "rejected";
|
|
116
|
+
InvitationStatusEnum["Cancelled"] = "cancelled";
|
|
117
|
+
})(InvitationStatusEnum || (InvitationStatusEnum = {}));
|
|
118
|
+
|
|
106
119
|
function getVersion() {
|
|
107
120
|
try {
|
|
108
121
|
// the string ''v7.4.0-esm'' should be replaced by actual value by @rollup/plugin-replace
|
|
@@ -549,6 +562,7 @@ const idResolvers = {
|
|
|
549
562
|
pinTarget: ({ targetId }) => targetId,
|
|
550
563
|
notificationTrayItem: ({ _id }) => _id,
|
|
551
564
|
notificationTraySeen: ({ userId }) => userId,
|
|
565
|
+
invitation: ({ _id }) => _id,
|
|
552
566
|
};
|
|
553
567
|
/**
|
|
554
568
|
* Retrieve the id resolver matching a domain name
|
|
@@ -601,6 +615,7 @@ const PAYLOAD2MODEL = {
|
|
|
601
615
|
pinTargets: 'pinTarget',
|
|
602
616
|
pins: 'pin',
|
|
603
617
|
notificationTrayItems: 'notificationTrayItem',
|
|
618
|
+
invitations: 'invitation',
|
|
604
619
|
};
|
|
605
620
|
/** hidden */
|
|
606
621
|
const isOutdated = (prevData, nextData) => {
|
|
@@ -22387,6 +22402,169 @@ const notificationTrayLinkedObject = (noti) => {
|
|
|
22387
22402
|
.map(user => userLinkedObject(user)) });
|
|
22388
22403
|
};
|
|
22389
22404
|
|
|
22405
|
+
/* begin_public_function
|
|
22406
|
+
id: invitation.createInvitations
|
|
22407
|
+
*/
|
|
22408
|
+
/**
|
|
22409
|
+
* ```js
|
|
22410
|
+
* import { createInvitations } from '@amityco/ts-sdk'
|
|
22411
|
+
* const created = await createInvitations({
|
|
22412
|
+
* type: string,
|
|
22413
|
+
* targetType: string,
|
|
22414
|
+
* targetId: string,
|
|
22415
|
+
* userIds: string[]
|
|
22416
|
+
* }))
|
|
22417
|
+
* ```
|
|
22418
|
+
*
|
|
22419
|
+
* Creates an {@link Amity.Invitation}
|
|
22420
|
+
*
|
|
22421
|
+
* @param bundle The data necessary to create a new {@link Amity.Invitation}
|
|
22422
|
+
* @returns The newly created {@link Amity.Invitation}
|
|
22423
|
+
*
|
|
22424
|
+
* @category Invitation API
|
|
22425
|
+
* @async
|
|
22426
|
+
*/
|
|
22427
|
+
const createInvitations = async (bundle) => {
|
|
22428
|
+
const client = getActiveClient();
|
|
22429
|
+
client.log('invitation/createInvitations', bundle);
|
|
22430
|
+
const { data } = await client.http.post('/api/v1/invitations', bundle);
|
|
22431
|
+
const cachedAt = client.cache && Date.now();
|
|
22432
|
+
if (client.cache)
|
|
22433
|
+
ingestInCache(data, { cachedAt });
|
|
22434
|
+
fireEvent('local.invitation.created', data);
|
|
22435
|
+
return {
|
|
22436
|
+
data: data.invitations,
|
|
22437
|
+
cachedAt,
|
|
22438
|
+
};
|
|
22439
|
+
};
|
|
22440
|
+
/* end_public_function */
|
|
22441
|
+
|
|
22442
|
+
/* begin_public_function
|
|
22443
|
+
id: invitation.accept
|
|
22444
|
+
*/
|
|
22445
|
+
/**
|
|
22446
|
+
* ```js
|
|
22447
|
+
* import { acceptInvitation } from '@amityco/ts-sdk'
|
|
22448
|
+
* const isAccepted = await acceptInvitation(invitationId)
|
|
22449
|
+
* ```
|
|
22450
|
+
*
|
|
22451
|
+
* Accepts a {@link Amity.Invitation} object
|
|
22452
|
+
*
|
|
22453
|
+
* @param invitationId the {@link Amity.Invitation} to accept
|
|
22454
|
+
* @returns A success boolean if the {@link Amity.Invitation} was accepted
|
|
22455
|
+
*
|
|
22456
|
+
* @category Invitation API
|
|
22457
|
+
* @async
|
|
22458
|
+
*/
|
|
22459
|
+
const acceptInvitation = async (invitationId) => {
|
|
22460
|
+
var _a;
|
|
22461
|
+
const client = getActiveClient();
|
|
22462
|
+
client.log('invitation/acceptInvitation', invitationId);
|
|
22463
|
+
const { data } = await client.http.post(`/api/v1/invitations/${invitationId}/accept`);
|
|
22464
|
+
const invitation = (_a = pullFromCache([
|
|
22465
|
+
'invitation',
|
|
22466
|
+
'get',
|
|
22467
|
+
invitationId,
|
|
22468
|
+
])) === null || _a === void 0 ? void 0 : _a.data;
|
|
22469
|
+
if (invitation) {
|
|
22470
|
+
upsertInCache(['invitation', 'get', invitationId], { status: "approved" /* InvitationStatusEnum.Approved */ });
|
|
22471
|
+
fireEvent('local.invitation.updated', { invitations: [invitation] });
|
|
22472
|
+
}
|
|
22473
|
+
return data.success;
|
|
22474
|
+
};
|
|
22475
|
+
/* end_public_function */
|
|
22476
|
+
|
|
22477
|
+
/* begin_public_function
|
|
22478
|
+
id: invitation.reject
|
|
22479
|
+
*/
|
|
22480
|
+
/**
|
|
22481
|
+
* ```js
|
|
22482
|
+
* import { rejectInvitation } from '@amityco/ts-sdk'
|
|
22483
|
+
* const isRejected = await rejectInvitation(invitationId)
|
|
22484
|
+
* ```
|
|
22485
|
+
*
|
|
22486
|
+
* Rejects a {@link Amity.Invitation} object
|
|
22487
|
+
*
|
|
22488
|
+
* @param invitationId the {@link Amity.Invitation} to reject
|
|
22489
|
+
* @returns A success boolean if the {@link Amity.Invitation} was rejected
|
|
22490
|
+
*
|
|
22491
|
+
* @category Invitation API
|
|
22492
|
+
* @async
|
|
22493
|
+
*/
|
|
22494
|
+
const rejectInvitation = async (invitationId) => {
|
|
22495
|
+
var _a;
|
|
22496
|
+
const client = getActiveClient();
|
|
22497
|
+
client.log('invitation/rejectInvitation', invitationId);
|
|
22498
|
+
const { data } = await client.http.post(`/api/v1/invitations/${invitationId}/reject`);
|
|
22499
|
+
const invitation = (_a = pullFromCache([
|
|
22500
|
+
'invitation',
|
|
22501
|
+
'get',
|
|
22502
|
+
invitationId,
|
|
22503
|
+
])) === null || _a === void 0 ? void 0 : _a.data;
|
|
22504
|
+
if (invitation) {
|
|
22505
|
+
upsertInCache(['invitation', 'get', invitationId], { status: "rejected" /* InvitationStatusEnum.Rejected */ });
|
|
22506
|
+
fireEvent('local.invitation.updated', { invitations: [invitation] });
|
|
22507
|
+
}
|
|
22508
|
+
return data.success;
|
|
22509
|
+
};
|
|
22510
|
+
/* end_public_function */
|
|
22511
|
+
|
|
22512
|
+
/* begin_public_function
|
|
22513
|
+
id: invitation.cancel
|
|
22514
|
+
*/
|
|
22515
|
+
/**
|
|
22516
|
+
* ```js
|
|
22517
|
+
* import { cancelInvitation } from '@amityco/ts-sdk'
|
|
22518
|
+
* const isCanceled = await cancelInvitation(invitationId)
|
|
22519
|
+
* ```
|
|
22520
|
+
*
|
|
22521
|
+
* Cancels a {@link Amity.Invitation} object
|
|
22522
|
+
*
|
|
22523
|
+
* @param invitationId the {@link Amity.Invitation} to cancel
|
|
22524
|
+
* @returns A success boolean if the {@link Amity.Invitation} was canceled
|
|
22525
|
+
*
|
|
22526
|
+
* @category Invitation API
|
|
22527
|
+
* @async
|
|
22528
|
+
*/
|
|
22529
|
+
const cancelInvitation = async (invitationId) => {
|
|
22530
|
+
var _a;
|
|
22531
|
+
const client = getActiveClient();
|
|
22532
|
+
client.log('invitation/cancelInvitation', invitationId);
|
|
22533
|
+
const { data } = await client.http.delete(`/api/v1/invitations/${invitationId}`);
|
|
22534
|
+
const invitation = (_a = pullFromCache([
|
|
22535
|
+
'invitation',
|
|
22536
|
+
'get',
|
|
22537
|
+
invitationId,
|
|
22538
|
+
])) === null || _a === void 0 ? void 0 : _a.data;
|
|
22539
|
+
if (invitation) {
|
|
22540
|
+
dropFromCache(['invitation', 'get', invitationId]);
|
|
22541
|
+
fireEvent('local.invitation.deleted', { invitations: [invitation] });
|
|
22542
|
+
}
|
|
22543
|
+
return data.success;
|
|
22544
|
+
};
|
|
22545
|
+
/* end_public_function */
|
|
22546
|
+
|
|
22547
|
+
const communityLinkedObject = (community) => {
|
|
22548
|
+
return Object.assign(Object.assign({}, community), { createInvitations: async (userIds) => {
|
|
22549
|
+
await createInvitations({
|
|
22550
|
+
type: "communityMemberInvite" /* InvitationTypeEnum.CommunityMemberInvite */,
|
|
22551
|
+
targetType: 'community',
|
|
22552
|
+
targetId: community.communityId,
|
|
22553
|
+
userIds,
|
|
22554
|
+
});
|
|
22555
|
+
} });
|
|
22556
|
+
};
|
|
22557
|
+
|
|
22558
|
+
const invitationLinkedObject = (invitation) => {
|
|
22559
|
+
return Object.assign(Object.assign({}, invitation), { accept: async () => {
|
|
22560
|
+
await acceptInvitation(invitation._id);
|
|
22561
|
+
}, reject: async () => {
|
|
22562
|
+
await rejectInvitation(invitation._id);
|
|
22563
|
+
}, cancel: async () => {
|
|
22564
|
+
await cancelInvitation(invitation._id);
|
|
22565
|
+
} });
|
|
22566
|
+
};
|
|
22567
|
+
|
|
22390
22568
|
const LinkedObject = {
|
|
22391
22569
|
ad: adLinkedObject,
|
|
22392
22570
|
comment: commentLinkedObject,
|
|
@@ -22401,6 +22579,8 @@ const LinkedObject = {
|
|
|
22401
22579
|
channel: channelLinkedObject,
|
|
22402
22580
|
pinnedPost: pinnedPostLinkedObject,
|
|
22403
22581
|
notificationTray: notificationTrayLinkedObject,
|
|
22582
|
+
community: communityLinkedObject,
|
|
22583
|
+
invitation: invitationLinkedObject,
|
|
22404
22584
|
};
|
|
22405
22585
|
|
|
22406
22586
|
const getChannelMessagePreviewWithUser = (channel) => {
|
|
@@ -26302,7 +26482,7 @@ const getUserUnread = (callback) => {
|
|
|
26302
26482
|
};
|
|
26303
26483
|
};
|
|
26304
26484
|
|
|
26305
|
-
var index$
|
|
26485
|
+
var index$n = /*#__PURE__*/Object.freeze({
|
|
26306
26486
|
__proto__: null,
|
|
26307
26487
|
getActiveClient: getActiveClient,
|
|
26308
26488
|
getActiveUser: getActiveUser,
|
|
@@ -27509,7 +27689,7 @@ const getMyFollowInfo = (callback) => {
|
|
|
27509
27689
|
};
|
|
27510
27690
|
/* end_public_function */
|
|
27511
27691
|
|
|
27512
|
-
var index$
|
|
27692
|
+
var index$m = /*#__PURE__*/Object.freeze({
|
|
27513
27693
|
__proto__: null,
|
|
27514
27694
|
blockUser: blockUser,
|
|
27515
27695
|
unBlockUser: unBlockUser,
|
|
@@ -28524,9 +28704,9 @@ var AmityUserSearchMatchType;
|
|
|
28524
28704
|
AmityUserSearchMatchType["PARTIAL"] = "partial";
|
|
28525
28705
|
})(AmityUserSearchMatchType || (AmityUserSearchMatchType = {}));
|
|
28526
28706
|
|
|
28527
|
-
var index$
|
|
28707
|
+
var index$l = /*#__PURE__*/Object.freeze({
|
|
28528
28708
|
__proto__: null,
|
|
28529
|
-
Relationship: index$
|
|
28709
|
+
Relationship: index$m,
|
|
28530
28710
|
getUserByIds: getUserByIds,
|
|
28531
28711
|
updateUser: updateUser,
|
|
28532
28712
|
flagUser: flagUser,
|
|
@@ -28834,7 +29014,7 @@ const updateAltText = async (fileId, altText) => {
|
|
|
28834
29014
|
};
|
|
28835
29015
|
/* end_public_function */
|
|
28836
29016
|
|
|
28837
|
-
var index$
|
|
29017
|
+
var index$k = /*#__PURE__*/Object.freeze({
|
|
28838
29018
|
__proto__: null,
|
|
28839
29019
|
getFile: getFile,
|
|
28840
29020
|
uploadFile: uploadFile,
|
|
@@ -29205,7 +29385,11 @@ function isCurrentUserPartOfCommunity(c, m) {
|
|
|
29205
29385
|
*/
|
|
29206
29386
|
function updateMembershipStatus(communities, communityUsers) {
|
|
29207
29387
|
return communities.map(c => {
|
|
29208
|
-
const cachedCommunity = pullFromCache([
|
|
29388
|
+
const cachedCommunity = pullFromCache([
|
|
29389
|
+
'community',
|
|
29390
|
+
'get',
|
|
29391
|
+
c.communityId,
|
|
29392
|
+
]);
|
|
29209
29393
|
if ((cachedCommunity === null || cachedCommunity === void 0 ? void 0 : cachedCommunity.data) && (cachedCommunity === null || cachedCommunity === void 0 ? void 0 : cachedCommunity.data.hasOwnProperty('isJoined'))) {
|
|
29210
29394
|
return Object.assign(Object.assign({}, cachedCommunity.data), c);
|
|
29211
29395
|
}
|
|
@@ -30702,7 +30886,7 @@ const getReactions = (params, callback, config) => {
|
|
|
30702
30886
|
};
|
|
30703
30887
|
/* end_public_function */
|
|
30704
30888
|
|
|
30705
|
-
var index$
|
|
30889
|
+
var index$j = /*#__PURE__*/Object.freeze({
|
|
30706
30890
|
__proto__: null,
|
|
30707
30891
|
addReaction: addReaction,
|
|
30708
30892
|
removeReaction: removeReaction,
|
|
@@ -32525,7 +32709,7 @@ const getMessages = (params, callback, config) => {
|
|
|
32525
32709
|
};
|
|
32526
32710
|
/* end_public_function */
|
|
32527
32711
|
|
|
32528
|
-
var index$
|
|
32712
|
+
var index$i = /*#__PURE__*/Object.freeze({
|
|
32529
32713
|
__proto__: null,
|
|
32530
32714
|
createMessage: createMessage,
|
|
32531
32715
|
updateMessage: updateMessage,
|
|
@@ -33051,7 +33235,7 @@ const stopMessageReceiptSync = (subChannelId) => {
|
|
|
33051
33235
|
};
|
|
33052
33236
|
/* end_public_function */
|
|
33053
33237
|
|
|
33054
|
-
var index$
|
|
33238
|
+
var index$h = /*#__PURE__*/Object.freeze({
|
|
33055
33239
|
__proto__: null,
|
|
33056
33240
|
getSubChannelByIds: getSubChannels$1,
|
|
33057
33241
|
createSubChannel: createSubChannel,
|
|
@@ -34365,7 +34549,7 @@ const searchMembers$1 = (params, callback, config) => {
|
|
|
34365
34549
|
};
|
|
34366
34550
|
/* end_public_function */
|
|
34367
34551
|
|
|
34368
|
-
var index$
|
|
34552
|
+
var index$g = /*#__PURE__*/Object.freeze({
|
|
34369
34553
|
__proto__: null,
|
|
34370
34554
|
addMembers: addMembers$1,
|
|
34371
34555
|
removeMembers: removeMembers$1,
|
|
@@ -34568,7 +34752,7 @@ const unmuteMembers = async (channelId, userIds) => {
|
|
|
34568
34752
|
};
|
|
34569
34753
|
/* end_public_function */
|
|
34570
34754
|
|
|
34571
|
-
var index$
|
|
34755
|
+
var index$f = /*#__PURE__*/Object.freeze({
|
|
34572
34756
|
__proto__: null,
|
|
34573
34757
|
addRole: addRole,
|
|
34574
34758
|
removeRole: removeRole,
|
|
@@ -34578,10 +34762,10 @@ var index$e = /*#__PURE__*/Object.freeze({
|
|
|
34578
34762
|
unmuteMembers: unmuteMembers
|
|
34579
34763
|
});
|
|
34580
34764
|
|
|
34581
|
-
var index$
|
|
34765
|
+
var index$e = /*#__PURE__*/Object.freeze({
|
|
34582
34766
|
__proto__: null,
|
|
34583
|
-
Membership: index$
|
|
34584
|
-
Moderation: index$
|
|
34767
|
+
Membership: index$g,
|
|
34768
|
+
Moderation: index$f,
|
|
34585
34769
|
getChannelByIds: getChannelByIds$1,
|
|
34586
34770
|
createChannel: createChannel,
|
|
34587
34771
|
updateChannel: updateChannel,
|
|
@@ -34649,7 +34833,7 @@ const getCommunities$1 = async (communityIds) => {
|
|
|
34649
34833
|
saveCommunityUsers(data.communities, data.communityUsers);
|
|
34650
34834
|
}
|
|
34651
34835
|
return {
|
|
34652
|
-
data: data.communities,
|
|
34836
|
+
data: data.communities.map(community => LinkedObject.community(community)),
|
|
34653
34837
|
cachedAt,
|
|
34654
34838
|
};
|
|
34655
34839
|
};
|
|
@@ -34715,7 +34899,7 @@ const createCommunity = async (bundle) => {
|
|
|
34715
34899
|
}
|
|
34716
34900
|
const { communities } = data;
|
|
34717
34901
|
return {
|
|
34718
|
-
data: communities[0],
|
|
34902
|
+
data: LinkedObject.community(communities[0]),
|
|
34719
34903
|
cachedAt,
|
|
34720
34904
|
};
|
|
34721
34905
|
};
|
|
@@ -34752,7 +34936,7 @@ const updateCommunity = async (communityId, patch) => {
|
|
|
34752
34936
|
}
|
|
34753
34937
|
const { communities } = data;
|
|
34754
34938
|
return {
|
|
34755
|
-
data: communities.find(community => community.communityId === communityId),
|
|
34939
|
+
data: LinkedObject.community(communities.find(community => community.communityId === communityId)),
|
|
34756
34940
|
cachedAt,
|
|
34757
34941
|
};
|
|
34758
34942
|
};
|
|
@@ -34785,7 +34969,7 @@ const getCommunity$1 = async (communityId) => {
|
|
|
34785
34969
|
}
|
|
34786
34970
|
const { communities } = data;
|
|
34787
34971
|
return {
|
|
34788
|
-
data: communities.find(community => community.communityId === communityId),
|
|
34972
|
+
data: LinkedObject.community(communities.find(community => community.communityId === communityId)),
|
|
34789
34973
|
cachedAt,
|
|
34790
34974
|
};
|
|
34791
34975
|
};
|
|
@@ -35961,7 +36145,7 @@ const searchMembers = (params, callback, config) => {
|
|
|
35961
36145
|
};
|
|
35962
36146
|
/* end_public_function */
|
|
35963
36147
|
|
|
35964
|
-
var index$
|
|
36148
|
+
var index$d = /*#__PURE__*/Object.freeze({
|
|
35965
36149
|
__proto__: null,
|
|
35966
36150
|
addMembers: addMembers,
|
|
35967
36151
|
removeMembers: removeMembers,
|
|
@@ -36986,7 +37170,7 @@ const unbanMembers = async (communityId, userIds) => {
|
|
|
36986
37170
|
};
|
|
36987
37171
|
/* end_public_function */
|
|
36988
37172
|
|
|
36989
|
-
var index$
|
|
37173
|
+
var index$c = /*#__PURE__*/Object.freeze({
|
|
36990
37174
|
__proto__: null,
|
|
36991
37175
|
addRoles: addRoles,
|
|
36992
37176
|
removeRoles: removeRoles,
|
|
@@ -36994,10 +37178,10 @@ var index$b = /*#__PURE__*/Object.freeze({
|
|
|
36994
37178
|
unbanMembers: unbanMembers
|
|
36995
37179
|
});
|
|
36996
37180
|
|
|
36997
|
-
var index$
|
|
37181
|
+
var index$b = /*#__PURE__*/Object.freeze({
|
|
36998
37182
|
__proto__: null,
|
|
36999
|
-
Moderation: index$
|
|
37000
|
-
Membership: index$
|
|
37183
|
+
Moderation: index$c,
|
|
37184
|
+
Membership: index$d,
|
|
37001
37185
|
getCommunityByIds: getCommunities$1,
|
|
37002
37186
|
createCommunity: createCommunity,
|
|
37003
37187
|
updateCommunity: updateCommunity,
|
|
@@ -37230,7 +37414,7 @@ const getCategories = (params, callback, config) => {
|
|
|
37230
37414
|
};
|
|
37231
37415
|
/* end_public_function */
|
|
37232
37416
|
|
|
37233
|
-
var index$
|
|
37417
|
+
var index$a = /*#__PURE__*/Object.freeze({
|
|
37234
37418
|
__proto__: null,
|
|
37235
37419
|
getCategory: getCategory,
|
|
37236
37420
|
getCategories: getCategories
|
|
@@ -37398,7 +37582,7 @@ getCustomRankingGlobalFeed.locally = (query) => {
|
|
|
37398
37582
|
: undefined;
|
|
37399
37583
|
};
|
|
37400
37584
|
|
|
37401
|
-
var index$
|
|
37585
|
+
var index$9 = /*#__PURE__*/Object.freeze({
|
|
37402
37586
|
__proto__: null,
|
|
37403
37587
|
queryGlobalFeed: queryGlobalFeed,
|
|
37404
37588
|
getCustomRankingGlobalFeed: getCustomRankingGlobalFeed
|
|
@@ -38727,7 +38911,7 @@ const getComments = (params, callback, config) => {
|
|
|
38727
38911
|
};
|
|
38728
38912
|
/* end_public_function */
|
|
38729
38913
|
|
|
38730
|
-
var index$
|
|
38914
|
+
var index$8 = /*#__PURE__*/Object.freeze({
|
|
38731
38915
|
__proto__: null,
|
|
38732
38916
|
getCommentByIds: getCommentByIds,
|
|
38733
38917
|
createComment: createComment,
|
|
@@ -39734,7 +39918,7 @@ const semanticSearchPosts = (params, callback, config) => {
|
|
|
39734
39918
|
};
|
|
39735
39919
|
};
|
|
39736
39920
|
|
|
39737
|
-
var index$
|
|
39921
|
+
var index$7 = /*#__PURE__*/Object.freeze({
|
|
39738
39922
|
__proto__: null,
|
|
39739
39923
|
getPostByIds: getPostByIds,
|
|
39740
39924
|
createPost: createPost,
|
|
@@ -40268,7 +40452,7 @@ const getStreams = (params, callback, config) => {
|
|
|
40268
40452
|
};
|
|
40269
40453
|
};
|
|
40270
40454
|
|
|
40271
|
-
var index$
|
|
40455
|
+
var index$6 = /*#__PURE__*/Object.freeze({
|
|
40272
40456
|
__proto__: null,
|
|
40273
40457
|
createStream: createStream,
|
|
40274
40458
|
updateStream: updateStream,
|
|
@@ -40555,7 +40739,7 @@ const getPoll = (pollId, callback) => {
|
|
|
40555
40739
|
};
|
|
40556
40740
|
/* end_public_function */
|
|
40557
40741
|
|
|
40558
|
-
var index$
|
|
40742
|
+
var index$5 = /*#__PURE__*/Object.freeze({
|
|
40559
40743
|
__proto__: null,
|
|
40560
40744
|
createPoll: createPoll,
|
|
40561
40745
|
closePoll: closePoll,
|
|
@@ -40926,7 +41110,7 @@ const getPlayer = async (parameters) => {
|
|
|
40926
41110
|
return video;
|
|
40927
41111
|
};
|
|
40928
41112
|
|
|
40929
|
-
var index$
|
|
41113
|
+
var index$4 = /*#__PURE__*/Object.freeze({
|
|
40930
41114
|
__proto__: null,
|
|
40931
41115
|
getPlayer: getPlayer
|
|
40932
41116
|
});
|
|
@@ -42099,7 +42283,7 @@ const getGlobalStoryTargets = (params, callback, config) => {
|
|
|
42099
42283
|
};
|
|
42100
42284
|
};
|
|
42101
42285
|
|
|
42102
|
-
var index$
|
|
42286
|
+
var index$3 = /*#__PURE__*/Object.freeze({
|
|
42103
42287
|
__proto__: null,
|
|
42104
42288
|
createImageStory: createImageStory,
|
|
42105
42289
|
createVideoStory: createVideoStory,
|
|
@@ -42136,7 +42320,7 @@ const getNetworkAds = async () => {
|
|
|
42136
42320
|
};
|
|
42137
42321
|
};
|
|
42138
42322
|
|
|
42139
|
-
var index$
|
|
42323
|
+
var index$2 = /*#__PURE__*/Object.freeze({
|
|
42140
42324
|
__proto__: null,
|
|
42141
42325
|
getNetworkAds: getNetworkAds
|
|
42142
42326
|
});
|
|
@@ -42527,7 +42711,7 @@ const markTraySeen = async (lastSeenAt) => {
|
|
|
42527
42711
|
};
|
|
42528
42712
|
/* end_public_function */
|
|
42529
42713
|
|
|
42530
|
-
var index = /*#__PURE__*/Object.freeze({
|
|
42714
|
+
var index$1 = /*#__PURE__*/Object.freeze({
|
|
42531
42715
|
__proto__: null,
|
|
42532
42716
|
getNotificationTraySeen: getNotificationTraySeen,
|
|
42533
42717
|
getNotificationTrayItems: getNotificationTrayItems,
|
|
@@ -42536,4 +42720,34 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
42536
42720
|
onNotificationTraySeenUpdated: onNotificationTraySeenUpdated
|
|
42537
42721
|
});
|
|
42538
42722
|
|
|
42539
|
-
|
|
42723
|
+
/**
|
|
42724
|
+
* ```js
|
|
42725
|
+
* import { onLocalInvitationCreated } from '@amityco/ts-sdk'
|
|
42726
|
+
* const dispose = onLocalInvitationCreated(data => {
|
|
42727
|
+
* // ...
|
|
42728
|
+
* })
|
|
42729
|
+
* ```
|
|
42730
|
+
*
|
|
42731
|
+
* Fired when an {@link Amity.InvitationPayload} has been created
|
|
42732
|
+
*
|
|
42733
|
+
* @param callback The function to call when the event was fired
|
|
42734
|
+
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
42735
|
+
*
|
|
42736
|
+
* @category Invitation Events
|
|
42737
|
+
*/
|
|
42738
|
+
const onLocalInvitationCreated = (callback) => {
|
|
42739
|
+
const client = getActiveClient();
|
|
42740
|
+
const disposers = [
|
|
42741
|
+
createEventSubscriber(client, 'onLocalInvitationCreated', 'local.invitation.created', payload => callback(payload)),
|
|
42742
|
+
];
|
|
42743
|
+
return () => {
|
|
42744
|
+
disposers.forEach(fn => fn());
|
|
42745
|
+
};
|
|
42746
|
+
};
|
|
42747
|
+
|
|
42748
|
+
var index = /*#__PURE__*/Object.freeze({
|
|
42749
|
+
__proto__: null,
|
|
42750
|
+
onLocalInvitationCreated: onLocalInvitationCreated
|
|
42751
|
+
});
|
|
42752
|
+
|
|
42753
|
+
export { API_REGIONS, index$2 as AdRepository, index$a as CategoryRepository, index$e as ChannelRepository, index$n as Client, index$8 as CommentRepository, CommunityPostSettingMaps, CommunityPostSettings, index$b as CommunityRepository, ContentFeedType, ContentFlagReasonEnum, DefaultCommunityPostSetting, index$9 as FeedRepository, FileAccessTypeEnum, index$k as FileRepository, FileType, index as InvitationRepository, InvitationStatusEnum, InvitationTypeEnum, index$4 as LiveStreamPlayer, MembershipAcceptanceTypeEnum, MessageContentType, index$i as MessageRepository, index$5 as PollRepository, PostContentType, index$7 as PostRepository, index$j as ReactionRepository, index$3 as StoryRepository, index$6 as StreamRepository, index$h as SubChannelRepository, SubscriptionLevels, index$l as UserRepository, VERSION, VideoResolution, VideoSize, VideoTranscodingStatus, backupCache, createQuery, createReport, createUserToken, deleteReport, disableCache, dropFromCache, enableCache, filterByChannelMembership, filterByCommunityMembership, filterByFeedType, filterByPostDataTypes, filterByPropEquality, filterByPropInclusion, filterByPropIntersection, filterBySearchTerm, filterByStringComparePartially, getChannelTopic, getCommentTopic, getCommunityStoriesTopic, getCommunityTopic, getLiveStreamTopic, getMarkedMessageTopic, getMarkerUserFeedTopic, getMessageTopic, getMyFollowersTopic, getMyFollowingsTopic, getNetworkTopic, getPostTopic, getRole, getSmartFeedChannelTopic, getSmartFeedMessageTopic, getSmartFeedSubChannelTopic, getStoryTopic, getSubChannelTopic, getUserTopic, isAfterBefore, isAfterBeforeRaw, isCachable, isFetcher, isFresh, isLocal, isMutator, isOffline, isPaged, isReportedByMe, isSkip, mergeInCache, index$1 as notificationTray, onChannelMarkerFetched, onFeedMarkerFetched, onFeedMarkerUpdated, onMessageMarked, onMessageMarkerFetched, onSubChannelMarkerFetched, onSubChannelMarkerUpdated, onUserMarkerFetched, onUserMarkerFetchedLegacy, pullFromCache, pushToCache, queryCache, queryOptions, queryRoles, restoreCache, runQuery, sortByChannelSegment, sortByDisplayName, sortByFirstCreated, sortByFirstUpdated, sortByLastActivity, sortByLastCreated, sortByLastUpdated, sortByLocalSortingDate, sortByName, sortBySegmentNumber, subscribeTopic, toPage, toPageRaw, toToken, upsertInCache, wipeCache };
|