@bitsocial/bitsocial-react-hooks 0.2.2 → 0.2.3

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 (117) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/README.md +2 -0
  3. package/dist/hooks/accounts/accounts.d.ts.map +1 -1
  4. package/dist/hooks/accounts/accounts.js +35 -10
  5. package/dist/hooks/accounts/accounts.js.map +1 -1
  6. package/dist/hooks/actions/actions.d.ts.map +1 -1
  7. package/dist/hooks/actions/actions.js +166 -93
  8. package/dist/hooks/actions/actions.js.map +1 -1
  9. package/dist/hooks/authors/author-avatars.d.ts +2 -2
  10. package/dist/hooks/authors/author-avatars.d.ts.map +1 -1
  11. package/dist/hooks/authors/author-avatars.js +48 -20
  12. package/dist/hooks/authors/author-avatars.js.map +1 -1
  13. package/dist/hooks/authors/authors.d.ts.map +1 -1
  14. package/dist/hooks/authors/authors.js +68 -22
  15. package/dist/hooks/authors/authors.js.map +1 -1
  16. package/dist/hooks/comments.d.ts.map +1 -1
  17. package/dist/hooks/comments.js +54 -3
  18. package/dist/hooks/comments.js.map +1 -1
  19. package/dist/hooks/communities.d.ts.map +1 -1
  20. package/dist/hooks/communities.js +41 -12
  21. package/dist/hooks/communities.js.map +1 -1
  22. package/dist/hooks/feeds/feeds.d.ts.map +1 -1
  23. package/dist/hooks/feeds/feeds.js +47 -11
  24. package/dist/hooks/feeds/feeds.js.map +1 -1
  25. package/dist/hooks/pkc-rpc.d.ts.map +1 -1
  26. package/dist/hooks/pkc-rpc.js +33 -20
  27. package/dist/hooks/pkc-rpc.js.map +1 -1
  28. package/dist/hooks/replies.d.ts.map +1 -1
  29. package/dist/hooks/replies.js +30 -4
  30. package/dist/hooks/replies.js.map +1 -1
  31. package/dist/index.d.ts +6 -4
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +4 -2
  34. package/dist/index.js.map +1 -1
  35. package/dist/lib/debug-utils.d.ts +4 -4
  36. package/dist/lib/debug-utils.d.ts.map +1 -1
  37. package/dist/lib/debug-utils.js +56 -11
  38. package/dist/lib/debug-utils.js.map +1 -1
  39. package/dist/lib/localforage-lru/localforage-lru.d.ts +1 -0
  40. package/dist/lib/localforage-lru/localforage-lru.d.ts.map +1 -1
  41. package/dist/lib/localforage-lru/localforage-lru.js +48 -10
  42. package/dist/lib/localforage-lru/localforage-lru.js.map +1 -1
  43. package/dist/lib/page-sorts.d.ts +6 -0
  44. package/dist/lib/page-sorts.d.ts.map +1 -1
  45. package/dist/lib/page-sorts.js +45 -9
  46. package/dist/lib/page-sorts.js.map +1 -1
  47. package/dist/lib/pkc-js/pkc-js-mock-content.d.ts.map +1 -1
  48. package/dist/lib/pkc-js/pkc-js-mock-content.js +5 -1
  49. package/dist/lib/pkc-js/pkc-js-mock-content.js.map +1 -1
  50. package/dist/lib/utils/utils.d.ts.map +1 -1
  51. package/dist/lib/utils/utils.js +24 -16
  52. package/dist/lib/utils/utils.js.map +1 -1
  53. package/dist/lib/validator.d.ts +1 -1
  54. package/dist/lib/validator.d.ts.map +1 -1
  55. package/dist/lib/validator.js +7 -1
  56. package/dist/lib/validator.js.map +1 -1
  57. package/dist/stores/accounts/account-generator.d.ts +1 -0
  58. package/dist/stores/accounts/account-generator.d.ts.map +1 -1
  59. package/dist/stores/accounts/account-generator.js +12 -4
  60. package/dist/stores/accounts/account-generator.js.map +1 -1
  61. package/dist/stores/accounts/accounts-actions-internal.d.ts.map +1 -1
  62. package/dist/stores/accounts/accounts-actions-internal.js +24 -6
  63. package/dist/stores/accounts/accounts-actions-internal.js.map +1 -1
  64. package/dist/stores/accounts/accounts-actions.d.ts.map +1 -1
  65. package/dist/stores/accounts/accounts-actions.js +339 -98
  66. package/dist/stores/accounts/accounts-actions.js.map +1 -1
  67. package/dist/stores/accounts/accounts-database.d.ts +1 -0
  68. package/dist/stores/accounts/accounts-database.d.ts.map +1 -1
  69. package/dist/stores/accounts/accounts-database.js +82 -15
  70. package/dist/stores/accounts/accounts-database.js.map +1 -1
  71. package/dist/stores/accounts/accounts-store.d.ts +1 -1
  72. package/dist/stores/accounts/accounts-store.d.ts.map +1 -1
  73. package/dist/stores/accounts/accounts-store.js +1 -1
  74. package/dist/stores/accounts/accounts-store.js.map +1 -1
  75. package/dist/stores/accounts/utils.d.ts +5 -1
  76. package/dist/stores/accounts/utils.d.ts.map +1 -1
  77. package/dist/stores/accounts/utils.js +58 -0
  78. package/dist/stores/accounts/utils.js.map +1 -1
  79. package/dist/stores/authors-comments/authors-comments-store.d.ts.map +1 -1
  80. package/dist/stores/authors-comments/authors-comments-store.js +39 -12
  81. package/dist/stores/authors-comments/authors-comments-store.js.map +1 -1
  82. package/dist/stores/comments/comments-store.d.ts +2 -0
  83. package/dist/stores/comments/comments-store.d.ts.map +1 -1
  84. package/dist/stores/comments/comments-store.js +170 -21
  85. package/dist/stores/comments/comments-store.js.map +1 -1
  86. package/dist/stores/communities/communities-store.d.ts.map +1 -1
  87. package/dist/stores/communities/communities-store.js +27 -7
  88. package/dist/stores/communities/communities-store.js.map +1 -1
  89. package/dist/stores/communities-pages/communities-pages-store.d.ts.map +1 -1
  90. package/dist/stores/communities-pages/communities-pages-store.js +60 -8
  91. package/dist/stores/communities-pages/communities-pages-store.js.map +1 -1
  92. package/dist/stores/feeds/feed-sorter.d.ts +5 -2
  93. package/dist/stores/feeds/feed-sorter.d.ts.map +1 -1
  94. package/dist/stores/feeds/feed-sorter.js +15 -4
  95. package/dist/stores/feeds/feed-sorter.js.map +1 -1
  96. package/dist/stores/feeds/feeds-store.d.ts +3 -0
  97. package/dist/stores/feeds/feeds-store.d.ts.map +1 -1
  98. package/dist/stores/feeds/feeds-store.js +36 -26
  99. package/dist/stores/feeds/feeds-store.js.map +1 -1
  100. package/dist/stores/feeds/utils.d.ts +16 -0
  101. package/dist/stores/feeds/utils.d.ts.map +1 -1
  102. package/dist/stores/feeds/utils.js +82 -26
  103. package/dist/stores/feeds/utils.js.map +1 -1
  104. package/dist/stores/replies/replies-store.d.ts.map +1 -1
  105. package/dist/stores/replies/replies-store.js +32 -6
  106. package/dist/stores/replies/replies-store.js.map +1 -1
  107. package/dist/stores/replies/utils.d.ts +3 -2
  108. package/dist/stores/replies/utils.d.ts.map +1 -1
  109. package/dist/stores/replies/utils.js +38 -5
  110. package/dist/stores/replies/utils.js.map +1 -1
  111. package/dist/stores/replies-pages/replies-pages-store.d.ts.map +1 -1
  112. package/dist/stores/replies-pages/replies-pages-store.js +68 -13
  113. package/dist/stores/replies-pages/replies-pages-store.js.map +1 -1
  114. package/dist/types.d.ts +11 -2
  115. package/dist/types.d.ts.map +1 -1
  116. package/dist/types.js.map +1 -1
  117. package/package.json +2 -2
