@stream-io/feeds-client 0.3.6 → 0.3.7

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.
@@ -154,6 +154,7 @@ decoders.ActivityResponse = (input) => {
154
154
  mentioned_users: { type: "UserResponse", isSingle: false },
155
155
  own_bookmarks: { type: "BookmarkResponse", isSingle: false },
156
156
  own_reactions: { type: "FeedsReactionResponse", isSingle: false },
157
+ collections: { type: "EnrichedCollectionResponse", isSingle: false },
157
158
  reaction_groups: { type: "ReactionGroupResponse", isSingle: false },
158
159
  user: { type: "UserResponse", isSingle: true },
159
160
  deleted_at: { type: "DatetimeType", isSingle: true },
@@ -448,6 +449,13 @@ decoders.ChannelResponse = (input) => {
448
449
  };
449
450
  return decode(typeMappings, input);
450
451
  };
452
+ decoders.CollectionResponse = (input) => {
453
+ const typeMappings = {
454
+ created_at: { type: "DatetimeType", isSingle: true },
455
+ updated_at: { type: "DatetimeType", isSingle: true }
456
+ };
457
+ return decode(typeMappings, input);
458
+ };
451
459
  decoders.Command = (input) => {
452
460
  const typeMappings = {
453
461
  created_at: { type: "DatetimeType", isSingle: true },
@@ -535,6 +543,12 @@ decoders.CreateBlockListResponse = (input) => {
535
543
  };
536
544
  return decode(typeMappings, input);
537
545
  };
546
+ decoders.CreateCollectionsResponse = (input) => {
547
+ const typeMappings = {
548
+ collections: { type: "CollectionResponse", isSingle: false }
549
+ };
550
+ return decode(typeMappings, input);
551
+ };
538
552
  decoders.CreateFeedsBatchResponse = (input) => {
539
553
  const typeMappings = {
540
554
  feeds: { type: "FeedResponse", isSingle: false }
@@ -608,6 +622,13 @@ decoders.EgressRTMPResponse = (input) => {
608
622
  };
609
623
  return decode(typeMappings, input);
610
624
  };
625
+ decoders.EnrichedCollectionResponse = (input) => {
626
+ const typeMappings = {
627
+ created_at: { type: "DatetimeType", isSingle: true },
628
+ updated_at: { type: "DatetimeType", isSingle: true }
629
+ };
630
+ return decode(typeMappings, input);
631
+ };
611
632
  decoders.EntityCreatorResponse = (input) => {
612
633
  const typeMappings = {
613
634
  created_at: { type: "DatetimeType", isSingle: true },
@@ -1213,6 +1234,12 @@ decoders.ReactionResponse = (input) => {
1213
1234
  };
1214
1235
  return decode(typeMappings, input);
1215
1236
  };
1237
+ decoders.ReadCollectionsResponse = (input) => {
1238
+ const typeMappings = {
1239
+ collections: { type: "CollectionResponse", isSingle: false }
1240
+ };
1241
+ return decode(typeMappings, input);
1242
+ };
1216
1243
  decoders.RejectFeedMemberInviteResponse = (input) => {
1217
1244
  const typeMappings = {
1218
1245
  member: { type: "FeedMemberResponse", isSingle: true }
@@ -1375,6 +1402,12 @@ decoders.UpdateBookmarkResponse = (input) => {
1375
1402
  };
1376
1403
  return decode(typeMappings, input);
1377
1404
  };
1405
+ decoders.UpdateCollectionsResponse = (input) => {
1406
+ const typeMappings = {
1407
+ collections: { type: "CollectionResponse", isSingle: false }
1408
+ };
1409
+ return decode(typeMappings, input);
1410
+ };
1378
1411
  decoders.UpdateCommentResponse = (input) => {
1379
1412
  const typeMappings = {
1380
1413
  comment: { type: "CommentResponse", isSingle: true }
@@ -1629,6 +1662,7 @@ class FeedsApi {
1629
1662
  visibility: request?.visibility,
1630
1663
  visibility_tag: request?.visibility_tag,
1631
1664
  attachments: request?.attachments,
1665
+ collection_refs: request?.collection_refs,
1632
1666
  filter_tags: request?.filter_tags,
1633
1667
  interest_tags: request?.interest_tags,
1634
1668
  mentioned_user_ids: request?.mentioned_user_ids,
@@ -1918,6 +1952,7 @@ class FeedsApi {
1918
1952
  text: request?.text,
1919
1953
  visibility: request?.visibility,
1920
1954
  attachments: request?.attachments,
1955
+ collection_refs: request?.collection_refs,
1921
1956
  feeds: request?.feeds,
1922
1957
  filter_tags: request?.filter_tags,
1923
1958
  interest_tags: request?.interest_tags,
@@ -2005,6 +2040,52 @@ class FeedsApi {
2005
2040
  decoders.QueryBookmarksResponse?.(response.body);
2006
2041
  return { ...response.body, metadata: response.metadata };
2007
2042
  }
2043
+ async deleteCollections(request) {
2044
+ const queryParams = {
2045
+ collection_refs: request?.collection_refs
2046
+ };
2047
+ const response = await this.apiClient.sendRequest("DELETE", "/api/v2/feeds/collections", void 0, queryParams);
2048
+ decoders.DeleteCollectionsResponse?.(response.body);
2049
+ return { ...response.body, metadata: response.metadata };
2050
+ }
2051
+ async readCollections(request) {
2052
+ const queryParams = {
2053
+ collection_refs: request?.collection_refs
2054
+ };
2055
+ const response = await this.apiClient.sendRequest("GET", "/api/v2/feeds/collections", void 0, queryParams);
2056
+ decoders.ReadCollectionsResponse?.(response.body);
2057
+ return { ...response.body, metadata: response.metadata };
2058
+ }
2059
+ async updateCollections(request) {
2060
+ const body = {
2061
+ collections: request?.collections
2062
+ };
2063
+ const response = await this.apiClient.sendRequest(
2064
+ "PATCH",
2065
+ "/api/v2/feeds/collections",
2066
+ void 0,
2067
+ void 0,
2068
+ body,
2069
+ "application/json"
2070
+ );
2071
+ decoders.UpdateCollectionsResponse?.(response.body);
2072
+ return { ...response.body, metadata: response.metadata };
2073
+ }
2074
+ async createCollections(request) {
2075
+ const body = {
2076
+ collections: request?.collections
2077
+ };
2078
+ const response = await this.apiClient.sendRequest(
2079
+ "POST",
2080
+ "/api/v2/feeds/collections",
2081
+ void 0,
2082
+ void 0,
2083
+ body,
2084
+ "application/json"
2085
+ );
2086
+ decoders.CreateCollectionsResponse?.(response.body);
2087
+ return { ...response.body, metadata: response.metadata };
2088
+ }
2008
2089
  async getComments(request) {
2009
2090
  const queryParams = {
2010
2091
  object_id: request?.object_id,
@@ -3781,7 +3862,7 @@ const getRateLimitFromResponseHeader = (response_headers) => {
3781
3862
  };
3782
3863
  return result;
3783
3864
  };
3784
- const version = "0.3.6";
3865
+ const version = "0.3.7";
3785
3866
  class ApiClient {
3786
3867
  constructor(apiKey, tokenManager, connectionIdManager, options) {
3787
3868
  this.apiKey = apiKey;
@@ -7355,4 +7436,4 @@ exports.replaceUniqueArrayMerge = replaceUniqueArrayMerge;
7355
7436
  exports.shouldUpdateState = shouldUpdateState;
7356
7437
  exports.uniqueArrayMerge = uniqueArrayMerge;
7357
7438
  exports.updateEntityInArray = updateEntityInArray;
7358
- //# sourceMappingURL=feeds-client-47vliZx_.js.map
7439
+ //# sourceMappingURL=feeds-client-DLiLkrA0.js.map