@amityco/ts-sdk 7.33.2-b0138d77.0 → 7.33.2-b8d561be.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.
Files changed (26) hide show
  1. package/dist/@types/domains/feed.d.ts +0 -14
  2. package/dist/@types/domains/feed.d.ts.map +1 -1
  3. package/dist/@types/domains/notification.d.ts +5 -1
  4. package/dist/@types/domains/notification.d.ts.map +1 -1
  5. package/dist/feedRepository/index.d.ts +1 -1
  6. package/dist/feedRepository/index.d.ts.map +1 -1
  7. package/dist/feedRepository/observers/index.d.ts +0 -1
  8. package/dist/feedRepository/observers/index.d.ts.map +1 -1
  9. package/dist/index.cjs.js +0 -193
  10. package/dist/index.esm.js +1 -194
  11. package/dist/index.umd.js +2 -2
  12. package/dist/utils/constants.d.ts +0 -1
  13. package/dist/utils/constants.d.ts.map +1 -1
  14. package/package.json +1 -1
  15. package/dist/feedRepository/observers/getFollowingFeed/LiveCollectionController.d.ts +0 -13
  16. package/dist/feedRepository/observers/getFollowingFeed/LiveCollectionController.d.ts.map +0 -1
  17. package/dist/feedRepository/observers/getFollowingFeed/PaginationController.d.ts +0 -10
  18. package/dist/feedRepository/observers/getFollowingFeed/PaginationController.d.ts.map +0 -1
  19. package/dist/feedRepository/observers/getFollowingFeed/QueryStreamController.d.ts +0 -22
  20. package/dist/feedRepository/observers/getFollowingFeed/QueryStreamController.d.ts.map +0 -1
  21. package/dist/feedRepository/observers/getFollowingFeed.d.ts +0 -35
  22. package/dist/feedRepository/observers/getFollowingFeed.d.ts.map +0 -1
  23. package/dist/feedRepository/observers/tests/integration/getFollowingFeed.integration.test.d.ts +0 -2
  24. package/dist/feedRepository/observers/tests/integration/getFollowingFeed.integration.test.d.ts.map +0 -1
  25. package/dist/feedRepository/observers/tests/unit/FollowingFeedQueryStreamController.test.d.ts +0 -2
  26. package/dist/feedRepository/observers/tests/unit/FollowingFeedQueryStreamController.test.d.ts.map +0 -1
@@ -16,13 +16,6 @@ export declare const enum FeedSortByEnum {
16
16
  LastUpdated = "lastUpdated",
17
17
  FirstUpdated = "firstUpdated"
18
18
  }
