@stream-io/feeds-client 0.3.32 → 0.3.34

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 (58) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +3 -2
  3. package/dist/cjs/index.js +3 -2
  4. package/dist/cjs/index.js.map +1 -1
  5. package/dist/cjs/react-bindings.js +40 -36
  6. package/dist/cjs/react-bindings.js.map +1 -1
  7. package/dist/es/index.mjs +4 -3
  8. package/dist/es/index.mjs.map +1 -1
  9. package/dist/es/react-bindings.mjs +40 -36
  10. package/dist/es/react-bindings.mjs.map +1 -1
  11. package/dist/{feeds-client-BNhvggk2.mjs → feeds-client-C-2_fdH1.mjs} +229 -209
  12. package/dist/feeds-client-C-2_fdH1.mjs.map +1 -0
  13. package/dist/{feeds-client-B9rwEWH3.js → feeds-client-Xj6kDjVH.js} +229 -209
  14. package/dist/feeds-client-Xj6kDjVH.js.map +1 -0
  15. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  16. package/dist/types/activity-with-state-updates/activity-with-state-updates.d.ts +4 -2
  17. package/dist/types/activity-with-state-updates/activity-with-state-updates.d.ts.map +1 -1
  18. package/dist/types/bindings/react/hooks/feed-state-hooks/index.d.ts +1 -0
  19. package/dist/types/bindings/react/hooks/feed-state-hooks/index.d.ts.map +1 -1
  20. package/dist/types/bindings/react/hooks/feed-state-hooks/useOwnCapabilities.d.ts.map +1 -1
  21. package/dist/types/bindings/react/hooks/feed-state-hooks/useOwnFollowings.d.ts +8 -0
  22. package/dist/types/bindings/react/hooks/feed-state-hooks/useOwnFollowings.d.ts.map +1 -0
  23. package/dist/types/bindings/react/hooks/useCreateFeedsClient.d.ts.map +1 -1
  24. package/dist/types/common/types.d.ts +1 -1
  25. package/dist/types/common/types.d.ts.map +1 -1
  26. package/dist/types/feed/event-handlers/activity/handle-activity-added.d.ts.map +1 -1
  27. package/dist/types/feed/event-handlers/activity/handle-activity-updated.d.ts.map +1 -1
  28. package/dist/types/feed/feed.d.ts +2 -1
  29. package/dist/types/feed/feed.d.ts.map +1 -1
  30. package/dist/types/feeds-client/active-activity.d.ts +2 -1
  31. package/dist/types/feeds-client/active-activity.d.ts.map +1 -1
  32. package/dist/types/feeds-client/feeds-client.d.ts +14 -12
  33. package/dist/types/feeds-client/feeds-client.d.ts.map +1 -1
  34. package/dist/types/utils/check-own-fields-equality.d.ts +2 -0
  35. package/dist/types/utils/check-own-fields-equality.d.ts.map +1 -1
  36. package/dist/types/utils/throttling/index.d.ts +1 -1
  37. package/dist/types/utils/throttling/index.d.ts.map +1 -1
  38. package/dist/types/utils/throttling/throttled-get-batched-own-fields.d.ts +14 -0
  39. package/dist/types/utils/throttling/throttled-get-batched-own-fields.d.ts.map +1 -0
  40. package/package.json +1 -1
  41. package/src/activity-with-state-updates/activity-with-state-updates.ts +17 -3
  42. package/src/bindings/react/hooks/feed-state-hooks/index.ts +1 -0
  43. package/src/bindings/react/hooks/feed-state-hooks/useOwnCapabilities.ts +14 -23
  44. package/src/bindings/react/hooks/feed-state-hooks/useOwnFollowings.ts +18 -0
  45. package/src/bindings/react/hooks/useCreateFeedsClient.ts +1 -3
  46. package/src/common/types.ts +1 -1
  47. package/src/feed/event-handlers/activity/handle-activity-added.ts +0 -6
  48. package/src/feed/event-handlers/activity/handle-activity-updated.ts +0 -4
  49. package/src/feed/feed.ts +53 -39
  50. package/src/feeds-client/active-activity.ts +8 -4
  51. package/src/feeds-client/feeds-client.ts +110 -114
  52. package/src/utils/check-own-fields-equality.ts +37 -10
  53. package/src/utils/throttling/index.ts +1 -1
  54. package/src/utils/throttling/{throttled-get-batched-own-capabilities.ts → throttled-get-batched-own-fields.ts} +10 -10
  55. package/dist/feeds-client-B9rwEWH3.js.map +0 -1
  56. package/dist/feeds-client-BNhvggk2.mjs.map +0 -1
  57. package/dist/types/utils/throttling/throttled-get-batched-own-capabilities.d.ts +0 -14
  58. package/dist/types/utils/throttling/throttled-get-batched-own-capabilities.d.ts.map +0 -1
@@ -1,35 +1,35 @@
1
1
  import type { FeedsClient } from '../../feeds-client';
2
2
  import type { ThrottledFunction } from './throttle';
3
3
 
4
- const BATCH_OWN_CAPABILITIES_API_LIMIT = 100;
4
+ const BATCH_OWN_FIELDS_API_LIMIT = 100;
5
5
 
6
- export type GetBatchedOwnCapabilities = {
6
+ export type GetBatchedOwnFields = {
7
7
  feeds: string[];
8
8
  };
9
9
 
10
- export type GetBatchedOwnCapabilitiesThrottledCallback = [
10
+ export type GetBatchedOwnFieldsThrottledCallback = [
11
11
  feeds: string[],
12
12
  callback: (feedsToClear: string[]) => void | Promise<void>,
13
13
  ];
14
14
 
15
- export type ThrottledGetBatchedOwnCapabilities =
16
- ThrottledFunction<GetBatchedOwnCapabilitiesThrottledCallback>;
15
+ export type ThrottledGetBatchedOwnFields =
16
+ ThrottledFunction<GetBatchedOwnFieldsThrottledCallback>;
17
17
 
18
- export const DEFAULT_BATCH_OWN_CAPABILITIES_THROTTLING_INTERVAL = 2000;
18
+ export const DEFAULT_BATCH_OWN_FIELDS_THROTTLING_INTERVAL = 2000;
19
19
 
20
20
  const queuedFeeds: Set<string> = new Set();
21
21
 
22
- export function queueBatchedOwnCapabilities(
22
+ export function queueBatchedOwnFields(
23
23
  this: FeedsClient,
24
- { feeds }: GetBatchedOwnCapabilities,
24
+ { feeds }: GetBatchedOwnFields,
25
25
  ) {
26
26
  for (const feed of feeds) {
27
27
  queuedFeeds.add(feed);
28
28
  }
29
29
 
30
30
  if (queuedFeeds.size > 0) {
31
- this.throttledGetBatchOwnCapabilities(
32
- [...queuedFeeds].slice(0, BATCH_OWN_CAPABILITIES_API_LIMIT),
31
+ this.throttledGetBatchOwnFields(
32
+ [...queuedFeeds].slice(0, BATCH_OWN_FIELDS_API_LIMIT),
33
33
  (feedsToClear: string[]) => {
34
34
  for (const feed of feedsToClear) {
35
35
  queuedFeeds.delete(feed);