@amityco/ts-sdk 7.11.0 → 7.11.1-1768ac5d.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 +32 -2
- package/dist/@types/core/events.d.ts.map +1 -1
- package/dist/@types/core/model.d.ts +2 -0
- package/dist/@types/core/model.d.ts.map +1 -1
- package/dist/@types/core/payload.d.ts +17 -0
- package/dist/@types/core/payload.d.ts.map +1 -1
- package/dist/@types/core/transport.d.ts +3 -0
- package/dist/@types/core/transport.d.ts.map +1 -1
- package/dist/@types/domains/community.d.ts +8 -1
- package/dist/@types/domains/community.d.ts.map +1 -1
- package/dist/@types/domains/event.d.ts +66 -0
- package/dist/@types/domains/event.d.ts.map +1 -0
- package/dist/@types/domains/partials.d.ts +2 -2
- package/dist/@types/domains/partials.d.ts.map +1 -1
- package/dist/@types/index.d.ts +1 -0
- package/dist/@types/index.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/eventRepository/api/createEvent.d.ts +16 -0
- package/dist/eventRepository/api/createEvent.d.ts.map +1 -0
- package/dist/eventRepository/api/deleteEvent.d.ts +15 -0
- package/dist/eventRepository/api/deleteEvent.d.ts.map +1 -0
- package/dist/eventRepository/api/index.d.ts +4 -0
- package/dist/eventRepository/api/index.d.ts.map +1 -0
- package/dist/eventRepository/api/updateEvent.d.ts +17 -0
- package/dist/eventRepository/api/updateEvent.d.ts.map +1 -0
- package/dist/eventRepository/events/enums.d.ts +6 -0
- package/dist/eventRepository/events/enums.d.ts.map +1 -0
- package/dist/eventRepository/events/index.d.ts +4 -0
- package/dist/eventRepository/events/index.d.ts.map +1 -0
- package/dist/eventRepository/events/onEventCreated.d.ts +17 -0
- package/dist/eventRepository/events/onEventCreated.d.ts.map +1 -0
- package/dist/eventRepository/events/onEventDeleted.d.ts +17 -0
- package/dist/eventRepository/events/onEventDeleted.d.ts.map +1 -0
- package/dist/eventRepository/events/onEventUpdated.d.ts +17 -0
- package/dist/eventRepository/events/onEventUpdated.d.ts.map +1 -0
- package/dist/eventRepository/index.d.ts +4 -0
- package/dist/eventRepository/index.d.ts.map +1 -0
- package/dist/eventRepository/internalApi/getEvent.d.ts +32 -0
- package/dist/eventRepository/internalApi/getEvent.d.ts.map +1 -0
- package/dist/eventRepository/internalApi/index.d.ts +2 -0
- package/dist/eventRepository/internalApi/index.d.ts.map +1 -0
- package/dist/eventRepository/observers/getEvent.d.ts +21 -0
- package/dist/eventRepository/observers/getEvent.d.ts.map +1 -0
- package/dist/eventRepository/observers/getEvents/LiveCollectionController.d.ts +13 -0
- package/dist/eventRepository/observers/getEvents/LiveCollectionController.d.ts.map +1 -0
- package/dist/eventRepository/observers/getEvents/PaginationController.d.ts +5 -0
- package/dist/eventRepository/observers/getEvents/PaginationController.d.ts.map +1 -0
- package/dist/eventRepository/observers/getEvents/QueryStreamController.d.ts +15 -0
- package/dist/eventRepository/observers/getEvents/QueryStreamController.d.ts.map +1 -0
- package/dist/eventRepository/observers/getEvents.d.ts +12 -0
- package/dist/eventRepository/observers/getEvents.d.ts.map +1 -0
- package/dist/eventRepository/observers/index.d.ts +3 -0
- package/dist/eventRepository/observers/index.d.ts.map +1 -0
- package/dist/eventRepository/utils/createEventEventSubscriber.d.ts +2 -0
- package/dist/eventRepository/utils/createEventEventSubscriber.d.ts.map +1 -0
- package/dist/eventRepository/utils/index.d.ts +3 -0
- package/dist/eventRepository/utils/index.d.ts.map +1 -0
- package/dist/eventRepository/utils/prepareEventPayload.d.ts +2 -0
- package/dist/eventRepository/utils/prepareEventPayload.d.ts.map +1 -0
- package/dist/index.cjs.js +516 -51
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +496 -32
- package/dist/index.umd.js +3 -3
- package/dist/messagePreview/utils/getChannelMessagePreviewWithUser.d.ts +1 -1
- package/dist/utils/linkedObject/eventLinkObject.d.ts +2 -0
- package/dist/utils/linkedObject/eventLinkObject.d.ts.map +1 -0
- package/dist/utils/linkedObject/index.d.ts +1 -0
- package/dist/utils/linkedObject/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -192,6 +192,24 @@ exports.FeedSourceEnum = void 0;
|
|
|
192
192
|
FeedSourceEnum["User"] = "user";
|
|
193
193
|
})(exports.FeedSourceEnum || (exports.FeedSourceEnum = {}));
|
|
194
194
|
|
|
195
|
+
exports.AmityEventType = void 0;
|
|
196
|
+
(function (AmityEventType) {
|
|
197
|
+
AmityEventType["Virtual"] = "virtual";
|
|
198
|
+
AmityEventType["InPerson"] = "in_person";
|
|
199
|
+
})(exports.AmityEventType || (exports.AmityEventType = {}));
|
|
200
|
+
exports.AmityEventOriginType = void 0;
|
|
201
|
+
(function (AmityEventOriginType) {
|
|
202
|
+
AmityEventOriginType["Community"] = "community";
|
|
203
|
+
AmityEventOriginType["User"] = "user";
|
|
204
|
+
})(exports.AmityEventOriginType || (exports.AmityEventOriginType = {}));
|
|
205
|
+
exports.AmityEventStatus = void 0;
|
|
206
|
+
(function (AmityEventStatus) {
|
|
207
|
+
AmityEventStatus["Scheduled"] = "scheduled";
|
|
208
|
+
AmityEventStatus["Live"] = "live";
|
|
209
|
+
AmityEventStatus["Ended"] = "ended";
|
|
210
|
+
AmityEventStatus["Cancelled"] = "cancelled";
|
|
211
|
+
})(exports.AmityEventStatus || (exports.AmityEventStatus = {}));
|
|
212
|
+
|
|
195
213
|
function getVersion() {
|
|
196
214
|
try {
|
|
197
215
|
// the string ''v7.11.0-cjs'' should be replaced by actual value by @rollup/plugin-replace
|
|
@@ -640,6 +658,7 @@ const idResolvers = {
|
|
|
640
658
|
notificationTraySeen: ({ userId }) => userId,
|
|
641
659
|
invitation: ({ _id }) => _id,
|
|
642
660
|
joinRequest: ({ joinRequestId }) => joinRequestId,
|
|
661
|
+
event: ({ eventId }) => eventId,
|
|
643
662
|
};
|
|
644
663
|
/**
|
|
645
664
|
* Retrieve the id resolver matching a domain name
|
|
@@ -695,6 +714,8 @@ const PAYLOAD2MODEL = {
|
|
|
695
714
|
notificationTrayItems: 'notificationTrayItem',
|
|
696
715
|
invitations: 'invitation',
|
|
697
716
|
joinRequests: 'joinRequest',
|
|
717
|
+
events: 'event',
|
|
718
|
+
discussionCommunities: 'community',
|
|
698
719
|
};
|
|
699
720
|
/** hidden */
|
|
700
721
|
const isOutdated = (prevData, nextData) => {
|
|
@@ -10460,7 +10481,7 @@ const getUserUnread = (callback) => {
|
|
|
10460
10481
|
};
|
|
10461
10482
|
};
|
|
10462
10483
|
|
|
10463
|
-
var index$
|
|
10484
|
+
var index$p = /*#__PURE__*/Object.freeze({
|
|
10464
10485
|
__proto__: null,
|
|
10465
10486
|
getActiveClient: getActiveClient,
|
|
10466
10487
|
getActiveUser: getActiveUser,
|
|
@@ -11679,7 +11700,7 @@ const getMyFollowInfo = (callback) => {
|
|
|
11679
11700
|
};
|
|
11680
11701
|
/* end_public_function */
|
|
11681
11702
|
|
|
11682
|
-
var index$
|
|
11703
|
+
var index$o = /*#__PURE__*/Object.freeze({
|
|
11683
11704
|
__proto__: null,
|
|
11684
11705
|
blockUser: blockUser,
|
|
11685
11706
|
unBlockUser: unBlockUser,
|
|
@@ -13658,6 +13679,35 @@ const communityLinkedObject = (community) => {
|
|
|
13658
13679
|
} });
|
|
13659
13680
|
};
|
|
13660
13681
|
|
|
13682
|
+
const eventLinkedObject = (event) => {
|
|
13683
|
+
return Object.assign(Object.assign({}, event), { get creator() {
|
|
13684
|
+
const cacheData = pullFromCache(['user', 'get', event.userId]);
|
|
13685
|
+
if (!(cacheData === null || cacheData === void 0 ? void 0 : cacheData.data))
|
|
13686
|
+
return;
|
|
13687
|
+
return userLinkedObject(cacheData.data);
|
|
13688
|
+
},
|
|
13689
|
+
get discussionCommunity() {
|
|
13690
|
+
if (!event.discussionCommunityId)
|
|
13691
|
+
return;
|
|
13692
|
+
const cacheData = pullFromCache([
|
|
13693
|
+
'community',
|
|
13694
|
+
'get',
|
|
13695
|
+
event.discussionCommunityId,
|
|
13696
|
+
]);
|
|
13697
|
+
if (!(cacheData === null || cacheData === void 0 ? void 0 : cacheData.data))
|
|
13698
|
+
return;
|
|
13699
|
+
return communityLinkedObject(cacheData.data);
|
|
13700
|
+
},
|
|
13701
|
+
get liveStream() {
|
|
13702
|
+
if (!event.livestreamId)
|
|
13703
|
+
return;
|
|
13704
|
+
const cacheData = pullFromCache(['stream', 'get', event.livestreamId]);
|
|
13705
|
+
if (!(cacheData === null || cacheData === void 0 ? void 0 : cacheData.data))
|
|
13706
|
+
return;
|
|
13707
|
+
return cacheData.data;
|
|
13708
|
+
} });
|
|
13709
|
+
};
|
|
13710
|
+
|
|
13661
13711
|
const LinkedObject = {
|
|
13662
13712
|
ad: adLinkedObject,
|
|
13663
13713
|
comment: commentLinkedObject,
|
|
@@ -13676,6 +13726,7 @@ const LinkedObject = {
|
|
|
13676
13726
|
invitation: invitationLinkedObject,
|
|
13677
13727
|
joinRequest: joinRequestLinkedObject,
|
|
13678
13728
|
channelMember: channelMemberLinkedObject,
|
|
13729
|
+
event: eventLinkedObject,
|
|
13679
13730
|
};
|
|
13680
13731
|
|
|
13681
13732
|
/* begin_public_function
|
|
@@ -14666,9 +14717,9 @@ var AmityUserSearchMatchType;
|
|
|
14666
14717
|
AmityUserSearchMatchType["PARTIAL"] = "partial";
|
|
14667
14718
|
})(AmityUserSearchMatchType || (AmityUserSearchMatchType = {}));
|
|
14668
14719
|
|
|
14669
|
-
var index$
|
|
14720
|
+
var index$n = /*#__PURE__*/Object.freeze({
|
|
14670
14721
|
__proto__: null,
|
|
14671
|
-
Relationship: index$
|
|
14722
|
+
Relationship: index$o,
|
|
14672
14723
|
getUserByIds: getUserByIds,
|
|
14673
14724
|
updateUser: updateUser,
|
|
14674
14725
|
flagUser: flagUser,
|
|
@@ -15071,7 +15122,7 @@ const uploadAudio = async (formData, onProgress) => {
|
|
|
15071
15122
|
};
|
|
15072
15123
|
/* end_public_function */
|
|
15073
15124
|
|
|
15074
|
-
var index$
|
|
15125
|
+
var index$m = /*#__PURE__*/Object.freeze({
|
|
15075
15126
|
__proto__: null,
|
|
15076
15127
|
getFile: getFile,
|
|
15077
15128
|
uploadFile: uploadFile,
|
|
@@ -16883,7 +16934,7 @@ const getReactions$1 = (params, callback, config) => {
|
|
|
16883
16934
|
};
|
|
16884
16935
|
/* end_public_function */
|
|
16885
16936
|
|
|
16886
|
-
var index$
|
|
16937
|
+
var index$l = /*#__PURE__*/Object.freeze({
|
|
16887
16938
|
__proto__: null,
|
|
16888
16939
|
addReaction: addReaction,
|
|
16889
16940
|
removeReaction: removeReaction,
|
|
@@ -18655,7 +18706,7 @@ const getMessages = (params, callback, config) => {
|
|
|
18655
18706
|
};
|
|
18656
18707
|
/* end_public_function */
|
|
18657
18708
|
|
|
18658
|
-
var index$
|
|
18709
|
+
var index$k = /*#__PURE__*/Object.freeze({
|
|
18659
18710
|
__proto__: null,
|
|
18660
18711
|
createMessage: createMessage,
|
|
18661
18712
|
updateMessage: updateMessage,
|
|
@@ -19181,7 +19232,7 @@ const stopMessageReceiptSync = (subChannelId) => {
|
|
|
19181
19232
|
};
|
|
19182
19233
|
/* end_public_function */
|
|
19183
19234
|
|
|
19184
|
-
var index$
|
|
19235
|
+
var index$j = /*#__PURE__*/Object.freeze({
|
|
19185
19236
|
__proto__: null,
|
|
19186
19237
|
getSubChannelByIds: getSubChannels$1,
|
|
19187
19238
|
createSubChannel: createSubChannel,
|
|
@@ -20508,7 +20559,7 @@ const searchMembers$1 = (params, callback, config) => {
|
|
|
20508
20559
|
};
|
|
20509
20560
|
/* end_public_function */
|
|
20510
20561
|
|
|
20511
|
-
var index$
|
|
20562
|
+
var index$i = /*#__PURE__*/Object.freeze({
|
|
20512
20563
|
__proto__: null,
|
|
20513
20564
|
addMembers: addMembers$1,
|
|
20514
20565
|
removeMembers: removeMembers$1,
|
|
@@ -20711,7 +20762,7 @@ const unmuteMembers = async (channelId, userIds) => {
|
|
|
20711
20762
|
};
|
|
20712
20763
|
/* end_public_function */
|
|
20713
20764
|
|
|
20714
|
-
var index$
|
|
20765
|
+
var index$h = /*#__PURE__*/Object.freeze({
|
|
20715
20766
|
__proto__: null,
|
|
20716
20767
|
addRole: addRole,
|
|
20717
20768
|
removeRole: removeRole,
|
|
@@ -20721,10 +20772,10 @@ var index$g = /*#__PURE__*/Object.freeze({
|
|
|
20721
20772
|
unmuteMembers: unmuteMembers
|
|
20722
20773
|
});
|
|
20723
20774
|
|
|
20724
|
-
var index$
|
|
20775
|
+
var index$g = /*#__PURE__*/Object.freeze({
|
|
20725
20776
|
__proto__: null,
|
|
20726
|
-
Membership: index$
|
|
20727
|
-
Moderation: index$
|
|
20777
|
+
Membership: index$i,
|
|
20778
|
+
Moderation: index$h,
|
|
20728
20779
|
getChannelByIds: getChannelByIds$1,
|
|
20729
20780
|
createChannel: createChannel,
|
|
20730
20781
|
updateChannel: updateChannel,
|
|
@@ -22127,7 +22178,7 @@ const searchMembers = (params, callback, config) => {
|
|
|
22127
22178
|
};
|
|
22128
22179
|
/* end_public_function */
|
|
22129
22180
|
|
|
22130
|
-
var index$
|
|
22181
|
+
var index$f = /*#__PURE__*/Object.freeze({
|
|
22131
22182
|
__proto__: null,
|
|
22132
22183
|
addMembers: addMembers,
|
|
22133
22184
|
removeMembers: removeMembers,
|
|
@@ -23378,7 +23429,7 @@ const unbanMembers = async (communityId, userIds) => {
|
|
|
23378
23429
|
};
|
|
23379
23430
|
/* end_public_function */
|
|
23380
23431
|
|
|
23381
|
-
var index$
|
|
23432
|
+
var index$e = /*#__PURE__*/Object.freeze({
|
|
23382
23433
|
__proto__: null,
|
|
23383
23434
|
addRoles: addRoles,
|
|
23384
23435
|
removeRoles: removeRoles,
|
|
@@ -23386,10 +23437,10 @@ var index$d = /*#__PURE__*/Object.freeze({
|
|
|
23386
23437
|
unbanMembers: unbanMembers
|
|
23387
23438
|
});
|
|
23388
23439
|
|
|
23389
|
-
var index$
|
|
23440
|
+
var index$d = /*#__PURE__*/Object.freeze({
|
|
23390
23441
|
__proto__: null,
|
|
23391
|
-
Moderation: index$
|
|
23392
|
-
Membership: index$
|
|
23442
|
+
Moderation: index$e,
|
|
23443
|
+
Membership: index$f,
|
|
23393
23444
|
getCommunityByIds: getCommunities$1,
|
|
23394
23445
|
createCommunity: createCommunity,
|
|
23395
23446
|
updateCommunity: updateCommunity,
|
|
@@ -23623,7 +23674,7 @@ const getCategories = (params, callback, config) => {
|
|
|
23623
23674
|
};
|
|
23624
23675
|
/* end_public_function */
|
|
23625
23676
|
|
|
23626
|
-
var index$
|
|
23677
|
+
var index$c = /*#__PURE__*/Object.freeze({
|
|
23627
23678
|
__proto__: null,
|
|
23628
23679
|
getCategory: getCategory,
|
|
23629
23680
|
getCategories: getCategories
|
|
@@ -24682,7 +24733,7 @@ const getComments = (params, callback, config) => {
|
|
|
24682
24733
|
};
|
|
24683
24734
|
/* end_public_function */
|
|
24684
24735
|
|
|
24685
|
-
var index$
|
|
24736
|
+
var index$b = /*#__PURE__*/Object.freeze({
|
|
24686
24737
|
__proto__: null,
|
|
24687
24738
|
getCommentByIds: getCommentByIds,
|
|
24688
24739
|
createComment: createComment,
|
|
@@ -25353,7 +25404,7 @@ const getUserFeed = (params, callback, config) => {
|
|
|
25353
25404
|
};
|
|
25354
25405
|
/* end_public_function */
|
|
25355
25406
|
|
|
25356
|
-
var index$
|
|
25407
|
+
var index$a = /*#__PURE__*/Object.freeze({
|
|
25357
25408
|
__proto__: null,
|
|
25358
25409
|
queryGlobalFeed: queryGlobalFeed,
|
|
25359
25410
|
getCustomRankingGlobalFeed: getCustomRankingGlobalFeed,
|
|
@@ -27034,7 +27085,7 @@ const searchPostsByHashtag = (params, callback, config) => {
|
|
|
27034
27085
|
};
|
|
27035
27086
|
/* end_public_function */
|
|
27036
27087
|
|
|
27037
|
-
var index$
|
|
27088
|
+
var index$9 = /*#__PURE__*/Object.freeze({
|
|
27038
27089
|
__proto__: null,
|
|
27039
27090
|
getPostByIds: getPostByIds,
|
|
27040
27091
|
createPost: createPost,
|
|
@@ -27642,7 +27693,7 @@ const getStreams = (params, callback, config) => {
|
|
|
27642
27693
|
};
|
|
27643
27694
|
};
|
|
27644
27695
|
|
|
27645
|
-
var index$
|
|
27696
|
+
var index$8 = /*#__PURE__*/Object.freeze({
|
|
27646
27697
|
__proto__: null,
|
|
27647
27698
|
createStream: createStream,
|
|
27648
27699
|
updateStream: updateStream,
|
|
@@ -27960,7 +28011,7 @@ const getPoll = (pollId, callback) => {
|
|
|
27960
28011
|
};
|
|
27961
28012
|
/* end_public_function */
|
|
27962
28013
|
|
|
27963
|
-
var index$
|
|
28014
|
+
var index$7 = /*#__PURE__*/Object.freeze({
|
|
27964
28015
|
__proto__: null,
|
|
27965
28016
|
createPoll: createPoll,
|
|
27966
28017
|
closePoll: closePoll,
|
|
@@ -27972,7 +28023,7 @@ var index$6 = /*#__PURE__*/Object.freeze({
|
|
|
27972
28023
|
getPoll: getPoll
|
|
27973
28024
|
});
|
|
27974
28025
|
|
|
27975
|
-
const privateKey = "-----BEGIN PRIVATE KEY-----\
|
|
28026
|
+
const privateKey = "-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDAARz+hmBgi8pJ\nQb8LeY41gtHhk+ACMwRfhsn7GqpqRQNG2qU0755mzZuVDUqjQMGSo8THJB7O+OJs\nflbZRkFXlFoFOVNw1UpNOgwEQZ6wB9oRwzepTJAfF1sVhm/o/ixvXh1zDFNDy6yZ\npXyiiJHUVxqyjllZhxnwdvjoVtDs6hW6awG09bB9nh/TTejlUKXoAgzqVwu/1QMu\nUVViET495elEe19aUarEy+oL2iKeXCEvqda/pWNBdbieFyJvvZ08HN8dPuT88wq2\njZLEAth1vrwQ2IAa4ktaLcBQdLJgIkrbDvAiVZ8lQAjS/bq5vXQikTGvoPlC5bbn\nvuOM/3eLAgMBAAECggEAVZ+peHAghq2QVj71nX5lxsNCKaCyYwixSJBpfouTt7Rz\nE6PpzMOXFi1W1o+I22jDakuSM2SOQKqI/u0QefB0r0O/KVk5NrZHXk0mkrdYtxOp\nUgaGyf8UvmjB+8VqHrNKyZdk9qtmbnNj01kTTcAtmE4H39zPR7eR/8Rul94vaZbs\nwCnKJS3mLT3JxyGug6lxanveKkjG+CKC1nJQYWaxCJxaFSzbwXQPvDhB+TvrIbee\npd5v4EAyEJohpr+T9oDGGJkb/KARBZCtwLyB976PKJwwBA8MRVL1i5QwawuMiMq5\nUtnOnbGKtCeFzaLbNU0Qi8bqyims84EQxC6DOu1fkQKBgQDdvsoBsEhsOXV7hlIJ\naEd0eSJZVkdqimxH8uGoMM2FeNaOrcB6yBXqTSP0R3OIyf8eaY6yjRvP30ZNXcll\n/gD3O1Mu6YmWQdt1W2WA6pKOsUuPXasf0pdOF7IiFZKlSabz5YHXFqwVuqm8loaj\nsXel3YWqPVdHiankE7tz+3ssnQKBgQDdqi4TNdD1MdEpihx19jr0QjUiXW3939FK\nqp30HESPEGDGQzXdmJgif9HhZb+cJSuWaHEbjgBrYahvgCF+y6LbEpOD+D/dmT+s\nDEAQaR84sah6dokwPjV8fjBSrcVFjCS+doxv0d3p/9OUEeyUhFrY03nxtIEYkLIE\n/Zvn37b4RwKBgQCLENVFe9XfsaVhQ5r9dV2iyTlmh7qgMZG5CbTFs12hQGhm8McO\n+Z7s41YSJCFr/yq1WwP4LJDtrBw99vyQr1zRsG35tNLp3gGRNzGQSQyC2uQFVHw2\np+7mNewsfhUK/gbrXNsyFnDz6635rPlhfbII3sWuP2wWXFqkxE9CbMwR7QKBgQC6\nawDMzxmo2/iYArrkyevSuEuPVxvFwpF1RgAI6C0QVCnPE38dmdN4UB7mfHekje4W\nVEercMURidPp0cxZolCYBQtilUjAyL0vqC3In1/Ogjq6oy3FEMxSop1pKxMY5j+Q\nnoqFD+6deLUrddeNH7J3X4LSr4dSbX4JjG+tlgt+yQKBgQCuwTL4hA6KqeInQ0Ta\n9VQX5Qr8hFlqJz1gpymi/k63tW/Ob8yedbg3WWNWyShwRMFYyY9S81ITFWM95uL6\nvF3x9rmRjwElJw9PMwVu6dmf/CO0Z1wzXSp2VVD12gbrUD/0/d7MUoJ9LgC8X8f/\nn0txLHYGHbx+nf95+JUg6lV3hg==\n-----END PRIVATE KEY-----";
|
|
27976
28027
|
/*
|
|
27977
28028
|
* The crypto algorithm used for importing key and signing string
|
|
27978
28029
|
*/
|
|
@@ -28343,7 +28394,7 @@ const getPlayer = async (parameters) => {
|
|
|
28343
28394
|
return video;
|
|
28344
28395
|
};
|
|
28345
28396
|
|
|
28346
|
-
var index$
|
|
28397
|
+
var index$6 = /*#__PURE__*/Object.freeze({
|
|
28347
28398
|
__proto__: null,
|
|
28348
28399
|
getPlayer: getPlayer
|
|
28349
28400
|
});
|
|
@@ -29516,7 +29567,7 @@ const getGlobalStoryTargets = (params, callback, config) => {
|
|
|
29516
29567
|
};
|
|
29517
29568
|
};
|
|
29518
29569
|
|
|
29519
|
-
var index$
|
|
29570
|
+
var index$5 = /*#__PURE__*/Object.freeze({
|
|
29520
29571
|
__proto__: null,
|
|
29521
29572
|
createImageStory: createImageStory,
|
|
29522
29573
|
createVideoStory: createVideoStory,
|
|
@@ -29553,7 +29604,7 @@ const getNetworkAds = async () => {
|
|
|
29553
29604
|
};
|
|
29554
29605
|
};
|
|
29555
29606
|
|
|
29556
|
-
var index$
|
|
29607
|
+
var index$4 = /*#__PURE__*/Object.freeze({
|
|
29557
29608
|
__proto__: null,
|
|
29558
29609
|
getNetworkAds: getNetworkAds
|
|
29559
29610
|
});
|
|
@@ -29944,7 +29995,7 @@ const markTraySeen = async (lastSeenAt) => {
|
|
|
29944
29995
|
};
|
|
29945
29996
|
/* end_public_function */
|
|
29946
29997
|
|
|
29947
|
-
var index$
|
|
29998
|
+
var index$3 = /*#__PURE__*/Object.freeze({
|
|
29948
29999
|
__proto__: null,
|
|
29949
30000
|
getNotificationTraySeen: getNotificationTraySeen,
|
|
29950
30001
|
getNotificationTrayItems: getNotificationTrayItems,
|
|
@@ -30145,7 +30196,7 @@ const getMyCommunityInvitations = (params, callback, config) => {
|
|
|
30145
30196
|
};
|
|
30146
30197
|
};
|
|
30147
30198
|
|
|
30148
|
-
var index$
|
|
30199
|
+
var index$2 = /*#__PURE__*/Object.freeze({
|
|
30149
30200
|
__proto__: null,
|
|
30150
30201
|
onLocalInvitationCreated: onLocalInvitationCreated,
|
|
30151
30202
|
onLocalInvitationUpdated: onLocalInvitationUpdated,
|
|
@@ -30286,42 +30337,456 @@ const getReactions = (postId, callback) => {
|
|
|
30286
30337
|
};
|
|
30287
30338
|
};
|
|
30288
30339
|
|
|
30289
|
-
var index = /*#__PURE__*/Object.freeze({
|
|
30340
|
+
var index$1 = /*#__PURE__*/Object.freeze({
|
|
30290
30341
|
__proto__: null,
|
|
30291
30342
|
createReaction: createReaction,
|
|
30292
30343
|
onLiveReactionCreated: onLiveReactionCreated,
|
|
30293
30344
|
getReactions: getReactions
|
|
30294
30345
|
});
|
|
30295
30346
|
|
|
30347
|
+
const prepareEventPayload = (rawPayload) => {
|
|
30348
|
+
return Object.assign(Object.assign({}, rawPayload), { users: rawPayload.users.map(convertRawUserToInternalUser) });
|
|
30349
|
+
};
|
|
30350
|
+
|
|
30351
|
+
const createEventEventSubscriber = (event, callback) => {
|
|
30352
|
+
const client = getActiveClient();
|
|
30353
|
+
const filter = (payload) => {
|
|
30354
|
+
const unpackedPayload = prepareEventPayload(payload);
|
|
30355
|
+
if (!client.cache) {
|
|
30356
|
+
callback(unpackedPayload.events[0]);
|
|
30357
|
+
}
|
|
30358
|
+
else {
|
|
30359
|
+
ingestInCache(unpackedPayload);
|
|
30360
|
+
const event = pullFromCache([
|
|
30361
|
+
'event',
|
|
30362
|
+
'get',
|
|
30363
|
+
unpackedPayload.events[0].eventId,
|
|
30364
|
+
]);
|
|
30365
|
+
callback(event.data);
|
|
30366
|
+
}
|
|
30367
|
+
};
|
|
30368
|
+
return createEventSubscriber(client, event, event, filter);
|
|
30369
|
+
};
|
|
30370
|
+
|
|
30371
|
+
/* begin_public_function
|
|
30372
|
+
id: event.create
|
|
30373
|
+
*/
|
|
30374
|
+
/**
|
|
30375
|
+
* ```js
|
|
30376
|
+
* import { EventRepository } from '@amityco/ts-sdk'
|
|
30377
|
+
* const response = await EventRepository.createEvent(bundle)
|
|
30378
|
+
* ```
|
|
30379
|
+
*
|
|
30380
|
+
* Creates an {@link Amity.Event}
|
|
30381
|
+
*
|
|
30382
|
+
* @param bundle The data necessary to create a new {@link Amity.Event}
|
|
30383
|
+
* @returns The newly created {@link Amity.Event}
|
|
30384
|
+
*
|
|
30385
|
+
* @category Event API
|
|
30386
|
+
* @async
|
|
30387
|
+
*/
|
|
30388
|
+
const createEvent = async (bundle) => {
|
|
30389
|
+
const client = getActiveClient();
|
|
30390
|
+
client.log('event/createEvent', bundle);
|
|
30391
|
+
const { data: payload } = await client.http.post('/api/v1/events', bundle);
|
|
30392
|
+
fireEvent('event.created', payload);
|
|
30393
|
+
const preparedPayload = prepareEventPayload(payload);
|
|
30394
|
+
const cachedAt = client.cache && Date.now();
|
|
30395
|
+
if (client.cache)
|
|
30396
|
+
ingestInCache(preparedPayload, { cachedAt });
|
|
30397
|
+
return {
|
|
30398
|
+
data: eventLinkedObject(preparedPayload.events[0]),
|
|
30399
|
+
cachedAt,
|
|
30400
|
+
};
|
|
30401
|
+
};
|
|
30402
|
+
/* end_public_function */
|
|
30403
|
+
|
|
30404
|
+
/* begin_public_function
|
|
30405
|
+
id: event.update
|
|
30406
|
+
*/
|
|
30407
|
+
/**
|
|
30408
|
+
* ```js
|
|
30409
|
+
* import { EventRepository } from '@amityco/ts-sdk'
|
|
30410
|
+
* const response = await EventRepository.updateEvent(eventId, bundle)
|
|
30411
|
+
* ```
|
|
30412
|
+
*
|
|
30413
|
+
* Updates an {@link Amity.Event}
|
|
30414
|
+
*
|
|
30415
|
+
* @param eventId The ID of the {@link Amity.Event} to edit
|
|
30416
|
+
* @param bundle The data necessary to update an existing {@link Amity.Event}
|
|
30417
|
+
* @returns the updated {@link Amity.Event}
|
|
30418
|
+
*
|
|
30419
|
+
* @category Event API
|
|
30420
|
+
* @async
|
|
30421
|
+
*/
|
|
30422
|
+
const updateEvent = async (eventId, bundle) => {
|
|
30423
|
+
const client = getActiveClient();
|
|
30424
|
+
client.log('event/updateEvent', eventId, bundle);
|
|
30425
|
+
const { data: payload } = await client.http.put(`/api/v1/events/${eventId}`, bundle);
|
|
30426
|
+
fireEvent('event.updated', payload);
|
|
30427
|
+
const preparedPayload = prepareEventPayload(payload);
|
|
30428
|
+
const cachedAt = client.cache && Date.now();
|
|
30429
|
+
if (client.cache)
|
|
30430
|
+
ingestInCache(preparedPayload, { cachedAt });
|
|
30431
|
+
return {
|
|
30432
|
+
data: eventLinkedObject(preparedPayload.events.find(event => event.eventId === eventId)),
|
|
30433
|
+
cachedAt,
|
|
30434
|
+
};
|
|
30435
|
+
};
|
|
30436
|
+
/* end_public_function */
|
|
30437
|
+
|
|
30438
|
+
/* begin_public_function
|
|
30439
|
+
id: event.get
|
|
30440
|
+
*/
|
|
30441
|
+
/**
|
|
30442
|
+
* ```js
|
|
30443
|
+
* import { EventRepository } from '@amityco/ts-sdk'
|
|
30444
|
+
* const event = await EventRepository.getEvent(eventId)
|
|
30445
|
+
* ```
|
|
30446
|
+
*
|
|
30447
|
+
* Fetches a {@link Amity.Event} object
|
|
30448
|
+
*
|
|
30449
|
+
* @param eventId the ID of the {@link Amity.Event} to fetch
|
|
30450
|
+
* @returns the associated {@link Amity.Event} object
|
|
30451
|
+
*
|
|
30452
|
+
* @category Event API
|
|
30453
|
+
* @async
|
|
30454
|
+
*/
|
|
30455
|
+
const getEvent$1 = async (eventId) => {
|
|
30456
|
+
const client = getActiveClient();
|
|
30457
|
+
client.log('event/getEvent', eventId);
|
|
30458
|
+
const { data: payload } = await client.http.get(`/api/v3/events/${eventId}`);
|
|
30459
|
+
const data = prepareEventPayload(payload);
|
|
30460
|
+
const cachedAt = client.cache && Date.now();
|
|
30461
|
+
if (client.cache)
|
|
30462
|
+
ingestInCache(data, { cachedAt });
|
|
30463
|
+
return {
|
|
30464
|
+
data: data.events.find(event => event.eventId === eventId),
|
|
30465
|
+
cachedAt,
|
|
30466
|
+
};
|
|
30467
|
+
};
|
|
30468
|
+
/* end_public_function */
|
|
30469
|
+
/**
|
|
30470
|
+
* ```js
|
|
30471
|
+
* import { EventRepository } from '@amityco/ts-sdk'
|
|
30472
|
+
* const event = EventRepository.getEvent.locally(eventId)
|
|
30473
|
+
* ```
|
|
30474
|
+
*
|
|
30475
|
+
* Fetches a {@link Amity.Event} object in cache
|
|
30476
|
+
*
|
|
30477
|
+
* @param eventId the ID of the {@link Amity.Event} to fetch
|
|
30478
|
+
* @returns the associated {@link Amity.Event} object
|
|
30479
|
+
*
|
|
30480
|
+
* @category Event API
|
|
30481
|
+
*/
|
|
30482
|
+
getEvent$1.locally = (eventId) => {
|
|
30483
|
+
const client = getActiveClient();
|
|
30484
|
+
client.log('event/getEvent.locally', eventId);
|
|
30485
|
+
if (!client.cache)
|
|
30486
|
+
return;
|
|
30487
|
+
const cache = pullFromCache(['event', 'get', eventId]);
|
|
30488
|
+
if (!cache)
|
|
30489
|
+
return;
|
|
30490
|
+
return {
|
|
30491
|
+
data: cache.data,
|
|
30492
|
+
cachedAt: cache.cachedAt,
|
|
30493
|
+
};
|
|
30494
|
+
};
|
|
30495
|
+
|
|
30496
|
+
/* begin_public_function
|
|
30497
|
+
id: event.delete
|
|
30498
|
+
*/
|
|
30499
|
+
/**
|
|
30500
|
+
* ```js
|
|
30501
|
+
* import { EventRepository } from '@amityco/ts-sdk'
|
|
30502
|
+
* const { success } = await EventRepository.deleteEvent(eventId)
|
|
30503
|
+
* ```
|
|
30504
|
+
*
|
|
30505
|
+
* Deletes a {@link Amity.Event}
|
|
30506
|
+
*
|
|
30507
|
+
* @param eventId The {@link Amity.Event} ID to delete
|
|
30508
|
+
*
|
|
30509
|
+
* @category Event API
|
|
30510
|
+
* @async
|
|
30511
|
+
*/
|
|
30512
|
+
const deleteEvent = async (eventId) => {
|
|
30513
|
+
const client = getActiveClient();
|
|
30514
|
+
client.log('event/deleteEvent', eventId);
|
|
30515
|
+
const event = await getEvent$1(eventId);
|
|
30516
|
+
await client.http.delete(`/api/v3/events/${eventId}`);
|
|
30517
|
+
const deletedEvent = Object.assign(Object.assign({}, event.data), { isDeleted: true });
|
|
30518
|
+
upsertInCache(['event', 'get', eventId], deletedEvent);
|
|
30519
|
+
fireEvent('event.deleted', {
|
|
30520
|
+
users: [],
|
|
30521
|
+
files: [],
|
|
30522
|
+
communities: [],
|
|
30523
|
+
videoStreamings: [],
|
|
30524
|
+
events: [deletedEvent],
|
|
30525
|
+
discussionCommunities: [],
|
|
30526
|
+
});
|
|
30527
|
+
};
|
|
30528
|
+
/* end_public_function */
|
|
30529
|
+
|
|
30530
|
+
/**
|
|
30531
|
+
* ```js
|
|
30532
|
+
* import { EventRepository } from '@amityco/ts-sdk'
|
|
30533
|
+
* const dispose = EventRepository.onEventCreated(event => {
|
|
30534
|
+
* // ...
|
|
30535
|
+
* })
|
|
30536
|
+
* ```
|
|
30537
|
+
*
|
|
30538
|
+
* Fired when a {@link Amity.Event} has been created
|
|
30539
|
+
*
|
|
30540
|
+
* @param callback The function to call when the event was fired
|
|
30541
|
+
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
30542
|
+
*
|
|
30543
|
+
* @category Event Events
|
|
30544
|
+
*/
|
|
30545
|
+
const onEventCreated = (callback) => createEventEventSubscriber('event.created', callback);
|
|
30546
|
+
|
|
30547
|
+
/**
|
|
30548
|
+
* ```js
|
|
30549
|
+
* import { EventRepository } from '@amityco/ts-sdk'
|
|
30550
|
+
* const dispose = EventRepository.onEventUpdated(event => {
|
|
30551
|
+
* // ...
|
|
30552
|
+
* })
|
|
30553
|
+
* ```
|
|
30554
|
+
*
|
|
30555
|
+
* Fired when a {@link Amity.Event} has been updated
|
|
30556
|
+
*
|
|
30557
|
+
* @param callback The function to call when the event was fired
|
|
30558
|
+
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
30559
|
+
*
|
|
30560
|
+
* @category Event Events
|
|
30561
|
+
*/
|
|
30562
|
+
const onEventUpdated = (callback) => createEventEventSubscriber('event.updated', callback);
|
|
30563
|
+
|
|
30564
|
+
/**
|
|
30565
|
+
* ```js
|
|
30566
|
+
* import { EventRepository } from '@amityco/ts-sdk'
|
|
30567
|
+
* const dispose = EventRepository.onEventDeleted(event => {
|
|
30568
|
+
* // ...
|
|
30569
|
+
* })
|
|
30570
|
+
* ```
|
|
30571
|
+
*
|
|
30572
|
+
* Fired when a {@link Amity.Event} has been deleted
|
|
30573
|
+
*
|
|
30574
|
+
* @param callback The function to call when the event was fired
|
|
30575
|
+
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
30576
|
+
*
|
|
30577
|
+
* @category Event Events
|
|
30578
|
+
*/
|
|
30579
|
+
const onEventDeleted = (callback) => createEventEventSubscriber('event.deleted', callback);
|
|
30580
|
+
|
|
30581
|
+
/* begin_public_function
|
|
30582
|
+
id: event.get
|
|
30583
|
+
*/
|
|
30584
|
+
/**
|
|
30585
|
+
* ```js
|
|
30586
|
+
* import { EventRepository } from '@amityco/ts-sdk';
|
|
30587
|
+
*
|
|
30588
|
+
* let event;
|
|
30589
|
+
*
|
|
30590
|
+
* const unsubscribe = EventRepository.getEvent(eventId, response => {
|
|
30591
|
+
* event = response.data;
|
|
30592
|
+
* });
|
|
30593
|
+
* ```
|
|
30594
|
+
*
|
|
30595
|
+
* Observe all mutation on a given {@link Amity.Event}
|
|
30596
|
+
*
|
|
30597
|
+
* @param eventId the ID of the event to observe
|
|
30598
|
+
* @param callback the function to call when new snapshot of event are available
|
|
30599
|
+
* @returns An {@link Amity.Unsubscriber} function to run when willing to stop observing the event
|
|
30600
|
+
*
|
|
30601
|
+
* @category Event Live Object
|
|
30602
|
+
*/
|
|
30603
|
+
const getEvent = (eventId, callback) => {
|
|
30604
|
+
return liveObject(eventId, callback, 'eventId', getEvent$1, [onEventCreated, onEventUpdated, onEventDeleted], {
|
|
30605
|
+
callbackDataSelector: (data) => (data ? eventLinkedObject(data) : data),
|
|
30606
|
+
});
|
|
30607
|
+
};
|
|
30608
|
+
/* end_public_function */
|
|
30609
|
+
|
|
30610
|
+
var EventActionsEnum;
|
|
30611
|
+
(function (EventActionsEnum) {
|
|
30612
|
+
EventActionsEnum["OnEventCreated"] = "onEventCreated";
|
|
30613
|
+
EventActionsEnum["OnEventUpdated"] = "onEventUpdated";
|
|
30614
|
+
EventActionsEnum["OnEventDeleted"] = "onEventDeleted";
|
|
30615
|
+
})(EventActionsEnum || (EventActionsEnum = {}));
|
|
30616
|
+
|
|
30617
|
+
class EventPaginationController extends PaginationController {
|
|
30618
|
+
async getRequest(queryParams, token) {
|
|
30619
|
+
const { limit = COLLECTION_DEFAULT_PAGINATION_LIMIT } = queryParams, params = __rest(queryParams, ["limit"]);
|
|
30620
|
+
const options = token ? { token } : { limit };
|
|
30621
|
+
const { data: response } = await this.http.get(`/api/v1/events`, { params: Object.assign(Object.assign({}, params), { options }) });
|
|
30622
|
+
return response;
|
|
30623
|
+
}
|
|
30624
|
+
}
|
|
30625
|
+
|
|
30626
|
+
class EventQueryStreamController extends QueryStreamController {
|
|
30627
|
+
constructor(query, cacheKey, notifyChange, preparePayload) {
|
|
30628
|
+
super(query, cacheKey);
|
|
30629
|
+
this.notifyChange = notifyChange;
|
|
30630
|
+
this.preparePayload = preparePayload;
|
|
30631
|
+
}
|
|
30632
|
+
async saveToMainDB(response) {
|
|
30633
|
+
const processedPayload = this.preparePayload(response);
|
|
30634
|
+
const client = getActiveClient();
|
|
30635
|
+
const cachedAt = client.cache && Date.now();
|
|
30636
|
+
if (client.cache)
|
|
30637
|
+
ingestInCache(processedPayload, { cachedAt });
|
|
30638
|
+
}
|
|
30639
|
+
appendToQueryStream(response, direction, refresh = false) {
|
|
30640
|
+
var _a, _b;
|
|
30641
|
+
if (refresh) {
|
|
30642
|
+
pushToCache(this.cacheKey, { data: response.events.map(getResolver('event')) });
|
|
30643
|
+
}
|
|
30644
|
+
else {
|
|
30645
|
+
const collection = (_a = pullFromCache(this.cacheKey)) === null || _a === void 0 ? void 0 : _a.data;
|
|
30646
|
+
const events = (_b = collection === null || collection === void 0 ? void 0 : collection.data) !== null && _b !== void 0 ? _b : [];
|
|
30647
|
+
pushToCache(this.cacheKey, Object.assign(Object.assign({}, collection), { data: [...new Set([...events, ...response.events.map(getResolver('event'))])] }));
|
|
30648
|
+
}
|
|
30649
|
+
}
|
|
30650
|
+
reactor(action) {
|
|
30651
|
+
return (event) => {
|
|
30652
|
+
var _a;
|
|
30653
|
+
const collection = (_a = pullFromCache(this.cacheKey)) === null || _a === void 0 ? void 0 : _a.data;
|
|
30654
|
+
if (!collection)
|
|
30655
|
+
return;
|
|
30656
|
+
if (action === EventActionsEnum.OnEventCreated) {
|
|
30657
|
+
collection.data = [...new Set([event.eventId, ...collection.data])];
|
|
30658
|
+
}
|
|
30659
|
+
if (action === EventActionsEnum.OnEventDeleted) {
|
|
30660
|
+
collection.data = collection.data.filter(eventId => eventId !== event.eventId);
|
|
30661
|
+
}
|
|
30662
|
+
pushToCache(this.cacheKey, collection);
|
|
30663
|
+
this.notifyChange({ origin: "event" /* Amity.LiveDataOrigin.EVENT */, loading: false });
|
|
30664
|
+
};
|
|
30665
|
+
}
|
|
30666
|
+
subscribeRTE(createSubscriber) {
|
|
30667
|
+
return createSubscriber.map(subscriber => subscriber.fn(this.reactor(subscriber.action)));
|
|
30668
|
+
}
|
|
30669
|
+
}
|
|
30670
|
+
|
|
30671
|
+
class EventLiveCollectionController extends LiveCollectionController {
|
|
30672
|
+
constructor(query, callback) {
|
|
30673
|
+
const queryStreamId = hash__default["default"](query);
|
|
30674
|
+
const cacheKey = ['event', 'collection', queryStreamId];
|
|
30675
|
+
const paginationController = new EventPaginationController(query);
|
|
30676
|
+
super(paginationController, queryStreamId, cacheKey, callback);
|
|
30677
|
+
this.query = query;
|
|
30678
|
+
this.queryStreamController = new EventQueryStreamController(this.query, this.cacheKey, this.notifyChange.bind(this), prepareEventPayload);
|
|
30679
|
+
this.callback = callback.bind(this);
|
|
30680
|
+
this.loadPage({ initial: true });
|
|
30681
|
+
}
|
|
30682
|
+
setup() {
|
|
30683
|
+
var _a;
|
|
30684
|
+
const collection = (_a = pullFromCache(this.cacheKey)) === null || _a === void 0 ? void 0 : _a.data;
|
|
30685
|
+
if (!collection)
|
|
30686
|
+
pushToCache(this.cacheKey, { data: [], params: {} });
|
|
30687
|
+
}
|
|
30688
|
+
async persistModel(queryPayload) {
|
|
30689
|
+
await this.queryStreamController.saveToMainDB(queryPayload);
|
|
30690
|
+
}
|
|
30691
|
+
persistQueryStream({ response, direction, refresh, }) {
|
|
30692
|
+
this.queryStreamController.appendToQueryStream(response, direction, refresh);
|
|
30693
|
+
}
|
|
30694
|
+
startSubscription() {
|
|
30695
|
+
return this.queryStreamController.subscribeRTE([
|
|
30696
|
+
{ fn: onEventCreated, action: EventActionsEnum.OnEventCreated },
|
|
30697
|
+
{ fn: onEventUpdated, action: EventActionsEnum.OnEventUpdated },
|
|
30698
|
+
{ fn: onEventDeleted, action: EventActionsEnum.OnEventDeleted },
|
|
30699
|
+
]);
|
|
30700
|
+
}
|
|
30701
|
+
notifyChange({ origin, loading, error }) {
|
|
30702
|
+
var _a, _b;
|
|
30703
|
+
const collection = (_a = pullFromCache(this.cacheKey)) === null || _a === void 0 ? void 0 : _a.data;
|
|
30704
|
+
if (!collection)
|
|
30705
|
+
return;
|
|
30706
|
+
const data = ((_b = collection.data
|
|
30707
|
+
.map(eventId => pullFromCache(['event', 'get', eventId]))
|
|
30708
|
+
.filter(isNonNullable)
|
|
30709
|
+
.map(({ data }) => data)) !== null && _b !== void 0 ? _b : []).map(LinkedObject.event);
|
|
30710
|
+
if (!this.shouldNotify(data) && origin === 'event')
|
|
30711
|
+
return;
|
|
30712
|
+
this.callback({
|
|
30713
|
+
data,
|
|
30714
|
+
error,
|
|
30715
|
+
loading,
|
|
30716
|
+
hasNextPage: !!this.paginationController.getNextToken(),
|
|
30717
|
+
onNextPage: () => this.loadPage({ direction: "next" /* Amity.LiveCollectionPageDirection.NEXT */ }),
|
|
30718
|
+
});
|
|
30719
|
+
}
|
|
30720
|
+
}
|
|
30721
|
+
|
|
30722
|
+
/**
|
|
30723
|
+
* Get events
|
|
30724
|
+
*
|
|
30725
|
+
* @param params the query parameters
|
|
30726
|
+
* @param callback the callback to be called when the events are updated
|
|
30727
|
+
* @returns events
|
|
30728
|
+
*
|
|
30729
|
+
* @category Event Live Collection
|
|
30730
|
+
*
|
|
30731
|
+
*/
|
|
30732
|
+
const getEvents = (params, callback, config) => {
|
|
30733
|
+
const { log, cache } = getActiveClient();
|
|
30734
|
+
if (!cache)
|
|
30735
|
+
console.log(ENABLE_CACHE_MESSAGE);
|
|
30736
|
+
const timestamp = Date.now();
|
|
30737
|
+
log(`getEvents: (tmpid: ${timestamp}) > listen`);
|
|
30738
|
+
const eventLiveCollection = new EventLiveCollectionController(params, callback);
|
|
30739
|
+
const disposers = eventLiveCollection.startSubscription();
|
|
30740
|
+
const cacheKey = eventLiveCollection.getCacheKey();
|
|
30741
|
+
disposers.push(() => dropFromCache(cacheKey));
|
|
30742
|
+
return () => {
|
|
30743
|
+
log(`getEvents (tmpid: ${timestamp}) > dispose`);
|
|
30744
|
+
disposers.forEach(fn => fn());
|
|
30745
|
+
};
|
|
30746
|
+
};
|
|
30747
|
+
|
|
30748
|
+
var index = /*#__PURE__*/Object.freeze({
|
|
30749
|
+
__proto__: null,
|
|
30750
|
+
createEvent: createEvent,
|
|
30751
|
+
updateEvent: updateEvent,
|
|
30752
|
+
deleteEvent: deleteEvent,
|
|
30753
|
+
onEventCreated: onEventCreated,
|
|
30754
|
+
onEventUpdated: onEventUpdated,
|
|
30755
|
+
onEventDeleted: onEventDeleted,
|
|
30756
|
+
getEvent: getEvent,
|
|
30757
|
+
getEvents: getEvents
|
|
30758
|
+
});
|
|
30759
|
+
|
|
30296
30760
|
exports.API_REGIONS = API_REGIONS;
|
|
30297
|
-
exports.AdRepository = index$
|
|
30298
|
-
exports.CategoryRepository = index$
|
|
30299
|
-
exports.ChannelRepository = index$
|
|
30300
|
-
exports.Client = index$
|
|
30301
|
-
exports.CommentRepository = index$
|
|
30761
|
+
exports.AdRepository = index$4;
|
|
30762
|
+
exports.CategoryRepository = index$c;
|
|
30763
|
+
exports.ChannelRepository = index$g;
|
|
30764
|
+
exports.Client = index$p;
|
|
30765
|
+
exports.CommentRepository = index$b;
|
|
30302
30766
|
exports.CommunityPostSettingMaps = CommunityPostSettingMaps;
|
|
30303
30767
|
exports.CommunityPostSettings = CommunityPostSettings;
|
|
30304
|
-
exports.CommunityRepository = index$
|
|
30768
|
+
exports.CommunityRepository = index$d;
|
|
30305
30769
|
exports.ContentFeedType = ContentFeedType;
|
|
30306
30770
|
exports.DefaultCommunityPostSetting = DefaultCommunityPostSetting;
|
|
30307
|
-
exports.
|
|
30308
|
-
exports.
|
|
30771
|
+
exports.EventRepository = index;
|
|
30772
|
+
exports.FeedRepository = index$a;
|
|
30773
|
+
exports.FileRepository = index$m;
|
|
30309
30774
|
exports.FileType = FileType;
|
|
30310
30775
|
exports.GET_WATCHER_URLS = GET_WATCHER_URLS;
|
|
30311
|
-
exports.InvitationRepository = index$
|
|
30312
|
-
exports.LiveReactionRepository = index;
|
|
30313
|
-
exports.LiveStreamPlayer = index$
|
|
30776
|
+
exports.InvitationRepository = index$2;
|
|
30777
|
+
exports.LiveReactionRepository = index$1;
|
|
30778
|
+
exports.LiveStreamPlayer = index$6;
|
|
30314
30779
|
exports.MessageContentType = MessageContentType;
|
|
30315
|
-
exports.MessageRepository = index$
|
|
30316
|
-
exports.PollRepository = index$
|
|
30780
|
+
exports.MessageRepository = index$k;
|
|
30781
|
+
exports.PollRepository = index$7;
|
|
30317
30782
|
exports.PostContentType = PostContentType;
|
|
30318
|
-
exports.PostRepository = index$
|
|
30783
|
+
exports.PostRepository = index$9;
|
|
30319
30784
|
exports.PostStructureType = PostStructureType;
|
|
30320
|
-
exports.ReactionRepository = index$
|
|
30321
|
-
exports.StoryRepository = index$
|
|
30322
|
-
exports.StreamRepository = index$
|
|
30323
|
-
exports.SubChannelRepository = index$
|
|
30324
|
-
exports.UserRepository = index$
|
|
30785
|
+
exports.ReactionRepository = index$l;
|
|
30786
|
+
exports.StoryRepository = index$5;
|
|
30787
|
+
exports.StreamRepository = index$8;
|
|
30788
|
+
exports.SubChannelRepository = index$j;
|
|
30789
|
+
exports.UserRepository = index$n;
|
|
30325
30790
|
exports.VERSION = VERSION;
|
|
30326
30791
|
exports.VideoResolution = VideoResolution;
|
|
30327
30792
|
exports.VideoSize = VideoSize;
|
|
@@ -30375,7 +30840,7 @@ exports.isPaged = isPaged;
|
|
|
30375
30840
|
exports.isReportedByMe = isReportedByMe;
|
|
30376
30841
|
exports.isSkip = isSkip;
|
|
30377
30842
|
exports.mergeInCache = mergeInCache;
|
|
30378
|
-
exports.notificationTray = index$
|
|
30843
|
+
exports.notificationTray = index$3;
|
|
30379
30844
|
exports.onChannelMarkerFetched = onChannelMarkerFetched;
|
|
30380
30845
|
exports.onFeedMarkerFetched = onFeedMarkerFetched;
|
|
30381
30846
|
exports.onFeedMarkerUpdated = onFeedMarkerUpdated;
|