@amityco/ts-sdk 7.22.1-fa4a2e0.0 → 7.23.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 (51) hide show
  1. package/dist/@types/core/errors.d.ts +2 -1
  2. package/dist/@types/core/errors.d.ts.map +1 -1
  3. package/dist/@types/core/payload.d.ts +0 -1
  4. package/dist/@types/core/payload.d.ts.map +1 -1
  5. package/dist/@types/domains/channel.d.ts +11 -0
  6. package/dist/@types/domains/channel.d.ts.map +1 -1
  7. package/dist/@types/domains/client.d.ts +6 -0
  8. package/dist/@types/domains/client.d.ts.map +1 -1
  9. package/dist/channelRepository/observers/index.d.ts +1 -0
  10. package/dist/channelRepository/observers/index.d.ts.map +1 -1
  11. package/dist/channelRepository/observers/searchChannels/SearchChannelLiveCollectionController.d.ts +14 -0
  12. package/dist/channelRepository/observers/searchChannels/SearchChannelLiveCollectionController.d.ts.map +1 -0
  13. package/dist/channelRepository/observers/searchChannels/SearchChannelPaginationController.d.ts +10 -0
  14. package/dist/channelRepository/observers/searchChannels/SearchChannelPaginationController.d.ts.map +1 -0
  15. package/dist/channelRepository/observers/searchChannels/SearchChannelQueryStreamController.d.ts +13 -0
  16. package/dist/channelRepository/observers/searchChannels/SearchChannelQueryStreamController.d.ts.map +1 -0
  17. package/dist/channelRepository/observers/searchChannels.d.ts +21 -0
  18. package/dist/channelRepository/observers/searchChannels.d.ts.map +1 -0
  19. package/dist/channelRepository/observers/tests/integrations/searchChannels.integration.test.d.ts +2 -0
  20. package/dist/channelRepository/observers/tests/integrations/searchChannels.integration.test.d.ts.map +1 -0
  21. package/dist/client/api/createClient.d.ts.map +1 -1
  22. package/dist/client/api/getForYouFeedSetting.d.ts +17 -0
  23. package/dist/client/api/getForYouFeedSetting.d.ts.map +1 -0
  24. package/dist/client/api/index.d.ts +1 -0
  25. package/dist/client/api/index.d.ts.map +1 -1
  26. package/dist/client/api/setupLoginSubscriptions.d.ts.map +1 -1
  27. package/dist/feedRepository/observers/getForYouFeed/CursorController.d.ts +2 -0
  28. package/dist/feedRepository/observers/getForYouFeed/CursorController.d.ts.map +1 -1
  29. package/dist/feedRepository/observers/getForYouFeed/PaginationController.d.ts +5 -4
  30. package/dist/feedRepository/observers/getForYouFeed/PaginationController.d.ts.map +1 -1
  31. package/dist/index.cjs.js +829 -197
  32. package/dist/index.esm.js +822 -190
  33. package/dist/index.umd.js +2 -2
  34. package/dist/userRepository/api/getAllBlockedUsers.d.ts.map +1 -1
  35. package/dist/userRepository/api/getAllBlockingUsers.d.ts +20 -0
  36. package/dist/userRepository/api/getAllBlockingUsers.d.ts.map +1 -0
  37. package/dist/userRepository/api/index.d.ts +1 -0
  38. package/dist/userRepository/api/index.d.ts.map +1 -1
  39. package/dist/userRepository/api/tests/integration/getAllBlockingUsers.integration.test.d.ts +2 -0
  40. package/dist/userRepository/api/tests/integration/getAllBlockingUsers.integration.test.d.ts.map +1 -0
  41. package/dist/userRepository/relationship/block/utils/blockRealtimeOnLoginHandler.d.ts +12 -0
  42. package/dist/userRepository/relationship/block/utils/blockRealtimeOnLoginHandler.d.ts.map +1 -0
  43. package/dist/userRepository/services/BlockedUserSyncEngine/blockedUserSyncEngine.d.ts +13 -13
  44. package/dist/userRepository/services/BlockedUserSyncEngine/blockedUserSyncEngine.d.ts.map +1 -1
  45. package/dist/userRepository/services/BlockingUserSyncEngine/blockingUserSyncEngine.d.ts +56 -0
  46. package/dist/userRepository/services/BlockingUserSyncEngine/blockingUserSyncEngine.d.ts.map +1 -0
  47. package/dist/userRepository/services/BlockingUserSyncEngine/blockingUserSyncEngineOnLoginHandler.d.ts +3 -0
  48. package/dist/userRepository/services/BlockingUserSyncEngine/blockingUserSyncEngineOnLoginHandler.d.ts.map +1 -0
  49. package/dist/utils/tests/dummy/block.d.ts +16 -0
  50. package/dist/utils/tests/dummy/block.d.ts.map +1 -1
  51. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"getAllBlockedUsers.d.ts","sourceRoot":"","sources":["../../../src/userRepository/api/getAllBlockedUsers.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,kBAAkB,QAAa,QAAQ,MAAM,IAAI,EAAE,CAW/D,CAAC"}
