@bitsocial/bitsocial-react-hooks 0.1.15 → 0.1.17

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.
@@ -5,6 +5,7 @@ export declare const sanitizeAccountCommentForState: (comment: Comment) => any;
5
5
  export declare const sanitizeStoredAccountComment: (comment: Comment) => any;
6
6
  export declare const getAccountCommentsIndex: (accountComments: AccountComment[] | undefined) => AccountCommentsIndex;
7
7
  export declare const getAccountsCommentsIndexes: (accountsComments: AccountsComments) => AccountsCommentsIndexes;
8
+ export declare const COMMENT_MODERATION_AUTHOR_SUMMARY_KEY = "commentModeration.author";
8
9
  export declare const getAccountEditPropertySummary: (accountEdits: AccountEdit[] | undefined) => {
9
10
  [propertyName: string]: import("../../types.js").AccountEditPropertySummary;
10
11
  };
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/stores/accounts/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EAEP,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,uBAAuB,EACvB,oBAAoB,EACpB,6BAA6B,EAC7B,OAAO,EACP,WAAW,EACX,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAoBrB,eAAO,MAAM,qBAAqB,GAAI,SAAS,OAAO,EAAE,aAAa,WAAW,QAiB/E,CAAC;AAEF,eAAO,MAAM,gCAAgC,GAAI,kBAAkB,gBAAgB,kCAalF,CAAC;AA0FF,eAAO,MAAM,8BAA8B,GAAI,SAAS,OAAO,QAuB9D,CAAC;AAEF,eAAO,MAAM,4BAA4B,GAAI,SAAS,OAAO,QAoB5D,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,iBAAiB,cAAc,EAAE,GAAG,SAAS,KAC5C,oBAoBF,CAAC;AAEF,eAAO,MAAM,0BAA0B,GAAI,kBAAkB,gBAAgB,4BAM5E,CAAC;AA2BF,eAAO,MAAM,6BAA6B,GAAI,cAAc,WAAW,EAAE,GAAG,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A,MAAM,KAAK;qCAtdoC,OAAO,eAAe,WAAW;yDAmBb,gBAAgB;+CAuJhE,cAAc,EAAE,GAAG,SAAS,KAC5C,oBAAoB;mDAsBsC,gBAAgB;8CAvErB,OAAO;4CAyBT,OAAO;kDAsFD,WAAW,EAAE,GAAG,SAAS;;;4CAwB/B;QACpD,CAAC,4BAA4B,EAAE,MAAM,GAAG,WAAW,EAAE,CAAC;KACvD;uCA4BsD,MAAM,KAAG,OAAO,CAAC,qBAAqB,CAAC;uDA8H7B,gBAAgB;wBAC9B,cAAc;mBAAa,MAAM;;sCAoBpC,OAAO;iDAoBI,OAAO;iBApL9C,CAAC,YAAY,OAAO,CAAC,CAAC,CAAC,EAAE,KAAG,OAAO,CAAC,CAAC,CAAC;CAkNzD,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -7,6 +7,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
+ var __rest = (this && this.__rest) || function (s, e) {
11
+ var t = {};
12
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
13
+ t[p] = s[p];
14
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
15
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
16
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
17
+ t[p[i]] = s[p[i]];
18
+ }
19
+ return t;
20
+ };
10
21
  import assert from "assert";
11
22
  import Logger from "@pkcprotocol/pkc-logger";
12
23
  const log = Logger("bitsocial-react-hooks:accounts:stores");
@@ -190,11 +201,17 @@ const accountEditNonPropertyNames = new Set([
190
201
  "communityAddress",
191
202
  "timestamp",
192
203
  ]);
