@amityco/ts-sdk 7.33.1 → 7.33.2-1e78722.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/payload.d.ts +4 -0
- package/dist/@types/core/payload.d.ts.map +1 -1
- package/dist/@types/domains/content.d.ts +5 -0
- package/dist/@types/domains/content.d.ts.map +1 -1
- package/dist/@types/domains/feed.d.ts +14 -0
- package/dist/@types/domains/feed.d.ts.map +1 -1
- package/dist/@types/domains/follow.d.ts +7 -0
- package/dist/@types/domains/follow.d.ts.map +1 -1
- package/dist/@types/domains/notification.d.ts +15 -3
- package/dist/@types/domains/notification.d.ts.map +1 -1
- package/dist/client/api/getFeedSettings.d.ts +3 -1
- package/dist/client/api/getFeedSettings.d.ts.map +1 -1
- package/dist/client/api/setupLoginSubscriptions.d.ts.map +1 -1
- package/dist/feedRepository/index.d.ts +1 -1
- package/dist/feedRepository/index.d.ts.map +1 -1
- package/dist/feedRepository/observers/getFollowingFeed/LiveCollectionController.d.ts +13 -0
- package/dist/feedRepository/observers/getFollowingFeed/LiveCollectionController.d.ts.map +1 -0
- package/dist/feedRepository/observers/getFollowingFeed/PaginationController.d.ts +10 -0
- package/dist/feedRepository/observers/getFollowingFeed/PaginationController.d.ts.map +1 -0
- package/dist/feedRepository/observers/getFollowingFeed/QueryStreamController.d.ts +22 -0
- package/dist/feedRepository/observers/getFollowingFeed/QueryStreamController.d.ts.map +1 -0
- package/dist/feedRepository/observers/getFollowingFeed.d.ts +35 -0
- package/dist/feedRepository/observers/getFollowingFeed.d.ts.map +1 -0
- package/dist/feedRepository/observers/index.d.ts +1 -0
- package/dist/feedRepository/observers/index.d.ts.map +1 -1
- package/dist/feedRepository/observers/tests/integration/getFollowingFeed.integration.test.d.ts +2 -0
- package/dist/feedRepository/observers/tests/integration/getFollowingFeed.integration.test.d.ts.map +1 -0
- package/dist/feedRepository/observers/tests/unit/FollowingFeedQueryStreamController.test.d.ts +2 -0
- package/dist/feedRepository/observers/tests/unit/FollowingFeedQueryStreamController.test.d.ts.map +1 -0
- package/dist/index.cjs.js +697 -261
- package/dist/index.esm.js +628 -192
- package/dist/index.umd.js +2 -2
- package/dist/userRepository/relationship/block/api/blockUser.d.ts.map +1 -1
- package/dist/userRepository/relationship/follow/api/follow.d.ts.map +1 -1
- package/dist/userRepository/relationship/follow/api/getAllFollowings.d.ts +34 -0
- package/dist/userRepository/relationship/follow/api/getAllFollowings.d.ts.map +1 -0
- package/dist/userRepository/relationship/follow/api/index.d.ts +1 -0
- package/dist/userRepository/relationship/follow/api/index.d.ts.map +1 -1
- package/dist/userRepository/relationship/follow/api/tests/getAllFollowings.test.d.ts +2 -0
- package/dist/userRepository/relationship/follow/api/tests/getAllFollowings.test.d.ts.map +1 -0
- package/dist/userRepository/relationship/follow/api/tests/integration/getAllFollowings.integration.test.d.ts +2 -0
- package/dist/userRepository/relationship/follow/api/tests/integration/getAllFollowings.integration.test.d.ts.map +1 -0
- package/dist/userRepository/relationship/follow/api/unfollow.d.ts.map +1 -1
- package/dist/userRepository/services/FollowingSyncEngine/followRealtimeOnLoginHandler.d.ts +19 -0
- package/dist/userRepository/services/FollowingSyncEngine/followRealtimeOnLoginHandler.d.ts.map +1 -0
- package/dist/userRepository/services/FollowingSyncEngine/followingSyncEngine.d.ts +61 -0
- package/dist/userRepository/services/FollowingSyncEngine/followingSyncEngine.d.ts.map +1 -0
- package/dist/userRepository/services/FollowingSyncEngine/followingSyncEngineOnLoginHandler.d.ts +3 -0
- package/dist/userRepository/services/FollowingSyncEngine/followingSyncEngineOnLoginHandler.d.ts.map +1 -0
- package/dist/utils/constants.d.ts +1 -0
- package/dist/utils/constants.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -246,6 +246,14 @@ var FeedSortByEnum;
|
|
|
246
246
|
FeedSortByEnum["LastUpdated"] = "lastUpdated";
|
|
247
247
|
FeedSortByEnum["FirstUpdated"] = "firstUpdated";
|
|
248
248
|
})(FeedSortByEnum || (FeedSortByEnum = {}));
|
|
249
|
+
/** Sort order of the following feed (`GET /api/v1/me/following-feeds`). */
|
|
250
|
+
var FollowingFeedSortByEnum;
|
|
251
|
+
(function (FollowingFeedSortByEnum) {
|
|
252
|
+
/** Server-ranked. The backend default when `sortBy` is not sent. */
|
|
253
|
+
FollowingFeedSortByEnum["CustomRanking"] = "customRanking";
|
|
254
|
+
/** Newest first. */
|
|
255
|
+
FollowingFeedSortByEnum["LastCreated"] = "lastCreated";
|
|
256
|
+
})(FollowingFeedSortByEnum || (FollowingFeedSortByEnum = {}));
|
|
249
257
|
var FeedSourceEnum;
|
|
250
258
|
(function (FeedSourceEnum) {
|
|
251
259
|
FeedSourceEnum["Community"] = "community";
|
|
@@ -374,6 +382,7 @@ const YEAR = 365 * DAY;
|
|
|
374
382
|
const ACCESS_TOKEN_WATCHER_INTERVAL = 10 * MINUTE;
|
|
375
383
|
const API_ENDPOINTS = {
|
|
376
384
|
forYouFeed: '/api/v1/feeds/for-you',
|
|
385
|
+
followingFeed: '/api/v1/me/following-feeds',
|
|
377
386
|
commentReviewQueue: (communityId) => `/api/v3/communities/${encodeURIComponent(communityId)}/comments/review-queue`,
|
|
378
387
|
};
|
|
379
388
|
// The review-queue route defaults to 10, not the SDK-wide page size, and caps at 100
|
|
@@ -1967,13 +1976,13 @@ class SessionWatcher {
|
|
|
1967
1976
|
this._listener.clear();
|
|
1968
1977
|
}
|
|
1969
1978
|
}
|
|
1970
|
-
let instance$
|
|
1979
|
+
let instance$c;
|
|
1971
1980
|
var SessionWatcher$1 = {
|
|
1972
1981
|
getInstance: () => {
|
|
1973
|
-
if (!instance$
|
|
1974
|
-
instance$
|
|
1982
|
+
if (!instance$c) {
|
|
1983
|
+
instance$c = new SessionWatcher();
|
|
1975
1984
|
}
|
|
1976
|
-
return instance$
|
|
1985
|
+
return instance$c;
|
|
1977
1986
|
},
|
|
1978
1987
|
};
|
|
1979
1988
|
|
|
@@ -2640,13 +2649,13 @@ class NetworkActivitiesWatcher {
|
|
|
2640
2649
|
this._listener.clear();
|
|
2641
2650
|
}
|
|
2642
2651
|
}
|
|
2643
|
-
let instance$
|
|
2652
|
+
let instance$b;
|
|
2644
2653
|
var NetworkActivitiesWatcher$1 = {
|
|
2645
2654
|
getInstance: () => {
|
|
2646
|
-
if (!instance$
|
|
2647
|
-
instance$
|
|
2655
|
+
if (!instance$b) {
|
|
2656
|
+
instance$b = new NetworkActivitiesWatcher();
|
|
2648
2657
|
}
|
|
2649
|
-
return instance$
|
|
2658
|
+
return instance$b;
|
|
2650
2659
|
},
|
|
2651
2660
|
};
|
|
2652
2661
|
|
|
@@ -2907,11 +2916,11 @@ class AutoSubscriptionManager {
|
|
|
2907
2916
|
this.seed();
|
|
2908
2917
|
}
|
|
2909
2918
|
}
|
|
2910
|
-
let instance$
|
|
2919
|
+
let instance$a = null;
|
|
2911
2920
|
const getAutoSubscriptionManager = () => {
|
|
2912
|
-
if (!instance$
|
|
2913
|
-
instance$
|
|
2914
|
-
return instance$
|
|
2921
|
+
if (!instance$a)
|
|
2922
|
+
instance$a = new AutoSubscriptionManager();
|
|
2923
|
+
return instance$a;
|
|
2915
2924
|
};
|
|
2916
2925
|
/** Resets the registry to its default baseline when the session ends. */
|
|
2917
2926
|
const resetAutoSubscriptionsOnLogout = () => onSessionStateChange(state => {
|
|
@@ -6257,9 +6266,11 @@ const validateTexts = async (texts) => {
|
|
|
6257
6266
|
* import { getFeedSettings } from '@amityco/ts-sdk'
|
|
6258
6267
|
* const feedSettings = await getFeedSettings()
|
|
6259
6268
|
* const postFeedSetting = feedSettings.post
|
|
6269
|
+
* const isAutoPlayEnabled = postFeedSetting?.find(({ contentType }) => contentType === 'video')?.autoPlay
|
|
6260
6270
|
* ```
|
|
6261
6271
|
*
|
|
6262
|
-
* Fetches a {@link Amity.FeedSettings} object
|
|
6272
|
+
* Fetches a {@link Amity.FeedSettings} object. Video content settings always
|
|
6273
|
+
* carry `autoPlay`, which is `false` when the server omits it.
|
|
6263
6274
|
*
|
|
6264
6275
|
* @returns A Promise of {@link Amity.FeedSettings} object
|
|
6265
6276
|
*
|
|
@@ -6270,7 +6281,14 @@ const getFeedSettings = async () => {
|
|
|
6270
6281
|
const client = getActiveClient();
|
|
6271
6282
|
const { data } = await client.http.get(`/api/v3/network-settings/feed-setting`);
|
|
6272
6283
|
return Object.fromEntries(data.feedSettings.map(({ feedType, contentSettings }) => {
|
|
6273
|
-
return [
|
|
6284
|
+
return [
|
|
6285
|
+
feedType,
|
|
6286
|
+
contentSettings === null || contentSettings === void 0 ? void 0 : contentSettings.map(setting => {
|
|
6287
|
+
var _a;
|
|
6288
|
+
return setting.contentType === 'video'
|
|
6289
|
+
? Object.assign(Object.assign({}, setting), { autoPlay: (_a = setting.autoPlay) !== null && _a !== void 0 ? _a : false }) : setting;
|
|
6290
|
+
}),
|
|
6291
|
+
];
|
|
6274
6292
|
}));
|
|
6275
6293
|
};
|
|
6276
6294
|
|
|
@@ -7001,13 +7019,13 @@ class AnalyticsEngine {
|
|
|
7001
7019
|
this._eventCapturer.resetAllBuckets();
|
|
7002
7020
|
}
|
|
7003
7021
|
}
|
|
7004
|
-
let instance$
|
|
7022
|
+
let instance$9;
|
|
7005
7023
|
var AnalyticsEngine$1 = {
|
|
7006
7024
|
getInstance: () => {
|
|
7007
|
-
if (!instance$
|
|
7008
|
-
instance$
|
|
7025
|
+
if (!instance$9) {
|
|
7026
|
+
instance$9 = new AnalyticsEngine();
|
|
7009
7027
|
}
|
|
7010
|
-
return instance$
|
|
7028
|
+
return instance$9;
|
|
7011
7029
|
},
|
|
7012
7030
|
};
|
|
7013
7031
|
|
|
@@ -7234,12 +7252,12 @@ class MessageReadReceiptSyncEngine {
|
|
|
7234
7252
|
}
|
|
7235
7253
|
}
|
|
7236
7254
|
}
|
|
7237
|
-
let instance$
|
|
7255
|
+
let instance$8 = null;
|
|
7238
7256
|
var ReadReceiptSyncEngine = {
|
|
7239
7257
|
getInstance: () => {
|
|
7240
|
-
if (!instance$
|
|
7241
|
-
instance$
|
|
7242
|
-
return instance$
|
|
7258
|
+
if (!instance$8)
|
|
7259
|
+
instance$8 = new MessageReadReceiptSyncEngine();
|
|
7260
|
+
return instance$8;
|
|
7243
7261
|
},
|
|
7244
7262
|
};
|
|
7245
7263
|
|
|
@@ -7493,12 +7511,12 @@ class LegacyMessageReadReceiptSyncEngine {
|
|
|
7493
7511
|
}
|
|
7494
7512
|
}
|
|
7495
7513
|
}
|
|
7496
|
-
let instance$
|
|
7514
|
+
let instance$7 = null;
|
|
7497
7515
|
var LegacyReadReceiptSyncEngine = {
|
|
7498
7516
|
getInstance: () => {
|
|
7499
|
-
if (!instance$
|
|
7500
|
-
instance$
|
|
7501
|
-
return instance$
|
|
7517
|
+
if (!instance$7)
|
|
7518
|
+
instance$7 = new LegacyMessageReadReceiptSyncEngine();
|
|
7519
|
+
return instance$7;
|
|
7502
7520
|
},
|
|
7503
7521
|
};
|
|
7504
7522
|
|
|
@@ -7744,12 +7762,12 @@ class ObjectResolverEngine {
|
|
|
7744
7762
|
this.stopResolver();
|
|
7745
7763
|
}
|
|
7746
7764
|
}
|
|
7747
|
-
let instance$
|
|
7765
|
+
let instance$6 = null;
|
|
7748
7766
|
var ObjectResolverEngine$1 = {
|
|
7749
7767
|
getInstance: () => {
|
|
7750
|
-
if (!instance$
|
|
7751
|
-
instance$
|
|
7752
|
-
return instance$
|
|
7768
|
+
if (!instance$6)
|
|
7769
|
+
instance$6 = new ObjectResolverEngine();
|
|
7770
|
+
return instance$6;
|
|
7753
7771
|
},
|
|
7754
7772
|
};
|
|
7755
7773
|
|
|
@@ -7899,13 +7917,13 @@ class LiveReactionSyncEngine {
|
|
|
7899
7917
|
this.stopReactionsSync();
|
|
7900
7918
|
}
|
|
7901
7919
|
}
|
|
7902
|
-
let instance$
|
|
7920
|
+
let instance$5;
|
|
7903
7921
|
var ReactionSyncEngine = {
|
|
7904
7922
|
getInstance: () => {
|
|
7905
|
-
if (!instance$
|
|
7906
|
-
instance$
|
|
7923
|
+
if (!instance$5) {
|
|
7924
|
+
instance$5 = new LiveReactionSyncEngine();
|
|
7907
7925
|
}
|
|
7908
|
-
return instance$
|
|
7926
|
+
return instance$5;
|
|
7909
7927
|
},
|
|
7910
7928
|
};
|
|
7911
7929
|
|
|
@@ -7936,7 +7954,7 @@ function prepareBlockedUserPayload(response) {
|
|
|
7936
7954
|
}
|
|
7937
7955
|
|
|
7938
7956
|
const BLOCK_LIST_LIMIT$1 = 100;
|
|
7939
|
-
const TTL_MS$
|
|
7957
|
+
const TTL_MS$2 = 5 * 60 * 1000; // 5 minutes
|
|
7940
7958
|
/**
|
|
7941
7959
|
* Session-scoped singleton engine that manages TTL-based fetching and caching
|
|
7942
7960
|
* of blocked users. Provides a lazy `ensureFetched()` gate for the
|
|
@@ -7974,7 +7992,7 @@ class BlockedUserSyncEngine {
|
|
|
7974
7992
|
isCacheExpired() {
|
|
7975
7993
|
if (this.lastFetchedAt === null)
|
|
7976
7994
|
return true;
|
|
7977
|
-
return Date.now() - this.lastFetchedAt > TTL_MS$
|
|
7995
|
+
return Date.now() - this.lastFetchedAt > TTL_MS$2;
|
|
7978
7996
|
}
|
|
7979
7997
|
/**
|
|
7980
7998
|
* Ensures the local store is populated with fresh blocked-user data.
|
|
@@ -8029,12 +8047,12 @@ class BlockedUserSyncEngine {
|
|
|
8029
8047
|
.map(userLinkedObject);
|
|
8030
8048
|
}
|
|
8031
8049
|
}
|
|
8032
|
-
let instance$
|
|
8050
|
+
let instance$4 = null;
|
|
8033
8051
|
var BlockedUserSyncEngine$1 = {
|
|
8034
8052
|
getInstance: () => {
|
|
8035
|
-
if (!instance$
|
|
8036
|
-
instance$
|
|
8037
|
-
return instance$
|
|
8053
|
+
if (!instance$4)
|
|
8054
|
+
instance$4 = new BlockedUserSyncEngine();
|
|
8055
|
+
return instance$4;
|
|
8038
8056
|
},
|
|
8039
8057
|
};
|
|
8040
8058
|
|
|
@@ -8065,7 +8083,7 @@ function prepareBlockingUserPayload(response) {
|
|
|
8065
8083
|
}
|
|
8066
8084
|
|
|
8067
8085
|
const BLOCK_LIST_LIMIT = 100;
|
|
8068
|
-
const TTL_MS = 5 * 60 * 1000; // 5 minutes
|
|
8086
|
+
const TTL_MS$1 = 5 * 60 * 1000; // 5 minutes
|
|
8069
8087
|
/**
|
|
8070
8088
|
* Session-scoped singleton engine that manages TTL-based fetching and caching
|
|
8071
8089
|
* of blocking users (the "blocked-by" list — users who blocked the current
|
|
@@ -8104,7 +8122,7 @@ class BlockingUserSyncEngine {
|
|
|
8104
8122
|
isCacheExpired() {
|
|
8105
8123
|
if (this.lastFetchedAt === null)
|
|
8106
8124
|
return true;
|
|
8107
|
-
return Date.now() - this.lastFetchedAt > TTL_MS;
|
|
8125
|
+
return Date.now() - this.lastFetchedAt > TTL_MS$1;
|
|
8108
8126
|
}
|
|
8109
8127
|
/**
|
|
8110
8128
|
* Ensures the local store is populated with fresh blocking-user data.
|
|
@@ -8159,12 +8177,12 @@ class BlockingUserSyncEngine {
|
|
|
8159
8177
|
.map(userLinkedObject);
|
|
8160
8178
|
}
|
|
8161
8179
|
}
|
|
8162
|
-
let instance$
|
|
8180
|
+
let instance$3 = null;
|
|
8163
8181
|
var BlockingUserSyncEngine$1 = {
|
|
8164
8182
|
getInstance: () => {
|
|
8165
|
-
if (!instance$
|
|
8166
|
-
instance$
|
|
8167
|
-
return instance$
|
|
8183
|
+
if (!instance$3)
|
|
8184
|
+
instance$3 = new BlockingUserSyncEngine();
|
|
8185
|
+
return instance$3;
|
|
8168
8186
|
},
|
|
8169
8187
|
};
|
|
8170
8188
|
|
|
@@ -8274,6 +8292,336 @@ var blockRealtimeOnLoginHandler = () => {
|
|
|
8274
8292
|
return () => disposers.forEach(dispose => dispose());
|
|
8275
8293
|
};
|
|
8276
8294
|
|
|
8295
|
+
const TTL_MS = 5 * 60 * 1000; // 5 minutes, as BlockedUserSyncEngine
|
|
8296
|
+
const isKept = (status) => status === 'accepted' || status === 'pending';
|
|
8297
|
+
/**
|
|
8298
|
+
* Session-scoped singleton engine behind `getAllFollowings()`: a 5-minute fetch gate
|
|
8299
|
+
* on `GET /api/v4/me/following-ids`, copied from BlockedUserSyncEngine.
|
|
8300
|
+
*
|
|
8301
|
+
* - `onSessionEstablished()` is a no-op — the fetch is lazy, on the first call
|
|
8302
|
+
* - `onSessionDestroyed()` resets `lastFetchedAt` and empties the list, so the next
|
|
8303
|
+
* session fetches again
|
|
8304
|
+
* - `ensureFetched()` fetches only when the window expired or nothing was fetched yet;
|
|
8305
|
+
* `lastFetchedAt` moves only on success
|
|
8306
|
+
* - the answer holds ids and statuses only, so the engine keeps it in memory — user id →
|
|
8307
|
+
* status — replaced on each fetch, never merged: a follow removed on another device
|
|
8308
|
+
* drops out at the next fetch. Nothing is written to the follow or user cache.
|
|
8309
|
+
* - `onFollowChanged()` applies every follow change of the session by its status; a change
|
|
8310
|
+
* that arrives while a fetch is in flight is replayed on top of the answer, so the older
|
|
8311
|
+
* answer does not drop it. Concurrent calls share one in-flight fetch.
|
|
8312
|
+
*
|
|
8313
|
+
* @internal
|
|
8314
|
+
*/
|
|
8315
|
+
class FollowingSyncEngine {
|
|
8316
|
+
constructor() {
|
|
8317
|
+
/** Epoch ms of the last successful fetch. null = never fetched in this session. */
|
|
8318
|
+
this.lastFetchedAt = null;
|
|
8319
|
+
/** user id → status, in order: the session's changes first, then the answer's order. */
|
|
8320
|
+
this.followings = new Map();
|
|
8321
|
+
/** Bumped on sign-out, so a fetch from the old session cannot fill the new one. */
|
|
8322
|
+
this.session = 0;
|
|
8323
|
+
/** The in-flight fetch, shared by concurrent calls. */
|
|
8324
|
+
this.fetching = null;
|
|
8325
|
+
/** Changes applied while `fetching` is in flight, replayed on top of its answer. */
|
|
8326
|
+
this.changesDuringFetch = [];
|
|
8327
|
+
}
|
|
8328
|
+
/** No-op — the fetch is lazy, triggered by getAllFollowings(). */
|
|
8329
|
+
// eslint-disable-next-line class-methods-use-this
|
|
8330
|
+
onSessionEstablished() {
|
|
8331
|
+
// intentionally empty
|
|
8332
|
+
}
|
|
8333
|
+
/** Resets the window so the next session starts with a fresh fetch. */
|
|
8334
|
+
onSessionDestroyed() {
|
|
8335
|
+
this.lastFetchedAt = null;
|
|
8336
|
+
this.followings = new Map();
|
|
8337
|
+
this.fetching = null;
|
|
8338
|
+
this.changesDuringFetch = [];
|
|
8339
|
+
this.session += 1;
|
|
8340
|
+
}
|
|
8341
|
+
/** No-op — the window does not depend on the token. */
|
|
8342
|
+
// eslint-disable-next-line class-methods-use-this
|
|
8343
|
+
onTokenExpired() {
|
|
8344
|
+
// intentionally empty
|
|
8345
|
+
}
|
|
8346
|
+
/**
|
|
8347
|
+
* Called for every follow change the SDK sees during the session. A follow whose
|
|
8348
|
+
* `from` is another user is ignored. Status `accepted` or `pending` sets the user with
|
|
8349
|
+
* that status and moves them to the front; any other status (`none` after an unfollow,
|
|
8350
|
+
* a cancel, a decline or a removed follower; `blocked`) removes them.
|
|
8351
|
+
*/
|
|
8352
|
+
onFollowChanged(follow) {
|
|
8353
|
+
if (!follow || follow.from !== getActiveClient().userId)
|
|
8354
|
+
return;
|
|
8355
|
+
if (this.fetching)
|
|
8356
|
+
this.changesDuringFetch.push(follow);
|
|
8357
|
+
this.apply(follow);
|
|
8358
|
+
}
|
|
8359
|
+
apply(follow) {
|
|
8360
|
+
const rest = [...this.followings].filter(([userId]) => userId !== follow.to);
|
|
8361
|
+
this.followings = new Map(isKept(follow.status) ? [[follow.to, follow.status], ...rest] : rest);
|
|
8362
|
+
}
|
|
8363
|
+
isCacheExpired() {
|
|
8364
|
+
if (this.lastFetchedAt === null)
|
|
8365
|
+
return true;
|
|
8366
|
+
return Date.now() - this.lastFetchedAt > TTL_MS;
|
|
8367
|
+
}
|
|
8368
|
+
/**
|
|
8369
|
+
* Fetches whom the user follows (up to 5,000 ids and statuses, one response, no
|
|
8370
|
+
* `status` so both accepted and pending come back) when the window has expired. A
|
|
8371
|
+
* failure propagates and leaves the window and the list unchanged, so the next call
|
|
8372
|
+
* retries.
|
|
8373
|
+
*/
|
|
8374
|
+
async ensureFetched() {
|
|
8375
|
+
if (!this.isCacheExpired())
|
|
8376
|
+
return;
|
|
8377
|
+
if (!this.fetching) {
|
|
8378
|
+
const { session } = this;
|
|
8379
|
+
this.changesDuringFetch = [];
|
|
8380
|
+
this.fetching = this.fetch(session).finally(() => {
|
|
8381
|
+
if (session !== this.session)
|
|
8382
|
+
return;
|
|
8383
|
+
this.fetching = null;
|
|
8384
|
+
this.changesDuringFetch = [];
|
|
8385
|
+
});
|
|
8386
|
+
}
|
|
8387
|
+
await this.fetching;
|
|
8388
|
+
}
|
|
8389
|
+
async fetch(session) {
|
|
8390
|
+
var _a;
|
|
8391
|
+
const client = getActiveClient();
|
|
8392
|
+
const { data } = await client.http.get('/api/v4/me/following-ids');
|
|
8393
|
+
if (session !== this.session)
|
|
8394
|
+
return; // signed out while in flight
|
|
8395
|
+
// replaced, never merged
|
|
8396
|
+
this.followings = new Map(((_a = data === null || data === void 0 ? void 0 : data.follows) !== null && _a !== void 0 ? _a : [])
|
|
8397
|
+
.filter(follow => isKept(follow.status))
|
|
8398
|
+
.map(follow => [follow.userId, follow.status]));
|
|
8399
|
+
// a change made while the request was in flight is newer than the answer
|
|
8400
|
+
this.changesDuringFetch.forEach(change => this.apply(change));
|
|
8401
|
+
this.lastFetchedAt = Date.now();
|
|
8402
|
+
}
|
|
8403
|
+
/** The kept entries, in order. */
|
|
8404
|
+
getFollowings() {
|
|
8405
|
+
return [...this.followings].map(([userId, status]) => ({ userId, status }));
|
|
8406
|
+
}
|
|
8407
|
+
}
|
|
8408
|
+
let instance$2 = null;
|
|
8409
|
+
var FollowingSyncEngine$1 = {
|
|
8410
|
+
getInstance: () => {
|
|
8411
|
+
if (!instance$2)
|
|
8412
|
+
instance$2 = new FollowingSyncEngine();
|
|
8413
|
+
return instance$2;
|
|
8414
|
+
},
|
|
8415
|
+
};
|
|
8416
|
+
|
|
8417
|
+
var followingSyncEngineOnLoginHandler = () => {
|
|
8418
|
+
const followingSyncEngine = FollowingSyncEngine$1.getInstance();
|
|
8419
|
+
onSessionStateChange(state => {
|
|
8420
|
+
if (state === "established" /* Amity.SessionStates.ESTABLISHED */) {
|
|
8421
|
+
followingSyncEngine.onSessionEstablished();
|
|
8422
|
+
}
|
|
8423
|
+
else if (state === "tokenExpired" /* Amity.SessionStates.TOKEN_EXPIRED */) {
|
|
8424
|
+
followingSyncEngine.onTokenExpired();
|
|
8425
|
+
}
|
|
8426
|
+
else {
|
|
8427
|
+
followingSyncEngine.onSessionDestroyed();
|
|
8428
|
+
}
|
|
8429
|
+
});
|
|
8430
|
+
return () => {
|
|
8431
|
+
followingSyncEngine.onSessionDestroyed();
|
|
8432
|
+
};
|
|
8433
|
+
};
|
|
8434
|
+
|
|
8435
|
+
const createFollowEventSubscriber = (event, callback) => {
|
|
8436
|
+
const client = getActiveClient();
|
|
8437
|
+
const filter = (data) => {
|
|
8438
|
+
const payload = prepareFollowersPayload(data);
|
|
8439
|
+
if (!client.cache) {
|
|
8440
|
+
callback(payload.follows[0]);
|
|
8441
|
+
}
|
|
8442
|
+
else {
|
|
8443
|
+
ingestInCache(payload);
|
|
8444
|
+
callback(payload.follows[0]);
|
|
8445
|
+
}
|
|
8446
|
+
};
|
|
8447
|
+
return createEventSubscriber(client, event, event, filter);
|
|
8448
|
+
};
|
|
8449
|
+
const createLocalFollowEventSubscriber = (event, callback) => {
|
|
8450
|
+
const client = getActiveClient();
|
|
8451
|
+
const filter = (data) => {
|
|
8452
|
+
const payload = prepareFollowStatusPayload(data);
|
|
8453
|
+
if (!client.cache) {
|
|
8454
|
+
callback(payload.follows[0]);
|
|
8455
|
+
}
|
|
8456
|
+
else {
|
|
8457
|
+
ingestInCache(payload);
|
|
8458
|
+
callback(payload.follows[0]);
|
|
8459
|
+
}
|
|
8460
|
+
};
|
|
8461
|
+
return createEventSubscriber(client, event, event, filter);
|
|
8462
|
+
};
|
|
8463
|
+
|
|
8464
|
+
/**
|
|
8465
|
+
* ```js
|
|
8466
|
+
* import { onUserFollowed } from '@amityco/ts-sdk'
|
|
8467
|
+
* const dispose = onUserFollowed(status => {
|
|
8468
|
+
* // ...
|
|
8469
|
+
* })
|
|
8470
|
+
* ```
|
|
8471
|
+
*
|
|
8472
|
+
* Fired when a user follows another users and confirmation is not required
|
|
8473
|
+
*
|
|
8474
|
+
* @param callback The function to call when the event was fired
|
|
8475
|
+
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
8476
|
+
*
|
|
8477
|
+
* @category Follow Events
|
|
8478
|
+
*/
|
|
8479
|
+
const onUserFollowed = (callback) => createFollowEventSubscriber('follow.created', callback);
|
|
8480
|
+
|
|
8481
|
+
/**
|
|
8482
|
+
* ```js
|
|
8483
|
+
* import { onFollowerRequested } from '@amityco/ts-sdk'
|
|
8484
|
+
* const dispose = onFollowerRequested(status => {
|
|
8485
|
+
* // ...
|
|
8486
|
+
* })
|
|
8487
|
+
* ```
|
|
8488
|
+
*
|
|
8489
|
+
* Fired when a user follows another users and confirmation is required
|
|
8490
|
+
*
|
|
8491
|
+
* @param callback The function to call when the event was fired
|
|
8492
|
+
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
8493
|
+
*
|
|
8494
|
+
* @category Follow Events
|
|
8495
|
+
*/
|
|
8496
|
+
const onFollowerRequested = (callback) => createFollowEventSubscriber('follow.requested', callback);
|
|
8497
|
+
|
|
8498
|
+
/**
|
|
8499
|
+
* ```js
|
|
8500
|
+
* import { onFollowRequestAccepted } from '@amityco/ts-sdk'
|
|
8501
|
+
* const dispose = onFollowRequestAccepted(status => {
|
|
8502
|
+
* // ...
|
|
8503
|
+
* })
|
|
8504
|
+
* ```
|
|
8505
|
+
*
|
|
8506
|
+
* Fired when a follow request has been accepted
|
|
8507
|
+
*
|
|
8508
|
+
* @param callback The function to call when the event was fired
|
|
8509
|
+
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
8510
|
+
*
|
|
8511
|
+
* @category Follow Events
|
|
8512
|
+
*/
|
|
8513
|
+
const onFollowRequestAccepted = (callback) => createFollowEventSubscriber('follow.accepted', callback);
|
|
8514
|
+
|
|
8515
|
+
/**
|
|
8516
|
+
* ```js
|
|
8517
|
+
* import { onUserUnfollowed } from '@amityco/ts-sdk'
|
|
8518
|
+
* const dispose = onUserFollowed(status => {
|
|
8519
|
+
* // ...
|
|
8520
|
+
* })
|
|
8521
|
+
* ```
|
|
8522
|
+
*
|
|
8523
|
+
* Fired when a user unfollows
|
|
8524
|
+
*
|
|
8525
|
+
* @param callback The function to call when the event was fired
|
|
8526
|
+
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
8527
|
+
*
|
|
8528
|
+
* @category Follow Events
|
|
8529
|
+
*/
|
|
8530
|
+
const onUserUnfollowed = (callback) => createFollowEventSubscriber('follow.unfollowed', callback);
|
|
8531
|
+
|
|
8532
|
+
/**
|
|
8533
|
+
* ```js
|
|
8534
|
+
* import { onFollowRequestCanceled } from '@amityco/ts-sdk'
|
|
8535
|
+
* const dispose = onFollowRequestCanceled(status => {
|
|
8536
|
+
* // ...
|
|
8537
|
+
* })
|
|
8538
|
+
* ```
|
|
8539
|
+
*
|
|
8540
|
+
* Fired when a follow request has been canceled
|
|
8541
|
+
*
|
|
8542
|
+
* @param callback The function to call when the event was fired
|
|
8543
|
+
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
8544
|
+
*
|
|
8545
|
+
* @category Follow Events
|
|
8546
|
+
*/
|
|
8547
|
+
const onFollowRequestCanceled = (callback) => createFollowEventSubscriber('follow.requestCanceled', callback);
|
|
8548
|
+
|
|
8549
|
+
/**
|
|
8550
|
+
* ```js
|
|
8551
|
+
* import { onFollowRequestDeclined } from '@amityco/ts-sdk'
|
|
8552
|
+
* const dispose = onFollowRequestDeclined(status => {
|
|
8553
|
+
* // ...
|
|
8554
|
+
* })
|
|
8555
|
+
* ```
|
|
8556
|
+
*
|
|
8557
|
+
* Fired when a follow request has been declined
|
|
8558
|
+
*
|
|
8559
|
+
* @param callback The function to call when the event was fired
|
|
8560
|
+
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
8561
|
+
*
|
|
8562
|
+
* @category Follow Events
|
|
8563
|
+
*/
|
|
8564
|
+
const onFollowRequestDeclined = (callback) => createFollowEventSubscriber('follow.requestDeclined', callback);
|
|
8565
|
+
|
|
8566
|
+
/**
|
|
8567
|
+
* ```js
|
|
8568
|
+
* import { onFollowerDeleted } from '@amityco/ts-sdk'
|
|
8569
|
+
* const dispose = onFollowerDeleted(status => {
|
|
8570
|
+
* // ...
|
|
8571
|
+
* })
|
|
8572
|
+
* ```
|
|
8573
|
+
*
|
|
8574
|
+
* Fired when a follower has been deleted
|
|
8575
|
+
*
|
|
8576
|
+
* @param callback The function to call when the event was fired
|
|
8577
|
+
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
8578
|
+
*
|
|
8579
|
+
* @category Follow Events
|
|
8580
|
+
*/
|
|
8581
|
+
const onFollowerDeleted = (callback) => createFollowEventSubscriber('follow.followerDeleted', callback);
|
|
8582
|
+
|
|
8583
|
+
const onLocalUserFollowed = (callback) => createLocalFollowEventSubscriber('local.follow.created', callback);
|
|
8584
|
+
|
|
8585
|
+
const onLocalFollowerRequested = (callback) => createLocalFollowEventSubscriber('local.follow.requested', callback);
|
|
8586
|
+
|
|
8587
|
+
const onLocalUserUnfollowed = (callback) => createLocalFollowEventSubscriber('local.follow.unfollowed', callback);
|
|
8588
|
+
|
|
8589
|
+
// Each event file directly, not the events barrel: the barrel's onFollowInfoUpdated imports
|
|
8590
|
+
/**
|
|
8591
|
+
* Keeps `getAllFollowings()` current for the whole session: every follow change — from
|
|
8592
|
+
* this device (local echo) or another (MQTT) — goes to `FollowingSyncEngine.onFollowChanged`,
|
|
8593
|
+
* which ignores follows of other users and applies the rest by status: a follow adds the
|
|
8594
|
+
* user as accepted, a request as pending, an accepted request turns accepted, and an
|
|
8595
|
+
* unfollow, a canceled or declined request, a removed follower or a block takes the user out.
|
|
8596
|
+
* `blockUser` also calls the engine itself: its local event swaps `from` and `to`.
|
|
8597
|
+
* `user.didBlock` is read here rather than through `onUserDidBlock`, which passes on only
|
|
8598
|
+
* the payload's first follow: every follow in it goes to the engine, as on Android and iOS,
|
|
8599
|
+
* so the signed-in user's block is applied wherever it sits in the payload.
|
|
8600
|
+
* The MQTT events arrive on the followers and followings topics of the BLOCK
|
|
8601
|
+
* auto-subscription (on by default).
|
|
8602
|
+
*
|
|
8603
|
+
* Registered via `setupLoginSubscriptions`; the returned unsubscriber is torn
|
|
8604
|
+
* down on logout.
|
|
8605
|
+
*/
|
|
8606
|
+
var followRealtimeOnLoginHandler = () => {
|
|
8607
|
+
const engine = FollowingSyncEngine$1.getInstance();
|
|
8608
|
+
const apply = (follow) => engine.onFollowChanged(follow);
|
|
8609
|
+
const disposers = [
|
|
8610
|
+
onUserFollowed(apply),
|
|
8611
|
+
onFollowerRequested(apply),
|
|
8612
|
+
onFollowRequestAccepted(apply),
|
|
8613
|
+
onUserUnfollowed(apply),
|
|
8614
|
+
onFollowRequestCanceled(apply),
|
|
8615
|
+
onFollowRequestDeclined(apply),
|
|
8616
|
+
onFollowerDeleted(apply),
|
|
8617
|
+
createEventSubscriber(getActiveClient(), 'user.didBlock', 'user.didBlock', payload => { var _a; return ((_a = payload === null || payload === void 0 ? void 0 : payload.follows) !== null && _a !== void 0 ? _a : []).forEach(apply); }),
|
|
8618
|
+
onLocalUserFollowed(apply),
|
|
8619
|
+
onLocalFollowerRequested(apply),
|
|
8620
|
+
onLocalUserUnfollowed(apply),
|
|
8621
|
+
];
|
|
8622
|
+
return () => disposers.forEach(dispose => dispose());
|
|
8623
|
+
};
|
|
8624
|
+
|
|
8277
8625
|
class CursorController {
|
|
8278
8626
|
constructor(networkId, userId) {
|
|
8279
8627
|
this.networkId = networkId;
|
|
@@ -8922,7 +9270,7 @@ const setupLoginSubscriptions = (unsubWatcher) => {
|
|
|
8922
9270
|
// NOTE: This is a temporary solution to handle the channel marker when the user is forced to leave
|
|
8923
9271
|
// the channel because currently backend can't handle this, so every time a user is banned from
|
|
8924
9272
|
// a channel or the channel is deleted the channel's unread count will not be reset to zero
|
|
8925
|
-
onChannelDeleted(removeChannelMarkerCache), onChannelMemberBanned(removeChannelMarkerCache), markReadEngineOnLoginHandler(), analyticsEngineOnLoginHandler(), objectResolverEngineOnLoginHandler(), reactionSyncEngineOnLoginHandler(), blockedUserSyncEngineOnLoginHandler(), blockingUserSyncEngineOnLoginHandler(), blockRealtimeOnLoginHandler(), resetAutoSubscriptionsOnLogout(), CursorController.clearOnLogout(), postCommentCountEngineOnLoginHandler(), channelActivityOnLoginHandler(), userFlagByMeOnLoginHandler());
|
|
9273
|
+
onChannelDeleted(removeChannelMarkerCache), onChannelMemberBanned(removeChannelMarkerCache), markReadEngineOnLoginHandler(), analyticsEngineOnLoginHandler(), objectResolverEngineOnLoginHandler(), reactionSyncEngineOnLoginHandler(), blockedUserSyncEngineOnLoginHandler(), blockingUserSyncEngineOnLoginHandler(), blockRealtimeOnLoginHandler(), followingSyncEngineOnLoginHandler(), followRealtimeOnLoginHandler(), resetAutoSubscriptionsOnLogout(), CursorController.clearOnLogout(), postCommentCountEngineOnLoginHandler(), channelActivityOnLoginHandler(), userFlagByMeOnLoginHandler());
|
|
8926
9274
|
if (client.useLegacyUnreadCount) {
|
|
8927
9275
|
subscriptions.push(readReceiptSyncEngineOnLoginHandler());
|
|
8928
9276
|
}
|
|
@@ -11251,6 +11599,14 @@ const blockUser = async (userId) => {
|
|
|
11251
11599
|
};
|
|
11252
11600
|
const payload = prepareFollowStatusPayload(blockedUnfollowStatus);
|
|
11253
11601
|
fireEvent('local.follow.unfollowed', payload);
|
|
11602
|
+
// the local event above swaps from and to, so getAllFollowings() cannot see this block in it
|
|
11603
|
+
if (client.userId) {
|
|
11604
|
+
FollowingSyncEngine$1.getInstance().onFollowChanged({
|
|
11605
|
+
from: client.userId,
|
|
11606
|
+
to: userId,
|
|
11607
|
+
status: 'blocked',
|
|
11608
|
+
});
|
|
11609
|
+
}
|
|
11254
11610
|
return data;
|
|
11255
11611
|
};
|
|
11256
11612
|
/* end_public_function */
|
|
@@ -11315,6 +11671,8 @@ const follow = async (userId) => {
|
|
|
11315
11671
|
ingestInCache(data, { cachedAt });
|
|
11316
11672
|
}
|
|
11317
11673
|
const payload = prepareFollowStatusPayload(data);
|
|
11674
|
+
// at once: the local event below is delivered on a later tick
|
|
11675
|
+
FollowingSyncEngine$1.getInstance().onFollowChanged(data.follows[0]);
|
|
11318
11676
|
if (data.follows[0].status === 'accepted') {
|
|
11319
11677
|
fireEvent('local.follow.created', payload);
|
|
11320
11678
|
}
|
|
@@ -11353,6 +11711,8 @@ const unfollow = async (userId) => {
|
|
|
11353
11711
|
ingestInCache(data);
|
|
11354
11712
|
}
|
|
11355
11713
|
const payload = prepareFollowStatusPayload(data);
|
|
11714
|
+
// at once: the local event below is delivered on a later tick
|
|
11715
|
+
FollowingSyncEngine$1.getInstance().onFollowChanged(data.follows[0]);
|
|
11356
11716
|
fireEvent('local.follow.unfollowed', payload);
|
|
11357
11717
|
return true;
|
|
11358
11718
|
};
|
|
@@ -11418,153 +11778,50 @@ const declineMyFollower = async (userId) => {
|
|
|
11418
11778
|
};
|
|
11419
11779
|
/* end_public_function */
|
|
11420
11780
|
|
|
11421
|
-
|
|
11422
|
-
|
|
11423
|
-
|
|
11424
|
-
const payload = prepareFollowersPayload(data);
|
|
11425
|
-
if (!client.cache) {
|
|
11426
|
-
callback(payload.follows[0]);
|
|
11427
|
-
}
|
|
11428
|
-
else {
|
|
11429
|
-
ingestInCache(payload);
|
|
11430
|
-
callback(payload.follows[0]);
|
|
11431
|
-
}
|
|
11432
|
-
};
|
|
11433
|
-
return createEventSubscriber(client, event, event, filter);
|
|
11434
|
-
};
|
|
11435
|
-
const createLocalFollowEventSubscriber = (event, callback) => {
|
|
11436
|
-
const client = getActiveClient();
|
|
11437
|
-
const filter = (data) => {
|
|
11438
|
-
const payload = prepareFollowStatusPayload(data);
|
|
11439
|
-
if (!client.cache) {
|
|
11440
|
-
callback(payload.follows[0]);
|
|
11441
|
-
}
|
|
11442
|
-
else {
|
|
11443
|
-
ingestInCache(payload);
|
|
11444
|
-
callback(payload.follows[0]);
|
|
11445
|
-
}
|
|
11446
|
-
};
|
|
11447
|
-
return createEventSubscriber(client, event, event, filter);
|
|
11448
|
-
};
|
|
11449
|
-
|
|
11450
|
-
/**
|
|
11451
|
-
* ```js
|
|
11452
|
-
* import { onUserFollowed } from '@amityco/ts-sdk'
|
|
11453
|
-
* const dispose = onUserFollowed(status => {
|
|
11454
|
-
* // ...
|
|
11455
|
-
* })
|
|
11456
|
-
* ```
|
|
11457
|
-
*
|
|
11458
|
-
* Fired when a user follows another users and confirmation is not required
|
|
11459
|
-
*
|
|
11460
|
-
* @param callback The function to call when the event was fired
|
|
11461
|
-
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
11462
|
-
*
|
|
11463
|
-
* @category Follow Events
|
|
11464
|
-
*/
|
|
11465
|
-
const onUserFollowed = (callback) => createFollowEventSubscriber('follow.created', callback);
|
|
11466
|
-
|
|
11467
|
-
/**
|
|
11468
|
-
* ```js
|
|
11469
|
-
* import { onUserUnfollowed } from '@amityco/ts-sdk'
|
|
11470
|
-
* const dispose = onUserFollowed(status => {
|
|
11471
|
-
* // ...
|
|
11472
|
-
* })
|
|
11473
|
-
* ```
|
|
11474
|
-
*
|
|
11475
|
-
* Fired when a user unfollows
|
|
11476
|
-
*
|
|
11477
|
-
* @param callback The function to call when the event was fired
|
|
11478
|
-
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
11479
|
-
*
|
|
11480
|
-
* @category Follow Events
|
|
11481
|
-
*/
|
|
11482
|
-
const onUserUnfollowed = (callback) => createFollowEventSubscriber('follow.unfollowed', callback);
|
|
11483
|
-
|
|
11484
|
-
/**
|
|
11485
|
-
* ```js
|
|
11486
|
-
* import { onFollowerDeleted } from '@amityco/ts-sdk'
|
|
11487
|
-
* const dispose = onFollowerDeleted(status => {
|
|
11488
|
-
* // ...
|
|
11489
|
-
* })
|
|
11490
|
-
* ```
|
|
11491
|
-
*
|
|
11492
|
-
* Fired when a follower has been deleted
|
|
11493
|
-
*
|
|
11494
|
-
* @param callback The function to call when the event was fired
|
|
11495
|
-
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
11496
|
-
*
|
|
11497
|
-
* @category Follow Events
|
|
11498
|
-
*/
|
|
11499
|
-
const onFollowerDeleted = (callback) => createFollowEventSubscriber('follow.followerDeleted', callback);
|
|
11500
|
-
|
|
11501
|
-
/**
|
|
11502
|
-
* ```js
|
|
11503
|
-
* import { onFollowerRequested } from '@amityco/ts-sdk'
|
|
11504
|
-
* const dispose = onFollowerRequested(status => {
|
|
11505
|
-
* // ...
|
|
11506
|
-
* })
|
|
11507
|
-
* ```
|
|
11508
|
-
*
|
|
11509
|
-
* Fired when a user follows another users and confirmation is required
|
|
11510
|
-
*
|
|
11511
|
-
* @param callback The function to call when the event was fired
|
|
11512
|
-
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
11513
|
-
*
|
|
11514
|
-
* @category Follow Events
|
|
11515
|
-
*/
|
|
11516
|
-
const onFollowerRequested = (callback) => createFollowEventSubscriber('follow.requested', callback);
|
|
11517
|
-
|
|
11781
|
+
/* begin_public_function
|
|
11782
|
+
id: user.relationship.get_all_followings
|
|
11783
|
+
*/
|
|
11518
11784
|
/**
|
|
11519
11785
|
* ```js
|
|
11520
|
-
* import {
|
|
11521
|
-
* const dispose = onFollowRequestCanceled(status => {
|
|
11522
|
-
* // ...
|
|
11523
|
-
* })
|
|
11524
|
-
* ```
|
|
11525
|
-
*
|
|
11526
|
-
* Fired when a follow request has been canceled
|
|
11527
|
-
*
|
|
11528
|
-
* @param callback The function to call when the event was fired
|
|
11529
|
-
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
11786
|
+
* import { UserRepository } from '@amityco/ts-sdk'
|
|
11530
11787
|
*
|
|
11531
|
-
*
|
|
11532
|
-
|
|
11533
|
-
|
|
11534
|
-
|
|
11535
|
-
/**
|
|
11536
|
-
* ```js
|
|
11537
|
-
* import { onFollowRequestAccepted } from '@amityco/ts-sdk'
|
|
11538
|
-
* const dispose = onFollowRequestAccepted(status => {
|
|
11539
|
-
* // ...
|
|
11540
|
-
* })
|
|
11788
|
+
* const followings = await UserRepository.Relationship.getAllFollowings()
|
|
11789
|
+
* const statusOf = new Map(followings.map(f => [f.userId, f.status]))
|
|
11790
|
+
* // 'accepted' → no button; 'pending' → Pending; missing → Follow
|
|
11541
11791
|
* ```
|
|
11542
11792
|
*
|
|
11543
|
-
*
|
|
11544
|
-
*
|
|
11545
|
-
*
|
|
11546
|
-
*
|
|
11793
|
+
* Returns whom the signed-in user follows as a one-shot list of at most 5,000 (the most a
|
|
11794
|
+
* user can follow), from one request with no paging: each followed user's id and the
|
|
11795
|
+
* follow's status — `accepted`, or `pending` for a request not yet accepted. A user
|
|
11796
|
+
* missing from the list is not followed. The list holds ids and statuses only, no user
|
|
11797
|
+
* profiles.
|
|
11547
11798
|
*
|
|
11548
|
-
*
|
|
11549
|
-
|
|
11550
|
-
const onFollowRequestAccepted = (callback) => createFollowEventSubscriber('follow.accepted', callback);
|
|
11551
|
-
|
|
11552
|
-
/**
|
|
11553
|
-
* ```js
|
|
11554
|
-
* import { onFollowRequestDeclined } from '@amityco/ts-sdk'
|
|
11555
|
-
* const dispose = onFollowRequestDeclined(status => {
|
|
11556
|
-
* // ...
|
|
11557
|
-
* })
|
|
11558
|
-
* ```
|
|
11799
|
+
* Use it to show the follow button next to each author in the post feed: match each
|
|
11800
|
+
* author by user id against `userId`.
|
|
11559
11801
|
*
|
|
11560
|
-
*
|
|
11802
|
+
* Keeping the app current: the function answers once, so call it again to see changes —
|
|
11803
|
+
* for example when more posts load or when the feed comes back into view. The answer is
|
|
11804
|
+
* kept on the device for 5 minutes, so a call within that window costs no request. Changes
|
|
11805
|
+
* made in this app show at once. Changes made elsewhere — on another device, or by the
|
|
11806
|
+
* other user accepting a request or removing the user as a follower — show once their
|
|
11807
|
+
* real-time event arrives; the SDK receives these on the followers and followings topics
|
|
11808
|
+
* of `AmityAutoSubscription.BLOCK`, on by default. An event missed while offline, or with
|
|
11809
|
+
* that subscription turned off, shows at the next fetch, after the 5 minutes.
|
|
11561
11810
|
*
|
|
11562
|
-
* @
|
|
11563
|
-
* @returns an {@link Amity.Unsubscriber} function to stop listening
|
|
11811
|
+
* @returns A promise that resolves to the signed-in user's {@link Amity.FollowingUserStatus} list
|
|
11564
11812
|
*
|
|
11565
|
-
* @category Follow
|
|
11813
|
+
* @category Follow API
|
|
11814
|
+
* @async
|
|
11566
11815
|
*/
|
|
11567
|
-
const
|
|
11816
|
+
const getAllFollowings = async () => {
|
|
11817
|
+
const client = getActiveClient();
|
|
11818
|
+
client.log('follow/getAllFollowings');
|
|
11819
|
+
const engine = FollowingSyncEngine$1.getInstance();
|
|
11820
|
+
// Fetch only when the 5-minute window has expired (no-op otherwise)
|
|
11821
|
+
await engine.ensureFetched();
|
|
11822
|
+
return engine.getFollowings();
|
|
11823
|
+
};
|
|
11824
|
+
/* end_public_function */
|
|
11568
11825
|
|
|
11569
11826
|
/**
|
|
11570
11827
|
* ```js
|
|
@@ -11670,12 +11927,6 @@ const onFollowInfoUpdated = (callback) => {
|
|
|
11670
11927
|
};
|
|
11671
11928
|
};
|
|
11672
11929
|
|
|
11673
|
-
const onLocalUserFollowed = (callback) => createLocalFollowEventSubscriber('local.follow.created', callback);
|
|
11674
|
-
|
|
11675
|
-
const onLocalUserUnfollowed = (callback) => createLocalFollowEventSubscriber('local.follow.unfollowed', callback);
|
|
11676
|
-
|
|
11677
|
-
const onLocalFollowerRequested = (callback) => createLocalFollowEventSubscriber('local.follow.requested', callback);
|
|
11678
|
-
|
|
11679
11930
|
const onLocalFollowRequestAccepted = (callback) => createLocalFollowEventSubscriber('local.follow.accepted', callback);
|
|
11680
11931
|
|
|
11681
11932
|
const onLocalFollowRequestDeclined = (callback) => createLocalFollowEventSubscriber('local.follow.requestDeclined', callback);
|
|
@@ -12397,6 +12648,7 @@ var index$s = /*#__PURE__*/Object.freeze({
|
|
|
12397
12648
|
unfollow: unfollow,
|
|
12398
12649
|
acceptMyFollower: acceptMyFollower,
|
|
12399
12650
|
declineMyFollower: declineMyFollower,
|
|
12651
|
+
getAllFollowings: getAllFollowings,
|
|
12400
12652
|
onUserFollowed: onUserFollowed,
|
|
12401
12653
|
onUserUnfollowed: onUserUnfollowed,
|
|
12402
12654
|
onFollowerDeleted: onFollowerDeleted,
|
|
@@ -14142,7 +14394,7 @@ const getWatchSessionStorage = () => {
|
|
|
14142
14394
|
return storageInstance;
|
|
14143
14395
|
};
|
|
14144
14396
|
|
|
14145
|
-
const privateKey = "
|
|
14397
|
+
const privateKey = "MIIEpQIBAAKCAQEAwAEc/oZgYIvKSUG/C3mONYLR4ZPgAjMEX4bJ+xqqakUDRtqlNO+eZs2blQ1Ko0DBkqPExyQezvjibH5W2UZBV5RaBTlTcNVKTToMBEGesAfaEcM3qUyQHxdbFYZv6P4sb14dcwxTQ8usmaV8ooiR1Fcaso5ZWYcZ8Hb46FbQ7OoVumsBtPWwfZ4f003o5VCl6AIM6lcLv9UDLlFVYhE+PeXpRHtfWlGqxMvqC9oinlwhL6nWv6VjQXW4nhcib72dPBzfHT7k/PMKto2SxALYdb68ENiAGuJLWi3AUHSyYCJK2w7wIlWfJUAI0v26ub10IpExr6D5QuW2577jjP93iwIDAQABAoIBAFWfqXhwIIatkFY+9Z1+ZcbDQimgsmMIsUiQaX6Lk7e0cxOj6czDlxYtVtaPiNtow2pLkjNkjkCqiP7tEHnwdK9DvylZOTa2R15NJpK3WLcTqVIGhsn/FL5owfvFah6zSsmXZParZm5zY9NZE03ALZhOB9/cz0e3kf/EbpfeL2mW7MApyiUt5i09ycchroOpcWp73ipIxvgigtZyUGFmsQicWhUs28F0D7w4Qfk76yG3nqXeb+BAMhCaIaa/k/aAxhiZG/ygEQWQrcC8gfe+jyicMAQPDEVS9YuUMGsLjIjKuVLZzp2xirQnhc2i2zVNEIvG6soprPOBEMQugzrtX5ECgYEA3b7KAbBIbDl1e4ZSCWhHdHkiWVZHaopsR/LhqDDNhXjWjq3AesgV6k0j9EdziMn/HmmOso0bz99GTV3JZf4A9ztTLumJlkHbdVtlgOqSjrFLj12rH9KXTheyIhWSpUmm8+WB1xasFbqpvJaGo7F3pd2Fqj1XR4mp5BO7c/t7LJ0CgYEA3aouEzXQ9THRKYocdfY69EI1Il1t/d/RSqqd9BxEjxBgxkM13ZiYIn/R4WW/nCUrlmhxG44Aa2Gob4Ahfsui2xKTg/g/3Zk/rAxAEGkfOLGoenaJMD41fH4wUq3FRYwkvnaMb9Hd6f/TlBHslIRa2NN58bSBGJCyBP2b59+2+EcCgYEAixDVRXvV37GlYUOa/XVdosk5Zoe6oDGRuQm0xbNdoUBoZvDHDvme7ONWEiQha/8qtVsD+CyQ7awcPfb8kK9c0bBt+bTS6d4BkTcxkEkMgtrkBVR8Nqfu5jXsLH4VCv4G61zbMhZw8+ut+az5YX2yCN7Frj9sFlxapMRPQmzMEe0CgYEAumsAzM8ZqNv4mAK65Mnr0rhLj1cbxcKRdUYACOgtEFQpzxN/HZnTeFAe5nx3pI3uFlRHq3DFEYnT6dHMWaJQmAULYpVIwMi9L6gtyJ9fzoI6uqMtxRDMUqKdaSsTGOY/kJ6KhQ/unXi1K3XXjR+yd1+C0q+HUm1+CYxvrZYLfskCgYEArsEy+IQOiqniJ0NE2vVUF+UK/IRZaic9YKcpov5Ot7Vvzm/MnnW4N1ljVskocETBWMmPUvNSExVjPebi+rxd8fa5kY8BJScPTzMFbunZn/wjtGdcM10qdlVQ9doG61A/9P3ezFKCfS4AvF/H/59LcSx2Bh28fp3/efiVIOpVd4Y=";
|
|
14146
14398
|
/*
|
|
14147
14399
|
* The crypto algorithm used for importing key and signing string
|
|
14148
14400
|
*/
|
|
@@ -30481,6 +30733,189 @@ const getForYouFeed = (callback) => {
|
|
|
30481
30733
|
};
|
|
30482
30734
|
/* end_public_function */
|
|
30483
30735
|
|
|
30736
|
+
class FollowingFeedQueryStreamController extends QueryStreamController {
|
|
30737
|
+
constructor(query, cacheKey, notifyChange, preparePayload) {
|
|
30738
|
+
super(query, cacheKey);
|
|
30739
|
+
this.notifyChange = notifyChange;
|
|
30740
|
+
this.preparePayload = preparePayload;
|
|
30741
|
+
}
|
|
30742
|
+
async saveToMainDB(response) {
|
|
30743
|
+
const processedPayload = await this.preparePayload(response);
|
|
30744
|
+
const client = getActiveClient();
|
|
30745
|
+
const cachedAt = client.cache && Date.now();
|
|
30746
|
+
if (client.cache) {
|
|
30747
|
+
ingestInCache(processedPayload, { cachedAt });
|
|
30748
|
+
}
|
|
30749
|
+
}
|
|
30750
|
+
appendToQueryStream(response, direction, refresh = false) {
|
|
30751
|
+
var _a, _b;
|
|
30752
|
+
if (refresh) {
|
|
30753
|
+
pushToCache(this.cacheKey, {
|
|
30754
|
+
data: response.posts.map(getResolver('post')),
|
|
30755
|
+
});
|
|
30756
|
+
}
|
|
30757
|
+
else {
|
|
30758
|
+
const collection = (_a = pullFromCache(this.cacheKey)) === null || _a === void 0 ? void 0 : _a.data;
|
|
30759
|
+
const posts = (_b = collection === null || collection === void 0 ? void 0 : collection.data) !== null && _b !== void 0 ? _b : [];
|
|
30760
|
+
pushToCache(this.cacheKey, Object.assign(Object.assign({}, collection), { data: [...new Set([...posts, ...response.posts.map(getResolver('post'))])] }));
|
|
30761
|
+
}
|
|
30762
|
+
}
|
|
30763
|
+
/**
|
|
30764
|
+
* The SDK does not know the viewer's follow list or the network's `social.globalFeed`
|
|
30765
|
+
* switches, so it cannot tell whether a new post belongs in this feed. A created or
|
|
30766
|
+
* approved post, by anyone (the current user included), never changes the list: it
|
|
30767
|
+
* appears on the next first-page load. Deleted and declined posts are removed; any
|
|
30768
|
+
* other event re-emits so listed posts render their new state.
|
|
30769
|
+
*/
|
|
30770
|
+
reactor(action) {
|
|
30771
|
+
return (post) => {
|
|
30772
|
+
var _a;
|
|
30773
|
+
if (action === EnumPostActions.OnPostCreated || action === EnumPostActions.OnPostApproved) {
|
|
30774
|
+
return;
|
|
30775
|
+
}
|
|
30776
|
+
const collection = (_a = pullFromCache(this.cacheKey)) === null || _a === void 0 ? void 0 : _a.data;
|
|
30777
|
+
if (!collection)
|
|
30778
|
+
return;
|
|
30779
|
+
// A child post event never adds or removes an entry; it re-emits only when its parent is listed
|
|
30780
|
+
if (post.parentPostId) {
|
|
30781
|
+
if (!collection.data.includes(post.parentPostId))
|
|
30782
|
+
return;
|
|
30783
|
+
}
|
|
30784
|
+
else if (action === EnumPostActions.OnPostDeleted ||
|
|
30785
|
+
action === EnumPostActions.OnPostDeclined) {
|
|
30786
|
+
collection.data = collection.data.filter(postId => postId !== post.postId);
|
|
30787
|
+
}
|
|
30788
|
+
pushToCache(this.cacheKey, collection);
|
|
30789
|
+
this.notifyChange({ origin: "event" /* Amity.LiveDataOrigin.EVENT */, loading: false });
|
|
30790
|
+
};
|
|
30791
|
+
}
|
|
30792
|
+
subscribeRTE(createSubscriber) {
|
|
30793
|
+
return createSubscriber.map(subscriber => subscriber.fn(this.reactor(subscriber.action)));
|
|
30794
|
+
}
|
|
30795
|
+
}
|
|
30796
|
+
|
|
30797
|
+
/**
|
|
30798
|
+
* `GET /api/v1/me/following-feeds` reads `limit` and `token` as flat query params.
|
|
30799
|
+
* Unlike the global feed, they must not be nested in `options`: the endpoint forwards
|
|
30800
|
+
* only `{ limit, token }`, so a nested token would be dropped and every page would be page one.
|
|
30801
|
+
*/
|
|
30802
|
+
class FollowingFeedPaginationController extends PaginationController {
|
|
30803
|
+
async getRequest(queryParams, token) {
|
|
30804
|
+
const { limit = COLLECTION_DEFAULT_PAGINATION_SIZE, sortBy } = queryParams;
|
|
30805
|
+
const params = token ? { token } : { limit };
|
|
30806
|
+
if (sortBy)
|
|
30807
|
+
params.sortBy = sortBy;
|
|
30808
|
+
const { data: queryResponse } = await this.http.get(API_ENDPOINTS.followingFeed, { params });
|
|
30809
|
+
return queryResponse;
|
|
30810
|
+
}
|
|
30811
|
+
}
|
|
30812
|
+
|
|
30813
|
+
class FollowingFeedLiveCollectionController extends LiveCollectionController {
|
|
30814
|
+
constructor(query, callback) {
|
|
30815
|
+
const queryStreamId = hash(query);
|
|
30816
|
+
const cacheKey = ['followingFeed', 'collection', queryStreamId];
|
|
30817
|
+
const paginationController = new FollowingFeedPaginationController(query);
|
|
30818
|
+
super(paginationController, queryStreamId, cacheKey, callback);
|
|
30819
|
+
this.query = query;
|
|
30820
|
+
this.queryStreamController = new FollowingFeedQueryStreamController(this.query, this.cacheKey, this.notifyChange.bind(this), preparePostPayload);
|
|
30821
|
+
this.callback = callback.bind(this);
|
|
30822
|
+
this.loadPage({ initial: true });
|
|
30823
|
+
}
|
|
30824
|
+
setup() {
|
|
30825
|
+
var _a;
|
|
30826
|
+
const collection = (_a = pullFromCache(this.cacheKey)) === null || _a === void 0 ? void 0 : _a.data;
|
|
30827
|
+
if (!collection) {
|
|
30828
|
+
pushToCache(this.cacheKey, {
|
|
30829
|
+
data: [],
|
|
30830
|
+
params: {},
|
|
30831
|
+
});
|
|
30832
|
+
}
|
|
30833
|
+
}
|
|
30834
|
+
async persistModel(queryPayload) {
|
|
30835
|
+
await this.queryStreamController.saveToMainDB(queryPayload);
|
|
30836
|
+
}
|
|
30837
|
+
persistQueryStream({ response, direction, refresh, }) {
|
|
30838
|
+
this.queryStreamController.appendToQueryStream(response, direction, refresh);
|
|
30839
|
+
}
|
|
30840
|
+
startSubscription() {
|
|
30841
|
+
return this.queryStreamController.subscribeRTE(getGlobalFeedSubscriptions(this.cacheKey));
|
|
30842
|
+
}
|
|
30843
|
+
notifyChange({ origin, loading, error }) {
|
|
30844
|
+
var _a, _b;
|
|
30845
|
+
const collection = (_a = pullFromCache(this.cacheKey)) === null || _a === void 0 ? void 0 : _a.data;
|
|
30846
|
+
if (!collection)
|
|
30847
|
+
return;
|
|
30848
|
+
const data = ((_b = collection.data
|
|
30849
|
+
.map(id => pullFromCache(['post', 'get', id]))
|
|
30850
|
+
.filter(isNonNullable)
|
|
30851
|
+
.map(({ data }) => data)) !== null && _b !== void 0 ? _b : []).map(LinkedObject.post);
|
|
30852
|
+
if (!this.shouldNotify(data) && origin === 'event')
|
|
30853
|
+
return;
|
|
30854
|
+
this.callback({
|
|
30855
|
+
onNextPage: () => this.loadPage({ direction: "next" /* Amity.LiveCollectionPageDirection.NEXT */ }),
|
|
30856
|
+
data,
|
|
30857
|
+
hasNextPage: !!this.paginationController.getNextToken(),
|
|
30858
|
+
loading,
|
|
30859
|
+
error,
|
|
30860
|
+
});
|
|
30861
|
+
}
|
|
30862
|
+
}
|
|
30863
|
+
|
|
30864
|
+
/* begin_public_function
|
|
30865
|
+
id: feed.query.following_feed
|
|
30866
|
+
api_style: live_collection
|
|
30867
|
+
*/
|
|
30868
|
+
/**
|
|
30869
|
+
* ```js
|
|
30870
|
+
* import { FeedRepository, FollowingFeedSortByEnum } from '@amityco/ts-sdk'
|
|
30871
|
+
*
|
|
30872
|
+
* const unsub = FeedRepository.getFollowingFeed(
|
|
30873
|
+
* { sortBy: FollowingFeedSortByEnum.LastCreated, limit: 20 },
|
|
30874
|
+
* ({ data: posts, hasNextPage, onNextPage, loading, error }) => processResponse(posts),
|
|
30875
|
+
* )
|
|
30876
|
+
* ```
|
|
30877
|
+
*
|
|
30878
|
+
* Observe all mutations on a list of {@link Amity.Post} for the current user's following feed.
|
|
30879
|
+
* Which posts match is decided by the server, from the network's `social.globalFeed` setting:
|
|
30880
|
+
* - `lastCreated`: posts by the users the current user follows, plus the current user's own
|
|
30881
|
+
* posts, newest first.
|
|
30882
|
+
* - `customRanking` (the default): server-ranked posts by the current user, the users they
|
|
30883
|
+
* follow and the communities they joined.
|
|
30884
|
+
*
|
|
30885
|
+
* A new post, the current user's own included, is not added in real time: it appears
|
|
30886
|
+
* when the feed is next loaded from the first page (for example, a new subscription).
|
|
30887
|
+
* With `customRanking` the server may take up to 5 minutes to include it.
|
|
30888
|
+
* Deleted and declined posts are removed at once.
|
|
30889
|
+
*
|
|
30890
|
+
* When the network enforces module entitlement and the `feed` module is not entitled,
|
|
30891
|
+
* the request fails with `400325` (`ModuleNotEntitled`), reported through `error`.
|
|
30892
|
+
*
|
|
30893
|
+
* @param params.sortBy order of the feed. When omitted, the server default (`customRanking`) applies
|
|
30894
|
+
* @param params.limit page size of the first request (1 - 100)
|
|
30895
|
+
* @param callback the function to call when new data are available
|
|
30896
|
+
* @param config
|
|
30897
|
+
* @returns An {@link Amity.Unsubscriber} function to run when willing to stop observing the posts
|
|
30898
|
+
*
|
|
30899
|
+
* @category Posts Live Collection
|
|
30900
|
+
*/
|
|
30901
|
+
const getFollowingFeed = (params, callback, config) => {
|
|
30902
|
+
const { log, cache } = getActiveClient();
|
|
30903
|
+
if (!cache) {
|
|
30904
|
+
console.log(ENABLE_CACHE_MESSAGE);
|
|
30905
|
+
}
|
|
30906
|
+
const timestamp = Date.now();
|
|
30907
|
+
log(`getFollowingFeed(tmpid: ${timestamp}) > listen`);
|
|
30908
|
+
const liveCollection = new FollowingFeedLiveCollectionController(params, callback);
|
|
30909
|
+
const disposers = liveCollection.startSubscription();
|
|
30910
|
+
const cacheKey = liveCollection.getCacheKey();
|
|
30911
|
+
disposers.push(() => dropFromCache(cacheKey));
|
|
30912
|
+
return () => {
|
|
30913
|
+
log(`getFollowingFeed(tmpid: ${timestamp}) > dispose`);
|
|
30914
|
+
disposers.forEach(fn => fn());
|
|
30915
|
+
};
|
|
30916
|
+
};
|
|
30917
|
+
/* end_public_function */
|
|
30918
|
+
|
|
30484
30919
|
var index$e = /*#__PURE__*/Object.freeze({
|
|
30485
30920
|
__proto__: null,
|
|
30486
30921
|
queryGlobalFeed: queryGlobalFeed,
|
|
@@ -30489,6 +30924,7 @@ var index$e = /*#__PURE__*/Object.freeze({
|
|
|
30489
30924
|
getUserFeed: getUserFeed,
|
|
30490
30925
|
getCommunityFeed: getCommunityFeed,
|
|
30491
30926
|
getForYouFeed: getForYouFeed,
|
|
30927
|
+
getFollowingFeed: getFollowingFeed,
|
|
30492
30928
|
AmityForYouFeedDisabledError: AmityForYouFeedDisabledError
|
|
30493
30929
|
});
|
|
30494
30930
|
|
|
@@ -38407,4 +38843,4 @@ const getContentFlagReasons = () => Object.values(ContentFlagReasonEnum);
|
|
|
38407
38843
|
const getContentFlagReasonKey = (reason) => CONTENT_FLAG_REASON_KEYS[reason];
|
|
38408
38844
|
/* end_public_function */
|
|
38409
38845
|
|
|
38410
|
-
export { API_REGIONS, index$6 as AdRepository, AmityAttachmentProductTags, AmityAutoSubscription, AmityChannelNotificationModeEnum, AmityCommunityType, ContentFlagReasonEnum as AmityContentFlagReasonType, AmityEventOrderOption, AmityEventOriginType, AmityEventResponseStatus, AmityEventSortOption, AmityEventStatus, AmityEventType, AmityLiveViewerCountMode, AmityModuleNotEntitledError, AmitySharableContentType, AnalyticsSourceTypeEnum, index$g as CategoryRepository, index$k as ChannelRepository, index$t as Client, index$f as CommentRepository, CommunityNotificationEventNameEnum, CommunityPostSettingMaps, CommunityPostSettings, index$h as CommunityRepository, ContentFeedType, ContentFlagReasonEnum, index as CuratedContentRepository, DefaultCommunityPostSetting, index$2 as EventRepository, FeedDataTypeEnum, index$e as FeedRepository, FeedSortByEnum, FeedSourceEnum, FeedTypeEnum, FileAccessTypeEnum, index$q as FileRepository, FileType, GET_WATCHER_URLS, index$4 as InvitationRepository, InvitationSortByEnum, InvitationStatusEnum, InvitationTargetTypeEnum, InvitationTypeEnum, JoinRequestStatusEnum, JoinResultStatusEnum, index$3 as LiveReactionRepository, index$8 as LiveStreamPlayer, MembershipAcceptanceTypeEnum, MessageContentType, index$o as MessageRepository, NotificationRolesFilterTypeEnum, NotificationSettingsLevelEnum, index$9 as PollRepository, PostContentType, index$c as PostRepository, PostStructureType, index$1 as ProductRepository, index$p as ReactionRepository, index$a as RoomPresenceRepository, index$d as RoomRepository, SearchUsersByEnum, index$7 as StoryRepository, index$b as StreamRepository, index$n as SubChannelRepository, SubscriptionLevels, UserNotificationModuleNameEnum, UserProfileFieldEnum, UserReportTypeEnum, UserReportTypeFilterEnum, index$r as UserRepository, UserTypeEnum, VERSION, VideoResolution, VideoSize, VideoTranscodingStatus, backupCache, createQuery, createReport, createUserToken, deleteReport, disableCache, dropFromCache, enableCache, exceedsUntilAtBoundary, filterByChannelMembership, filterByCommunityMembership, filterByFeedType, filterByPostDataTypes, filterByPropEquality, filterByPropInclusion, filterByPropIntersection, filterBySearchTerm, filterByStringComparePartially, filterByUntilAt, filterCommentsByBlockUsers, filterPostsByBlockUsers, getBlockUsersId, getChannelTopic, getCommentTopic, getCommunityStoriesTopic, getCommunityTopic, getContentFlagReasonKey, getContentFlagReasons, getLiveReactionTopic, getLiveStreamTopic, getMarkedMessageTopic, getMarkerUserFeedTopic, getMessageTopic, getMyFollowersTopic, getMyFollowingsTopic, getNetworkId, getNetworkTopic, getPostTopic, getRole, getRoomStreamerTopic, getRoomWatcherTopic, getSmartFeedChannelTopic, getSmartFeedMessageTopic, getSmartFeedSubChannelTopic, getStoryTopic, getSubChannelTopic, getUserTopic, isAfterBefore, isAfterBeforeRaw, isCachable, isFetcher, isFresh, isLocal, isMutator, isOffline, isPaged, isReportedByMe, isSkip, mergeInCache, index$5 as notificationTray, onChannelMarkerFetched, onFeedMarkerFetched, onFeedMarkerUpdated, onMessageMarked, onMessageMarkerFetched, onSubChannelMarkerFetched, onSubChannelMarkerUpdated, onUserMarkerFetched, onUserMarkerFetchedLegacy, pullFromCache, pushToCache, queryCache, queryOptions, queryRoles, resolveModuleAvailability, restoreCache, runQuery, sortByChannelSegment, sortByDisplayName, sortByFirstCreated, sortByFirstUpdated, sortByLastActivity, sortByLastCreated, sortByLastMessage, sortByLastUpdated, sortByLocalSortingDate, sortByName, sortBySegmentNumber, subscribeTopic, toPage, toPageRaw, toToken, upsertInCache, validateUntilAt, wipeCache };
|
|
38846
|
+
export { API_REGIONS, index$6 as AdRepository, AmityAttachmentProductTags, AmityAutoSubscription, AmityChannelNotificationModeEnum, AmityCommunityType, ContentFlagReasonEnum as AmityContentFlagReasonType, AmityEventOrderOption, AmityEventOriginType, AmityEventResponseStatus, AmityEventSortOption, AmityEventStatus, AmityEventType, AmityLiveViewerCountMode, AmityModuleNotEntitledError, AmitySharableContentType, AnalyticsSourceTypeEnum, index$g as CategoryRepository, index$k as ChannelRepository, index$t as Client, index$f as CommentRepository, CommunityNotificationEventNameEnum, CommunityPostSettingMaps, CommunityPostSettings, index$h as CommunityRepository, ContentFeedType, ContentFlagReasonEnum, index as CuratedContentRepository, DefaultCommunityPostSetting, index$2 as EventRepository, FeedDataTypeEnum, index$e as FeedRepository, FeedSortByEnum, FeedSourceEnum, FeedTypeEnum, FileAccessTypeEnum, index$q as FileRepository, FileType, FollowingFeedSortByEnum, GET_WATCHER_URLS, index$4 as InvitationRepository, InvitationSortByEnum, InvitationStatusEnum, InvitationTargetTypeEnum, InvitationTypeEnum, JoinRequestStatusEnum, JoinResultStatusEnum, index$3 as LiveReactionRepository, index$8 as LiveStreamPlayer, MembershipAcceptanceTypeEnum, MessageContentType, index$o as MessageRepository, NotificationRolesFilterTypeEnum, NotificationSettingsLevelEnum, index$9 as PollRepository, PostContentType, index$c as PostRepository, PostStructureType, index$1 as ProductRepository, index$p as ReactionRepository, index$a as RoomPresenceRepository, index$d as RoomRepository, SearchUsersByEnum, index$7 as StoryRepository, index$b as StreamRepository, index$n as SubChannelRepository, SubscriptionLevels, UserNotificationModuleNameEnum, UserProfileFieldEnum, UserReportTypeEnum, UserReportTypeFilterEnum, index$r as UserRepository, UserTypeEnum, VERSION, VideoResolution, VideoSize, VideoTranscodingStatus, backupCache, createQuery, createReport, createUserToken, deleteReport, disableCache, dropFromCache, enableCache, exceedsUntilAtBoundary, filterByChannelMembership, filterByCommunityMembership, filterByFeedType, filterByPostDataTypes, filterByPropEquality, filterByPropInclusion, filterByPropIntersection, filterBySearchTerm, filterByStringComparePartially, filterByUntilAt, filterCommentsByBlockUsers, filterPostsByBlockUsers, getBlockUsersId, getChannelTopic, getCommentTopic, getCommunityStoriesTopic, getCommunityTopic, getContentFlagReasonKey, getContentFlagReasons, getLiveReactionTopic, getLiveStreamTopic, getMarkedMessageTopic, getMarkerUserFeedTopic, getMessageTopic, getMyFollowersTopic, getMyFollowingsTopic, getNetworkId, getNetworkTopic, getPostTopic, getRole, getRoomStreamerTopic, getRoomWatcherTopic, getSmartFeedChannelTopic, getSmartFeedMessageTopic, getSmartFeedSubChannelTopic, getStoryTopic, getSubChannelTopic, getUserTopic, isAfterBefore, isAfterBeforeRaw, isCachable, isFetcher, isFresh, isLocal, isMutator, isOffline, isPaged, isReportedByMe, isSkip, mergeInCache, index$5 as notificationTray, onChannelMarkerFetched, onFeedMarkerFetched, onFeedMarkerUpdated, onMessageMarked, onMessageMarkerFetched, onSubChannelMarkerFetched, onSubChannelMarkerUpdated, onUserMarkerFetched, onUserMarkerFetchedLegacy, pullFromCache, pushToCache, queryCache, queryOptions, queryRoles, resolveModuleAvailability, restoreCache, runQuery, sortByChannelSegment, sortByDisplayName, sortByFirstCreated, sortByFirstUpdated, sortByLastActivity, sortByLastCreated, sortByLastMessage, sortByLastUpdated, sortByLocalSortingDate, sortByName, sortBySegmentNumber, subscribeTopic, toPage, toPageRaw, toToken, upsertInCache, validateUntilAt, wipeCache };
|