1
+ {"version":3,"file":"getAllBlockedUsers.d.ts","sourceRoot":"","sources":["../../../src/userRepository/api/getAllBlockedUsers.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,kBAAkB,QAAa,QAAQ,MAAM,IAAI,EAAE,CAU/D,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * ```js
3
+ * import { UserRepository } from '@amityco/ts-sdk'
4
+ * const blockingUsers = await UserRepository.getAllBlockingUsers()
5
+ * ```
6
+ *
7
+ * Returns all users who have blocked the current user
8
+ * non-paginated list (limit 100) with TTL-based caching (5-minute window). Within the
9
+ * TTL window, subsequent calls resolve instantly from the local store without any
10
+ * server call. After the TTL expires, the next call triggers a fresh server fetch.
11
+ *
12
+ * The directional inverse of {@link getAllBlockedUsers}.
13
+ *
14
+ * @returns A promise that resolves to an array of blocking {@link Amity.User} objects
15
+ *
16
+ * @category Block API
17
+ * @async
18
+ */
19
+ export declare const getAllBlockingUsers: () => Promise<Amity.User[]>;
20
+ //# sourceMappingURL=getAllBlockingUsers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAllBlockingUsers.d.ts","sourceRoot":"","sources":["../../../src/userRepository/api/getAllBlockingUsers.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,mBAAmB,QAAa,QAAQ,MAAM,IAAI,EAAE,CAWhE,CAAC"}
@@ -4,4 +4,5 @@ export { flagUser } from './flagUser';
4
4
  export { unflagUser } from './unflagUser';
5
5
  export { isUserFlaggedByMe } from './isUserFlaggedByMe';
6
6
  export { getAllBlockedUsers } from './getAllBlockedUsers';
7
+ export { getAllBlockingUsers } from './getAllBlockingUsers';
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/userRepository/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/userRepository/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=getAllBlockingUsers.integration.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAllBlockingUsers.integration.test.d.ts","sourceRoot":"","sources":["../../../../../src/userRepository/api/tests/integration/getAllBlockingUsers.integration.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Keeps the follow cache current for incoming/outgoing block changes for the
3
+ * whole session — the ingest happens as a side effect inside
4
+ * createBlockEventSubscriber, so the one-shot `getAllBlockedUsers()` /
5
+ * `getAllBlockingUsers()` reflect RTE block/unblock within the TTL window.
6
+ *
7
+ * Registered via `setupLoginSubscriptions`; the returned unsubscriber is torn
8
+ * down on logout.
9
+ */
10
+ declare const _default: () => Amity.Unsubscriber;
11
+ export default _default;
12
+ //# sourceMappingURL=blockRealtimeOnLoginHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blockRealtimeOnLoginHandler.d.ts","sourceRoot":"","sources":["../../../../../src/userRepository/relationship/block/utils/blockRealtimeOnLoginHandler.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;8BACgB,MAAM,YAAY;AAArC,wBAGE"}
@@ -4,19 +4,18 @@
4
4
  * `getAllBlockedUsers()` API.
5
5
  *
6
6
  * Key behaviours:
7
- * - `establish()` is a no-op — fetch is lazy, triggered only by consumer call
8
- * - `destroy()` resets `lastFetchedAt` to null (ensures fresh fetch on next session)
7
+ * - `onSessionEstablished()` is a no-op — fetch is lazy, triggered only by consumer call
8
+ * - `onSessionDestroyed()` resets `lastFetchedAt` to null (ensures fresh fetch on next session)
9
9
  * - `ensureFetched()` fetches from server only when cache is expired or never fetched
10
10
  * - `lastFetchedAt` is only updated on successful fetch
11
- * - `blockedUserIds` is kept in sync with each successful fetch
11
+ * - reads query the follow cache live, so block/unblock changes are reflected
12
+ * even within the TTL window
12
13
  *
13
14
  * @internal
14
15
  */
15
16
  declare class BlockedUserSyncEngine {
16
17
  /** Epoch ms of last successful fetch. null = never fetched in this session. */
17
18
  private lastFetchedAt;
18
- /** Ordered list of userId strings from the most recent successful fetch. */
19
- private blockedUserIds;
20
19
  /** No-op — fetch is lazy, triggered by consumer calling getAllBlockedUsers(). */
21
20
  onSessionEstablished(): void;
22
21
  /** Resets state so the next session starts with a cold cache. */
@@ -37,16 +36,17 @@ declare class BlockedUserSyncEngine {
37
36
  */
38
37
  ensureFetched(): Promise<void>;
39
38
  /**
40
- * Returns blocked {@link Amity.InternalUser} objects from the in-memory cache.
39
+ * Returns the blocked users by querying the follow cache live — the outgoing
40
+ * direction (`from === me`, `status === 'blocked'`). Reading the cache (not a
41
+ * fetched snapshot) means `blockUser()` / `unblockUser()` changes are reflected
42
+ * even within the TTL window.
41
43
  *
42
- * Applies the spec-mandated filter:
43
- * - Only users whose `isDeleted` is false or null
44
- * - Hard limit of 100 results
45
- *
46
- * This always reads the latest local state, so changes made by `blockUser()`
47
- * and `unblockUser()` are reflected even within the TTL window.
44
+ * Applies the spec-mandated query:
45
+ * - filter `from === currentUserId`, `status === 'blocked'`, blocked user not deleted
46
+ * - sort by `updatedAt` DESC
47
+ * - hard limit of 100 results
48
48
  */
49
- getCachedUsers(): Amity.InternalUser[];
49
+ getCachedUsers(): Amity.User[];
50
50
  }
51
51
  declare const _default: {
52
52
  getInstance: () => BlockedUserSyncEngine;
@@ -1 +1 @@
1
- {"version":3,"file":"blockedUserSyncEngine.d.ts","sourceRoot":"","sources":["../../../../src/userRepository/services/BlockedUserSyncEngine/blockedUserSyncEngine.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;GAaG;AACH,cAAM,qBAAqB;IACzB,+EAA+E;IAC/E,OAAO,CAAC,aAAa,CAAuB;IAE5C,4EAA4E;IAC5E,OAAO,CAAC,cAAc,CAAgB;IAMtC,iFAAiF;IAEjF,oBAAoB,IAAI,IAAI;IAI5B,iEAAiE;IACjE,kBAAkB,IAAI,IAAI;IAK1B,6BAA6B;IAE7B,cAAc,IAAI,IAAI;IAQtB,OAAO,CAAC,cAAc;IAStB;;;;;;;;;;OAUG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IA6BpC;;;;;;;;;OASG;IACH,cAAc,IAAI,KAAK,CAAC,YAAY,EAAE;CAYvC;;uBASkB,qBAAqB;;AADxC,wBAKE"}
1
+ {"version":3,"file":"blockedUserSyncEngine.d.ts","sourceRoot":"","sources":["../../../../src/userRepository/services/BlockedUserSyncEngine/blockedUserSyncEngine.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;GAcG;AACH,cAAM,qBAAqB;IACzB,+EAA+E;IAC/E,OAAO,CAAC,aAAa,CAAuB;IAE5C,iFAAiF;IAEjF,oBAAoB,IAAI,IAAI;IAI5B,iEAAiE;IACjE,kBAAkB,IAAI,IAAI;IAI1B,6BAA6B;IAE7B,cAAc,IAAI,IAAI;IAItB,OAAO,CAAC,cAAc;IAKtB;;;;;;;;;;OAUG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAsBpC;;;;;;;;;;OAUG;IAEH,cAAc,IAAI,KAAK,CAAC,IAAI,EAAE;CAe/B;;uBAKkB,qBAAqB;;AADxC,wBAKE"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Session-scoped singleton engine that manages TTL-based fetching and caching
3
+ * of blocking users (the "blocked-by" list — users who blocked the current
4
+ * user). Provides a lazy `ensureFetched()` gate for the `getAllBlockingUsers()`
5
+ * API. Directional inverse of {@link BlockedUserSyncEngine}.
6
+ *
7
+ * Key behaviours:
8
+ * - `onSessionEstablished()` is a no-op — fetch is lazy, triggered only by consumer call
9
+ * - `onSessionDestroyed()` resets `lastFetchedAt` to null (ensures fresh fetch on next session)
10
+ * - `ensureFetched()` fetches from server only when cache is expired or never fetched
11
+ * - `lastFetchedAt` is only updated on successful fetch
12
+ * - reads query the follow cache live, so block/unblock changes are reflected
13
+ * even within the TTL window
14
+ *
15
+ * @internal
16
+ */
17
+ declare class BlockingUserSyncEngine {
18
+ /** Epoch ms of last successful fetch. null = never fetched in this session. */
19
+ private lastFetchedAt;
20
+ /** No-op — fetch is lazy, triggered by consumer calling getAllBlockingUsers(). */
21
+ onSessionEstablished(): void;
22
+ /** Resets state so the next session starts with a cold cache. */
23
+ onSessionDestroyed(): void;
24
+ /** No-op for this engine. */
25
+ onTokenExpired(): void;
26
+ private isCacheExpired;
27
+ /**
28
+ * Ensures the local store is populated with fresh blocking-user data.
29
+ *
30
+ * - If the cache is still within the 5-minute TTL window: resolves immediately
31
+ * (no server call).
32
+ * - If the cache is expired (or never fetched): fetches from the server,
33
+ * persists the payload to the cache, and updates `lastFetchedAt`.
34
+ *
35
+ * On failure the error propagates to the caller and `lastFetchedAt` is NOT
36
+ * updated, so the next call will retry.
37
+ */
38
+ ensureFetched(): Promise<void>;
39
+ /**
40
+ * Returns the "blocked-by" users by querying the follow cache live — the
41
+ * incoming direction (`to === me`, `status === 'blocked'`). Reading the cache
42
+ * (not a fetched snapshot) means RTE `user.didBlock` / `user.didUnblock`
43
+ * changes are reflected even within the TTL window.
44
+ *
45
+ * Applies the spec-mandated query (REQ-012/013/014):
46
+ * - filter `to === currentUserId`, `status === 'blocked'`, blocker not deleted
47
+ * - sort by `updatedAt` DESC
48
+ * - hard limit of 100 results
49
+ */
50
+ getCachedUsers(): Amity.User[];
51
+ }
52
+ declare const _default: {
53
+ getInstance: () => BlockingUserSyncEngine;
54
+ };
55
+ export default _default;
56
+ //# sourceMappingURL=blockingUserSyncEngine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blockingUserSyncEngine.d.ts","sourceRoot":"","sources":["../../../../src/userRepository/services/BlockingUserSyncEngine/blockingUserSyncEngine.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;GAeG;AACH,cAAM,sBAAsB;IAC1B,+EAA+E;IAC/E,OAAO,CAAC,aAAa,CAAuB;IAE5C,kFAAkF;IAElF,oBAAoB,IAAI,IAAI;IAI5B,iEAAiE;IACjE,kBAAkB,IAAI,IAAI;IAI1B,6BAA6B;IAE7B,cAAc,IAAI,IAAI;IAItB,OAAO,CAAC,cAAc;IAKtB;;;;;;;;;;OAUG;IACG,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAsBpC;;;;;;;;;;OAUG;IAEH,cAAc,IAAI,KAAK,CAAC,IAAI,EAAE;CAe/B;;uBAKkB,sBAAsB;;AADzC,wBAKE"}
@@ -0,0 +1,3 @@
1
+ declare const _default: () => () => void;
2
+ export default _default;
3
+ //# sourceMappingURL=blockingUserSyncEngineOnLoginHandler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blockingUserSyncEngineOnLoginHandler.d.ts","sourceRoot":"","sources":["../../../../src/userRepository/services/BlockingUserSyncEngine/blockingUserSyncEngineOnLoginHandler.ts"],"names":[],"mappings":";AAGA,wBAgBE"}
@@ -25,4 +25,20 @@ export declare const generateBlockedUsers: (...blockedUser: Amity.InternalUser[]
25
25
  };
26
26
  };
27
27
  };
28
+ export declare const generateBlockingUsers: (...blockingUser: Amity.InternalUser[]) => {
29
+ data: {
30
+ users: Amity.InternalUser[];
31
+ files: never[];
32
+ follows: {
33
+ status: "blocked";
34
+ from: string;
35
+ to: string;
36
+ createdAt: string;
37
+ updatedAt: string;
38
+ }[];
39
+ paging: {
40
+ total: number;
41
+ };
42
+ };
43
+ };
28
44
  //# sourceMappingURL=block.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../../../src/utils/tests/dummy/block.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,SAAU,MAAM,YAAY;;;;;CAO3D,CAAC;AAEF,eAAO,MAAM,mBAAmB,cACnB,MAAM,YAAY,UACrB,QAAQ,MAAM,gBAAgB,EAAE,KAAK,CAAC;;;;;;;;;;CAQ/C,CAAC;AAEF,eAAO,MAAM,oBAAoB,mBAAoB,MAAM,YAAY,EAAE;;;;;;;;;CAWxE,CAAC"}
1
+ {"version":3,"file":"block.d.ts","sourceRoot":"","sources":["../../../../src/utils/tests/dummy/block.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,SAAU,MAAM,YAAY;;;;;CAO3D,CAAC;AAEF,eAAO,MAAM,mBAAmB,cACnB,MAAM,YAAY,UACrB,QAAQ,MAAM,gBAAgB,EAAE,KAAK,CAAC;;;;;;;;;;CAQ/C,CAAC;AAEF,eAAO,MAAM,oBAAoB,mBAAoB,MAAM,YAAY,EAAE;;;;;;;;;CAWxE,CAAC;AAEF,eAAO,MAAM,qBAAqB,oBAAqB,MAAM,YAAY,EAAE;;;;;;;;;;;;;;;CAqB1E,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amityco/ts-sdk",
3
- "version": "7.22.1-fa4a2e0.0",
3
+ "version": "7.23.0",
4
4
  "license": "CC-BY-ND-4.0",
5
5
  "author": "amity.co <developers@amity.co> (https://amity.co)",
6
6
  "description": "Amity Social Cloud Typescript SDK",