204
+ export const COMMENT_MODERATION_AUTHOR_SUMMARY_KEY = "commentModeration.author";
193
205
  const normalizeAccountEditForSummary = (accountEdit) => {
194
206
  var _a;
195
207
  const normalizedAccountEdit = Object.assign({}, accountEdit);
196
- if (normalizedAccountEdit.commentModeration) {
197
- Object.assign(normalizedAccountEdit, normalizedAccountEdit.commentModeration);
208
+ const commentModeration = normalizedAccountEdit.commentModeration;
209
+ if (commentModeration && typeof commentModeration === "object") {
210
+ const { author } = commentModeration, commentModerationProperties = __rest(commentModeration, ["author"]);
211
+ Object.assign(normalizedAccountEdit, commentModerationProperties);
212
+ if (Object.prototype.hasOwnProperty.call(commentModeration, "author")) {
213
+ normalizedAccountEdit[COMMENT_MODERATION_AUTHOR_SUMMARY_KEY] = author;
214
+ }
198
215
  delete normalizedAccountEdit.commentModeration;
199
216
  }
200
217
  const communityEdit = (_a = normalizedAccountEdit.communityEdit) !== null && _a !== void 0 ? _a : normalizedAccountEdit.communityEdit;
@@ -211,7 +228,8 @@ export const getAccountEditPropertySummary = (accountEdits) => {
211
228
  for (const accountEdit of accountEdits || []) {
212
229
  const normalizedAccountEdit = normalizeAccountEditForSummary(accountEdit);
213
230
  for (const propertyName in normalizedAccountEdit) {
214
- if (normalizedAccountEdit[propertyName] === undefined ||
231
+ if ((normalizedAccountEdit[propertyName] === undefined &&
232
+ propertyName !== COMMENT_MODERATION_AUTHOR_SUMMARY_KEY) ||
215
233
  accountEditNonPropertyNames.has(propertyName)) {
216
234
  continue;
217
235
  }
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/stores/accounts/utils.ts"],"names":[],"mappings":";;;;;;;;;AAaA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAC7C,MAAM,GAAG,GAAG,MAAM,CAAC,uCAAuC,CAAC,CAAC;AAC5D,OAAO,aAAa,MAAM,aAAa,CAAC;AACxC,OAAO,iBAAiB,MAAM,kBAAkB,CAAC;AACjD,OAAO,qBAAqB,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,MAAM,kBAAkB,CAAC;AAErC,MAAM,oCAAoC,GAAG,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,CAAC;QAC3C,OAAO,kBAAkB,GAAG,CAAC,CAAC;IAChC,CAAC;IACD,6FAA6F;IAC7F,yEAAyE;AAC3E,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,OAAgB,EAAE,EAAE;IACpE,OAAO,qBAAQ,OAAO,CAAE,CAAC;IACzB,IAAI,CAAC;QACH,OAAO,CAAC,qBAAqB,GAAG,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC;YACxD,OAAO,EAAE,OAAO,CAAC,gBAAgB;SAClC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC,CAAA,CAAC;IACd,IAAI,CAAC;QACH,OAAO,CAAC,MAAM,qBAAQ,OAAO,CAAC,MAAM,CAAE,CAAC;QACvC,OAAO,CAAC,MAAM,CAAC,YAAY,GAAG,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC;YACtD,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO;SAChC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC,CAAA,CAAC;IACd,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,KAAK,GAAG;IACZ,qBAAqB;IACrB,gCAAgC;IAChC,uBAAuB;IACvB,0BAA0B;IAC1B,8BAA8B;IAC9B,4BAA4B;IAC5B,6BAA6B;IAC7B,uBAAuB;IACvB,0BAA0B;IAC1B,8BAA8B;IAC9B,sBAAsB;IACtB,iCAAiC;IACjC,UAAU;CACX,CAAC;AAEF,eAAe,KAAK,CAAC","sourcesContent":["import {\n Account,\n Role,\n Communities,\n AccountComment,\n AccountsComments,\n AccountsCommentsIndexes,\n AccountCommentsIndex,\n CommentCidsToAccountsComments,\n Comment,\n AccountEdit,\n AccountEditsSummary,\n} from \"../../types\";\nimport assert from \"assert\";\nimport Logger from \"@pkcprotocol/pkc-logger\";\nconst log = Logger(\"bitsocial-react-hooks:accounts:stores\");\nimport commentsStore from \"../comments\";\nimport repliesPagesStore from \"../replies-pages\";\nimport communitiesPagesStore from \"../communities-pages\";\nimport PkcJs from \"../../lib/pkc-js\";\n\nconst getAuthorAddressRolesFromCommunities = (authorAddress: string, communities: Communities) => {\n const roles: { [communityAddress: string]: Role } = {};\n for (const communityAddress in communities) {\n const role = communities[communityAddress]?.roles?.[authorAddress];\n if (role) {\n roles[communityAddress] = role;\n }\n }\n return roles;\n};\n\nexport const getAccountCommunities = (account: Account, communities: Communities) => {\n assert(\n account?.author?.address && typeof account?.author?.address === \"string\",\n `accountsStore utils getAccountCommunities invalid account.author.address '${account?.author?.address}'`,\n );\n assert(\n communities && typeof communities === \"object\",\n `accountsStore utils getAccountCommunities invalid communities '${communities}'`,\n );\n\n const roles = getAuthorAddressRolesFromCommunities(account.author.address, communities);\n const accountCommunities = { ...account.communities };\n for (const communityAddress in roles) {\n accountCommunities[communityAddress] = { ...accountCommunities[communityAddress] };\n accountCommunities[communityAddress].role = roles[communityAddress];\n }\n return accountCommunities;\n};\n\nexport const getCommentCidsToAccountsComments = (accountsComments: AccountsComments) => {\n const commentCidsToAccountsComments: CommentCidsToAccountsComments = {};\n for (const accountId in accountsComments) {\n for (const accountComment of accountsComments[accountId]) {\n if (accountComment.cid) {\n commentCidsToAccountsComments[accountComment.cid] = {\n accountId,\n accountCommentIndex: accountComment.index,\n };\n }\n }\n }\n return commentCidsToAccountsComments;\n};\n\nconst cloneWithoutFunctions = (value: any): any => {\n if (Array.isArray(value)) {\n return value\n .map((entry) => cloneWithoutFunctions(entry))\n .filter((entry) => entry !== undefined);\n }\n if (!value || typeof value !== \"object\") {\n return typeof value === \"function\" ? undefined : value;\n }\n\n const clonedValue: Record<string, any> = {};\n for (const key in value) {\n if (typeof value[key] === \"function\") {\n continue;\n }\n const clonedChild = cloneWithoutFunctions(value[key]);\n if (clonedChild !== undefined) {\n clonedValue[key] = clonedChild;\n }\n }\n return clonedValue;\n};\n\nconst compactStoredCommentAuthor = (author: any) => {\n if (!author || typeof author !== \"object\") {\n return undefined;\n }\n\n const compactAuthor = cloneWithoutFunctions({\n address: author.address,\n shortAddress: author.shortAddress,\n displayName: author.displayName,\n avatar: author.avatar,\n flair: author.flair,\n });\n\n return compactAuthor && Object.keys(compactAuthor).length > 0 ? compactAuthor : undefined;\n};\n\nconst compactStoredOriginalComment = (originalComment: any) => {\n if (!originalComment || typeof originalComment !== \"object\") {\n return undefined;\n }\n\n const compactOriginalComment = cloneWithoutFunctions({\n cid: originalComment.cid,\n content: originalComment.content,\n title: originalComment.title,\n link: originalComment.link,\n linkWidth: originalComment.linkWidth,\n linkHeight: originalComment.linkHeight,\n linkHtmlTagName: originalComment.linkHtmlTagName,\n thumbnailUrl: originalComment.thumbnailUrl,\n media: originalComment.media,\n spoiler: originalComment.spoiler,\n nsfw: originalComment.nsfw,\n deleted: originalComment.deleted,\n removed: originalComment.removed,\n reason: originalComment.reason,\n quotedCids: originalComment.quotedCids,\n parentCid: originalComment.parentCid,\n postCid: originalComment.postCid,\n communityAddress: originalComment.communityAddress,\n timestamp: originalComment.timestamp,\n author: compactStoredCommentAuthor(originalComment.author),\n });\n\n return compactOriginalComment && Object.keys(compactOriginalComment).length > 0\n ? compactOriginalComment\n : undefined;\n};\n\nconst compactStoredReplies = (replies: any) => {\n if (!replies || typeof replies !== \"object\") {\n return undefined;\n }\n\n const compactReplies = cloneWithoutFunctions(\n Object.fromEntries(\n Object.entries(replies).filter(\n ([replyKey]) => replyKey !== \"pages\" && replyKey !== \"clients\",\n ),\n ),\n );\n\n return compactReplies && Object.keys(compactReplies).length > 0 ? compactReplies : undefined;\n};\n\nexport const sanitizeAccountCommentForState = (comment: Comment) => {\n const sanitizedComment = cloneWithoutFunctions({\n ...comment,\n signer: undefined,\n raw: undefined,\n replies: comment?.replies\n ? Object.fromEntries(\n Object.entries(comment.replies).filter(([replyKey]) => replyKey !== \"pages\"),\n )\n : comment?.replies,\n });\n\n if (!sanitizedComment || typeof sanitizedComment !== \"object\") {\n return sanitizedComment;\n }\n if (sanitizedComment?.replies?.pages) {\n sanitizedComment.replies = { ...sanitizedComment.replies };\n delete sanitizedComment.replies.pages;\n }\n if (sanitizedComment?.replies && Object.keys(sanitizedComment.replies).length === 0) {\n delete sanitizedComment.replies;\n }\n return sanitizedComment;\n};\n\nexport const sanitizeStoredAccountComment = (comment: Comment) => {\n const preprocessedComment = {\n ...comment,\n signer: undefined,\n clients: undefined,\n raw: undefined,\n replies: compactStoredReplies(comment?.replies),\n original: comment?.edit ? compactStoredOriginalComment(comment.original) : undefined,\n };\n const sanitizedComment = cloneWithoutFunctions(preprocessedComment);\n if (!sanitizedComment || typeof sanitizedComment !== \"object\") {\n return sanitizedComment;\n }\n if (sanitizedComment?.replies && Object.keys(sanitizedComment.replies).length === 0) {\n delete sanitizedComment.replies;\n }\n if (sanitizedComment?.original && Object.keys(sanitizedComment.original).length === 0) {\n delete sanitizedComment.original;\n }\n return sanitizedComment;\n};\n\nexport const getAccountCommentsIndex = (\n accountComments: AccountComment[] | undefined,\n): AccountCommentsIndex => {\n const index: AccountCommentsIndex = {\n byCommunityAddress: {},\n byParentCid: {},\n };\n for (const accountComment of accountComments || []) {\n if (accountComment.communityAddress) {\n if (!index.byCommunityAddress[accountComment.communityAddress]) {\n index.byCommunityAddress[accountComment.communityAddress] = [];\n }\n index.byCommunityAddress[accountComment.communityAddress].push(accountComment.index);\n }\n if (accountComment.parentCid) {\n if (!index.byParentCid[accountComment.parentCid]) {\n index.byParentCid[accountComment.parentCid] = [];\n }\n index.byParentCid[accountComment.parentCid].push(accountComment.index);\n }\n }\n return index;\n};\n\nexport const getAccountsCommentsIndexes = (accountsComments: AccountsComments) => {\n const indexes: AccountsCommentsIndexes = {};\n for (const accountId in accountsComments) {\n indexes[accountId] = getAccountCommentsIndex(accountsComments[accountId]);\n }\n return indexes;\n};\n\nconst accountEditNonPropertyNames = new Set([\n \"author\",\n \"signer\",\n \"clientId\",\n \"commentCid\",\n \"communityAddress\",\n \"communityAddress\",\n \"timestamp\",\n]);\n\nconst normalizeAccountEditForSummary = (accountEdit: AccountEdit) => {\n const normalizedAccountEdit = { ...accountEdit };\n if (normalizedAccountEdit.commentModeration) {\n Object.assign(normalizedAccountEdit, normalizedAccountEdit.commentModeration);\n delete normalizedAccountEdit.commentModeration;\n }\n const communityEdit = normalizedAccountEdit.communityEdit ?? normalizedAccountEdit.communityEdit;\n if (communityEdit && typeof communityEdit === \"object\") {\n Object.assign(normalizedAccountEdit, communityEdit);\n }\n delete normalizedAccountEdit.communityEdit;\n delete normalizedAccountEdit.communityEdit;\n return normalizedAccountEdit;\n};\n\nexport const getAccountEditPropertySummary = (accountEdits: AccountEdit[] | undefined) => {\n const accountEditPropertySummary: AccountEditsSummary[string] = {};\n for (const accountEdit of accountEdits || []) {\n const normalizedAccountEdit = normalizeAccountEditForSummary(accountEdit);\n for (const propertyName in normalizedAccountEdit) {\n if (\n normalizedAccountEdit[propertyName] === undefined ||\n accountEditNonPropertyNames.has(propertyName)\n ) {\n continue;\n }\n const previousTimestamp = accountEditPropertySummary[propertyName]?.timestamp || 0;\n if ((normalizedAccountEdit.timestamp || 0) >= previousTimestamp) {\n accountEditPropertySummary[propertyName] = {\n timestamp: normalizedAccountEdit.timestamp,\n value: normalizedAccountEdit[propertyName],\n };\n }\n }\n }\n return accountEditPropertySummary;\n};\n\nexport const getAccountsEditsSummary = (accountEdits: {\n [commentCidOrCommunityAddress: string]: AccountEdit[];\n}) => {\n const summary: AccountEditsSummary = {};\n for (const target in accountEdits || {}) {\n summary[target] = getAccountEditPropertySummary(accountEdits[target]);\n }\n return summary;\n};\n\ninterface CommentLinkDimensions {\n linkWidth?: number;\n linkHeight?: number;\n linkHtmlTagName?: \"img\" | \"video\" | \"audio\";\n}\n\n// polyfill Promise.any, exported for test coverage of empty-array branch\nconst promiseAny = <T>(promises: Promise<T>[]): Promise<T> =>\n new Promise((res, rej) => {\n let count = promises.length;\n if (count === 0) return rej(Error(\"all promises rejected\"));\n promises.forEach((p) =>\n Promise.resolve(p)\n .then(res)\n .catch((e) => {\n if (--count === 0) rej(Error(\"all promises rejected\"));\n }),\n );\n });\n\nexport const fetchCommentLinkDimensions = async (link: string): Promise<CommentLinkDimensions> => {\n if (!link) {\n return {};\n }\n\n const fetchImageDimensions = (url: string) =>\n new Promise<CommentLinkDimensions>((resolve, reject) => {\n const image = new Image();\n image.onload = () => {\n // don't accept 0px value\n if (!image.width || !image.height) {\n return reject(Error(`failed fetching image dimensions for url '${url}'`));\n }\n resolve({\n linkWidth: image.width,\n linkHeight: image.height,\n linkHtmlTagName: \"img\",\n });\n\n // remove image from memory\n try {\n image.src = \"\";\n } catch (e) {}\n };\n image.onerror = (error) => {\n reject(Error(`failed fetching image dimensions for url '${url}'`));\n };\n\n // max loading time\n const timeout = 10000;\n setTimeout(\n () =>\n reject(Error(`failed fetching image dimensions for url '${url}' timeout '${timeout}'`)),\n timeout,\n );\n\n // start loading\n image.src = url;\n });\n\n const fetchVideoDimensions = (url: string) =>\n new Promise<CommentLinkDimensions>((resolve, reject) => {\n const video = document.createElement(\"video\");\n video.muted = true;\n video.loop = false;\n video.addEventListener(\"loadeddata\", () => {\n // don't accept 0px value\n if (!video.videoWidth || !video.videoHeight) {\n return reject(Error(`failed fetching video dimensions for url '${url}'`));\n }\n resolve({\n linkWidth: video.videoWidth,\n linkHeight: video.videoHeight,\n linkHtmlTagName: \"video\",\n });\n // prevent video from playing\n try {\n video.pause();\n } catch (e) {}\n // prevent video from loading\n try {\n video.src = \"\";\n } catch (e) {}\n });\n video.addEventListener(\"error\", (error) => {\n reject(Error(`failed fetching video dimensions for url '${url}'`));\n });\n\n // max loading time\n const timeout = 30000;\n setTimeout(\n () =>\n reject(Error(`failed fetching video dimensions for url '${url}' timeout '${timeout}'`)),\n timeout,\n );\n\n // start loading\n video.src = url;\n });\n\n const fetchAudio = (url: string) =>\n new Promise<CommentLinkDimensions>((resolve, reject) => {\n const audio = document.createElement(\"audio\");\n audio.addEventListener(\"loadeddata\", () => {\n resolve({\n linkHtmlTagName: \"audio\",\n });\n try {\n audio.pause();\n } catch {}\n try {\n audio.src = \"\";\n } catch {}\n });\n audio.addEventListener(\"error\", () =>\n reject(Error(`failed fetching audio html tag name for url '${url}'`)),\n );\n\n const timeout = 20000;\n setTimeout(\n () =>\n reject(\n Error(`failed fetching audio html tag name for url '${url}' timeout '${timeout}'`),\n ),\n timeout,\n );\n\n audio.src = url;\n });\n\n try {\n if (new URL(link).protocol !== \"https:\") {\n throw Error(`failed fetching comment.link dimensions for link '${link}' not https protocol`);\n }\n const dimensions = await promiseAny([\n fetchImageDimensions(link),\n fetchVideoDimensions(link),\n fetchAudio(link),\n ]);\n return dimensions;\n } catch (error: any) {\n log.error(\"fetchCommentLinkDimensions error\", { error, link });\n return {};\n }\n};\n\nexport const getInitAccountCommentsToUpdate = (accountsComments: AccountsComments) => {\n const accountCommentsToUpdate: { accountComment: AccountComment; accountId: string }[] = [];\n for (const accountId in accountsComments) {\n for (const accountComment of accountsComments[accountId]) {\n accountCommentsToUpdate.push({ accountComment, accountId });\n }\n }\n\n // update newer comments first, more likely to have notifications\n accountCommentsToUpdate.sort((a, b) => b.accountComment.timestamp - a.accountComment.timestamp);\n\n // updating too many comments during init slows down fetching comments/subs\n if (accountCommentsToUpdate.length > 10) {\n accountCommentsToUpdate.length = 10;\n }\n\n // TODO: add some algo to fetch all notifications (even old), but not on init\n // during downtimes when we're not fetching anything else\n return accountCommentsToUpdate;\n};\n\nexport const getAccountCommentDepth = (comment: Comment) => {\n if (!comment.parentCid) {\n return 0;\n }\n let parentCommentDepth = commentsStore.getState().comments[comment.parentCid]?.depth;\n if (typeof parentCommentDepth === \"number\") {\n return parentCommentDepth + 1;\n }\n parentCommentDepth = repliesPagesStore.getState().comments[comment.parentCid]?.depth;\n if (typeof parentCommentDepth === \"number\") {\n return parentCommentDepth + 1;\n }\n parentCommentDepth = communitiesPagesStore.getState().comments[comment.parentCid]?.depth;\n if (typeof parentCommentDepth === \"number\") {\n return parentCommentDepth + 1;\n }\n // if can't find the parent comment depth anywhere, don't include it with the account comment\n // it will be added automatically when challenge verification is received\n};\n\nexport const addShortAddressesToAccountComment = (comment: Comment) => {\n comment = { ...comment };\n try {\n comment.shortCommunityAddress = PkcJs.PKC.getShortAddress({\n address: comment.communityAddress,\n });\n } catch (e) {}\n try {\n comment.author = { ...comment.author };\n comment.author.shortAddress = PkcJs.PKC.getShortAddress({\n address: comment.author.address,\n });\n } catch (e) {}\n return comment;\n};\n\nconst utils = {\n getAccountCommunities,\n getCommentCidsToAccountsComments,\n getAccountCommentsIndex,\n getAccountsCommentsIndexes,\n sanitizeAccountCommentForState,\n sanitizeStoredAccountComment,\n getAccountEditPropertySummary,\n getAccountsEditsSummary,\n fetchCommentLinkDimensions,\n getInitAccountCommentsToUpdate,\n getAccountCommentDepth,\n addShortAddressesToAccountComment,\n promiseAny,\n};\n\nexport default utils;\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/stores/accounts/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAaA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAC7C,MAAM,GAAG,GAAG,MAAM,CAAC,uCAAuC,CAAC,CAAC;AAC5D,OAAO,aAAa,MAAM,aAAa,CAAC;AACxC,OAAO,iBAAiB,MAAM,kBAAkB,CAAC;AACjD,OAAO,qBAAqB,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,MAAM,kBAAkB,CAAC;AAErC,MAAM,oCAAoC,GAAG,CAAC,aAAqB,EAAE,WAAwB,EAAE,EAAE;;IAC/F,MAAM,KAAK,GAAyC,EAAE,CAAC;IACvD,KAAK,MAAM,gBAAgB,IAAI,WAAW,EAAE,CAAC;QAC3C,MAAM,IAAI,GAAG,MAAA,MAAA,WAAW,CAAC,gBAAgB,CAAC,0CAAE,KAAK,0CAAG,aAAa,CAAC,CAAC;QACnE,IAAI,IAAI,EAAE,CAAC;YACT,KAAK,CAA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AA,qBAAqB,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,0CAAE,KAAK,CAAC;IACzF,IAAI,OAAO,kBAAkB,KAAK,QAAQ,EAAE,CAAC;QAC3C,OAAO,kBAAkB,GAAG,CAAC,CAAC;IAChC,CAAC;IACD,6FAA6F;IAC7F,yEAAyE;AAC3E,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,OAAgB,EAAE,EAAE;IACpE,OAAO,qBAAQ,OAAO,CAAE,CAAC;IACzB,IAAI,CAAC;QACH,OAAO,CAAC,qBAAqB,GAAG,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC;YACxD,OAAO,EAAE,OAAO,CAAC,gBAAgB;SAClC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC,CAAA,CAAC;IACd,IAAI,CAAC;QACH,OAAO,CAAC,MAAM,qBAAQ,OAAO,CAAC,MAAM,CAAE,CAAC;QACvC,OAAO,CAAC,MAAM,CAAC,YAAY,GAAG,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC;YACtD,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,OAAO;SAChC,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC,CAAA,CAAC;IACd,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF,MAAM,KAAK,GAAG;IACZ,qBAAqB;IACrB,gCAAgC;IAChC,uBAAuB;IACvB,0BAA0B;IAC1B,8BAA8B;IAC9B,4BAA4B;IAC5B,6BAA6B;IAC7B,uBAAuB;IACvB,0BAA0B;IAC1B,8BAA8B;IAC9B,sBAAsB;IACtB,iCAAiC;IACjC,UAAU;CACX,CAAC;AAEF,eAAe,KAAK,CAAC","sourcesContent":["import {\n Account,\n Role,\n Communities,\n AccountComment,\n AccountsComments,\n AccountsCommentsIndexes,\n AccountCommentsIndex,\n CommentCidsToAccountsComments,\n Comment,\n AccountEdit,\n AccountEditsSummary,\n} from \"../../types\";\nimport assert from \"assert\";\nimport Logger from \"@pkcprotocol/pkc-logger\";\nconst log = Logger(\"bitsocial-react-hooks:accounts:stores\");\nimport commentsStore from \"../comments\";\nimport repliesPagesStore from \"../replies-pages\";\nimport communitiesPagesStore from \"../communities-pages\";\nimport PkcJs from \"../../lib/pkc-js\";\n\nconst getAuthorAddressRolesFromCommunities = (authorAddress: string, communities: Communities) => {\n const roles: { [communityAddress: string]: Role } = {};\n for (const communityAddress in communities) {\n const role = communities[communityAddress]?.roles?.[authorAddress];\n if (role) {\n roles[communityAddress] = role;\n }\n }\n return roles;\n};\n\nexport const getAccountCommunities = (account: Account, communities: Communities) => {\n assert(\n account?.author?.address && typeof account?.author?.address === \"string\",\n `accountsStore utils getAccountCommunities invalid account.author.address '${account?.author?.address}'`,\n );\n assert(\n communities && typeof communities === \"object\",\n `accountsStore utils getAccountCommunities invalid communities '${communities}'`,\n );\n\n const roles = getAuthorAddressRolesFromCommunities(account.author.address, communities);\n const accountCommunities = { ...account.communities };\n for (const communityAddress in roles) {\n accountCommunities[communityAddress] = { ...accountCommunities[communityAddress] };\n accountCommunities[communityAddress].role = roles[communityAddress];\n }\n return accountCommunities;\n};\n\nexport const getCommentCidsToAccountsComments = (accountsComments: AccountsComments) => {\n const commentCidsToAccountsComments: CommentCidsToAccountsComments = {};\n for (const accountId in accountsComments) {\n for (const accountComment of accountsComments[accountId]) {\n if (accountComment.cid) {\n commentCidsToAccountsComments[accountComment.cid] = {\n accountId,\n accountCommentIndex: accountComment.index,\n };\n }\n }\n }\n return commentCidsToAccountsComments;\n};\n\nconst cloneWithoutFunctions = (value: any): any => {\n if (Array.isArray(value)) {\n return value\n .map((entry) => cloneWithoutFunctions(entry))\n .filter((entry) => entry !== undefined);\n }\n if (!value || typeof value !== \"object\") {\n return typeof value === \"function\" ? undefined : value;\n }\n\n const clonedValue: Record<string, any> = {};\n for (const key in value) {\n if (typeof value[key] === \"function\") {\n continue;\n }\n const clonedChild = cloneWithoutFunctions(value[key]);\n if (clonedChild !== undefined) {\n clonedValue[key] = clonedChild;\n }\n }\n return clonedValue;\n};\n\nconst compactStoredCommentAuthor = (author: any) => {\n if (!author || typeof author !== \"object\") {\n return undefined;\n }\n\n const compactAuthor = cloneWithoutFunctions({\n address: author.address,\n shortAddress: author.shortAddress,\n displayName: author.displayName,\n avatar: author.avatar,\n flair: author.flair,\n });\n\n return compactAuthor && Object.keys(compactAuthor).length > 0 ? compactAuthor : undefined;\n};\n\nconst compactStoredOriginalComment = (originalComment: any) => {\n if (!originalComment || typeof originalComment !== \"object\") {\n return undefined;\n }\n\n const compactOriginalComment = cloneWithoutFunctions({\n cid: originalComment.cid,\n content: originalComment.content,\n title: originalComment.title,\n link: originalComment.link,\n linkWidth: originalComment.linkWidth,\n linkHeight: originalComment.linkHeight,\n linkHtmlTagName: originalComment.linkHtmlTagName,\n thumbnailUrl: originalComment.thumbnailUrl,\n media: originalComment.media,\n spoiler: originalComment.spoiler,\n nsfw: originalComment.nsfw,\n deleted: originalComment.deleted,\n removed: originalComment.removed,\n reason: originalComment.reason,\n quotedCids: originalComment.quotedCids,\n parentCid: originalComment.parentCid,\n postCid: originalComment.postCid,\n communityAddress: originalComment.communityAddress,\n timestamp: originalComment.timestamp,\n author: compactStoredCommentAuthor(originalComment.author),\n });\n\n return compactOriginalComment && Object.keys(compactOriginalComment).length > 0\n ? compactOriginalComment\n : undefined;\n};\n\nconst compactStoredReplies = (replies: any) => {\n if (!replies || typeof replies !== \"object\") {\n return undefined;\n }\n\n const compactReplies = cloneWithoutFunctions(\n Object.fromEntries(\n Object.entries(replies).filter(\n ([replyKey]) => replyKey !== \"pages\" && replyKey !== \"clients\",\n ),\n ),\n );\n\n return compactReplies && Object.keys(compactReplies).length > 0 ? compactReplies : undefined;\n};\n\nexport const sanitizeAccountCommentForState = (comment: Comment) => {\n const sanitizedComment = cloneWithoutFunctions({\n ...comment,\n signer: undefined,\n raw: undefined,\n replies: comment?.replies\n ? Object.fromEntries(\n Object.entries(comment.replies).filter(([replyKey]) => replyKey !== \"pages\"),\n )\n : comment?.replies,\n });\n\n if (!sanitizedComment || typeof sanitizedComment !== \"object\") {\n return sanitizedComment;\n }\n if (sanitizedComment?.replies?.pages) {\n sanitizedComment.replies = { ...sanitizedComment.replies };\n delete sanitizedComment.replies.pages;\n }\n if (sanitizedComment?.replies && Object.keys(sanitizedComment.replies).length === 0) {\n delete sanitizedComment.replies;\n }\n return sanitizedComment;\n};\n\nexport const sanitizeStoredAccountComment = (comment: Comment) => {\n const preprocessedComment = {\n ...comment,\n signer: undefined,\n clients: undefined,\n raw: undefined,\n replies: compactStoredReplies(comment?.replies),\n original: comment?.edit ? compactStoredOriginalComment(comment.original) : undefined,\n };\n const sanitizedComment = cloneWithoutFunctions(preprocessedComment);\n if (!sanitizedComment || typeof sanitizedComment !== \"object\") {\n return sanitizedComment;\n }\n if (sanitizedComment?.replies && Object.keys(sanitizedComment.replies).length === 0) {\n delete sanitizedComment.replies;\n }\n if (sanitizedComment?.original && Object.keys(sanitizedComment.original).length === 0) {\n delete sanitizedComment.original;\n }\n return sanitizedComment;\n};\n\nexport const getAccountCommentsIndex = (\n accountComments: AccountComment[] | undefined,\n): AccountCommentsIndex => {\n const index: AccountCommentsIndex = {\n byCommunityAddress: {},\n byParentCid: {},\n };\n for (const accountComment of accountComments || []) {\n if (accountComment.communityAddress) {\n if (!index.byCommunityAddress[accountComment.communityAddress]) {\n index.byCommunityAddress[accountComment.communityAddress] = [];\n }\n index.byCommunityAddress[accountComment.communityAddress].push(accountComment.index);\n }\n if (accountComment.parentCid) {\n if (!index.byParentCid[accountComment.parentCid]) {\n index.byParentCid[accountComment.parentCid] = [];\n }\n index.byParentCid[accountComment.parentCid].push(accountComment.index);\n }\n }\n return index;\n};\n\nexport const getAccountsCommentsIndexes = (accountsComments: AccountsComments) => {\n const indexes: AccountsCommentsIndexes = {};\n for (const accountId in accountsComments) {\n indexes[accountId] = getAccountCommentsIndex(accountsComments[accountId]);\n }\n return indexes;\n};\n\nconst accountEditNonPropertyNames = new Set([\n \"author\",\n \"signer\",\n \"clientId\",\n \"commentCid\",\n \"communityAddress\",\n \"communityAddress\",\n \"timestamp\",\n]);\n\nexport const COMMENT_MODERATION_AUTHOR_SUMMARY_KEY = \"commentModeration.author\";\n\nconst normalizeAccountEditForSummary = (accountEdit: AccountEdit) => {\n const normalizedAccountEdit = { ...accountEdit };\n const commentModeration = normalizedAccountEdit.commentModeration;\n if (commentModeration && typeof commentModeration === \"object\") {\n const { author, ...commentModerationProperties } = commentModeration;\n Object.assign(normalizedAccountEdit, commentModerationProperties);\n if (Object.prototype.hasOwnProperty.call(commentModeration, \"author\")) {\n normalizedAccountEdit[COMMENT_MODERATION_AUTHOR_SUMMARY_KEY] = author;\n }\n delete normalizedAccountEdit.commentModeration;\n }\n const communityEdit = normalizedAccountEdit.communityEdit ?? normalizedAccountEdit.communityEdit;\n if (communityEdit && typeof communityEdit === \"object\") {\n Object.assign(normalizedAccountEdit, communityEdit);\n }\n delete normalizedAccountEdit.communityEdit;\n delete normalizedAccountEdit.communityEdit;\n return normalizedAccountEdit;\n};\n\nexport const getAccountEditPropertySummary = (accountEdits: AccountEdit[] | undefined) => {\n const accountEditPropertySummary: AccountEditsSummary[string] = {};\n for (const accountEdit of accountEdits || []) {\n const normalizedAccountEdit = normalizeAccountEditForSummary(accountEdit);\n for (const propertyName in normalizedAccountEdit) {\n if (\n (normalizedAccountEdit[propertyName] === undefined &&\n propertyName !== COMMENT_MODERATION_AUTHOR_SUMMARY_KEY) ||\n accountEditNonPropertyNames.has(propertyName)\n ) {\n continue;\n }\n const previousTimestamp = accountEditPropertySummary[propertyName]?.timestamp || 0;\n if ((normalizedAccountEdit.timestamp || 0) >= previousTimestamp) {\n accountEditPropertySummary[propertyName] = {\n timestamp: normalizedAccountEdit.timestamp,\n value: normalizedAccountEdit[propertyName],\n };\n }\n }\n }\n return accountEditPropertySummary;\n};\n\nexport const getAccountsEditsSummary = (accountEdits: {\n [commentCidOrCommunityAddress: string]: AccountEdit[];\n}) => {\n const summary: AccountEditsSummary = {};\n for (const target in accountEdits || {}) {\n summary[target] = getAccountEditPropertySummary(accountEdits[target]);\n }\n return summary;\n};\n\ninterface CommentLinkDimensions {\n linkWidth?: number;\n linkHeight?: number;\n linkHtmlTagName?: \"img\" | \"video\" | \"audio\";\n}\n\n// polyfill Promise.any, exported for test coverage of empty-array branch\nconst promiseAny = <T>(promises: Promise<T>[]): Promise<T> =>\n new Promise((res, rej) => {\n let count = promises.length;\n if (count === 0) return rej(Error(\"all promises rejected\"));\n promises.forEach((p) =>\n Promise.resolve(p)\n .then(res)\n .catch((e) => {\n if (--count === 0) rej(Error(\"all promises rejected\"));\n }),\n );\n });\n\nexport const fetchCommentLinkDimensions = async (link: string): Promise<CommentLinkDimensions> => {\n if (!link) {\n return {};\n }\n\n const fetchImageDimensions = (url: string) =>\n new Promise<CommentLinkDimensions>((resolve, reject) => {\n const image = new Image();\n image.onload = () => {\n // don't accept 0px value\n if (!image.width || !image.height) {\n return reject(Error(`failed fetching image dimensions for url '${url}'`));\n }\n resolve({\n linkWidth: image.width,\n linkHeight: image.height,\n linkHtmlTagName: \"img\",\n });\n\n // remove image from memory\n try {\n image.src = \"\";\n } catch (e) {}\n };\n image.onerror = (error) => {\n reject(Error(`failed fetching image dimensions for url '${url}'`));\n };\n\n // max loading time\n const timeout = 10000;\n setTimeout(\n () =>\n reject(Error(`failed fetching image dimensions for url '${url}' timeout '${timeout}'`)),\n timeout,\n );\n\n // start loading\n image.src = url;\n });\n\n const fetchVideoDimensions = (url: string) =>\n new Promise<CommentLinkDimensions>((resolve, reject) => {\n const video = document.createElement(\"video\");\n video.muted = true;\n video.loop = false;\n video.addEventListener(\"loadeddata\", () => {\n // don't accept 0px value\n if (!video.videoWidth || !video.videoHeight) {\n return reject(Error(`failed fetching video dimensions for url '${url}'`));\n }\n resolve({\n linkWidth: video.videoWidth,\n linkHeight: video.videoHeight,\n linkHtmlTagName: \"video\",\n });\n // prevent video from playing\n try {\n video.pause();\n } catch (e) {}\n // prevent video from loading\n try {\n video.src = \"\";\n } catch (e) {}\n });\n video.addEventListener(\"error\", (error) => {\n reject(Error(`failed fetching video dimensions for url '${url}'`));\n });\n\n // max loading time\n const timeout = 30000;\n setTimeout(\n () =>\n reject(Error(`failed fetching video dimensions for url '${url}' timeout '${timeout}'`)),\n timeout,\n );\n\n // start loading\n video.src = url;\n });\n\n const fetchAudio = (url: string) =>\n new Promise<CommentLinkDimensions>((resolve, reject) => {\n const audio = document.createElement(\"audio\");\n audio.addEventListener(\"loadeddata\", () => {\n resolve({\n linkHtmlTagName: \"audio\",\n });\n try {\n audio.pause();\n } catch {}\n try {\n audio.src = \"\";\n } catch {}\n });\n audio.addEventListener(\"error\", () =>\n reject(Error(`failed fetching audio html tag name for url '${url}'`)),\n );\n\n const timeout = 20000;\n setTimeout(\n () =>\n reject(\n Error(`failed fetching audio html tag name for url '${url}' timeout '${timeout}'`),\n ),\n timeout,\n );\n\n audio.src = url;\n });\n\n try {\n if (new URL(link).protocol !== \"https:\") {\n throw Error(`failed fetching comment.link dimensions for link '${link}' not https protocol`);\n }\n const dimensions = await promiseAny([\n fetchImageDimensions(link),\n fetchVideoDimensions(link),\n fetchAudio(link),\n ]);\n return dimensions;\n } catch (error: any) {\n log.error(\"fetchCommentLinkDimensions error\", { error, link });\n return {};\n }\n};\n\nexport const getInitAccountCommentsToUpdate = (accountsComments: AccountsComments) => {\n const accountCommentsToUpdate: { accountComment: AccountComment; accountId: string }[] = [];\n for (const accountId in accountsComments) {\n for (const accountComment of accountsComments[accountId]) {\n accountCommentsToUpdate.push({ accountComment, accountId });\n }\n }\n\n // update newer comments first, more likely to have notifications\n accountCommentsToUpdate.sort((a, b) => b.accountComment.timestamp - a.accountComment.timestamp);\n\n // updating too many comments during init slows down fetching comments/subs\n if (accountCommentsToUpdate.length > 10) {\n accountCommentsToUpdate.length = 10;\n }\n\n // TODO: add some algo to fetch all notifications (even old), but not on init\n // during downtimes when we're not fetching anything else\n return accountCommentsToUpdate;\n};\n\nexport const getAccountCommentDepth = (comment: Comment) => {\n if (!comment.parentCid) {\n return 0;\n }\n let parentCommentDepth = commentsStore.getState().comments[comment.parentCid]?.depth;\n if (typeof parentCommentDepth === \"number\") {\n return parentCommentDepth + 1;\n }\n parentCommentDepth = repliesPagesStore.getState().comments[comment.parentCid]?.depth;\n if (typeof parentCommentDepth === \"number\") {\n return parentCommentDepth + 1;\n }\n parentCommentDepth = communitiesPagesStore.getState().comments[comment.parentCid]?.depth;\n if (typeof parentCommentDepth === \"number\") {\n return parentCommentDepth + 1;\n }\n // if can't find the parent comment depth anywhere, don't include it with the account comment\n // it will be added automatically when challenge verification is received\n};\n\nexport const addShortAddressesToAccountComment = (comment: Comment) => {\n comment = { ...comment };\n try {\n comment.shortCommunityAddress = PkcJs.PKC.getShortAddress({\n address: comment.communityAddress,\n });\n } catch (e) {}\n try {\n comment.author = { ...comment.author };\n comment.author.shortAddress = PkcJs.PKC.getShortAddress({\n address: comment.author.address,\n });\n } catch (e) {}\n return comment;\n};\n\nconst utils = {\n getAccountCommunities,\n getCommentCidsToAccountsComments,\n getAccountCommentsIndex,\n getAccountsCommentsIndexes,\n sanitizeAccountCommentForState,\n sanitizeStoredAccountComment,\n getAccountEditPropertySummary,\n getAccountsEditsSummary,\n fetchCommentLinkDimensions,\n getInitAccountCommentsToUpdate,\n getAccountCommentDepth,\n addShortAddressesToAccountComment,\n promiseAny,\n};\n\nexport default utils;\n"]}
package/dist/types.d.ts CHANGED
@@ -266,7 +266,7 @@ export interface UsePublishCommentResult extends Result {
266
266
  challengeVerification: ChallengeVerification | undefined;
267
267
  publishComment(): Promise<void>;
268
268
  abandonPublish(): Promise<void>;
269
- publishChallengeAnswers(challengeAnswers: string[]): Promise<void>;
269
+ publishChallengeAnswers(challengeAnswers?: string[]): Promise<void>;
270
270
  }
271
271
  export interface UsePublishVoteOptions extends Options {
272
272
  onChallenge?(challenge: Challenge, comment?: Comment): Promise<void>;
@@ -277,7 +277,7 @@ export interface UsePublishVoteResult extends Result {
277
277
  challenge: Challenge | undefined;
278
278
  challengeVerification: ChallengeVerification | undefined;
279
279
  publishVote(): Promise<void>;
280
- publishChallengeAnswers(challengeAnswers: string[]): Promise<void>;
280
+ publishChallengeAnswers(challengeAnswers?: string[]): Promise<void>;
281
281
  }
282
282
  export interface UsePublishCommentEditOptions extends Options {
283
283
  onChallenge?(challenge: Challenge, comment?: Comment): Promise<void>;
@@ -288,7 +288,7 @@ export interface UsePublishCommentEditResult extends Result {
288
288
  challenge: Challenge | undefined;
289
289
  challengeVerification: ChallengeVerification | undefined;
290
290
  publishCommentEdit(): Promise<void>;
291
- publishChallengeAnswers(challengeAnswers: string[]): Promise<void>;
291
+ publishChallengeAnswers(challengeAnswers?: string[]): Promise<void>;
292
292
  }
293
293
  export interface UsePublishCommentModerationOptions extends Options {
294
294
  onChallenge?(challenge: Challenge, comment?: Comment): Promise<void>;
@@ -299,7 +299,7 @@ export interface UsePublishCommentModerationResult extends Result {
299
299
  challenge: Challenge | undefined;
300
300
  challengeVerification: ChallengeVerification | undefined;
301
301
  publishCommentModeration(): Promise<void>;
302
- publishChallengeAnswers(challengeAnswers: string[]): Promise<void>;
302
+ publishChallengeAnswers(challengeAnswers?: string[]): Promise<void>;
303
303
  }
304
304
  export interface UsePublishCommunityEditOptions extends Options {
305
305
  communityAddress?: string;
@@ -311,7 +311,7 @@ export interface UsePublishCommunityEditResult extends Result {
311
311
  challenge: Challenge | undefined;
312
312
  challengeVerification: ChallengeVerification | undefined;
313
313
  publishCommunityEdit(): Promise<void>;
314
- publishChallengeAnswers(challengeAnswers: string[]): Promise<void>;
314
+ publishChallengeAnswers(challengeAnswers?: string[]): Promise<void>;
315
315
  }
316
316
  export interface UseCreateCommunityOptions extends Options {
317
317
  [createCommunityOption: string]: any;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"A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E,CAAC,QAAQ,EAAE,MAAM,GAAG,kBAAkB,CAAA;CAAE,CAAC;AAC7E,MAAM,MAAM,WAAW,GAAG,aAAa,CAAC;AACxC,MAAM,MAAM,YAAY,GAAG;IAAE,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,CAAA;CAAE,CAAC;AAE9D;;GAEG;AAEH,MAAM,MAAM,eAAe,GAAG;IAAE,CAAC,kBAAkB,EAAE,MAAM,GAAG,OAAO,EAAE,CAAA;CAAE,CAAC;AAC1E,MAAM,MAAM,qBAAqB,GAAG;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,SAAS,EAAE,MAAM,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 onlyIfCached?: boolean;\n autoUpdate?: boolean;\n}\nexport interface UseCommentResult extends Result, Comment {\n refresh(): Promise<void>;\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// 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 interface UseCommunityOptions extends Options {\n community?: CommunityIdentifier;\n onlyIfCached?: boolean;\n}\nexport interface UseCommunityResult extends Result, Community {}\n\n// useCommunities(options): result\nexport interface UseCommunitiesOptions extends Options {\n communities?: CommunityIdentifier[];\n onlyIfCached?: 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 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\nexport interface UsePublishCommentOptions 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 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 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// 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 PkcRpcSettings = { [key: string]: any };\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 };\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 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 onlyIfCached?: boolean;\n autoUpdate?: boolean;\n}\nexport interface UseCommentResult extends Result, Comment {\n refresh(): Promise<void>;\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// 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 interface UseCommunityOptions extends Options {\n community?: CommunityIdentifier;\n onlyIfCached?: boolean;\n}\nexport interface UseCommunityResult extends Result, Community {}\n\n// useCommunities(options): result\nexport interface UseCommunitiesOptions extends Options {\n communities?: CommunityIdentifier[];\n onlyIfCached?: 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 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\nexport interface UsePublishCommentOptions 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 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 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// 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 PkcRpcSettings = { [key: string]: any };\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 };\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 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"]}
package/package.json CHANGED
@@ -13,7 +13,7 @@
13
13
  "publishConfig": {
14
14
  "access": "public"
15
15
  },
16
- "version": "0.1.15",
16
+ "version": "0.1.17",
17
17
  "packageManager": "yarn@4.13.0",
18
18
  "files": [
19
19
  "CHANGELOG.md",
@@ -48,7 +48,7 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "@bitsocial/bso-resolver": "0.0.8",
51
- "@pkcprotocol/pkc-js": "0.0.41",
51
+ "@pkcprotocol/pkc-js": "0.0.47",
52
52
  "@pkcprotocol/pkc-logger": "0.1.0",
53
53
  "assert": "2.0.0",
54
54
  "ethers": "5.8.0",
@@ -69,9 +69,9 @@
69
69
  "resolutions": {
70
70
  "follow-redirects": "1.16.0",
71
71
  "postcss": "8.5.10",
72
- "protobufjs": "7.5.5",
72
+ "protobufjs": "7.5.8",
73
73
  "uuid": "14.0.0",
74
- "axios": "1.15.2",
74
+ "axios": "1.16.0",
75
75
  "vite": "8.0.7",
76
76
  "tar": "7.5.11",
77
77
  "undici": "7.24.0",
@@ -88,8 +88,14 @@
88
88
  "picomatch@npm:^2.3.1": "2.3.2",
89
89
  "picomatch@npm:^4.0.1": "4.0.4",
90
90
  "picomatch@npm:^4.0.3": "4.0.4",
91
- "tmp": "0.2.4",
92
- "@tootallnate/once": "3.0.1"
91
+ "tmp": "0.2.6",
92
+ "@tootallnate/once": "3.0.1",
93
+ "@protobufjs/utf8": "1.1.1",
94
+ "@libp2p/gossipsub": "15.0.23",
95
+ "@libp2p/kad-dht": "16.2.6",
96
+ "fast-uri": "3.1.2",
97
+ "ip-address": "10.1.1",
98
+ "ws": "8.20.1"
93
99
  },
94
100
  "devDependencies": {
95
101
  "@testing-library/dom": "10.4.1",
@@ -101,9 +107,9 @@
101
107
  "@types/react": "19.1.6",
102
108
  "@types/react-dom": "19.1.6",
103
109
  "@types/uuid": "11.0.0",
104
- "@vitest/browser": "4.0.18",
105
- "@vitest/browser-playwright": "4.0.18",
106
- "@vitest/coverage-istanbul": "4.0.18",
110
+ "@vitest/browser": "4.1.6",
111
+ "@vitest/browser-playwright": "4.1.6",
112
+ "@vitest/coverage-istanbul": "4.1.6",
107
113
  "commitizen": "4.3.1",
108
114
  "conventional-changelog-cli": "4.1.0",
109
115
  "cross-env": "10.0.0",
@@ -111,7 +117,7 @@
111
117
  "husky": "4.3.8",
112
118
  "jsdom": "27.3.0",
113
119
  "knip": "6.1.0",
114
- "kubo": "0.39.0",
120
+ "kubo": "0.42.0",
115
121
  "lint-staged": "12.3.8",
116
122
  "oxfmt": "0.36.0",
117
123
  "oxlint": "1.51.0",
@@ -122,7 +128,7 @@
122
128
  "tempy": "1.0.1",
123
129
  "typescript": "6.0.2",
124
130
  "vite": "8.0.7",
125
- "vitest": "4.0.18",
131
+ "vitest": "4.1.6",
126
132
  "wait-on": "9.0.3"
127
133
  },
128
134
  "lint-staged": {