@@ -29,7 +29,7 @@ const repliesPagesStore = createStore((setState, getState) => ({
29
29
  repliesPages: {},
30
30
  comments: {},
31
31
  addNextRepliesPageToStore: (comment, sortType, account) => __awaiter(void 0, void 0, void 0, function* () {
32
- var _a, _b;
32
+ var _a, _b, _c;
33
33
  assert((comment === null || comment === void 0 ? void 0 : comment.cid) && typeof (comment === null || comment === void 0 ? void 0 : comment.cid) === "string", `repliesPagesStore.addNextRepliesPageToStore comment '${comment}' invalid`);
34
34
  assert(sortType === undefined || (typeof sortType === "string" && sortType.length > 0), `repliesPagesStore.addNextRepliesPageToStore sortType '${sortType}' invalid`);
35
35
  const resolvedSortType = resolveReplySortType(comment, sortType);
@@ -67,14 +67,16 @@ const repliesPagesStore = createStore((setState, getState) => ({
67
67
  pageCidToAdd = nextCid;
68
68
  }
69
69
  // page is already added or pending
70
+ const pendingKey = account.id + pageCidToAdd;
70
71
  if (repliesPagesStore.repliesPages[pageCidToAdd] ||
71
- fetchPagePending[account.id + pageCidToAdd]) {
72
+ pageFetchIsPending(pendingKey, account.pkc)) {
72
73
  return;
73
74
  }
74
- fetchPagePending[account.id + pageCidToAdd] = true;
75
+ const pendingFetch = { pkc: account.pkc, failed: false };
76
+ fetchPagePending[pendingKey] = [...(fetchPagePending[pendingKey] || []), pendingFetch];
75
77
  let page;
76
78
  try {
77
- page = yield fetchPage(pageCidToAdd, comment, account);
79
+ page = yield fetchPage(pageCidToAdd, comment, account, pendingFetch);
78
80
  log.trace("repliesPagesStore.addNextRepliesPageToStore comment.replies.getPage", {
79
81
  pageCid: pageCidToAdd,
80
82
  page,
@@ -87,7 +89,7 @@ const repliesPagesStore = createStore((setState, getState) => ({
87
89
  throw e;
88
90
  }
89
91
  finally {
90
- fetchPagePending[account.id + pageCidToAdd] = false;
92
+ fetchPagePending[pendingKey] = (_c = fetchPagePending[pendingKey]) === null || _c === void 0 ? void 0 : _c.filter((fetch) => fetch !== pendingFetch);
91
93
  }
92
94
  // find new comments in the page (missing-or-fresher: insert when absent or incoming is fresher)
93
95
  const flattenedComments = utils.flattenCommentsPages(page);
@@ -188,28 +190,81 @@ const onCommentRepliesClientsStateChange = (commentCid) => (clientState, clientT
188
190
  return { comments: Object.assign(Object.assign({}, state.comments), { [commentCid]: comment }) };
189
191
  });
190
192
  };
191
- const fetchPageComments = {}; // cache pkc.createComment because sometimes it's slow
193
+ // cache pkc.createComment per account because sometimes it's slow, recreated when the account's pkc
194
+ // client changes, so page fetches don't keep using a replaced client
195
+ const fetchPageComments = {};
192
196
  let fetchPagePending = {};
193
- const fetchPage = (pageCid, comment, account) => __awaiter(void 0, void 0, void 0, function* () {
197
+ const pageFetchIsPending = (key, pkc) => { var _a; return Boolean((_a = fetchPagePending[key]) === null || _a === void 0 ? void 0 : _a.some((fetch) => fetch.pkc === pkc || !fetch.failed)); };
198
+ // a page fetch stops retrying with its pkc client once its account was deleted, or setAccount gave
199
+ // the account another client. An account the accounts store didn't hold when the fetch started
200
+ // keeps retrying
201
+ const getShouldRetryPageFetch = (account) => {
194
202
  var _a;
203
+ const accountWasStored = Boolean((_a = accountsStore.getState().accounts) === null || _a === void 0 ? void 0 : _a[account.id]);
204
+ return () => {
205
+ var _a;
206
+ const storedAccount = (_a = accountsStore.getState().accounts) === null || _a === void 0 ? void 0 : _a[account.id];
207
+ return storedAccount ? storedAccount.pkc === account.pkc : !accountWasStored;
208
+ };
209
+ };
210
+ // setAccount gives the account a new pkc client on every edit, so a fetch that stopped retrying
211
+ // with the replaced client continues with the account's new one, unless another fetch of the page
212
+ // already uses it
213
+ const getAccountWithNewPkc = (account, pendingKey, pendingFetch) => {
214
+ var _a, _b;
215
+ const storedAccount = (_a = accountsStore.getState().accounts) === null || _a === void 0 ? void 0 : _a[account.id];
216
+ if (!storedAccount ||
217
+ storedAccount.pkc === account.pkc ||
218
+ ((_b = fetchPagePending[pendingKey]) === null || _b === void 0 ? void 0 : _b.some((fetch) => fetch !== pendingFetch && fetch.pkc === storedAccount.pkc))) {
219
+ return;
220
+ }
221
+ return storedAccount;
222
+ };
223
+ const fetchPage = (pageCid, comment, account, pendingFetch) => __awaiter(void 0, void 0, void 0, function* () {
224
+ var _a;
225
+ const shouldRetry = getShouldRetryPageFetch(account);
195
226
  // replies page is cached
196
227
  const cachedRepliesPage = yield repliesPagesDatabase.getItem(pageCid);
197
228
  if (cachedRepliesPage) {
198
229
  return cachedRepliesPage;
199
230
  }
200
- if (!fetchPageComments[comment.cid]) {
201
- fetchPageComments[comment.cid] = yield account.pkc.createComment({
231
+ if (!fetchPageComments[account.id] || fetchPageComments[account.id].pkc !== account.pkc) {
232
+ fetchPageComments[account.id] = { pkc: account.pkc, comments: {} };
233
+ }
234
+ const accountComments = fetchPageComments[account.id].comments;
235
+ if (!accountComments[comment.cid]) {
236
+ accountComments[comment.cid] = yield account.pkc.createComment({
202
237
  cid: comment.cid,
203
238
  postCid: comment.postCid,
204
239
  communityAddress: comment.communityAddress,
205
240
  depth: comment.depth,
206
241
  });
207
- listeners.push(fetchPageComments[comment.cid]);
242
+ listeners.push(accountComments[comment.cid]);
208
243
  // set clients states on communities store so the frontend can display it
209
- utils.pageClientsOnStateChange((_a = fetchPageComments[comment.cid].replies) === null || _a === void 0 ? void 0 : _a.clients, onCommentRepliesClientsStateChange(comment.cid));
244
+ utils.pageClientsOnStateChange((_a = accountComments[comment.cid].replies) === null || _a === void 0 ? void 0 : _a.clients, onCommentRepliesClientsStateChange(comment.cid));
245
+ }
246
+ const onError = (error) => {
247
+ if (pendingFetch) {
248
+ pendingFetch.failed = true;
249
+ }
250
+ log.error(`repliesPagesStore comment '${comment.cid}' failed comment.replies.getPage page cid '${pageCid}':`, error);
251
+ };
252
+ let fetchedRepliesPage;
253
+ try {
254
+ fetchedRepliesPage = yield utils.retryInfinity(() => accountComments[comment.cid].replies.getPage({ cid: pageCid }), { onError, shouldRetry });
255
+ }
256
+ catch (error) {
257
+ const accountWithNewPkc = getAccountWithNewPkc(account, account.id + pageCid, pendingFetch);
258
+ if (!accountWithNewPkc) {
259
+ throw error;
260
+ }
261
+ // the fetch continues as a new fetch with the new client, starting from the page cache
262
+ if (pendingFetch) {
263
+ pendingFetch.pkc = accountWithNewPkc.pkc;
264
+ pendingFetch.failed = false;
265
+ }
266
+ return fetchPage(pageCid, comment, accountWithNewPkc, pendingFetch);
210
267
  }
211
- const onError = (error) => log.error(`repliesPagesStore comment '${comment.cid}' failed comment.replies.getPage page cid '${pageCid}':`, error);
212
- const fetchedRepliesPage = yield utils.retryInfinity(() => fetchPageComments[comment.cid].replies.getPage({ cid: pageCid }), { onError });
213
268
  yield repliesPagesDatabase.setItem(pageCid, utils.clone(fetchedRepliesPage));
214
269
  return fetchedRepliesPage;
215
270
  });
@@ -1 +1 @@
1
- {"version":3,"file":"replies-pages-store.js","sourceRoot":"","sources":["../../../src/stores/replies-pages/replies-pages-store.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAC7C,uDAAuD;AACvD,MAAM,CAAC,MAAM,GAAG,GAAG,MAAM,CAAC,sCAAsC,CAAC,CAAC;AAElE,OAAO,aAAa,MAAM,aAAa,CAAC;AACxC,OAAO,aAAgC,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,mCAAmC,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F,MAAM,sBAAsB,EAAE,CAAC;AACjC,CAAC,CAAA,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import utils from \"../../lib/utils\";\nimport Logger from \"@pkcprotocol/pkc-logger\";\n// include replies pages store with feeds for debugging\nexport const log = Logger(\"bitsocial-react-hooks:replies:stores\");\nimport { RepliesPage, RepliesPages, Account, Comment, Comments } from \"../../types\";\nimport accountsStore from \"../accounts\";\nimport commentsStore, { CommentsState } from \"../comments\";\nimport { addChildrenRepliesFeedsToAddToStore } from \"./utils\";\nimport localForageLru from \"../../lib/localforage-lru\";\nimport createStore from \"zustand\";\nimport assert from \"../../lib/assert\";\nimport { getReplyPageSortType, resolveReplySortType } from \"../../lib/page-sorts\";\n\nconst repliesPagesDatabase = localForageLru.createInstance({\n name: \"bitsocialReactHooks-repliesPages\",\n size: 500,\n});\n\n// reset all event listeners in between tests\nconst listeners: any = [];\n\ntype RepliesPagesState = {\n repliesPages: RepliesPages;\n comments: Comments;\n addNextRepliesPageToStore: Function;\n addRepliesPageCommentsToStore: Function;\n};\n\nconst repliesPagesStore = createStore<RepliesPagesState>(\n (setState: Function, getState: Function) => ({\n // TODO: eventually clear old pages and comments from memory\n repliesPages: {},\n comments: {},\n\n addNextRepliesPageToStore: async (\n comment: Comment,\n sortType: string | undefined,\n account: Account,\n ) => {\n assert(\n comment?.cid && typeof comment?.cid === \"string\",\n `repliesPagesStore.addNextRepliesPageToStore comment '${comment}' invalid`,\n );\n assert(\n sortType === undefined || (typeof sortType === \"string\" && sortType.length > 0),\n `repliesPagesStore.addNextRepliesPageToStore sortType '${sortType}' invalid`,\n );\n const resolvedSortType = resolveReplySortType(comment, sortType);\n if (!resolvedSortType) {\n return;\n }\n sortType = resolvedSortType;\n assert(\n typeof account?.pkc?.createComment === \"function\",\n `repliesPagesStore.addNextRepliesPageToStore account '${account}' invalid`,\n );\n\n // check the preloaded replies on comment.replies.pages first, then the comment.replies.pageCids\n const repliesFirstPageCid = getRepliesFirstPageCid(comment, sortType);\n if (!repliesFirstPageCid) {\n log(\n `repliesPagesStore.addNextRepliesPageToStore comment '${comment?.cid}' sortType '${sortType}' no repliesFirstPageCid`,\n );\n return;\n }\n\n // all replies pages in store\n const repliesPagesStore = getState();\n // only specific pages of the comment+sortType\n const repliesPages = getRepliesPages(comment, sortType, repliesPagesStore.repliesPages);\n\n // if no pages exist yet, add the first page\n let pageCidToAdd: string;\n if (!repliesPages.length) {\n pageCidToAdd = repliesFirstPageCid;\n } else {\n const nextCid = repliesPages[repliesPages.length - 1]?.nextCid;\n // if last nextCid is undefined, reached end of pages\n if (!nextCid) {\n log.trace(\"repliesPagesStore.addNextRepliesPageToStore no more pages\", {\n commentCid: comment.cid,\n sortType,\n account,\n });\n return;\n }\n\n pageCidToAdd = nextCid;\n }\n\n // page is already added or pending\n if (\n repliesPagesStore.repliesPages[pageCidToAdd] ||\n fetchPagePending[account.id + pageCidToAdd]\n ) {\n return;\n }\n\n fetchPagePending[account.id + pageCidToAdd] = true;\n let page: RepliesPage;\n try {\n page = await fetchPage(pageCidToAdd, comment, account);\n log.trace(\"repliesPagesStore.addNextRepliesPageToStore comment.replies.getPage\", {\n pageCid: pageCidToAdd,\n page,\n commentCid: comment.cid,\n communityAddress: comment.communityAddress,\n account,\n });\n } catch (e) {\n throw e;\n } finally {\n fetchPagePending[account.id + pageCidToAdd] = false;\n }\n\n // find new comments in the page (missing-or-fresher: insert when absent or incoming is fresher)\n const flattenedComments = utils.flattenCommentsPages(page);\n const { comments } = getState();\n let hasNewComments = false;\n const newComments: Comments = {};\n for (const comment of flattenedComments) {\n if (!comment.cid) continue;\n const existing = comments[comment.cid];\n const incomingFresh = Math.max(comment.updatedAt || 0, comment.timestamp || 0, 0);\n const existingFresh = existing\n ? Math.max(existing.updatedAt || 0, existing.timestamp || 0, 0)\n : -1;\n if (!existing || incomingFresh > existingFresh) {\n // don't clone the comment to save memory, comments remain a pointer to the page object\n newComments[comment.cid] = comment;\n hasNewComments = true;\n }\n }\n\n // add missing children replies feeds\n addChildrenRepliesFeedsToAddToStore(page, comment);\n\n setState(({ repliesPages, comments }: any) => {\n const newState: any = { repliesPages: { ...repliesPages, [pageCidToAdd]: page } };\n if (hasNewComments) {\n newState.comments = { ...comments, ...newComments };\n }\n return newState;\n });\n log(\"repliesPagesStore.addNextRepliesPageToStore\", {\n pageCid: pageCidToAdd,\n commentCid: comment.cid,\n sortType,\n page,\n account,\n });\n\n // when publishing a comment, you don't yet know its CID\n // so when a new comment is fetched, check to see if it's your own\n // comment, and if yes, add the CID to your account comments database\n for (const comment of flattenedComments) {\n accountsStore\n .getState()\n .accountsActionsInternal.addCidToAccountComment(comment)\n .catch((error: unknown) =>\n log.error(\"repliesPagesStore.addNextRepliesPageToStore addCidToAccountComment error\", {\n comment,\n error,\n }),\n );\n }\n },\n\n // comments contain preloaded pages, those page comments must be added separately\n addRepliesPageCommentsToStore: (comment: Comment) => {\n if (!comment.replies?.pages) {\n return;\n }\n\n // find new comments in the page (missing-or-fresher: insert when absent or incoming is fresher)\n const flattenedComments = utils.flattenCommentsPages(comment.replies.pages);\n const { comments } = getState();\n let hasNewComments = false;\n const newComments: Comments = {};\n for (const c of flattenedComments) {\n if (!c.cid) continue;\n const existing = comments[c.cid];\n const incomingFresh = Math.max(c.updatedAt || 0, c.timestamp || 0, 0);\n const existingFresh = existing\n ? Math.max(existing.updatedAt || 0, existing.timestamp || 0, 0)\n : -1;\n if (!existing || incomingFresh > existingFresh) {\n // don't clone the comment to save memory, comments remain a pointer to the page object\n newComments[c.cid] = c;\n hasNewComments = true;\n }\n }\n\n if (!hasNewComments) {\n return;\n }\n\n setState(({ comments }: any) => {\n return { comments: { ...comments, ...newComments } };\n });\n log(\"repliesPagesStore.addRepliesPageCommentsToStore\", { comment, newComments });\n },\n }),\n);\n\n// set clients states on comments store so the frontend can display it, dont persist in db because a reload cancels updating\nconst onCommentRepliesClientsStateChange =\n (commentCid: string) =>\n (clientState: string, clientType: string, sortType: string, clientUrl: string) => {\n commentsStore.setState((state: CommentsState) => {\n // make sure not undefined, sometimes happens in e2e tests\n if (!state.comments[commentCid]) {\n return {};\n }\n const client = { state: clientState };\n const comment = { ...state.comments[commentCid] };\n comment.replies = { ...comment.replies };\n comment.replies.clients = { ...comment.replies.clients };\n comment.replies.clients[clientType] = { ...comment.replies.clients[clientType] };\n comment.replies.clients[clientType][sortType] = {\n ...comment.replies.clients[clientType][sortType],\n };\n comment.replies.clients[clientType][sortType][clientUrl] = client;\n return { comments: { ...state.comments, [commentCid]: comment } };\n });\n };\n\nconst fetchPageComments: { [commentCid: string]: any } = {}; // cache pkc.createComment because sometimes it's slow\nlet fetchPagePending: { [key: string]: boolean } = {};\nconst fetchPage = async (pageCid: string, comment: Comment, account: Account) => {\n // replies page is cached\n const cachedRepliesPage = await repliesPagesDatabase.getItem(pageCid);\n if (cachedRepliesPage) {\n return cachedRepliesPage;\n }\n if (!fetchPageComments[comment.cid]) {\n fetchPageComments[comment.cid] = await account.pkc.createComment({\n cid: comment.cid,\n postCid: comment.postCid,\n communityAddress: comment.communityAddress,\n depth: comment.depth,\n });\n listeners.push(fetchPageComments[comment.cid]);\n\n // set clients states on communities store so the frontend can display it\n utils.pageClientsOnStateChange(\n fetchPageComments[comment.cid].replies?.clients,\n onCommentRepliesClientsStateChange(comment.cid),\n );\n }\n\n const onError = (error: any) =>\n log.error(\n `repliesPagesStore comment '${comment.cid}' failed comment.replies.getPage page cid '${pageCid}':`,\n error,\n );\n const fetchedRepliesPage = await utils.retryInfinity(\n () => fetchPageComments[comment.cid].replies.getPage({ cid: pageCid }),\n { onError },\n );\n await repliesPagesDatabase.setItem(pageCid, utils.clone(fetchedRepliesPage));\n return fetchedRepliesPage;\n};\n\n/**\n * Util function to get all pages in the store for a\n * specific comment+sortType using `RepliesPage.nextCid`\n */\nexport const getRepliesPages = (\n comment: Comment,\n sortType: string | undefined,\n repliesPages: RepliesPages,\n) => {\n assert(\n repliesPages && typeof repliesPages === \"object\",\n `getRepliesPages repliesPages '${repliesPages}' invalid`,\n );\n const pages: RepliesPage[] = [];\n const firstPageCid = getRepliesFirstPageCid(comment, sortType);\n // comment has no pages\n // TODO: if a loaded comment doesn't have a first page, it's unclear what we should do\n // should we try to use another sort type by default, like 'best', or should we just ignore it?\n // 'return pages' to ignore it for now\n if (!firstPageCid) {\n return pages;\n }\n const firstPage = repliesPages[firstPageCid];\n if (!firstPage) {\n return pages;\n }\n pages.push(firstPage);\n while (true) {\n const nextCid = pages[pages.length - 1]?.nextCid;\n const repliesPage = nextCid && repliesPages[nextCid];\n if (!repliesPage) {\n return pages;\n }\n pages.push(repliesPage);\n }\n};\n\nexport const getRepliesFirstPageCid = (comment: Comment, sortType?: string) => {\n assert(comment?.cid, `getRepliesFirstPageCid comment '${comment}' invalid`);\n assert(\n sortType === undefined || (typeof sortType === \"string\" && sortType.length > 0),\n `getRepliesFirstPageCid sortType '${sortType}' invalid`,\n );\n // replies served client-side from a complete preloaded page read that page instead of their own\n const pageSortType = getReplyPageSortType(comment, sortType);\n if (!pageSortType) {\n return;\n }\n // comment has preloaded replies for sort type\n if (comment.replies?.pages?.[pageSortType]?.comments) {\n return comment.replies?.pages?.[pageSortType]?.nextCid;\n }\n return comment.replies?.pageCids?.[pageSortType];\n\n // TODO: if a loaded comment doesn't have a first page, it's unclear what we should do\n // should we try to use another sort type by default, like 'best', or should we just ignore it?\n};\n\n// reset store in between tests\nconst originalState = repliesPagesStore.getState();\n// async function because some stores have async init\nexport const resetRepliesPagesStore = async () => {\n fetchPagePending = {};\n // remove all event listeners\n listeners.forEach((listener: any) => listener.removeAllListeners());\n // destroy all component subscriptions to the store\n repliesPagesStore.destroy();\n // restore original state\n repliesPagesStore.setState(originalState);\n};\n\n// reset database and store in between tests\nexport const resetRepliesPagesDatabaseAndStore = async () => {\n await localForageLru.createInstance({ name: \"bitsocialReactHooks-repliesPages\" }).clear();\n await resetRepliesPagesStore();\n};\n\nexport default repliesPagesStore;\n"]}
1
+ {"version":3,"file":"replies-pages-store.js","sour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qDAAqD;AACrD,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAS,EAAE;IAC/C,gBAAgB,GAAG,EAAE,CAAC;IACtB,6BAA6B;IAC7B,SAAS,CAAC,OAAO,CAAC,CAAC,QAAa,EAAE,EAAE,CAAC,QAAQ,CAAC,kBAAkB,EAAE,CAAC,CAAC;IACpE,mDAAmD;IACnD,iBAAiB,CAAC,OAAO,EAAE,CAAC;IAC5B,yBAAyB;IACzB,iBAAiB,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AAEF,4CAA4C;AAC5C,MAAM,CAAC,MAAM,iCAAiC,GAAG,GAAS,EAAE;IAC1D,MAAM,cAAc,CAAC,cAAc,CAAC,EAAE,IAAI,EAAE,kCAAkC,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;IAC1F,MAAM,sBAAsB,EAAE,CAAC;AACjC,CAAC,CAAA,CAAC;AAEF,eAAe,iBAAiB,CAAC","sourcesContent":["import utils from \"../../lib/utils\";\nimport Logger from \"@pkcprotocol/pkc-logger\";\n// include replies pages store with feeds for debugging\nexport const log = Logger(\"bitsocial-react-hooks:replies:stores\");\nimport { RepliesPage, RepliesPages, Account, Comment, Comments } from \"../../types\";\nimport accountsStore from \"../accounts\";\nimport commentsStore, { CommentsState } from \"../comments\";\nimport { addChildrenRepliesFeedsToAddToStore } from \"./utils\";\nimport localForageLru from \"../../lib/localforage-lru\";\nimport createStore from \"zustand\";\nimport assert from \"../../lib/assert\";\nimport { getReplyPageSortType, resolveReplySortType } from \"../../lib/page-sorts\";\n\nconst repliesPagesDatabase = localForageLru.createInstance({\n name: \"bitsocialReactHooks-repliesPages\",\n size: 500,\n});\n\n// reset all event listeners in between tests\nconst listeners: any = [];\n\ntype RepliesPagesState = {\n repliesPages: RepliesPages;\n comments: Comments;\n addNextRepliesPageToStore: Function;\n addRepliesPageCommentsToStore: Function;\n};\n\nconst repliesPagesStore = createStore<RepliesPagesState>(\n (setState: Function, getState: Function) => ({\n // TODO: eventually clear old pages and comments from memory\n repliesPages: {},\n comments: {},\n\n addNextRepliesPageToStore: async (\n comment: Comment,\n sortType: string | undefined,\n account: Account,\n ) => {\n assert(\n comment?.cid && typeof comment?.cid === \"string\",\n `repliesPagesStore.addNextRepliesPageToStore comment '${comment}' invalid`,\n );\n assert(\n sortType === undefined || (typeof sortType === \"string\" && sortType.length > 0),\n `repliesPagesStore.addNextRepliesPageToStore sortType '${sortType}' invalid`,\n );\n const resolvedSortType = resolveReplySortType(comment, sortType);\n if (!resolvedSortType) {\n return;\n }\n sortType = resolvedSortType;\n assert(\n typeof account?.pkc?.createComment === \"function\",\n `repliesPagesStore.addNextRepliesPageToStore account '${account}' invalid`,\n );\n\n // check the preloaded replies on comment.replies.pages first, then the comment.replies.pageCids\n const repliesFirstPageCid = getRepliesFirstPageCid(comment, sortType);\n if (!repliesFirstPageCid) {\n log(\n `repliesPagesStore.addNextRepliesPageToStore comment '${comment?.cid}' sortType '${sortType}' no repliesFirstPageCid`,\n );\n return;\n }\n\n // all replies pages in store\n const repliesPagesStore = getState();\n // only specific pages of the comment+sortType\n const repliesPages = getRepliesPages(comment, sortType, repliesPagesStore.repliesPages);\n\n // if no pages exist yet, add the first page\n let pageCidToAdd: string;\n if (!repliesPages.length) {\n pageCidToAdd = repliesFirstPageCid;\n } else {\n const nextCid = repliesPages[repliesPages.length - 1]?.nextCid;\n // if last nextCid is undefined, reached end of pages\n if (!nextCid) {\n log.trace(\"repliesPagesStore.addNextRepliesPageToStore no more pages\", {\n commentCid: comment.cid,\n sortType,\n account,\n });\n return;\n }\n\n pageCidToAdd = nextCid;\n }\n\n // page is already added or pending\n const pendingKey = account.id + pageCidToAdd;\n if (\n repliesPagesStore.repliesPages[pageCidToAdd] ||\n pageFetchIsPending(pendingKey, account.pkc)\n ) {\n return;\n }\n\n const pendingFetch: PendingPageFetch = { pkc: account.pkc, failed: false };\n fetchPagePending[pendingKey] = [...(fetchPagePending[pendingKey] || []), pendingFetch];\n let page: RepliesPage;\n try {\n page = await fetchPage(pageCidToAdd, comment, account, pendingFetch);\n log.trace(\"repliesPagesStore.addNextRepliesPageToStore comment.replies.getPage\", {\n pageCid: pageCidToAdd,\n page,\n commentCid: comment.cid,\n communityAddress: comment.communityAddress,\n account,\n });\n } catch (e) {\n throw e;\n } finally {\n fetchPagePending[pendingKey] = fetchPagePending[pendingKey]?.filter(\n (fetch) => fetch !== pendingFetch,\n );\n }\n\n // find new comments in the page (missing-or-fresher: insert when absent or incoming is fresher)\n const flattenedComments = utils.flattenCommentsPages(page);\n const { comments } = getState();\n let hasNewComments = false;\n const newComments: Comments = {};\n for (const comment of flattenedComments) {\n if (!comment.cid) continue;\n const existing = comments[comment.cid];\n const incomingFresh = Math.max(comment.updatedAt || 0, comment.timestamp || 0, 0);\n const existingFresh = existing\n ? Math.max(existing.updatedAt || 0, existing.timestamp || 0, 0)\n : -1;\n if (!existing || incomingFresh > existingFresh) {\n // don't clone the comment to save memory, comments remain a pointer to the page object\n newComments[comment.cid] = comment;\n hasNewComments = true;\n }\n }\n\n // add missing children replies feeds\n addChildrenRepliesFeedsToAddToStore(page, comment);\n\n setState(({ repliesPages, comments }: any) => {\n const newState: any = { repliesPages: { ...repliesPages, [pageCidToAdd]: page } };\n if (hasNewComments) {\n newState.comments = { ...comments, ...newComments };\n }\n return newState;\n });\n log(\"repliesPagesStore.addNextRepliesPageToStore\", {\n pageCid: pageCidToAdd,\n commentCid: comment.cid,\n sortType,\n page,\n account,\n });\n\n // when publishing a comment, you don't yet know its CID\n // so when a new comment is fetched, check to see if it's your own\n // comment, and if yes, add the CID to your account comments database\n for (const comment of flattenedComments) {\n accountsStore\n .getState()\n .accountsActionsInternal.addCidToAccountComment(comment)\n .catch((error: unknown) =>\n log.error(\"repliesPagesStore.addNextRepliesPageToStore addCidToAccountComment error\", {\n comment,\n error,\n }),\n );\n }\n },\n\n // comments contain preloaded pages, those page comments must be added separately\n addRepliesPageCommentsToStore: (comment: Comment) => {\n if (!comment.replies?.pages) {\n return;\n }\n\n // find new comments in the page (missing-or-fresher: insert when absent or incoming is fresher)\n const flattenedComments = utils.flattenCommentsPages(comment.replies.pages);\n const { comments } = getState();\n let hasNewComments = false;\n const newComments: Comments = {};\n for (const c of flattenedComments) {\n if (!c.cid) continue;\n const existing = comments[c.cid];\n const incomingFresh = Math.max(c.updatedAt || 0, c.timestamp || 0, 0);\n const existingFresh = existing\n ? Math.max(existing.updatedAt || 0, existing.timestamp || 0, 0)\n : -1;\n if (!existing || incomingFresh > existingFresh) {\n // don't clone the comment to save memory, comments remain a pointer to the page object\n newComments[c.cid] = c;\n hasNewComments = true;\n }\n }\n\n if (!hasNewComments) {\n return;\n }\n\n setState(({ comments }: any) => {\n return { comments: { ...comments, ...newComments } };\n });\n log(\"repliesPagesStore.addRepliesPageCommentsToStore\", { comment, newComments });\n },\n }),\n);\n\n// set clients states on comments store so the frontend can display it, dont persist in db because a reload cancels updating\nconst onCommentRepliesClientsStateChange =\n (commentCid: string) =>\n (clientState: string, clientType: string, sortType: string, clientUrl: string) => {\n commentsStore.setState((state: CommentsState) => {\n // make sure not undefined, sometimes happens in e2e tests\n if (!state.comments[commentCid]) {\n return {};\n }\n const client = { state: clientState };\n const comment = { ...state.comments[commentCid] };\n comment.replies = { ...comment.replies };\n comment.replies.clients = { ...comment.replies.clients };\n comment.replies.clients[clientType] = { ...comment.replies.clients[clientType] };\n comment.replies.clients[clientType][sortType] = {\n ...comment.replies.clients[clientType][sortType],\n };\n comment.replies.clients[clientType][sortType][clientUrl] = client;\n return { comments: { ...state.comments, [commentCid]: comment } };\n });\n };\n\n// cache pkc.createComment per account because sometimes it's slow, recreated when the account's pkc\n// client changes, so page fetches don't keep using a replaced client\nconst fetchPageComments: {\n [accountId: string]: { pkc: any; comments: { [commentCid: string]: any } };\n} = {};\n// the page fetches in progress per account and page cid, with the pkc client each uses. A new fetch\n// waits for one with the same client, or with another client until that one fails, so a replaced\n// client doesn't wait for the old client's retries\ntype PendingPageFetch = { pkc: any; failed: boolean };\nlet fetchPagePending: { [key: string]: PendingPageFetch[] | undefined } = {};\nconst pageFetchIsPending = (key: string, pkc: any) =>\n Boolean(fetchPagePending[key]?.some((fetch) => fetch.pkc === pkc || !fetch.failed));\n// a page fetch stops retrying with its pkc client once its account was deleted, or setAccount gave\n// the account another client. An account the accounts store didn't hold when the fetch started\n// keeps retrying\nconst getShouldRetryPageFetch = (account: Account) => {\n const accountWasStored = Boolean(accountsStore.getState().accounts?.[account.id]);\n return () => {\n const storedAccount = accountsStore.getState().accounts?.[account.id];\n return storedAccount ? storedAccount.pkc === account.pkc : !accountWasStored;\n };\n};\n// setAccount gives the account a new pkc client on every edit, so a fetch that stopped retrying\n// with the replaced client continues with the account's new one, unless another fetch of the page\n// already uses it\nconst getAccountWithNewPkc = (\n account: Account,\n pendingKey: string,\n pendingFetch?: PendingPageFetch,\n): Account | undefined => {\n const storedAccount = accountsStore.getState().accounts?.[account.id];\n if (\n !storedAccount ||\n storedAccount.pkc === account.pkc ||\n fetchPagePending[pendingKey]?.some(\n (fetch) => fetch !== pendingFetch && fetch.pkc === storedAccount.pkc,\n )\n ) {\n return;\n }\n return storedAccount;\n};\nconst fetchPage = async (\n pageCid: string,\n comment: Comment,\n account: Account,\n pendingFetch?: PendingPageFetch,\n): Promise<RepliesPage> => {\n const shouldRetry = getShouldRetryPageFetch(account);\n // replies page is cached\n const cachedRepliesPage = await repliesPagesDatabase.getItem(pageCid);\n if (cachedRepliesPage) {\n return cachedRepliesPage;\n }\n if (!fetchPageComments[account.id] || fetchPageComments[account.id].pkc !== account.pkc) {\n fetchPageComments[account.id] = { pkc: account.pkc, comments: {} };\n }\n const accountComments = fetchPageComments[account.id].comments;\n if (!accountComments[comment.cid]) {\n accountComments[comment.cid] = await account.pkc.createComment({\n cid: comment.cid,\n postCid: comment.postCid,\n communityAddress: comment.communityAddress,\n depth: comment.depth,\n });\n listeners.push(accountComments[comment.cid]);\n\n // set clients states on communities store so the frontend can display it\n utils.pageClientsOnStateChange(\n accountComments[comment.cid].replies?.clients,\n onCommentRepliesClientsStateChange(comment.cid),\n );\n }\n\n const onError = (error: any) => {\n if (pendingFetch) {\n pendingFetch.failed = true;\n }\n log.error(\n `repliesPagesStore comment '${comment.cid}' failed comment.replies.getPage page cid '${pageCid}':`,\n error,\n );\n };\n let fetchedRepliesPage: RepliesPage;\n try {\n fetchedRepliesPage = await utils.retryInfinity(\n () => accountComments[comment.cid].replies.getPage({ cid: pageCid }),\n { onError, shouldRetry },\n );\n } catch (error) {\n const accountWithNewPkc = getAccountWithNewPkc(account, account.id + pageCid, pendingFetch);\n if (!accountWithNewPkc) {\n throw error;\n }\n // the fetch continues as a new fetch with the new client, starting from the page cache\n if (pendingFetch) {\n pendingFetch.pkc = accountWithNewPkc.pkc;\n pendingFetch.failed = false;\n }\n return fetchPage(pageCid, comment, accountWithNewPkc, pendingFetch);\n }\n await repliesPagesDatabase.setItem(pageCid, utils.clone(fetchedRepliesPage));\n return fetchedRepliesPage;\n};\n\n/**\n * Util function to get all pages in the store for a\n * specific comment+sortType using `RepliesPage.nextCid`\n */\nexport const getRepliesPages = (\n comment: Comment,\n sortType: string | undefined,\n repliesPages: RepliesPages,\n) => {\n assert(\n repliesPages && typeof repliesPages === \"object\",\n `getRepliesPages repliesPages '${repliesPages}' invalid`,\n );\n const pages: RepliesPage[] = [];\n const firstPageCid = getRepliesFirstPageCid(comment, sortType);\n // comment has no pages\n // TODO: if a loaded comment doesn't have a first page, it's unclear what we should do\n // should we try to use another sort type by default, like 'best', or should we just ignore it?\n // 'return pages' to ignore it for now\n if (!firstPageCid) {\n return pages;\n }\n const firstPage = repliesPages[firstPageCid];\n if (!firstPage) {\n return pages;\n }\n pages.push(firstPage);\n while (true) {\n const nextCid = pages[pages.length - 1]?.nextCid;\n const repliesPage = nextCid && repliesPages[nextCid];\n if (!repliesPage) {\n return pages;\n }\n pages.push(repliesPage);\n }\n};\n\nexport const getRepliesFirstPageCid = (comment: Comment, sortType?: string) => {\n assert(comment?.cid, `getRepliesFirstPageCid comment '${comment}' invalid`);\n assert(\n sortType === undefined || (typeof sortType === \"string\" && sortType.length > 0),\n `getRepliesFirstPageCid sortType '${sortType}' invalid`,\n );\n // replies served client-side from a complete preloaded page read that page instead of their own\n const pageSortType = getReplyPageSortType(comment, sortType);\n if (!pageSortType) {\n return;\n }\n // comment has preloaded replies for sort type\n if (comment.replies?.pages?.[pageSortType]?.comments) {\n return comment.replies?.pages?.[pageSortType]?.nextCid;\n }\n return comment.replies?.pageCids?.[pageSortType];\n\n // TODO: if a loaded comment doesn't have a first page, it's unclear what we should do\n // should we try to use another sort type by default, like 'best', or should we just ignore it?\n};\n\n// reset store in between tests\nconst originalState = repliesPagesStore.getState();\n// async function because some stores have async init\nexport const resetRepliesPagesStore = async () => {\n fetchPagePending = {};\n // remove all event listeners\n listeners.forEach((listener: any) => listener.removeAllListeners());\n // destroy all component subscriptions to the store\n repliesPagesStore.destroy();\n // restore original state\n repliesPagesStore.setState(originalState);\n};\n\n// reset database and store in between tests\nexport const resetRepliesPagesDatabaseAndStore = async () => {\n await localForageLru.createInstance({ name: \"bitsocialReactHooks-repliesPages\" }).clear();\n await resetRepliesPagesStore();\n};\n\nexport default repliesPagesStore;\n"]}
package/dist/types.d.ts CHANGED
@@ -175,6 +175,7 @@ export interface UseRepliesResult extends Result {
175
175
  bufferedReplies: Comment[];
176
176
  updatedReplies: Comment[];
177
177
  hasMore: boolean;
178
+ sortTypeUnavailable: boolean;
178
179
  loadMore(): Promise<void>;
179
180
  reset(): Promise<void>;
180
181
  }
@@ -239,6 +240,7 @@ export interface UseFeedOptions extends Options {
239
240
  accountComments?: FeedOptionsAccountComments;
240
241
  filter?: CommentsFilter;
241
242
  modQueue?: string[];
243
+ includeBlockedCids?: boolean;
242
244
  }
243
245
  export interface UseFeedResult extends Result {
244
246
  feed: Comment[];
@@ -247,10 +249,11 @@ export interface UseFeedResult extends Result {
247
249
  expandTimeWindow(newerThan?: number): Promise<void>;
248
250
  communityKeysWithNewerPosts: string[];
249
251
  communityKeysWithMore: string[];
252
+ communityKeysWithUnavailableSort: string[];
250
253
  reset(): Promise<void>;
251
254
  }
252
255
  export interface UseBufferedFeedsOptions extends Options {
253
- feedsOptions?: UseFeedOptions[];
256
+ feedsOptions?: Omit<UseFeedOptions, "includeBlockedCids">[];
254
257
  }
255
258
  export interface UseBufferedFeedsResult extends Result {
256
259
  bufferedFeeds: Comment[][];
@@ -312,7 +315,11 @@ export interface UsePublishCommentOptions extends Options {
312
315
  gallery?: CommentGalleryItem[];
313
316
  /** Called immediately with the provisional comment, then again if persistence shifts its index. */
314
317
  onPendingComment?(accountCommentIndex: number, comment: AccountComment): void;
315
- onChallenge?(challenge: Challenge, comment?: Comment): Promise<void>;
318
+ /**
319
+ * abandonPublish abandons this publication only, while the result's abandonPublish() abandons the
320
+ * latest one, which differs once publishComment() was called again before this challenge was answered.
321
+ */
322
+ onChallenge?(challenge: Challenge, comment?: Comment, abandonPublish?: () => Promise<void>): Promise<void>;
316
323
  onChallengeVerification?(challengeVerification: ChallengeVerification, comment?: Comment): Promise<void>;
317
324
  /**
318
325
  * Called before each automatic republish after a failed challenge answer, with the options about to be
@@ -682,10 +689,12 @@ export type FeedOptions = {
682
689
  newerThan?: number;
683
690
  accountComments?: FeedOptionsAccountComments;
684
691
  modQueue?: string[];
692
+ includeBlockedCids?: boolean;
685
693
  };
686
694
  export type FeedOptionsAccountComments = {
687
695
  newerThan?: number;
688
696
  append?: boolean;
697
+ limit?: number;
689
698
  };
690
699
  export type FeedsOptions = {
691
700
  [feedName: string]: FeedOptions;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH,MAAM,WAAW,OAAO;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,WAAW,MAAM;IACr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M,CAAC;CACnB,CAAC;AACF,MAAM,MAAM,sBAAsB,GAAG;IAAE,CAAC,kBAAkB,EAAE,MAAM,GAAG,WAAW,CAAA;CAAE,CAAC;AAEnF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC;AACF,MAAM,MAAM,cAAc,GAAG;IAAE,CAAC,WAAW,EAAE,MAAM,GAAG,aAAa,CAAA;CAAE,CAAC"}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,sEAAsE","sourcesContent":["// Note: the commented out types are TODO functionalities to implement\n\n/**\n * Public interface\n */\n\nexport interface Options {\n accountName?: string;\n onError?(error: Error): void;\n}\n\nexport interface Result {\n state: string;\n error: Error | undefined;\n errors: Error[];\n}\n\nexport interface NameResolverInfo {\n key: string;\n nameSystem: string;\n chainTicker: string;\n provider: string;\n providerLabel: string;\n}\n\nexport type CommunityIdentifier =\n | {\n name: string;\n publicKey?: string;\n }\n | {\n name?: string;\n publicKey: string;\n };\n\n// useAccount(options): result\nexport interface UseAccountOptions extends Options {}\nexport interface UseAccountResult extends Result, Account {}\n\n// useAccounts(options): result\nexport interface UseAccountsOptions extends Options {}\nexport interface UseAccountsResult extends Result {\n accounts: Account[];\n}\n\n// useAccountComments(options): result\nexport interface UseAccountCommentsOptions extends Options {\n filter?: AccountPublicationsFilter;\n commentCid?: string;\n commentIndices?: number[];\n communityAddress?: string;\n parentCid?: string;\n newerThan?: number;\n page?: number;\n pageSize?: number;\n sortType?: \"new\" | \"old\";\n /** @deprecated use sortType */\n order?: \"asc\" | \"desc\";\n}\nexport interface UseAccountCommentsResult extends Result {\n accountComments: AccountComment[];\n}\n\n// useAccountComment(options): result\nexport interface UseAccountCommentOptions extends Options {\n commentIndex?: number;\n commentCid?: string;\n}\nexport interface UseAccountCommentResult extends Result, AccountComment {}\n\n// useAccountVotes(options): result\nexport interface UseAccountVotesOptions extends Options {\n filter?: AccountPublicationsFilter;\n vote?: number;\n commentCid?: string;\n communityAddress?: string;\n newerThan?: number;\n page?: number;\n pageSize?: number;\n sortType?: \"new\" | \"old\";\n /** @deprecated use sortType */\n order?: \"asc\" | \"desc\";\n}\nexport interface UseAccountVotesResult extends Result {\n accountVotes: AccountVote[];\n}\n\n// useAccountVote(options): result\nexport interface UseAccountVoteOptions extends Options {\n commentCid?: string;\n}\nexport interface UseAccountVoteResult extends Result, AccountVote {\n commentCid: string | undefined;\n vote: number | undefined;\n}\n\n// useAccountEdits(options): result\nexport interface UseAccountEditsOptions extends Options {\n filter?: AccountPublicationsFilter;\n}\nexport interface UseAccountEditsResult extends Result {\n accountEdits: AccountEdit[];\n}\n\n// useNotifications(options): result\nexport interface UseNotificationsOptions extends Options {}\nexport interface UseNotificationsResult extends Result {\n notifications: Notification[];\n markAsRead(): Promise<void>;\n}\n\n// useAccountCommunities(options): result\nexport interface UseAccountCommunitiesOptions extends Options {\n onlyIfCached?: boolean;\n}\nexport interface UseAccountCommunitiesResult extends Result {\n accountCommunities: { [communityAddress: string]: AccountCommunity & Partial<Community> };\n}\n\n// usePubsubSubscribe(options): result\nexport interface UsePubsubSubscribeOptions extends Options {\n communityAddress?: string;\n}\nexport interface UsePubsubSubscribeResult extends Result {}\n\n// useComment(options): result\nexport interface UseCommentOptions extends Options {\n commentCid?: string;\n community?: CommunityIdentifier;\n /** Initial data passed to pkc.createComment, for example an embedded crosspost record. */\n initialComment?: Comment;\n onlyIfCached?: boolean;\n autoUpdate?: boolean;\n}\nexport interface UseCommentResult extends Result, Comment {\n refresh(): Promise<void>;\n}\n\nexport interface Crosspost {\n cid: string;\n comment: Comment;\n}\n\nexport interface UseCrosspostOptions extends Options {\n crosspost?: Crosspost;\n autoUpdate?: boolean;\n}\n\nexport interface UseCrosspostResult extends UseCommentResult {\n /** True once the referenced community's signed CommentUpdate has been loaded. */\n isCommunityVerified: boolean;\n}\n\n// useComments(options): result\nexport interface UseCommentsOptions extends Options {\n commentCids?: string[];\n onlyIfCached?: boolean;\n autoUpdate?: boolean;\n}\nexport interface UseCommentsResult extends Result {\n // TODO: remove | undefined, that shouldn't happen when comments have comment.state\n comments: (Comment | undefined)[];\n refresh(): Promise<void>;\n}\n\n// useValidateComment(options): result\nexport interface UseValidateCommentOptions extends Options {\n comment?: Comment;\n validateReplies?: boolean;\n}\nexport interface UseValidateCommentResult extends Result {\n valid: boolean;\n}\n\n// validateComment(comment, options): result\nexport interface ValidateCommentOptions {\n /** @deprecated Ignored, validateComment no longer uses an account. */\n accountName?: string;\n /** Also validate the replies preloaded in comment.raw.commentUpdate.replies. Defaults to true. */\n validateReplies?: boolean;\n /**\n * The comment's community as loaded by useCommunity. Its signer must have signed the\n * commentUpdate. Without it, the signer must be the communityPublicKey the author signed.\n */\n community?: Community;\n}\nexport type ValidateCommentResult = { valid: true } | { valid: false; reason: string };\n\n// useCommentThumbnailUrl(options): result\n// export interface UseCommentThumbnailUrlOptions extends Options {\n// comment?: Comment\n// }\n// export interface UseCommentThumbnailUrlResult extends Result {\n// thumnbailUrl: string | undefined\n// }\n\n// useReplies(options): result\nexport interface UseRepliesOptions extends Options {\n comment?: Comment;\n onlyIfCached?: boolean;\n sortType?: string;\n repliesPerPage?: number;\n flat?: boolean;\n flatDepth?: number;\n accountComments?: FeedOptionsAccountComments;\n filter?: CommentsFilter;\n validateOptimistically?: boolean; // assume replies are valid to first render immediately, then validate, then remove invalid replies, generally safe because validation takes less than 100ms\n streamPage?: boolean; // by default, replies with depth > 1 won't continuously fill the page until repliesPerPage is reached, to not displace the UI\n}\nexport interface UseRepliesResult extends Result {\n replies: Comment[];\n bufferedReplies: Comment[];\n updatedReplies: Comment[];\n hasMore: boolean;\n loadMore(): Promise<void>;\n reset(): Promise<void>;\n}\n\n// useEditedComment(options): result\nexport interface UseEditedCommentOptions extends Options {\n comment?: Comment;\n}\nexport interface UseEditedCommentResult extends Result {\n // editedComment only contains the succeeded and pending props, failed props aren't added\n editedComment: Comment | undefined;\n succeededEdits: { [succeededEditPropertyName: string]: any };\n pendingEdits: { [pendingEditPropertyName: string]: any };\n failedEdits: { [failedEditPropertyName: string]: any };\n // state: 'initializing' | 'unedited' | 'succeeded' | 'pending' | 'failed'\n}\n\n// useCommunity(options): result\nexport type CommunitySyncState =\n | \"initializing\"\n | \"loading\"\n | \"retrying\"\n | \"succeeded\"\n | \"failed\"\n | \"stopped\";\n\nexport interface UseCommunityOptions extends Options {\n community?: CommunityIdentifier;\n onlyIfCached?: boolean;\n /** Keep the community updating while mounted (default true). False loads it once. */\n autoUpdate?: boolean;\n}\nexport interface UseCommunityResult extends Result, Community {\n syncState: CommunitySyncState;\n hasCachedData: boolean;\n lastFetchAttemptAt: number | undefined;\n lastSuccessfulFetchAt: number | undefined;\n /** The transient error behind the current retries, cleared once the community updates. */\n lastRetriableError: Error | undefined;\n}\n\n// useCommunities(options): result\nexport interface UseCommunitiesOptions extends Options {\n communities?: CommunityIdentifier[];\n onlyIfCached?: boolean;\n /** Keep the communities updating while mounted (default true). False loads them once. */\n autoUpdate?: boolean;\n}\nexport interface UseCommunitiesResult extends Result {\n communities: (Community | undefined)[];\n}\n\n// useCommunityStats(options): result\nexport interface UseCommunityStatsOptions extends Options {\n community?: CommunityIdentifier;\n onlyIfCached?: boolean;\n}\nexport interface UseCommunityStatsResult extends Result, CommunityStats {}\n\n// useResolvedCommunityAddress(options): result\nexport interface UseResolvedCommunityAddressOptions extends Options {\n communityAddress: string | undefined;\n cache?: boolean;\n}\nexport interface UseResolvedCommunityAddressResult extends Result {\n resolvedAddress: string | undefined;\n chainProvider: ChainProvider | undefined;\n}\n\n// useFeed(options): result\nexport interface UseFeedOptions extends Options {\n communities?: CommunityIdentifier[];\n sortType?: string;\n postsPerPage?: number;\n newerThan?: number;\n accountComments?: FeedOptionsAccountComments;\n filter?: CommentsFilter;\n modQueue?: string[];\n}\nexport interface UseFeedResult extends Result {\n feed: Comment[];\n hasMore: boolean;\n loadMore(): Promise<void>;\n expandTimeWindow(newerThan?: number): Promise<void>;\n communityKeysWithNewerPosts: string[];\n // communities that still have posts to load, until each has loaded and fetched its last page\n communityKeysWithMore: string[];\n reset(): Promise<void>;\n}\n\n// useBufferedFeeds(options): result\nexport interface UseBufferedFeedsOptions extends Options {\n feedsOptions?: UseFeedOptions[];\n}\nexport interface UseBufferedFeedsResult extends Result {\n bufferedFeeds: Comment[][];\n}\n\n// useAuthor(options): result\nexport interface UseAuthorOptions extends Options {\n authorAddress?: string;\n // the last known comment cid of this author (required, can't fetch author from author address alone)\n commentCid?: string;\n}\nexport interface UseAuthorResult extends Result {\n author: Author | undefined;\n}\n\n// useAuthorComments(options): result\nexport interface UseAuthorCommentsOptions extends Options {\n authorAddress?: string;\n // the last known comment cid of this author (required, can't fetch author comment from author address alone)\n commentCid?: string;\n // TODO: add filter\n filter?: CommentsFilter;\n}\nexport interface UseAuthorCommentsResult extends Result {\n // TODO: remove | undefined, that shouldn't happen when comments have comment.state\n authorComments: (Comment | undefined)[];\n lastCommentCid: string | undefined;\n hasMore: boolean;\n loadMore(): Promise<void>;\n}\n\n// useResolvedAuthorAddress(options): result\nexport interface UseResolvedAuthorAddressOptions extends Options {\n author?: Author;\n cache?: boolean;\n}\nexport interface UseResolvedAuthorAddressResult extends Result {\n resolvedAddress: string | undefined;\n chainProvider: ChainProvider | undefined;\n nameResolver: NameResolverInfo | undefined;\n}\n\n// useAuthorAvatar(options): result\nexport interface UseAuthorAvatarOptions extends Options {\n author?: Author;\n}\nexport interface UseAuthorAvatarResult extends Result {\n imageUrl: string | undefined;\n metadataUrl: string | undefined;\n chainProvider: ChainProvider | undefined;\n}\n\n// useAuthorAddress(options): result\nexport interface UseAuthorAddressOptions extends Options {\n comment?: Comment;\n}\nexport interface UseAuthorAddressResult extends Result {\n authorAddress: string | undefined;\n shortAuthorAddress: string | undefined;\n authorAddressChanged: boolean;\n}\n\n// useCreateAccount(options): result\n// export interface UseCreateAccountOptions extends Options {}\n// export interface UseCreateAccountResult extends Result {\n// createdAccount: Account | undefined\n// createAccount(): Promise<void>\n// }\n\n// useDeleteAccount(options): result\n// export interface UseDeleteAccountOptions extends Options {}\n// export interface UseDeleteAccountResult extends Result {\n// deletedAccount: Account | undefined\n// deleteAccount(): Promise<void>\n// }\n\n// useSetAccount(options): result\n// export interface UseSetAccountOptions extends Options {\n// account?: Account\n// }\n// export interface UseSetAccountResult extends Result {\n// account: Account | undefined\n// setAccount(): Promise<void>\n// }\n\n// useSetActiveAccount(options): result\n// export interface UseSetActiveAccountOptions extends Options {\n// activeAccount?: string\n// }\n// export interface UseSetActiveAccountResult extends Result {\n// activeAccount: string | undefined\n// setActiveAccount(): Promise<void>\n// }\n\n// useSetAccountsOrder(options): result\n// export interface UseSetAccountsOrderOptions extends Options {\n// accountsOrder?: string[]\n// }\n// export interface UseSetAccountsOrderResult extends Result {\n// accountsOrder: string[]\n// setAccountsOrder(): Promise<void>\n// }\n\n// useImportAccount(options): result\n// export interface UseImportAccountOptions extends Options {\n// account?: string\n// }\n// export interface UseImportAccountResult extends Result {\n// importedAccount: Account | undefined\n// importAccount(): Promise<void>\n// }\n\n// useExportAccount(options): result\n// export interface UseExportAccountOptions extends Options {}\n// export interface UseExportAccountResult extends Result {\n// exportedAccount: string | undefined\n// exportAccount(): Promise<void>\n// }\n\n// usePublishComment(options): result\n/** An author-signed image, video or audio attachment. Additional protocol fields are preserved. */\nexport interface CommentGalleryItem {\n url: string;\n htmlTagName: \"img\" | \"video\" | \"audio\";\n width?: number;\n height?: number;\n alt?: string;\n [key: string]: unknown;\n}\n\nexport interface UsePublishCommentOptions extends Options {\n /** Requires the community to enable maxPostGalleryItems or maxReplyGalleryItems. */\n gallery?: CommentGalleryItem[];\n /** Called immediately with the provisional comment, then again if persistence shifts its index. */\n onPendingComment?(accountCommentIndex: number, comment: AccountComment): void;\n onChallenge?(challenge: Challenge, comment?: Comment): Promise<void>;\n onChallengeVerification?(\n challengeVerification: ChallengeVerification,\n comment?: Comment,\n ): Promise<void>;\n /**\n * Called before each automatic republish after a failed challenge answer, with the options about to be\n * republished: the last published options, without callbacks, with timestamp set to the current time\n * (the same as the last timestamp if the republish happens within the same second). Resolves to the\n * options to publish instead, which go through the same validation and wordfilters as the first\n * publish. A rejection ends the publish and is reported through onError. While it runs, the pending\n * comment keeps its last publishing state.\n */\n onBeforeRepublish?(\n publishCommentOptions: PublishCommentOptions,\n ): PublishCommentOptions | Promise<PublishCommentOptions>;\n [publishOption: string]: any;\n}\nexport interface UsePublishCommentResult extends Result {\n index: number | undefined;\n challenge: Challenge | undefined;\n challengeVerification: ChallengeVerification | undefined;\n publishComment(): Promise<void>;\n abandonPublish(): Promise<void>;\n publishChallengeAnswers(challengeAnswers?: string[]): Promise<void>;\n}\n\n// usePublishVote(options): result\nexport interface UsePublishVoteOptions extends Options {\n onChallenge?(challenge: Challenge, comment?: Comment): Promise<void>;\n onChallengeVerification?(\n challengeVerification: ChallengeVerification,\n comment?: Comment,\n ): Promise<void>;\n [publishOption: string]: any;\n}\nexport interface UsePublishVoteResult extends Result {\n challenge: Challenge | undefined;\n challengeVerification: ChallengeVerification | undefined;\n publishVote(): Promise<void>;\n abandonPublish(): Promise<void>;\n publishChallengeAnswers(challengeAnswers?: string[]): Promise<void>;\n}\n\n// usePublishCommentEdit(options): result\nexport interface UsePublishCommentEditOptions extends Options {\n onChallenge?(challenge: Challenge, comment?: Comment): Promise<void>;\n onChallengeVerification?(\n challengeVerification: ChallengeVerification,\n comment?: Comment,\n ): Promise<void>;\n [publishOption: string]: any;\n}\nexport interface UsePublishCommentEditResult extends Result {\n challenge: Challenge | undefined;\n challengeVerification: ChallengeVerification | undefined;\n publishCommentEdit(): Promise<void>;\n publishChallengeAnswers(challengeAnswers?: string[]): Promise<void>;\n}\n\n// usePublishCommentModeration(options): result\nexport interface UsePublishCommentModerationOptions extends Options {\n onChallenge?(challenge: Challenge, comment?: Comment): Promise<void>;\n onChallengeVerification?(\n challengeVerification: ChallengeVerification,\n comment?: Comment,\n ): Promise<void>;\n [publishOption: string]: any;\n}\nexport interface UsePublishCommentModerationResult extends Result {\n challenge: Challenge | undefined;\n challengeVerification: ChallengeVerification | undefined;\n publishCommentModeration(): Promise<void>;\n publishChallengeAnswers(challengeAnswers?: string[]): Promise<void>;\n}\n\n// usePublishCommunityEdit(options): result\nexport interface UsePublishCommunityEditOptions extends Options {\n communityAddress?: string;\n onChallenge?(challenge: Challenge, comment?: Comment): Promise<void>;\n onChallengeVerification?(\n challengeVerification: ChallengeVerification,\n comment?: Comment,\n ): Promise<void>;\n [publishOption: string]: any;\n}\nexport interface UsePublishCommunityEditResult extends Result {\n challenge: Challenge | undefined;\n challengeVerification: ChallengeVerification | undefined;\n publishCommunityEdit(): Promise<void>;\n publishChallengeAnswers(challengeAnswers?: string[]): Promise<void>;\n}\n\n// useCreateCommunity(options): result\nexport interface UseCreateCommunityOptions extends Options {\n [createCommunityOption: string]: any;\n}\nexport interface UseCreateCommunityResult extends Result {\n createdCommunity: Community | undefined;\n createCommunity(): Promise<void>;\n}\n\n// useExportCommunity(options): result\nexport interface UseExportCommunityOptions extends Options {\n communityAddress?: string;\n communityAddresses?: string[];\n includePrivateKey?: boolean;\n exportPath?: string;\n signal?: AbortSignal;\n}\nexport interface UseExportCommunityResult extends Result {\n communityExports: CommunityExport[];\n exportCommunity(): Promise<void>;\n}\n\n// useDeleteCommunity(options): result\n// export interface UseDeleteCommunityOptions extends Options {\n// communityAddress?: string\n// }\n// export interface UseDeleteCommunityResult extends Result {\n// deletedCommunity: Community | undefined\n// deleteCommunity(): Promise<void>\n// }\n\n// useSubscribe(options): result\nexport interface UseSubscribeOptions extends Options {\n communityAddress?: string;\n multisubAddress?: string;\n authorAddress?: string;\n}\nexport interface UseSubscribeResult extends Result {\n subscribed: boolean | undefined;\n subscribe(): Promise<void>;\n unsubscribe(): Promise<void>;\n}\n\n// useBlock(options): result\nexport interface UseBlockOptions extends Options {\n address?: string;\n cid?: string;\n}\nexport interface UseBlockResult extends Result {\n blocked: boolean | undefined;\n block(): Promise<void>;\n unblock(): Promise<void>;\n}\n\n// useSaveComment(options): result\nexport interface UseSaveCommentOptions extends Options {\n commentCid?: string;\n}\nexport interface UseSaveCommentResult extends Result {\n saved: boolean | undefined;\n saveComment(): Promise<void>;\n unsaveComment(): Promise<void>;\n}\n\n// useNotify(options): result\n// export interface UseNotifyOptions extends Options {\n// communityAddress?: string\n// multisubAddress?: string\n// authorAddress?: string\n// commentCid?: string\n// }\n// export interface UseNotifyCommunityResult extends Result {\n// notifying: boolean | undefined\n// notify(): Promise<void>\n// unnotify(): Promise<void>\n// }\n\n// useLimit(options): result\n// export interface UseLimitOptions extends Options {\n// address?: string\n// }\n// export interface UseLimitResult extends Result {\n// limited: number | undefined\n// limit(): Promise<void>\n// unlimit(): Promise<void>\n// }\n\n// useSave(options): result\n// export interface UseSaveOptions extends Options {\n// commentCid?: string\n// }\n// export interface UseSaveResult extends Result {\n// saved: boolean | undefined\n// save(): Promise<void>\n// unsave(): Promise<void>\n// }\n\n// useDeleteComment(options): result\n// export interface UseDeleteCommentOptions extends Options {\n// commentCid?: string\n// accountCommentIndex?: number\n// }\n// export interface UseDeleteCommentResult extends Result {\n// deletedComment: Comment | undefined\n// deleteComment(): Promise<void>\n// undeleteComment(): Promise<void>\n// }\n\nexport interface UseClientsStatesOptions extends Options {\n comment?: Comment;\n community?: Community;\n}\ntype ClientUrls = string[];\ntype Peer = string;\nexport interface UseClientsStatesResult extends Result {\n states: { [state: string]: ClientUrls };\n peers: { [clientUrl: string]: Peer[] };\n}\n\nexport interface UseCommunitiesStatesOptions extends Options {\n communities?: CommunityIdentifier[];\n}\nexport interface UseCommunitiesStatesResult extends Result {\n states: { [state: string]: { communityAddresses: string[]; clientUrls: string[] } };\n peers: { [clientUrl: string]: Peer[] };\n}\n\nexport type PkcRpcChallengeOptionInput = {\n option: string;\n label: string;\n default?: string;\n description?: string;\n placeholder?: string;\n required?: boolean;\n [key: string]: unknown;\n};\nexport type PkcRpcChallengeSettings = {\n optionInputs?: PkcRpcChallengeOptionInput[];\n type?: string;\n challenge?: string;\n caseInsensitive?: boolean;\n description?: string;\n [key: string]: unknown;\n};\nexport type PkcRpcSettings = {\n pkcOptions?: Record<string, unknown>;\n challenges?: Record<string, PkcRpcChallengeSettings>;\n [key: string]: any;\n};\nexport interface UsePkcRpcSettingsOptions extends Options {}\nexport interface UsePkcRpcSettingsResult extends Result {\n pkcRpcSettings: PkcRpcSettings | undefined;\n setPkcRpcSettings(pkcRpcSettings: PkcRpcSettings): Promise<void>;\n}\n\n/**\n * TODO: define these types more in depth, most are already defined in:\n * https://github.com/pkcprotocol/pkc-js or\n * https://github.com/bitsocialnet/bitsocial-react-hooks/blob/master/docs/schema.md\n */\nexport type Account = { [key: string]: any };\nexport type AccountsActions = { [key: string]: any };\nexport type PublishCommentOptions = { [key: string]: any };\nexport type PublishVoteOptions = { [key: string]: any };\nexport type PublishCommentEditOptions = { [key: string]: any };\nexport type PublishCommentModerationOptions = { [key: string]: any };\nexport type PublishCommunityEditOptions = { [key: string]: any };\nexport interface ExportCommunityOptions {\n includePrivateKey?: boolean;\n exportPath?: string;\n signal?: AbortSignal;\n [key: string]: unknown;\n}\nexport type Challenge = { [key: string]: any };\nexport type ChallengeVerification = { [key: string]: any };\nexport type CreateCommentOptions = { [key: string]: any };\nexport type CreateCommunityOptions = { [key: string]: any };\nexport type CreateVoteOptions = { [key: string]: any };\n// Keep this open shape assignable to consumers selecting arbitrary optional comment fields.\n// Adding a named optional field triggers TypeScript weak-target checks (see types.compat.test.ts).\nexport type Comment = { [key: string]: any };\nexport type Vote = { [key: string]: any };\nexport type CommentEdit = { [key: string]: any };\nexport type CommentModeration = { [key: string]: any };\nexport type CommunityEdit = { [key: string]: any };\nexport type Community = { [key: string]: any };\nexport type CommunityExport = {\n communityAddress: string;\n exportId: string;\n name?: string;\n publicKey?: string;\n includePrivateKey?: boolean;\n progress?: number;\n url?: string;\n [key: string]: unknown;\n};\nexport type CommunityStats = { [key: string]: any };\nexport type Notification = { [key: string]: any };\nexport type Nft = { [key: string]: any };\nexport type Author = { [key: string]: any };\nexport type Wallet = { [key: string]: any };\n\n/**\n * Communities and comments store\n */\nexport type Communities = { [communityAddress: string]: Community };\nexport type Comments = { [commentCid: string]: Comment };\n\n/**\n * Accounts store\n */\nexport type Accounts = { [accountId: string]: Account };\nexport type AccountNamesToAccountIds = { [accountName: string]: string };\nexport interface AccountComment extends Comment {\n index: number;\n accountId: string;\n}\nexport type AccountComments = AccountComment[];\nexport type AccountsComments = { [accountId: string]: AccountComments };\nexport type AccountCommentsIndex = {\n byCommunityAddress: { [communityAddress: string]: number[] };\n byParentCid: { [parentCid: string]: number[] };\n};\nexport type AccountsCommentsIndexes = { [accountId: string]: AccountCommentsIndex };\nexport type CommentCidsToAccountsComments = {\n [commentCid: string]: { accountId: string; accountCommentIndex: number };\n};\nexport interface AccountCommentReply extends Comment {\n markedAsRead: boolean;\n}\nexport type AccountCommentsReplies = { [replyCid: string]: AccountCommentReply };\nexport type AccountsCommentsReplies = { [accountId: string]: AccountCommentsReplies };\nexport type AccountsNotifications = { [accountId: string]: Notification[] };\nexport type Role = {\n role: \"owner\" | \"admin\" | \"moderator\";\n};\nexport type AccountCommunity = {\n role: Role;\n};\nexport type AccountsVotes = { [accountId: string]: AccountVotes };\nexport type AccountVotes = { [commentCid: string]: AccountVote };\nexport type AccountVote = {\n // has all the publish options like commentCid, vote, timestamp, etc\n [publishOption: string]: any;\n};\nexport type AccountsEdits = { [accountId: string]: AccountEdits };\nexport type AccountEdits = { [commentCidOrCommunityAddress: string]: AccountEdit[] };\nexport type AccountEditPropertySummary = {\n timestamp: number;\n value: any;\n};\nexport type AccountEditsSummary = {\n [commentCidOrCommunityAddress: string]: {\n [propertyName: string]: AccountEditPropertySummary;\n };\n};\nexport type AccountsEditsSummaries = { [accountId: string]: AccountEditsSummary };\nexport type AccountEdit = {\n // has all the publish options like commentCid, vote, timestamp, etc (both comment edits and community edits)\n [publishOption: string]: any;\n};\nexport type AccountPublicationsFilter = (\n publication: AccountComment | AccountVote | AccountEdit,\n) => Boolean;\n\n/**\n * Feeds store\n */\nexport type Feed = Comment[];\nexport type Feeds = { [feedName: string]: Feed };\nexport type FeedOptions = {\n communities: CommunityIdentifier[];\n communityKeys: string[];\n sortType?: string;\n /** @deprecated Ignored. Feed sort names are no longer derived from time windows. */\n requestedSortType?: string;\n accountId: string;\n pageNumber: number;\n postsPerPage: number;\n filter: CommentsFilter;\n newerThan?: number;\n accountComments?: FeedOptionsAccountComments;\n modQueue?: string[];\n};\nexport type FeedOptionsAccountComments = {\n newerThan?: number;\n append?: boolean; // default to prepend, set append: true to append instead\n};\nexport type FeedsOptions = { [feedName: string]: FeedOptions };\nexport type FeedCommunitiesPostCounts = { [communityAddress: string]: number };\nexport type FeedsCommunitiesPostCounts = { [feedName: string]: FeedCommunitiesPostCounts };\nexport type CommunityPage = {\n nextCid?: string;\n comments: Comment[];\n};\nexport type CommunitiesPages = { [pageCid: string]: CommunityPage };\nexport type CommentsFilter = {\n filter(comment: Comment): Boolean;\n key: string;\n};\n\n/**\n * Replies store\n */\n// NOTE: to have different replies options for different depth, eg smaller repliesPerPage for depth > 1,\n// we will need another prop, eg `{depth: '>1': {repliesPerPage: 3}}`, because of how react renders work\nexport type RepliesFeedOptions = {\n commentCid: string;\n commentDepth: number;\n postCid: string;\n sortType?: string;\n accountId: string;\n pageNumber: number;\n repliesPerPage: number;\n onlyIfCached?: boolean;\n flat?: boolean;\n accountComments?: FeedOptionsAccountComments;\n filter?: CommentsFilter;\n streamPage?: boolean; // by default, replies with depth > 1 won't continuously fill the page until repliesPerPage is reached, to not displace the UI\n};\nexport type RepliesFeedsOptions = { [feedName: string]: RepliesFeedOptions };\nexport type RepliesPage = CommunityPage;\nexport type RepliesPages = { [pageCid: string]: RepliesPage };\n\n/**\n * Authors comments store\n */\n// authorCommentsName is a string used a key to represent authorAddress + filter + accountId\nexport type AuthorsComments = { [authorCommentsName: string]: Comment[] };\nexport type AuthorCommentsOptions = {\n authorAddress: string;\n pageNumber: number;\n filter?: CommentsFilter;\n accountId: string;\n};\nexport type AuthorsCommentsOptions = { [authorCommentsName: string]: FeedOptions };\n\n/**\n * Other\n */\nexport type ChainProvider = {\n chainId?: number;\n urls?: string[];\n};\nexport type ChainProviders = { [chainTicker: string]: ChainProvider };\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,sEAAsE","sourcesContent":["// Note: the commented out types are TODO functionalities to implement\n\n/**\n * Public interface\n */\n\nexport interface Options {\n accountName?: string;\n onError?(error: Error): void;\n}\n\nexport interface Result {\n state: string;\n error: Error | undefined;\n errors: Error[];\n}\n\nexport interface NameResolverInfo {\n key: string;\n nameSystem: string;\n chainTicker: string;\n provider: string;\n providerLabel: string;\n}\n\nexport type CommunityIdentifier =\n | {\n name: string;\n publicKey?: string;\n }\n | {\n name?: string;\n publicKey: string;\n };\n\n// useAccount(options): result\nexport interface UseAccountOptions extends Options {}\nexport interface UseAccountResult extends Result, Account {}\n\n// useAccounts(options): result\nexport interface UseAccountsOptions extends Options {}\nexport interface UseAccountsResult extends Result {\n accounts: Account[];\n}\n\n// useAccountComments(options): result\nexport interface UseAccountCommentsOptions extends Options {\n filter?: AccountPublicationsFilter;\n commentCid?: string;\n commentIndices?: number[];\n communityAddress?: string;\n parentCid?: string;\n newerThan?: number;\n page?: number;\n pageSize?: number;\n sortType?: \"new\" | \"old\";\n /** @deprecated use sortType */\n order?: \"asc\" | \"desc\";\n}\nexport interface UseAccountCommentsResult extends Result {\n accountComments: AccountComment[];\n}\n\n// useAccountComment(options): result\nexport interface UseAccountCommentOptions extends Options {\n commentIndex?: number;\n commentCid?: string;\n}\nexport interface UseAccountCommentResult extends Result, AccountComment {}\n\n// useAccountVotes(options): result\nexport interface UseAccountVotesOptions extends Options {\n filter?: AccountPublicationsFilter;\n vote?: number;\n commentCid?: string;\n communityAddress?: string;\n newerThan?: number;\n page?: number;\n pageSize?: number;\n sortType?: \"new\" | \"old\";\n /** @deprecated use sortType */\n order?: \"asc\" | \"desc\";\n}\nexport interface UseAccountVotesResult extends Result {\n accountVotes: AccountVote[];\n}\n\n// useAccountVote(options): result\nexport interface UseAccountVoteOptions extends Options {\n commentCid?: string;\n}\nexport interface UseAccountVoteResult extends Result, AccountVote {\n commentCid: string | undefined;\n vote: number | undefined;\n}\n\n// useAccountEdits(options): result\nexport interface UseAccountEditsOptions extends Options {\n filter?: AccountPublicationsFilter;\n}\nexport interface UseAccountEditsResult extends Result {\n accountEdits: AccountEdit[];\n}\n\n// useNotifications(options): result\nexport interface UseNotificationsOptions extends Options {}\nexport interface UseNotificationsResult extends Result {\n notifications: Notification[];\n markAsRead(): Promise<void>;\n}\n\n// useAccountCommunities(options): result\nexport interface UseAccountCommunitiesOptions extends Options {\n onlyIfCached?: boolean;\n}\nexport interface UseAccountCommunitiesResult extends Result {\n accountCommunities: { [communityAddress: string]: AccountCommunity & Partial<Community> };\n}\n\n// usePubsubSubscribe(options): result\nexport interface UsePubsubSubscribeOptions extends Options {\n communityAddress?: string;\n}\nexport interface UsePubsubSubscribeResult extends Result {}\n\n// useComment(options): result\nexport interface UseCommentOptions extends Options {\n commentCid?: string;\n community?: CommunityIdentifier;\n /** Initial data passed to pkc.createComment, for example an embedded crosspost record. */\n initialComment?: Comment;\n onlyIfCached?: boolean;\n autoUpdate?: boolean;\n}\nexport interface UseCommentResult extends Result, Comment {\n refresh(): Promise<void>;\n}\n\nexport interface Crosspost {\n cid: string;\n comment: Comment;\n}\n\nexport interface UseCrosspostOptions extends Options {\n crosspost?: Crosspost;\n autoUpdate?: boolean;\n}\n\nexport interface UseCrosspostResult extends UseCommentResult {\n /** True once the referenced community's signed CommentUpdate has been loaded. */\n isCommunityVerified: boolean;\n}\n\n// useComments(options): result\nexport interface UseCommentsOptions extends Options {\n commentCids?: string[];\n onlyIfCached?: boolean;\n autoUpdate?: boolean;\n}\nexport interface UseCommentsResult extends Result {\n // TODO: remove | undefined, that shouldn't happen when comments have comment.state\n comments: (Comment | undefined)[];\n refresh(): Promise<void>;\n}\n\n// useValidateComment(options): result\nexport interface UseValidateCommentOptions extends Options {\n comment?: Comment;\n validateReplies?: boolean;\n}\nexport interface UseValidateCommentResult extends Result {\n valid: boolean;\n}\n\n// validateComment(comment, options): result\nexport interface ValidateCommentOptions {\n /** @deprecated Ignored, validateComment no longer uses an account. */\n accountName?: string;\n /** Also validate the replies preloaded in comment.raw.commentUpdate.replies. Defaults to true. */\n validateReplies?: boolean;\n /**\n * The comment's community as loaded by useCommunity. Its signer must have signed the\n * commentUpdate. Without it, the signer must be the communityPublicKey the author signed.\n */\n community?: Community;\n}\nexport type ValidateCommentResult = { valid: true } | { valid: false; reason: string };\n\n// useCommentThumbnailUrl(options): result\n// export interface UseCommentThumbnailUrlOptions extends Options {\n// comment?: Comment\n// }\n// export interface UseCommentThumbnailUrlResult extends Result {\n// thumnbailUrl: string | undefined\n// }\n\n// useReplies(options): result\nexport interface UseRepliesOptions extends Options {\n comment?: Comment;\n onlyIfCached?: boolean;\n sortType?: string;\n repliesPerPage?: number;\n flat?: boolean;\n flatDepth?: number;\n accountComments?: FeedOptionsAccountComments;\n filter?: CommentsFilter;\n validateOptimistically?: boolean; // assume replies are valid to first render immediately, then validate, then remove invalid replies, generally safe because validation takes less than 100ms\n streamPage?: boolean; // by default, replies with depth > 1 won't continuously fill the page until repliesPerPage is reached, to not displace the UI\n}\nexport interface UseRepliesResult extends Result {\n replies: Comment[];\n bufferedReplies: Comment[];\n updatedReplies: Comment[];\n hasMore: boolean;\n // the comment's replies are published, but not under the requested sortType\n sortTypeUnavailable: boolean;\n loadMore(): Promise<void>;\n reset(): Promise<void>;\n}\n\n// useEditedComment(options): result\nexport interface UseEditedCommentOptions extends Options {\n comment?: Comment;\n}\nexport interface UseEditedCommentResult extends Result {\n // editedComment only contains the succeeded and pending props, failed props aren't added\n editedComment: Comment | undefined;\n succeededEdits: { [succeededEditPropertyName: string]: any };\n pendingEdits: { [pendingEditPropertyName: string]: any };\n failedEdits: { [failedEditPropertyName: string]: any };\n // state: 'initializing' | 'unedited' | 'succeeded' | 'pending' | 'failed'\n}\n\n// useCommunity(options): result\nexport type CommunitySyncState =\n | \"initializing\"\n | \"loading\"\n | \"retrying\"\n | \"succeeded\"\n | \"failed\"\n | \"stopped\";\n\nexport interface UseCommunityOptions extends Options {\n community?: CommunityIdentifier;\n onlyIfCached?: boolean;\n /** Keep the community updating while mounted (default true). False loads it once. */\n autoUpdate?: boolean;\n}\nexport interface UseCommunityResult extends Result, Community {\n syncState: CommunitySyncState;\n hasCachedData: boolean;\n lastFetchAttemptAt: number | undefined;\n lastSuccessfulFetchAt: number | undefined;\n /** The transient error behind the current retries, cleared once the community updates. */\n lastRetriableError: Error | undefined;\n}\n\n// useCommunities(options): result\nexport interface UseCommunitiesOptions extends Options {\n communities?: CommunityIdentifier[];\n onlyIfCached?: boolean;\n /** Keep the communities updating while mounted (default true). False loads them once. */\n autoUpdate?: boolean;\n}\nexport interface UseCommunitiesResult extends Result {\n communities: (Community | undefined)[];\n}\n\n// useCommunityStats(options): result\nexport interface UseCommunityStatsOptions extends Options {\n community?: CommunityIdentifier;\n onlyIfCached?: boolean;\n}\nexport interface UseCommunityStatsResult extends Result, CommunityStats {}\n\n// useResolvedCommunityAddress(options): result\nexport interface UseResolvedCommunityAddressOptions extends Options {\n communityAddress: string | undefined;\n cache?: boolean;\n}\nexport interface UseResolvedCommunityAddressResult extends Result {\n resolvedAddress: string | undefined;\n chainProvider: ChainProvider | undefined;\n}\n\n// useFeed(options): result\nexport interface UseFeedOptions extends Options {\n communities?: CommunityIdentifier[];\n sortType?: string;\n postsPerPage?: number;\n newerThan?: number;\n accountComments?: FeedOptionsAccountComments;\n filter?: CommentsFilter;\n modQueue?: string[];\n includeBlockedCids?: boolean; // keep the posts whose cid the account blocked (account.blockedCids) in the feed\n}\nexport interface UseFeedResult extends Result {\n feed: Comment[];\n hasMore: boolean;\n loadMore(): Promise<void>;\n expandTimeWindow(newerThan?: number): Promise<void>;\n communityKeysWithNewerPosts: string[];\n // communities that still have posts to load, until each has loaded and fetched its last page\n communityKeysWithMore: string[];\n // loaded communities that do not serve the requested sortType, so they add nothing to the feed\n communityKeysWithUnavailableSort: string[];\n reset(): Promise<void>;\n}\n\n// useBufferedFeeds(options): result\nexport interface UseBufferedFeedsOptions extends Options {\n // buffered feeds always leave out blocked cids, includeBlockedCids is a useFeed option\n feedsOptions?: Omit<UseFeedOptions, \"includeBlockedCids\">[];\n}\nexport interface UseBufferedFeedsResult extends Result {\n bufferedFeeds: Comment[][];\n}\n\n// useAuthor(options): result\nexport interface UseAuthorOptions extends Options {\n authorAddress?: string;\n // the last known comment cid of this author (required, can't fetch author from author address alone)\n commentCid?: string;\n}\nexport interface UseAuthorResult extends Result {\n author: Author | undefined;\n}\n\n// useAuthorComments(options): result\nexport interface UseAuthorCommentsOptions extends Options {\n authorAddress?: string;\n // the last known comment cid of this author (required, can't fetch author comment from author address alone)\n commentCid?: string;\n // TODO: add filter\n filter?: CommentsFilter;\n}\nexport interface UseAuthorCommentsResult extends Result {\n // TODO: remove | undefined, that shouldn't happen when comments have comment.state\n authorComments: (Comment | undefined)[];\n lastCommentCid: string | undefined;\n hasMore: boolean;\n loadMore(): Promise<void>;\n}\n\n// useResolvedAuthorAddress(options): result\nexport interface UseResolvedAuthorAddressOptions extends Options {\n author?: Author;\n cache?: boolean;\n}\nexport interface UseResolvedAuthorAddressResult extends Result {\n resolvedAddress: string | undefined;\n chainProvider: ChainProvider | undefined;\n nameResolver: NameResolverInfo | undefined;\n}\n\n// useAuthorAvatar(options): result\nexport interface UseAuthorAvatarOptions extends Options {\n author?: Author;\n}\nexport interface UseAuthorAvatarResult extends Result {\n imageUrl: string | undefined;\n metadataUrl: string | undefined;\n chainProvider: ChainProvider | undefined;\n}\n\n// useAuthorAddress(options): result\nexport interface UseAuthorAddressOptions extends Options {\n comment?: Comment;\n}\nexport interface UseAuthorAddressResult extends Result {\n authorAddress: string | undefined;\n shortAuthorAddress: string | undefined;\n authorAddressChanged: boolean;\n}\n\n// useCreateAccount(options): result\n// export interface UseCreateAccountOptions extends Options {}\n// export interface UseCreateAccountResult extends Result {\n// createdAccount: Account | undefined\n// createAccount(): Promise<void>\n// }\n\n// useDeleteAccount(options): result\n// export interface UseDeleteAccountOptions extends Options {}\n// export interface UseDeleteAccountResult extends Result {\n// deletedAccount: Account | undefined\n// deleteAccount(): Promise<void>\n// }\n\n// useSetAccount(options): result\n// export interface UseSetAccountOptions extends Options {\n// account?: Account\n// }\n// export interface UseSetAccountResult extends Result {\n// account: Account | undefined\n// setAccount(): Promise<void>\n// }\n\n// useSetActiveAccount(options): result\n// export interface UseSetActiveAccountOptions extends Options {\n// activeAccount?: string\n// }\n// export interface UseSetActiveAccountResult extends Result {\n// activeAccount: string | undefined\n// setActiveAccount(): Promise<void>\n// }\n\n// useSetAccountsOrder(options): result\n// export interface UseSetAccountsOrderOptions extends Options {\n// accountsOrder?: string[]\n// }\n// export interface UseSetAccountsOrderResult extends Result {\n// accountsOrder: string[]\n// setAccountsOrder(): Promise<void>\n// }\n\n// useImportAccount(options): result\n// export interface UseImportAccountOptions extends Options {\n// account?: string\n// }\n// export interface UseImportAccountResult extends Result {\n// importedAccount: Account | undefined\n// importAccount(): Promise<void>\n// }\n\n// useExportAccount(options): result\n// export interface UseExportAccountOptions extends Options {}\n// export interface UseExportAccountResult extends Result {\n// exportedAccount: string | undefined\n// exportAccount(): Promise<void>\n// }\n\n// usePublishComment(options): result\n/** An author-signed image, video or audio attachment. Additional protocol fields are preserved. */\nexport interface CommentGalleryItem {\n url: string;\n htmlTagName: \"img\" | \"video\" | \"audio\";\n width?: number;\n height?: number;\n alt?: string;\n [key: string]: unknown;\n}\n\nexport interface UsePublishCommentOptions extends Options {\n /** Requires the community to enable maxPostGalleryItems or maxReplyGalleryItems. */\n gallery?: CommentGalleryItem[];\n /** Called immediately with the provisional comment, then again if persistence shifts its index. */\n onPendingComment?(accountCommentIndex: number, comment: AccountComment): void;\n /**\n * abandonPublish abandons this publication only, while the result's abandonPublish() abandons the\n * latest one, which differs once publishComment() was called again before this challenge was answered.\n */\n onChallenge?(\n challenge: Challenge,\n comment?: Comment,\n abandonPublish?: () => Promise<void>,\n ): Promise<void>;\n onChallengeVerification?(\n challengeVerification: ChallengeVerification,\n comment?: Comment,\n ): Promise<void>;\n /**\n * Called before each automatic republish after a failed challenge answer, with the options about to be\n * republished: the last published options, without callbacks, with timestamp set to the current time\n * (the same as the last timestamp if the republish happens within the same second). Resolves to the\n * options to publish instead, which go through the same validation and wordfilters as the first\n * publish. A rejection ends the publish and is reported through onError. While it runs, the pending\n * comment keeps its last publishing state.\n */\n onBeforeRepublish?(\n publishCommentOptions: PublishCommentOptions,\n ): PublishCommentOptions | Promise<PublishCommentOptions>;\n [publishOption: string]: any;\n}\nexport interface UsePublishCommentResult extends Result {\n index: number | undefined;\n challenge: Challenge | undefined;\n challengeVerification: ChallengeVerification | undefined;\n publishComment(): Promise<void>;\n abandonPublish(): Promise<void>;\n publishChallengeAnswers(challengeAnswers?: string[]): Promise<void>;\n}\n\n// usePublishVote(options): result\nexport interface UsePublishVoteOptions extends Options {\n onChallenge?(challenge: Challenge, comment?: Comment): Promise<void>;\n onChallengeVerification?(\n challengeVerification: ChallengeVerification,\n comment?: Comment,\n ): Promise<void>;\n [publishOption: string]: any;\n}\nexport interface UsePublishVoteResult extends Result {\n challenge: Challenge | undefined;\n challengeVerification: ChallengeVerification | undefined;\n publishVote(): Promise<void>;\n abandonPublish(): Promise<void>;\n publishChallengeAnswers(challengeAnswers?: string[]): Promise<void>;\n}\n\n// usePublishCommentEdit(options): result\nexport interface UsePublishCommentEditOptions extends Options {\n onChallenge?(challenge: Challenge, comment?: Comment): Promise<void>;\n onChallengeVerification?(\n challengeVerification: ChallengeVerification,\n comment?: Comment,\n ): Promise<void>;\n [publishOption: string]: any;\n}\nexport interface UsePublishCommentEditResult extends Result {\n challenge: Challenge | undefined;\n challengeVerification: ChallengeVerification | undefined;\n publishCommentEdit(): Promise<void>;\n publishChallengeAnswers(challengeAnswers?: string[]): Promise<void>;\n}\n\n// usePublishCommentModeration(options): result\nexport interface UsePublishCommentModerationOptions extends Options {\n onChallenge?(challenge: Challenge, comment?: Comment): Promise<void>;\n onChallengeVerification?(\n challengeVerification: ChallengeVerification,\n comment?: Comment,\n ): Promise<void>;\n [publishOption: string]: any;\n}\nexport interface UsePublishCommentModerationResult extends Result {\n challenge: Challenge | undefined;\n challengeVerification: ChallengeVerification | undefined;\n publishCommentModeration(): Promise<void>;\n publishChallengeAnswers(challengeAnswers?: string[]): Promise<void>;\n}\n\n// usePublishCommunityEdit(options): result\nexport interface UsePublishCommunityEditOptions extends Options {\n communityAddress?: string;\n onChallenge?(challenge: Challenge, comment?: Comment): Promise<void>;\n onChallengeVerification?(\n challengeVerification: ChallengeVerification,\n comment?: Comment,\n ): Promise<void>;\n [publishOption: string]: any;\n}\nexport interface UsePublishCommunityEditResult extends Result {\n challenge: Challenge | undefined;\n challengeVerification: ChallengeVerification | undefined;\n publishCommunityEdit(): Promise<void>;\n publishChallengeAnswers(challengeAnswers?: string[]): Promise<void>;\n}\n\n// useCreateCommunity(options): result\nexport interface UseCreateCommunityOptions extends Options {\n [createCommunityOption: string]: any;\n}\nexport interface UseCreateCommunityResult extends Result {\n createdCommunity: Community | undefined;\n createCommunity(): Promise<void>;\n}\n\n// useExportCommunity(options): result\nexport interface UseExportCommunityOptions extends Options {\n communityAddress?: string;\n communityAddresses?: string[];\n includePrivateKey?: boolean;\n exportPath?: string;\n signal?: AbortSignal;\n}\nexport interface UseExportCommunityResult extends Result {\n communityExports: CommunityExport[];\n exportCommunity(): Promise<void>;\n}\n\n// useDeleteCommunity(options): result\n// export interface UseDeleteCommunityOptions extends Options {\n// communityAddress?: string\n// }\n// export interface UseDeleteCommunityResult extends Result {\n// deletedCommunity: Community | undefined\n// deleteCommunity(): Promise<void>\n// }\n\n// useSubscribe(options): result\nexport interface UseSubscribeOptions extends Options {\n communityAddress?: string;\n multisubAddress?: string;\n authorAddress?: string;\n}\nexport interface UseSubscribeResult extends Result {\n subscribed: boolean | undefined;\n subscribe(): Promise<void>;\n unsubscribe(): Promise<void>;\n}\n\n// useBlock(options): result\nexport interface UseBlockOptions extends Options {\n address?: string;\n cid?: string;\n}\nexport interface UseBlockResult extends Result {\n blocked: boolean | undefined;\n block(): Promise<void>;\n unblock(): Promise<void>;\n}\n\n// useSaveComment(options): result\nexport interface UseSaveCommentOptions extends Options {\n commentCid?: string;\n}\nexport interface UseSaveCommentResult extends Result {\n saved: boolean | undefined;\n saveComment(): Promise<void>;\n unsaveComment(): Promise<void>;\n}\n\n// useNotify(options): result\n// export interface UseNotifyOptions extends Options {\n// communityAddress?: string\n// multisubAddress?: string\n// authorAddress?: string\n// commentCid?: string\n// }\n// export interface UseNotifyCommunityResult extends Result {\n// notifying: boolean | undefined\n// notify(): Promise<void>\n// unnotify(): Promise<void>\n// }\n\n// useLimit(options): result\n// export interface UseLimitOptions extends Options {\n// address?: string\n// }\n// export interface UseLimitResult extends Result {\n// limited: number | undefined\n// limit(): Promise<void>\n// unlimit(): Promise<void>\n// }\n\n// useSave(options): result\n// export interface UseSaveOptions extends Options {\n// commentCid?: string\n// }\n// export interface UseSaveResult extends Result {\n// saved: boolean | undefined\n// save(): Promise<void>\n// unsave(): Promise<void>\n// }\n\n// useDeleteComment(options): result\n// export interface UseDeleteCommentOptions extends Options {\n// commentCid?: string\n// accountCommentIndex?: number\n// }\n// export interface UseDeleteCommentResult extends Result {\n// deletedComment: Comment | undefined\n// deleteComment(): Promise<void>\n// undeleteComment(): Promise<void>\n// }\n\nexport interface UseClientsStatesOptions extends Options {\n comment?: Comment;\n community?: Community;\n}\ntype ClientUrls = string[];\ntype Peer = string;\nexport interface UseClientsStatesResult extends Result {\n states: { [state: string]: ClientUrls };\n peers: { [clientUrl: string]: Peer[] };\n}\n\nexport interface UseCommunitiesStatesOptions extends Options {\n communities?: CommunityIdentifier[];\n}\nexport interface UseCommunitiesStatesResult extends Result {\n states: { [state: string]: { communityAddresses: string[]; clientUrls: string[] } };\n peers: { [clientUrl: string]: Peer[] };\n}\n\nexport type PkcRpcChallengeOptionInput = {\n option: string;\n label: string;\n default?: string;\n description?: string;\n placeholder?: string;\n required?: boolean;\n [key: string]: unknown;\n};\nexport type PkcRpcChallengeSettings = {\n optionInputs?: PkcRpcChallengeOptionInput[];\n type?: string;\n challenge?: string;\n caseInsensitive?: boolean;\n description?: string;\n [key: string]: unknown;\n};\nexport type PkcRpcSettings = {\n pkcOptions?: Record<string, unknown>;\n challenges?: Record<string, PkcRpcChallengeSettings>;\n [key: string]: any;\n};\nexport interface UsePkcRpcSettingsOptions extends Options {}\nexport interface UsePkcRpcSettingsResult extends Result {\n pkcRpcSettings: PkcRpcSettings | undefined;\n setPkcRpcSettings(pkcRpcSettings: PkcRpcSettings): Promise<void>;\n}\n\n/**\n * TODO: define these types more in depth, most are already defined in:\n * https://github.com/pkcprotocol/pkc-js or\n * https://github.com/bitsocialnet/bitsocial-react-hooks/blob/master/docs/schema.md\n */\n// `account.createdAt` is the unix timestamp in seconds of when the account was generated, or\n// undefined for accounts created before the field existed. It stays undeclared for the same\n// weak-target reason as Comment below: a named optional field would stop Account from being\n// assignable to consumer shapes that have only optional fields.\nexport type Account = { [key: string]: any };\nexport type AccountsActions = { [key: string]: any };\nexport type PublishCommentOptions = { [key: string]: any };\nexport type PublishVoteOptions = { [key: string]: any };\nexport type PublishCommentEditOptions = { [key: string]: any };\nexport type PublishCommentModerationOptions = { [key: string]: any };\nexport type PublishCommunityEditOptions = { [key: string]: any };\nexport interface ExportCommunityOptions {\n includePrivateKey?: boolean;\n exportPath?: string;\n signal?: AbortSignal;\n [key: string]: unknown;\n}\nexport type Challenge = { [key: string]: any };\nexport type ChallengeVerification = { [key: string]: any };\nexport type CreateCommentOptions = { [key: string]: any };\nexport type CreateCommunityOptions = { [key: string]: any };\nexport type CreateVoteOptions = { [key: string]: any };\n// Keep this open shape assignable to consumers selecting arbitrary optional comment fields.\n// Adding a named optional field triggers TypeScript weak-target checks (see types.compat.test.ts).\nexport type Comment = { [key: string]: any };\nexport type Vote = { [key: string]: any };\nexport type CommentEdit = { [key: string]: any };\nexport type CommentModeration = { [key: string]: any };\nexport type CommunityEdit = { [key: string]: any };\nexport type Community = { [key: string]: any };\nexport type CommunityExport = {\n communityAddress: string;\n exportId: string;\n name?: string;\n publicKey?: string;\n includePrivateKey?: boolean;\n progress?: number;\n url?: string;\n [key: string]: unknown;\n};\nexport type CommunityStats = { [key: string]: any };\nexport type Notification = { [key: string]: any };\nexport type Nft = { [key: string]: any };\nexport type Author = { [key: string]: any };\nexport type Wallet = { [key: string]: any };\n\n/**\n * Communities and comments store\n */\nexport type Communities = { [communityAddress: string]: Community };\nexport type Comments = { [commentCid: string]: Comment };\n\n/**\n * Accounts store\n */\nexport type Accounts = { [accountId: string]: Account };\nexport type AccountNamesToAccountIds = { [accountName: string]: string };\nexport interface AccountComment extends Comment {\n index: number;\n accountId: string;\n}\nexport type AccountComments = AccountComment[];\nexport type AccountsComments = { [accountId: string]: AccountComments };\nexport type AccountCommentsIndex = {\n byCommunityAddress: { [communityAddress: string]: number[] };\n byParentCid: { [parentCid: string]: number[] };\n};\nexport type AccountsCommentsIndexes = { [accountId: string]: AccountCommentsIndex };\nexport type CommentCidsToAccountsComments = {\n [commentCid: string]: { accountId: string; accountCommentIndex: number };\n};\nexport interface AccountCommentReply extends Comment {\n markedAsRead: boolean;\n}\nexport type AccountCommentsReplies = { [replyCid: string]: AccountCommentReply };\nexport type AccountsCommentsReplies = { [accountId: string]: AccountCommentsReplies };\nexport type AccountsNotifications = { [accountId: string]: Notification[] };\nexport type Role = {\n role: \"owner\" | \"admin\" | \"moderator\";\n};\nexport type AccountCommunity = {\n role: Role;\n};\nexport type AccountsVotes = { [accountId: string]: AccountVotes };\nexport type AccountVotes = { [commentCid: string]: AccountVote };\nexport type AccountVote = {\n // has all the publish options like commentCid, vote, timestamp, etc\n [publishOption: string]: any;\n};\nexport type AccountsEdits = { [accountId: string]: AccountEdits };\nexport type AccountEdits = { [commentCidOrCommunityAddress: string]: AccountEdit[] };\nexport type AccountEditPropertySummary = {\n timestamp: number;\n value: any;\n};\nexport type AccountEditsSummary = {\n [commentCidOrCommunityAddress: string]: {\n [propertyName: string]: AccountEditPropertySummary;\n };\n};\nexport type AccountsEditsSummaries = { [accountId: string]: AccountEditsSummary };\nexport type AccountEdit = {\n // has all the publish options like commentCid, vote, timestamp, etc (both comment edits and community edits)\n [publishOption: string]: any;\n};\nexport type AccountPublicationsFilter = (\n publication: AccountComment | AccountVote | AccountEdit,\n) => Boolean;\n\n/**\n * Feeds store\n */\nexport type Feed = Comment[];\nexport type Feeds = { [feedName: string]: Feed };\nexport type FeedOptions = {\n communities: CommunityIdentifier[];\n communityKeys: string[];\n sortType?: string;\n /** @deprecated Ignored. Feed sort names are no longer derived from time windows. */\n requestedSortType?: string;\n accountId: string;\n pageNumber: number;\n postsPerPage: number;\n filter: CommentsFilter;\n newerThan?: number;\n accountComments?: FeedOptionsAccountComments;\n modQueue?: string[];\n includeBlockedCids?: boolean;\n};\nexport type FeedOptionsAccountComments = {\n newerThan?: number;\n append?: boolean; // default to prepend, set append: true to append instead\n limit?: number; // only add the newest `limit` account comments, default to no limit\n};\nexport type FeedsOptions = { [feedName: string]: FeedOptions };\nexport type FeedCommunitiesPostCounts = { [communityAddress: string]: number };\nexport type FeedsCommunitiesPostCounts = { [feedName: string]: FeedCommunitiesPostCounts };\nexport type CommunityPage = {\n nextCid?: string;\n comments: Comment[];\n};\nexport type CommunitiesPages = { [pageCid: string]: CommunityPage };\nexport type CommentsFilter = {\n filter(comment: Comment): Boolean;\n key: string;\n};\n\n/**\n * Replies store\n */\n// NOTE: to have different replies options for different depth, eg smaller repliesPerPage for depth > 1,\n// we will need another prop, eg `{depth: '>1': {repliesPerPage: 3}}`, because of how react renders work\nexport type RepliesFeedOptions = {\n commentCid: string;\n commentDepth: number;\n postCid: string;\n sortType?: string;\n accountId: string;\n pageNumber: number;\n repliesPerPage: number;\n onlyIfCached?: boolean;\n flat?: boolean;\n accountComments?: FeedOptionsAccountComments;\n filter?: CommentsFilter;\n streamPage?: boolean; // by default, replies with depth > 1 won't continuously fill the page until repliesPerPage is reached, to not displace the UI\n};\nexport type RepliesFeedsOptions = { [feedName: string]: RepliesFeedOptions };\nexport type RepliesPage = CommunityPage;\nexport type RepliesPages = { [pageCid: string]: RepliesPage };\n\n/**\n * Authors comments store\n */\n// authorCommentsName is a string used a key to represent authorAddress + filter + accountId\nexport type AuthorsComments = { [authorCommentsName: string]: Comment[] };\nexport type AuthorCommentsOptions = {\n authorAddress: string;\n pageNumber: number;\n filter?: CommentsFilter;\n accountId: string;\n};\nexport type AuthorsCommentsOptions = { [authorCommentsName: string]: FeedOptions };\n\n/**\n * Other\n */\nexport type ChainProvider = {\n chainId?: number;\n urls?: string[];\n};\nexport type ChainProviders = { [chainTicker: string]: ChainProvider };\n"]}
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "publishConfig": {
15
15
  "access": "public"
16
16
  },
17
- "version": "0.2.2",
17
+ "version": "0.2.3",
18
18
  "packageManager": "yarn@4.13.0",
19
19
  "files": [
20
20
  "CHANGELOG.md",
@@ -63,7 +63,7 @@
63
63
  },
64
64
  "dependencies": {
65
65
  "@bitsocial/bso-resolver": "0.0.10",
66
- "@pkcprotocol/pkc-js": "0.0.132",
66
+ "@pkcprotocol/pkc-js": "0.0.142",
67
67
  "@pkcprotocol/pkc-logger": "0.1.0",
68
68
  "ethers": "5.8.0",
69
69
  "localforage": "1.10.0",