@ecency/sdk 1.5.10 → 1.5.11

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.
@@ -889,6 +889,47 @@ function getActiveAccountBookmarksQueryOptions(activeUsername, code) {
889
889
  }
890
890
  });
891
891
  }
892
+ function getActiveAccountBookmarksInfiniteQueryOptions(activeUsername, code, limit = 10) {
893
+ return reactQuery.infiniteQueryOptions({
894
+ queryKey: ["accounts", "bookmarks", "infinite", activeUsername, limit],
895
+ queryFn: async ({ pageParam = 0 }) => {
896
+ if (!activeUsername || !code) {
897
+ return {
898
+ data: [],
899
+ pagination: {
900
+ total: 0,
901
+ limit,
902
+ offset: 0,
903
+ has_next: false
904
+ }
905
+ };
906
+ }
907
+ const fetchApi = getBoundFetch();
908
+ const response = await fetchApi(
909
+ `${CONFIG.privateApiHost}/private-api/bookmarks?format=wrapped&offset=${pageParam}&limit=${limit}`,
910
+ {
911
+ method: "POST",
912
+ headers: {
913
+ "Content-Type": "application/json"
914
+ },
915
+ body: JSON.stringify({ code })
916
+ }
917
+ );
918
+ if (!response.ok) {
919
+ throw new Error(`Failed to fetch bookmarks: ${response.status}`);
920
+ }
921
+ return response.json();
922
+ },
923
+ initialPageParam: 0,
924
+ getNextPageParam: (lastPage) => {
925
+ if (lastPage.pagination.has_next) {
926
+ return lastPage.pagination.offset + lastPage.pagination.limit;
927
+ }
928
+ return void 0;
929
+ },
930
+ enabled: !!activeUsername && !!code
931
+ });
932
+ }
892
933
  function getActiveAccountFavouritesQueryOptions(activeUsername, code) {
893
934
  return reactQuery.queryOptions({
894
935
  queryKey: ["accounts", "favourites", activeUsername],
@@ -912,6 +953,47 @@ function getActiveAccountFavouritesQueryOptions(activeUsername, code) {
912
953
  }
913
954
  });
914
955
  }