19
- /** Sort order of the following feed (`GET /api/v1/me/following-feeds`). */
20
- export declare const enum FollowingFeedSortByEnum {
21
- /** Server-ranked. The backend default when `sortBy` is not sent. */
22
- CustomRanking = "customRanking",
23
- /** Newest first. */
24
- LastCreated = "lastCreated"
25
- }
26
19
  export declare const enum FeedSourceEnum {
27
20
  Community = "community",
28
21
  User = "user"
@@ -36,7 +29,6 @@ declare global {
36
29
  namespace Amity {
37
30
  type FeedDataType = FeedDataTypeEnum;
38
31
  type FeedSortBy = FeedSortByEnum;
39
- type FollowingFeedSortBy = FollowingFeedSortByEnum;
40
32
  type FeedSource = FeedSourceEnum;
41
33
  type Feed = {
42
34
  feedId: string;
@@ -71,12 +63,6 @@ declare global {
71
63
  type GlobalFeedLiveCollectionCache = Amity.LiveCollectionCache<Amity.InternalPost['postId'], QueryGlobalFeed>;
72
64
  type ForYouFeedLiveCollection = Amity.LiveCollectionParams<Record<string, never>>;
73
65
  type ForYouFeedLiveCollectionCache = Amity.LiveCollectionCache<Amity.InternalPost['postId'], Record<string, never>>;
74
- type QueryFollowingFeed = {
75
- /** Left off the request when unset, so the server default (`customRanking`) applies. */
76
- sortBy?: Amity.FollowingFeedSortBy;
77
- };
78
- type FollowingFeedLiveCollection = Amity.LiveCollectionParams<QueryFollowingFeed>;
79
- type FollowingFeedLiveCollectionCache = Amity.LiveCollectionCache<Amity.InternalPost['postId'], QueryFollowingFeed>;
80
66
  type QueryUserFeed = {
81
67
  userId: string;
82
68
  includeDeleted?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"feed.d.ts","sourceRoot":"","sources":["../../../src/@types/domains/feed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC;AAEV,0BAAkB,gBAAgB;IAChC,IAAI,SAAS;IACb,KAAK,UAAU;IACf,KAAK,UAAU;IACf,IAAI,SAAS;IACb,KAAK,UA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,mBAAmB,CAC/D,KAAK,CAAC,YAAY,CAAC,QAAQ,CAAC,EAC5B,kBAAkB,CACnB,CAAC;KACH;CACF"}
@@ -9,6 +9,7 @@ declare global {
9
9
  POST_REACT = "reaction_on_post",
10
10
  COMMENT_REACT = "reaction_on_comment",
11
11
  REPLY_REACT = "reaction_on_reply",
12
+ POLL_REACT = "reaction_on_poll",
12
13
  RESPONSE_JOIN_REQUEST = "respond_on_join_request",
13
14
  FOLLOW_USER = "follow",
14
15
  EVENT_REMINDER = "event_reminder",
@@ -25,7 +26,10 @@ declare global {
25
26
  MENTION = "mention",
26
27
  REPLY = "reply",
27
28
  JOIN_REQUEST = "join_request",
28
- USER = "user"
29
+ USER = "user",
30
+ FOLLOW = "follow",
31
+ EVENT = "event",
32
+ INVITATION = "invitation"
29
33
  }
30
34
  type RawNotificationTrayItem = {
31
35
  _id: string;
@@ -1 +1 @@
1
- {"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../../src/@types/domains/notification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC;AAEV,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,KAAK,CAAC;QACd,WAAW,oBAAoB;YAC7B,YAAY,oBAAoB;YAChC,eAAe,uBAAuB;YACtC,aAAa,qBAAqB;YAClC,YAAY,oBAAoB;YAChC,UAAU,qBAAqB;YAC/B,aAAa,wBAAwB;YACrC,WAAW,sBAAsB;YACjC,qBAAqB,4BAA4B;YACjD,WAAW,WAAW;YACtB,cAAc,mBAAmB;YACjC,aAAa,kBAAkB;YAC/B,aAAa,kBAAkB;YAC/B,kBAAkB,uBAAuB;YACzC,kBAAkB,uBAAuB;SAC1C;QAED,WAAW,UAAU;YACnB,IAAI,SAAS;YACb,IAAI,SAAS;YACb,OAAO,YAAY;YACnB,QAAQ,aAAa;YACrB,OAAO,YAAY;YACnB,KAAK,UAAU;YACf,YAAY,iBAAiB;YAC7B,IAAI,SAAS;SACd;QAED,KAAK,uBAAuB,GAAG;YAC7B,G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}
@@ -1,4 +1,4 @@
1
1
  export { queryGlobalFeed } from './api';
2
- export { getCustomRankingGlobalFeed, getGlobalFeed, getUserFeed, getCommunityFeed, getForYouFeed, getFollowingFeed, } from './observers';
2
+ export { getCustomRankingGlobalFeed, getGlobalFeed, getUserFeed, getCommunityFeed, getForYouFeed, } from './observers';
3
3
  export { AmityForYouFeedDisabledError } from './errors/AmityForYouFeedDisabledError';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/feedRepository/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EACL,0BAA0B,EAC1B,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/feedRepository/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EACL,0BAA0B,EAC1B,aAAa,EACb,WAAW,EACX,gBAAgB,EAChB,aAAa,GACd,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,4BAA4B,EAAE,MAAM,uCAAuC,CAAC"}
@@ -3,5 +3,4 @@ export { getGlobalFeed } from './getGlobalFeed';
3
3
  export { getUserFeed } from './getUserFeed';
4
4
  export { getCommunityFeed } from './getCommunityFeed';
5
5
  export { getForYouFeed } from './getForYouFeed';
6
- export { getFollowingFeed } from './getFollowingFeed';
7
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feedRepository/observers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/feedRepository/observers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC"}
package/dist/index.cjs.js CHANGED
@@ -262,14 +262,6 @@ exports.FeedSortByEnum = void 0;
262
262
  FeedSortByEnum["LastUpdated"] = "lastUpdated";
263
263
  FeedSortByEnum["FirstUpdated"] = "firstUpdated";
264
264
  })(exports.FeedSortByEnum || (exports.FeedSortByEnum = {}));
265
- /** Sort order of the following feed (`GET /api/v1/me/following-feeds`). */
266
- exports.FollowingFeedSortByEnum = void 0;
267
- (function (FollowingFeedSortByEnum) {
268
- /** Server-ranked. The backend default when `sortBy` is not sent. */
269
- FollowingFeedSortByEnum["CustomRanking"] = "customRanking";
270
- /** Newest first. */
271
- FollowingFeedSortByEnum["LastCreated"] = "lastCreated";
272
- })(exports.FollowingFeedSortByEnum || (exports.FollowingFeedSortByEnum = {}));
273
265
  exports.FeedSourceEnum = void 0;
274
266
  (function (FeedSourceEnum) {
275
267
  FeedSourceEnum["Community"] = "community";
@@ -398,7 +390,6 @@ const YEAR = 365 * DAY;
398
390
  const ACCESS_TOKEN_WATCHER_INTERVAL = 10 * MINUTE;
399
391
  const API_ENDPOINTS = {
400
392
  forYouFeed: '/api/v1/feeds/for-you',
401
- followingFeed: '/api/v1/me/following-feeds',
402
393
  commentReviewQueue: (communityId) => `/api/v3/communities/${encodeURIComponent(communityId)}/comments/review-queue`,
403
394
  };
404
395
  // The review-queue route defaults to 10, not the SDK-wide page size, and caps at 100
@@ -30733,189 +30724,6 @@ const getForYouFeed = (callback) => {
30733
30724
  };
30734
30725
  /* end_public_function */
30735
30726
 
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__default["default"](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
-
30919
30727
  var index$e = /*#__PURE__*/Object.freeze({
30920
30728
  __proto__: null,
30921
30729
  queryGlobalFeed: queryGlobalFeed,
@@ -30924,7 +30732,6 @@ var index$e = /*#__PURE__*/Object.freeze({
30924
30732
  getUserFeed: getUserFeed,
30925
30733
  getCommunityFeed: getCommunityFeed,
30926
30734
  getForYouFeed: getForYouFeed,
30927
- getFollowingFeed: getFollowingFeed,
30928
30735
  AmityForYouFeedDisabledError: AmityForYouFeedDisabledError
30929
30736
  });
30930
30737
 
package/dist/index.esm.js CHANGED
@@ -246,14 +246,6 @@ 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 = {}));
257
249
  var FeedSourceEnum;
258
250
  (function (FeedSourceEnum) {
259
251
  FeedSourceEnum["Community"] = "community";
@@ -382,7 +374,6 @@ const YEAR = 365 * DAY;
382
374
  const ACCESS_TOKEN_WATCHER_INTERVAL = 10 * MINUTE;
383
375
  const API_ENDPOINTS = {
384
376
  forYouFeed: '/api/v1/feeds/for-you',
385
- followingFeed: '/api/v1/me/following-feeds',
386
377
  commentReviewQueue: (communityId) => `/api/v3/communities/${encodeURIComponent(communityId)}/comments/review-queue`,
387
378
  };
388
379
  // The review-queue route defaults to 10, not the SDK-wide page size, and caps at 100
@@ -30733,189 +30724,6 @@ const getForYouFeed = (callback) => {
30733
30724
  };
30734
30725
  /* end_public_function */
30735
30726
 
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
-
30919
30727
  var index$e = /*#__PURE__*/Object.freeze({
30920
30728
  __proto__: null,
30921
30729
  queryGlobalFeed: queryGlobalFeed,
@@ -30924,7 +30732,6 @@ var index$e = /*#__PURE__*/Object.freeze({
30924
30732
  getUserFeed: getUserFeed,
30925
30733
  getCommunityFeed: getCommunityFeed,
30926
30734
  getForYouFeed: getForYouFeed,
30927
- getFollowingFeed: getFollowingFeed,
30928
30735
  AmityForYouFeedDisabledError: AmityForYouFeedDisabledError
30929
30736
  });
30930
30737
 
@@ -38843,4 +38650,4 @@ const getContentFlagReasons = () => Object.values(ContentFlagReasonEnum);
38843
38650
  const getContentFlagReasonKey = (reason) => CONTENT_FLAG_REASON_KEYS[reason];
38844
38651
  /* end_public_function */
38845
38652
 
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 };
38653
+ 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 };