956
+ function getActiveAccountFavouritesInfiniteQueryOptions(activeUsername, code, limit = 10) {
957
+ return reactQuery.infiniteQueryOptions({
958
+ queryKey: ["accounts", "favourites", "infinite", activeUsername, limit],
959
+ queryFn: async ({ pageParam = 0 }) => {
960
+ if (!activeUsername || !code) {
961
+ return {
962
+ data: [],
963
+ pagination: {
964
+ total: 0,
965
+ limit,
966
+ offset: 0,
967
+ has_next: false
968
+ }
969
+ };
970
+ }
971
+ const fetchApi = getBoundFetch();
972
+ const response = await fetchApi(
973
+ `${CONFIG.privateApiHost}/private-api/favorites?format=wrapped&offset=${pageParam}&limit=${limit}`,
974
+ {
975
+ method: "POST",
976
+ headers: {
977
+ "Content-Type": "application/json"
978
+ },
979
+ body: JSON.stringify({ code })
980
+ }
981
+ );
982
+ if (!response.ok) {
983
+ throw new Error(`Failed to fetch favorites: ${response.status}`);
984
+ }
985
+ return response.json();
986
+ },
987
+ initialPageParam: 0,
988
+ getNextPageParam: (lastPage) => {
989
+ if (lastPage.pagination.has_next) {
990
+ return lastPage.pagination.offset + lastPage.pagination.limit;
991
+ }
992
+ return void 0;
993
+ },
994
+ enabled: !!activeUsername && !!code
995
+ });
996
+ }
915
997
  function getAccountRecoveriesQueryOptions(username, code) {
916
998
  return reactQuery.queryOptions({
917
999
  enabled: !!username && !!code,
@@ -1245,6 +1327,49 @@ function getFragmentsQueryOptions(username, code) {
1245
1327
  enabled: !!username && !!code
1246
1328
  });
1247
1329
  }
1330
+ function getFragmentsInfiniteQueryOptions(username, code, limit = 10) {
1331
+ return reactQuery.infiniteQueryOptions({
1332
+ queryKey: ["posts", "fragments", "infinite", username, limit],
1333
+ queryFn: async ({ pageParam = 0 }) => {
1334
+ if (!username || !code) {
1335
+ return {
1336
+ data: [],
1337
+ pagination: {
1338
+ total: 0,
1339
+ limit,
1340
+ offset: 0,
1341
+ has_next: false
1342
+ }
1343
+ };
1344
+ }
1345
+ const fetchApi = getBoundFetch();
1346
+ const response = await fetchApi(
1347
+ `${CONFIG.privateApiHost}/private-api/fragments?format=wrapped&offset=${pageParam}&limit=${limit}`,
1348
+ {
1349
+ method: "POST",
1350
+ headers: {
1351
+ "Content-Type": "application/json"
1352
+ },
1353
+ body: JSON.stringify({
1354
+ code
1355
+ })
1356
+ }
1357
+ );
1358
+ if (!response.ok) {
1359
+ throw new Error(`Failed to fetch fragments: ${response.status}`);
1360
+ }
1361
+ return response.json();
1362
+ },
1363
+ initialPageParam: 0,
1364
+ getNextPageParam: (lastPage) => {
1365
+ if (lastPage.pagination.has_next) {
1366
+ return lastPage.pagination.offset + lastPage.pagination.limit;
1367
+ }
1368
+ return void 0;
1369
+ },
1370
+ enabled: !!username && !!code
1371
+ });
1372
+ }
1248
1373
  function getPromotedPostsQuery(type = "feed") {
1249
1374
  return reactQuery.queryOptions({
1250
1375
  queryKey: ["posts", "promoted", type],
@@ -1865,6 +1990,49 @@ function getSchedulesQueryOptions(activeUsername, code) {
1865
1990
  enabled: !!activeUsername && !!code
1866
1991
  });
1867
1992
  }
1993
+ function getSchedulesInfiniteQueryOptions(activeUsername, code, limit = 10) {
1994
+ return reactQuery.infiniteQueryOptions({
1995
+ queryKey: ["posts", "schedules", "infinite", activeUsername, limit],
1996
+ queryFn: async ({ pageParam = 0 }) => {
1997
+ if (!activeUsername || !code) {
1998
+ return {
1999
+ data: [],
2000
+ pagination: {
2001
+ total: 0,
2002
+ limit,
2003
+ offset: 0,
2004
+ has_next: false
2005
+ }
2006
+ };
2007
+ }
2008
+ const fetchApi = getBoundFetch();
2009
+ const response = await fetchApi(
2010
+ `${CONFIG.privateApiHost}/private-api/schedules?format=wrapped&offset=${pageParam}&limit=${limit}`,
2011
+ {
2012
+ method: "POST",
2013
+ headers: {
2014
+ "Content-Type": "application/json"
2015
+ },
2016
+ body: JSON.stringify({
2017
+ code
2018
+ })
2019
+ }
2020
+ );
2021
+ if (!response.ok) {
2022
+ throw new Error(`Failed to fetch schedules: ${response.status}`);
2023
+ }
2024
+ return response.json();
2025
+ },
2026
+ initialPageParam: 0,
2027
+ getNextPageParam: (lastPage) => {
2028
+ if (lastPage.pagination.has_next) {
2029
+ return lastPage.pagination.offset + lastPage.pagination.limit;
2030
+ }
2031
+ return void 0;
2032
+ },
2033
+ enabled: !!activeUsername && !!code
2034
+ });
2035
+ }
1868
2036
  function getDraftsQueryOptions(activeUsername, code) {
1869
2037
  return reactQuery.queryOptions({
1870
2038
  queryKey: ["posts", "drafts", activeUsername],
@@ -1890,6 +2058,49 @@ function getDraftsQueryOptions(activeUsername, code) {
1890
2058
  enabled: !!activeUsername && !!code
1891
2059
  });
1892
2060
  }
2061
+ function getDraftsInfiniteQueryOptions(activeUsername, code, limit = 10) {
2062
+ return reactQuery.infiniteQueryOptions({
2063
+ queryKey: ["posts", "drafts", "infinite", activeUsername, limit],
2064
+ queryFn: async ({ pageParam = 0 }) => {
2065
+ if (!activeUsername || !code) {
2066
+ return {
2067
+ data: [],
2068
+ pagination: {
2069
+ total: 0,
2070
+ limit,
2071
+ offset: 0,
2072
+ has_next: false
2073
+ }
2074
+ };
2075
+ }
2076
+ const fetchApi = getBoundFetch();
2077
+ const response = await fetchApi(
2078
+ `${CONFIG.privateApiHost}/private-api/drafts?format=wrapped&offset=${pageParam}&limit=${limit}`,
2079
+ {
2080
+ method: "POST",
2081
+ headers: {
2082
+ "Content-Type": "application/json"
2083
+ },
2084
+ body: JSON.stringify({
2085
+ code
2086
+ })
2087
+ }
2088
+ );
2089
+ if (!response.ok) {
2090
+ throw new Error(`Failed to fetch drafts: ${response.status}`);
2091
+ }
2092
+ return response.json();
2093
+ },
2094
+ initialPageParam: 0,
2095
+ getNextPageParam: (lastPage) => {
2096
+ if (lastPage.pagination.has_next) {
2097
+ return lastPage.pagination.offset + lastPage.pagination.limit;
2098
+ }
2099
+ return void 0;
2100
+ },
2101
+ enabled: !!activeUsername && !!code
2102
+ });
2103
+ }
1893
2104
  async function fetchUserImages(code) {
1894
2105
  const fetchApi = getBoundFetch();
1895
2106
  const response = await fetchApi(CONFIG.privateApiHost + "/private-api/images", {
@@ -1930,6 +2141,49 @@ function getGalleryImagesQueryOptions(activeUsername, code) {
1930
2141
  enabled: !!activeUsername && !!code
1931
2142
  });
1932
2143
  }
2144
+ function getImagesInfiniteQueryOptions(username, code, limit = 10) {
2145
+ return reactQuery.infiniteQueryOptions({
2146
+ queryKey: ["posts", "images", "infinite", username, limit],
2147
+ queryFn: async ({ pageParam = 0 }) => {
2148
+ if (!username || !code) {
2149
+ return {
2150
+ data: [],
2151
+ pagination: {
2152
+ total: 0,
2153
+ limit,
2154
+ offset: 0,
2155
+ has_next: false
2156
+ }
2157
+ };
2158
+ }
2159
+ const fetchApi = getBoundFetch();
2160
+ const response = await fetchApi(
2161
+ `${CONFIG.privateApiHost}/private-api/images?format=wrapped&offset=${pageParam}&limit=${limit}`,
2162
+ {
2163
+ method: "POST",
2164
+ headers: {
2165
+ "Content-Type": "application/json"
2166
+ },
2167
+ body: JSON.stringify({
2168
+ code
2169
+ })
2170
+ }
2171
+ );
2172
+ if (!response.ok) {
2173
+ throw new Error(`Failed to fetch images: ${response.status}`);
2174
+ }
2175
+ return response.json();
2176
+ },
2177
+ initialPageParam: 0,
2178
+ getNextPageParam: (lastPage) => {
2179
+ if (lastPage.pagination.has_next) {
2180
+ return lastPage.pagination.offset + lastPage.pagination.limit;
2181
+ }
2182
+ return void 0;
2183
+ },
2184
+ enabled: !!username && !!code
2185
+ });
2186
+ }
1933
2187
  function getCommentHistoryQueryOptions(author, permlink, onlyMeta = false) {
1934
2188
  return reactQuery.queryOptions({
1935
2189
  queryKey: ["posts", "comment-history", author, permlink, onlyMeta],
@@ -5215,7 +5469,9 @@ exports.getAccountReputationsQueryOptions = getAccountReputationsQueryOptions;
5215
5469
  exports.getAccountSubscriptionsQueryOptions = getAccountSubscriptionsQueryOptions;
5216
5470
  exports.getAccountVoteHistoryInfiniteQueryOptions = getAccountVoteHistoryInfiniteQueryOptions;
5217
5471
  exports.getAccountsQueryOptions = getAccountsQueryOptions;
5472
+ exports.getActiveAccountBookmarksInfiniteQueryOptions = getActiveAccountBookmarksInfiniteQueryOptions;
5218
5473
  exports.getActiveAccountBookmarksQueryOptions = getActiveAccountBookmarksQueryOptions;
5474
+ exports.getActiveAccountFavouritesInfiniteQueryOptions = getActiveAccountFavouritesInfiniteQueryOptions;
5219
5475
  exports.getActiveAccountFavouritesQueryOptions = getActiveAccountFavouritesQueryOptions;
5220
5476
  exports.getAnnouncementsQueryOptions = getAnnouncementsQueryOptions;
5221
5477
  exports.getBoostPlusAccountPricesQueryOptions = getBoostPlusAccountPricesQueryOptions;
@@ -5246,11 +5502,13 @@ exports.getDiscoverLeaderboardQueryOptions = getDiscoverLeaderboardQueryOptions;
5246
5502
  exports.getDiscussion = getDiscussion;
5247
5503
  exports.getDiscussionQueryOptions = getDiscussionQueryOptions;
5248
5504
  exports.getDiscussionsQueryOptions = getDiscussionsQueryOptions;
5505
+ exports.getDraftsInfiniteQueryOptions = getDraftsInfiniteQueryOptions;
5249
5506
  exports.getDraftsQueryOptions = getDraftsQueryOptions;
5250
5507
  exports.getDynamicPropsQueryOptions = getDynamicPropsQueryOptions;
5251
5508
  exports.getEntryActiveVotesQueryOptions = getEntryActiveVotesQueryOptions;
5252
5509
  exports.getFollowCountQueryOptions = getFollowCountQueryOptions;
5253
5510
  exports.getFollowingQueryOptions = getFollowingQueryOptions;
5511
+ exports.getFragmentsInfiniteQueryOptions = getFragmentsInfiniteQueryOptions;
5254
5512
  exports.getFragmentsQueryOptions = getFragmentsQueryOptions;
5255
5513
  exports.getFriendsInfiniteQueryOptions = getFriendsInfiniteQueryOptions;
5256
5514
  exports.getGalleryImagesQueryOptions = getGalleryImagesQueryOptions;
@@ -5268,6 +5526,7 @@ exports.getHiveEngineUnclaimedRewards = getHiveEngineUnclaimedRewards;
5268
5526
  exports.getHiveHbdStatsQueryOptions = getHiveHbdStatsQueryOptions;
5269
5527
  exports.getHivePoshLinksQueryOptions = getHivePoshLinksQueryOptions;
5270
5528
  exports.getHivePrice = getHivePrice;
5529
+ exports.getImagesInfiniteQueryOptions = getImagesInfiniteQueryOptions;
5271
5530
  exports.getImagesQueryOptions = getImagesQueryOptions;
5272
5531
  exports.getIncomingRcQueryOptions = getIncomingRcQueryOptions;
5273
5532
  exports.getMarketData = getMarketData;
@@ -5312,6 +5571,7 @@ exports.getRelationshipBetweenAccounts = getRelationshipBetweenAccounts;
5312
5571
  exports.getRelationshipBetweenAccountsQueryOptions = getRelationshipBetweenAccountsQueryOptions;
5313
5572
  exports.getRewardedCommunitiesQueryOptions = getRewardedCommunitiesQueryOptions;
5314
5573
  exports.getSavingsWithdrawFromQueryOptions = getSavingsWithdrawFromQueryOptions;
5574
+ exports.getSchedulesInfiniteQueryOptions = getSchedulesInfiniteQueryOptions;
5315
5575
  exports.getSchedulesQueryOptions = getSchedulesQueryOptions;
5316
5576
  exports.getSearchAccountQueryOptions = getSearchAccountQueryOptions;
5317
5577
  exports.getSearchAccountsByUsernameQueryOptions = getSearchAccountsByUsernameQueryOptions;