@bitsocial/bitsocial-react-hooks 0.1.13 → 0.1.15
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.
- package/CHANGELOG.md +23 -0
- package/README.md +34 -0
- package/dist/hooks/actions/actions.d.ts +2 -1
- package/dist/hooks/actions/actions.d.ts.map +1 -1
- package/dist/hooks/actions/actions.js +54 -0
- package/dist/hooks/actions/actions.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/pkc-js/pkc-js-mock.d.ts +6 -0
- package/dist/lib/pkc-js/pkc-js-mock.d.ts.map +1 -1
- package/dist/lib/pkc-js/pkc-js-mock.js +23 -0
- package/dist/lib/pkc-js/pkc-js-mock.js.map +1 -1
- package/dist/stores/accounts/accounts-actions.d.ts +2 -1
- package/dist/stores/accounts/accounts-actions.d.ts.map +1 -1
- package/dist/stores/accounts/accounts-actions.js +56 -1
- package/dist/stores/accounts/accounts-actions.js.map +1 -1
- package/dist/stores/comments/comments-store.d.ts.map +1 -1
- package/dist/stores/comments/comments-store.js +65 -1
- package/dist/stores/comments/comments-store.js.map +1 -1
- package/dist/types.d.ts +27 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comments-store.d.ts","sourceRoot":"","sources":["../../../src/stores/comments/comments-store.ts"],"names":[],"mappings":"AAKA,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAC7C,eAAO,MAAM,GAAG,QAAkD,CAAC;AACnE,OAAO,EAAW,QAAQ,EAAW,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"comments-store.d.ts","sourceRoot":"","sources":["../../../src/stores/comments/comments-store.ts"],"names":[],"mappings":"AAKA,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAC7C,eAAO,MAAM,GAAG,QAAkD,CAAC;AACnE,OAAO,EAAW,QAAQ,EAAW,MAAM,aAAa,CAAC;AAmBzD,eAAO,MAAM,SAAS,EAAE,GAAQ,CAAC;AAEjC,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,EAAE;QAAE,CAAC,UAAU,EAAE,MAAM,GAAG,KAAK,EAAE,CAAA;KAAE,CAAC;IAC1C,iBAAiB,EAAE,QAAQ,CAAC;IAC5B,sBAAsB,EAAE,QAAQ,CAAC;IACjC,qBAAqB,EAAE,QAAQ,CAAC;IAChC,cAAc,EAAE,QAAQ,CAAC;CAC1B,CAAC;AAuDF,QAAA,MAAM,aAAa,4EAqZjB,CAAC;AA8BH,eAAO,MAAM,kBAAkB,qBAmC9B,CAAC;AAGF,eAAO,MAAM,6BAA6B,qBAGzC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -24,6 +24,7 @@ const liveComments = {};
|
|
|
24
24
|
const liveCommentPromises = {};
|
|
25
25
|
const commentAutoUpdateSubscribers = {};
|
|
26
26
|
const stopCommentAfterNextUpdate = {};
|
|
27
|
+
const sparseCommentFollowupRequested = {};
|
|
27
28
|
const initializedComments = new WeakSet();
|
|
28
29
|
const trackedListeners = new WeakSet();
|
|
29
30
|
// reset all event listeners in between tests
|
|
@@ -89,7 +90,11 @@ const commentsStore = createStore((setState, getState) => {
|
|
|
89
90
|
repliesPagesStore.getState().addRepliesPageCommentsToStore(nextComment);
|
|
90
91
|
return normalizedComment;
|
|
91
92
|
});
|
|
93
|
+
const clearCommentUpdateFollowup = (commentCid) => {
|
|
94
|
+
delete sparseCommentFollowupRequested[commentCid];
|
|
95
|
+
};
|
|
92
96
|
const stopLiveComment = (commentCid, comment) => __awaiter(void 0, void 0, void 0, function* () {
|
|
97
|
+
clearCommentUpdateFollowup(commentCid);
|
|
93
98
|
const liveComment = comment || liveComments[commentCid];
|
|
94
99
|
if (typeof (liveComment === null || liveComment === void 0 ? void 0 : liveComment.stop) !== "function") {
|
|
95
100
|
return;
|
|
@@ -113,6 +118,41 @@ const commentsStore = createStore((setState, getState) => {
|
|
|
113
118
|
maybeReleaseStoppedLiveComment(commentCid, comment);
|
|
114
119
|
});
|
|
115
120
|
};
|
|
121
|
+
const toCommentUpdateError = (error) => error instanceof Error ? error : Error("comment update failed");
|
|
122
|
+
const emitCommentError = (comment, error) => {
|
|
123
|
+
const emit = comment === null || comment === void 0 ? void 0 : comment.emit;
|
|
124
|
+
if (typeof emit !== "function") {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
try {
|
|
128
|
+
emit.call(comment, "error", error);
|
|
129
|
+
}
|
|
130
|
+
catch (emitError) {
|
|
131
|
+
if (emitError !== error) {
|
|
132
|
+
log.trace("comment.update error event error", { comment, error: emitError });
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
const handleCommentUpdateError = (commentCid, comment, error) => {
|
|
137
|
+
var _a, _b;
|
|
138
|
+
const updateError = toCommentUpdateError(error);
|
|
139
|
+
clearCommentUpdateFollowup(commentCid);
|
|
140
|
+
if (!((_a = getState().errors[commentCid]) === null || _a === void 0 ? void 0 : _a.includes(updateError))) {
|
|
141
|
+
emitCommentError(comment, updateError);
|
|
142
|
+
if (!((_b = getState().errors[commentCid]) === null || _b === void 0 ? void 0 : _b.includes(updateError))) {
|
|
143
|
+
addCommentError(commentCid, updateError);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
maybeStopCommentAfterOneShotUpdate(commentCid, comment);
|
|
147
|
+
return updateError;
|
|
148
|
+
};
|
|
149
|
+
const isSparseCommentUpdate = (comment) => !!(comment === null || comment === void 0 ? void 0 : comment.timestamp) && !(comment === null || comment === void 0 ? void 0 : comment.updatedAt);
|
|
150
|
+
// A CID-only comment update can settle after immutable IPFS data; one follow-up
|
|
151
|
+
// update gives PKC a chance to load mutable community data such as replies.
|
|
152
|
+
const shouldRequestSparseCommentFollowup = (commentCid, comment) => !sparseCommentFollowupRequested[commentCid] &&
|
|
153
|
+
(stopCommentAfterNextUpdate[commentCid] || hasCommentAutoUpdateSubscribers(commentCid)) &&
|
|
154
|
+
isSparseCommentUpdate(comment);
|
|
155
|
+
const shouldWaitForSparseCommentFollowup = (commentCid, comment) => sparseCommentFollowupRequested[commentCid] && isSparseCommentUpdate(comment);
|
|
116
156
|
const initializeComment = (commentCid, comment, account) => {
|
|
117
157
|
var _a, _b, _c, _d;
|
|
118
158
|
if (initializedComments.has(comment)) {
|
|
@@ -129,6 +169,21 @@ const commentsStore = createStore((setState, getState) => {
|
|
|
129
169
|
setState((state) => ({
|
|
130
170
|
comments: Object.assign(Object.assign({}, state.comments), { [commentCid]: Object.assign(Object.assign({}, state.comments[commentCid]), { updatingState }) }),
|
|
131
171
|
}));
|
|
172
|
+
if (updatingState === "succeeded" &&
|
|
173
|
+
shouldRequestSparseCommentFollowup(commentCid, comment)) {
|
|
174
|
+
sparseCommentFollowupRequested[commentCid] = true;
|
|
175
|
+
requestCommentUpdate(commentCid, comment, {
|
|
176
|
+
stopAfterNextUpdate: !!stopCommentAfterNextUpdate[commentCid],
|
|
177
|
+
});
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
if (updatingState === "succeeded" &&
|
|
181
|
+
(comment.updatedAt || sparseCommentFollowupRequested[commentCid])) {
|
|
182
|
+
clearCommentUpdateFollowup(commentCid);
|
|
183
|
+
}
|
|
184
|
+
if (updatingState === "failed") {
|
|
185
|
+
clearCommentUpdateFollowup(commentCid);
|
|
186
|
+
}
|
|
132
187
|
if (updatingState === "succeeded" || updatingState === "failed") {
|
|
133
188
|
maybeStopCommentAfterOneShotUpdate(commentCid, comment);
|
|
134
189
|
}
|
|
@@ -205,13 +260,19 @@ const commentsStore = createStore((setState, getState) => {
|
|
|
205
260
|
else {
|
|
206
261
|
delete stopCommentAfterNextUpdate[commentCid];
|
|
207
262
|
}
|
|
208
|
-
(_a = comment === null || comment === void 0 ? void 0 : comment.update) === null || _a === void 0 ? void 0 : _a.call(comment).catch((error) =>
|
|
263
|
+
(_a = comment === null || comment === void 0 ? void 0 : comment.update) === null || _a === void 0 ? void 0 : _a.call(comment).catch((error) => {
|
|
264
|
+
const updateError = handleCommentUpdateError(commentCid, comment, error);
|
|
265
|
+
log.trace("comment.update error", { commentCid, comment, error: updateError });
|
|
266
|
+
});
|
|
209
267
|
};
|
|
210
268
|
const waitForCommentUpdateCycle = (commentCid, comment) => new Promise((resolve, reject) => {
|
|
211
269
|
var _a, _b;
|
|
212
270
|
const onUpdatingStateChange = (updatingState) => {
|
|
213
271
|
var _a;
|
|
214
272
|
if (updatingState === "succeeded") {
|
|
273
|
+
if (shouldWaitForSparseCommentFollowup(commentCid, comment)) {
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
215
276
|
cleanup();
|
|
216
277
|
resolve(normalizeCommentCommunityAddress(utils.clone(comment)));
|
|
217
278
|
return;
|
|
@@ -362,6 +423,9 @@ export const resetCommentsStore = () => __awaiter(void 0, void 0, void 0, functi
|
|
|
362
423
|
for (const commentCid in stopCommentAfterNextUpdate) {
|
|
363
424
|
delete stopCommentAfterNextUpdate[commentCid];
|
|
364
425
|
}
|
|
426
|
+
for (const commentCid in sparseCommentFollowupRequested) {
|
|
427
|
+
delete sparseCommentFollowupRequested[commentCid];
|
|
428
|
+
}
|
|
365
429
|
for (const commentCid in liveCommentPromises) {
|
|
366
430
|
delete liveCommentPromises[commentCid];
|
|
367
431
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"comments-store.js","sourceRoot":"","sources":["../../../src/stores/comments/comments-store.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,cAAc,MAAM,2BAA2B,CAAC;AACvD,MAAM,gBAAgB,GAAG,cAAc,CAAC,cAAc,CAAC;IACrD,IAAI,EAAE,8BAA8B;IACpC,IAAI,EAAE,IAAI;CACX,CAAC,CAAC;AACH,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAC7C,MAAM,CAA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Q,aAAR,QAAQ,uBAAR,QAAQ,CAAE,kBAAkB,wDAAI,CAAC;IACnC,CAAC,CAAA,CAAC,CACH,CAAC;IACF,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;IAErB,mDAAmD;IACnD,aAAa,CAAC,OAAO,EAAE,CAAC;IACxB,yBAAyB;IACzB,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;AACxC,CAAC,CAAA,CAAC;AAEF,4CAA4C;AAC5C,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAS,EAAE;IACtD,MAAM,cAAc,CAAC,cAAc,CAAC,EAAE,IAAI,EAAE,8BAA8B,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;IACtF,MAAM,kBAAkB,EAAE,CAAC;AAC7B,CAAC,CAAA,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import localForageLru from \"../../lib/localforage-lru\";\nconst commentsDatabase = localForageLru.createInstance({\n name: \"bitsocialReactHooks-comments\",\n size: 5000,\n});\nimport Logger from \"@pkcprotocol/pkc-logger\";\nexport const log = Logger(\"bitsocial-react-hooks:comments:stores\");\nimport { Comment, Comments, Account } from \"../../types\";\nimport utils from \"../../lib/utils\";\nimport createStore from \"zustand\";\nimport accountsStore from \"../accounts\";\nimport repliesPagesStore from \"../replies-pages\";\nimport { normalizeCommentCommunityAddress } from \"../../lib/pkc-compat\";\n\nlet pkcGetCommentPending: { [key: string]: boolean } = {};\nconst liveComments: { [commentCid: string]: Comment } = {};\nconst liveCommentPromises: { [commentCid: string]: Promise<Comment> | undefined } = {};\nconst commentAutoUpdateSubscribers: {\n [commentCid: string]: { [subscriberId: string]: true };\n} = {};\nconst stopCommentAfterNextUpdate: { [commentCid: string]: boolean } = {};\nconst initializedComments = new WeakSet<object>();\nconst trackedListeners = new WeakSet<object>();\n\n// reset all event listeners in between tests\nexport const listeners: any = [];\n\nexport type CommentsState = {\n comments: Comments;\n errors: { [commentCid: string]: Error[] };\n addCommentToStore: Function;\n startCommentAutoUpdate: Function;\n stopCommentAutoUpdate: Function;\n refreshComment: Function;\n};\n\nconst removeCommentListener = (comment: any, event: string, listener: (...args: any[]) => void) => {\n if (typeof comment?.off === \"function\") {\n comment.off(event, listener);\n return;\n }\n if (typeof comment?.removeListener === \"function\") {\n comment.removeListener(event, listener);\n }\n};\n\nconst getCommentAutoUpdateSubscribersCount = (commentCid: string) =>\n Object.keys(commentAutoUpdateSubscribers[commentCid] || {}).length;\n\nconst hasCommentAutoUpdateSubscribers = (commentCid: string) =>\n getCommentAutoUpdateSubscribersCount(commentCid) > 0;\n\nconst mergeCommentData = (\n commentCid: string,\n ...commentDataList: (Comment | undefined)[]\n): Comment => {\n const mergedCommentData: Comment = { cid: commentCid };\n for (const commentData of commentDataList) {\n if (commentData && typeof commentData === \"object\") {\n Object.assign(mergedCommentData, utils.clone(commentData));\n }\n }\n mergedCommentData.cid = commentCid;\n return mergedCommentData;\n};\n\nconst releaseLiveComment = (commentCid: string, comment?: Comment) => {\n const liveComment = comment || liveComments[commentCid];\n if (liveComment) {\n const listenerIndex = listeners.indexOf(liveComment);\n if (listenerIndex !== -1) {\n listeners.splice(listenerIndex, 1);\n }\n }\n if (!comment || liveComments[commentCid] === liveComment) {\n delete liveComments[commentCid];\n }\n};\n\nconst maybeReleaseStoppedLiveComment = (commentCid: string, comment?: Comment) => {\n if (!comment || hasCommentAutoUpdateSubscribers(commentCid)) {\n return;\n }\n if (liveComments[commentCid] !== comment) {\n return;\n }\n releaseLiveComment(commentCid, comment);\n};\n\nconst commentsStore = createStore<CommentsState>((setState: Function, getState: Function) => {\n const addCommentError = (commentCid: string, error: Error) => {\n setState((state: CommentsState) => {\n let commentErrors = state.errors[commentCid] || [];\n commentErrors = [...commentErrors, error];\n return { ...state, errors: { ...state.errors, [commentCid]: commentErrors } };\n });\n };\n\n const persistComment = async (commentCid: string, nextComment: Comment) => {\n const normalizedComment = normalizeCommentCommunityAddress(utils.clone(nextComment)) as Comment;\n await commentsDatabase.setItem(commentCid, normalizedComment);\n log(\"commentsStore comment update\", { commentCid, updatedComment: normalizedComment });\n setState((state: CommentsState) => ({\n comments: { ...state.comments, [commentCid]: normalizedComment },\n }));\n\n // add comment replies pages to repliesPagesStore so they can be used in useComment\n repliesPagesStore.getState().addRepliesPageCommentsToStore(nextComment);\n\n return normalizedComment;\n };\n\n const stopLiveComment = async (commentCid: string, comment?: Comment) => {\n const liveComment = comment || liveComments[commentCid];\n if (typeof liveComment?.stop !== \"function\") {\n return;\n }\n try {\n await liveComment.stop();\n } catch (error) {\n log.trace(\"comment.stop error\", { commentCid, comment: liveComment, error });\n }\n };\n\n const maybeStopCommentAfterOneShotUpdate = (commentCid: string, comment: Comment) => {\n if (!stopCommentAfterNextUpdate[commentCid]) {\n return;\n }\n delete stopCommentAfterNextUpdate[commentCid];\n if (hasCommentAutoUpdateSubscribers(commentCid)) {\n return;\n }\n void stopLiveComment(commentCid, comment).finally(() => {\n maybeReleaseStoppedLiveComment(commentCid, comment);\n });\n };\n\n const initializeComment = (commentCid: string, comment: Comment, account: Account) => {\n if (initializedComments.has(comment as object)) {\n liveComments[commentCid] = comment;\n return;\n }\n initializedComments.add(comment as object);\n liveComments[commentCid] = comment;\n\n comment?.on?.(\"update\", async (updatedComment: Comment) => {\n updatedComment = normalizeCommentCommunityAddress(utils.clone(updatedComment)) as Comment;\n await persistComment(commentCid, updatedComment);\n });\n\n comment?.on?.(\"updatingstatechange\", (updatingState: string) => {\n setState((state: CommentsState) => ({\n comments: {\n ...state.comments,\n [commentCid]: { ...state.comments[commentCid], updatingState },\n },\n }));\n\n if (updatingState === \"succeeded\" || updatingState === \"failed\") {\n maybeStopCommentAfterOneShotUpdate(commentCid, comment);\n }\n });\n\n comment?.on?.(\"error\", (error: Error) => {\n addCommentError(commentCid, error);\n });\n\n // set clients on comment so the frontend can display it, dont persist in db because a reload cancels updating\n utils.clientsOnStateChange(\n comment?.clients,\n (clientState: string, clientType: string, clientUrl: string, chainTicker?: string) => {\n setState((state: CommentsState) => {\n // make sure not undefined, sometimes happens in e2e tests\n if (!state.comments[commentCid]) {\n return {};\n }\n const clients = { ...state.comments[commentCid]?.clients };\n const client = { state: clientState };\n if (chainTicker) {\n const chainProviders = { ...clients[clientType][chainTicker], [clientUrl]: client };\n clients[clientType] = { ...clients[clientType], [chainTicker]: chainProviders };\n } else {\n clients[clientType] = { ...clients[clientType], [clientUrl]: client };\n }\n return {\n comments: {\n ...state.comments,\n [commentCid]: { ...state.comments[commentCid], clients },\n },\n };\n });\n },\n );\n\n // when publishing a comment, you don't yet know its CID\n // so when a new comment is fetched, check to see if it's your own\n // comment, and if yes, add the CID to your account comments database\n // if comment.timestamp isn't defined, it means the next update will contain the timestamp and author\n // which is used in addCidToAccountComment\n if (!comment?.timestamp) {\n comment?.once?.(\"update\", () =>\n accountsStore\n .getState()\n .accountsActionsInternal.addCidToAccountComment(comment)\n .catch((error: any) =>\n log.error(\"accountsActionsInternal.addCidToAccountComment error\", { comment, error }),\n ),\n );\n }\n\n if (!trackedListeners.has(comment as object)) {\n trackedListeners.add(comment as object);\n listeners.push(comment);\n }\n };\n\n const ensureLiveComment = async (commentCid: string, account: Account, commentData?: Comment) => {\n if (liveComments[commentCid]) {\n return liveComments[commentCid];\n }\n if (liveCommentPromises[commentCid]) {\n return liveCommentPromises[commentCid] as Promise<Comment>;\n }\n\n const liveCommentPromise = (async () => {\n const initialComment = normalizeCommentCommunityAddress(\n mergeCommentData(commentCid, commentData),\n );\n const liveComment = normalizeCommentCommunityAddress(\n await account.pkc.createComment(initialComment),\n ) as Comment;\n initializeComment(commentCid, liveComment, account);\n return liveComment;\n })();\n liveCommentPromises[commentCid] = liveCommentPromise;\n\n try {\n return await liveCommentPromise;\n } finally {\n if (liveCommentPromises[commentCid] === liveCommentPromise) {\n delete liveCommentPromises[commentCid];\n }\n }\n };\n\n const requestCommentUpdate = (\n commentCid: string,\n comment: Comment,\n options?: { stopAfterNextUpdate?: boolean },\n ) => {\n if (options?.stopAfterNextUpdate) {\n stopCommentAfterNextUpdate[commentCid] = true;\n } else {\n delete stopCommentAfterNextUpdate[commentCid];\n }\n\n comment\n ?.update?.()\n .catch((error: unknown) => log.trace(\"comment.update error\", { commentCid, comment, error }));\n };\n\n const waitForCommentUpdateCycle = (commentCid: string, comment: Comment) =>\n new Promise<Comment>((resolve, reject) => {\n const onUpdatingStateChange = (updatingState: string) => {\n if (updatingState === \"succeeded\") {\n cleanup();\n resolve(normalizeCommentCommunityAddress(utils.clone(comment)) as Comment);\n return;\n }\n if (updatingState === \"failed\") {\n cleanup();\n reject(getState().errors[commentCid]?.slice(-1)[0] || Error(\"comment update failed\"));\n }\n };\n\n const onError = (error: Error) => {\n cleanup();\n reject(error);\n };\n\n const cleanup = () => {\n removeCommentListener(comment, \"updatingstatechange\", onUpdatingStateChange);\n removeCommentListener(comment, \"error\", onError);\n };\n\n comment?.on?.(\"updatingstatechange\", onUpdatingStateChange);\n comment?.on?.(\"error\", onError);\n });\n\n return {\n comments: {},\n errors: {},\n\n async addCommentToStore(commentCid: string, account: Account, commentData?: Comment) {\n const { comments } = getState();\n const pendingKey = commentCid + account.id;\n\n // comment is in store already, do nothing\n let comment: Comment | undefined = comments[commentCid];\n if (comment || pkcGetCommentPending[pendingKey]) {\n return;\n }\n pkcGetCommentPending[pendingKey] = true;\n\n try {\n // try to find comment in database\n comment = await getCommentFromDatabase(commentCid, account, commentData);\n\n if (!comment) {\n comment = await ensureLiveComment(commentCid, account, commentData);\n comment = normalizeCommentCommunityAddress(comment);\n log(\"commentsStore.addCommentToStore\", { commentCid, comment, account });\n setState((state: CommentsState) => ({\n comments: { ...state.comments, [commentCid]: utils.clone(comment) },\n }));\n } else {\n comment = normalizeCommentCommunityAddress(comment);\n setState((state: CommentsState) => ({\n comments: { ...state.comments, [commentCid]: utils.clone(comment) },\n }));\n\n // add comment replies pages to repliesPagesStore so they can be used in useComment\n repliesPagesStore.getState().addRepliesPageCommentsToStore(comment);\n\n comment = await ensureLiveComment(\n commentCid,\n account,\n mergeCommentData(commentCid, comment, commentData),\n );\n }\n\n if (comment) {\n requestCommentUpdate(commentCid, comment, { stopAfterNextUpdate: true });\n }\n } catch (e: any) {\n addCommentError(commentCid, e);\n throw e;\n } finally {\n pkcGetCommentPending[pendingKey] = false;\n }\n },\n\n async startCommentAutoUpdate(\n commentCid: string,\n subscriberId: string,\n account: Account,\n commentData?: Comment,\n ) {\n const hadAutoUpdateSubscribers = hasCommentAutoUpdateSubscribers(commentCid);\n commentAutoUpdateSubscribers[commentCid] = {\n ...(commentAutoUpdateSubscribers[commentCid] || {}),\n [subscriberId]: true,\n };\n\n if (hadAutoUpdateSubscribers && liveComments[commentCid]) {\n return;\n }\n\n const storedComment = getState().comments[commentCid];\n const liveComment = await ensureLiveComment(\n commentCid,\n account,\n mergeCommentData(commentCid, storedComment, commentData),\n );\n\n if (!storedComment) {\n setState((state: CommentsState) => ({\n comments: { ...state.comments, [commentCid]: utils.clone(liveComment) },\n }));\n }\n\n if (!hasCommentAutoUpdateSubscribers(commentCid)) {\n await stopLiveComment(commentCid, liveComment);\n maybeReleaseStoppedLiveComment(commentCid, liveComment);\n return;\n }\n\n requestCommentUpdate(commentCid, liveComment);\n },\n\n async stopCommentAutoUpdate(commentCid: string, subscriberId: string) {\n if (commentAutoUpdateSubscribers[commentCid]) {\n delete commentAutoUpdateSubscribers[commentCid][subscriberId];\n if (Object.keys(commentAutoUpdateSubscribers[commentCid]).length === 0) {\n delete commentAutoUpdateSubscribers[commentCid];\n }\n }\n\n if (hasCommentAutoUpdateSubscribers(commentCid)) {\n return;\n }\n\n delete stopCommentAfterNextUpdate[commentCid];\n const liveComment = liveComments[commentCid];\n await stopLiveComment(commentCid, liveComment);\n maybeReleaseStoppedLiveComment(commentCid, liveComment);\n },\n\n async refreshComment(commentCid: string, account: Account, commentData?: Comment) {\n const storedComment = getState().comments[commentCid];\n const liveComment = await ensureLiveComment(\n commentCid,\n account,\n mergeCommentData(commentCid, storedComment, commentData),\n );\n\n if (\n !hasCommentAutoUpdateSubscribers(commentCid) &&\n liveComment?.updatingState !== \"stopped\"\n ) {\n await stopLiveComment(commentCid, liveComment);\n }\n\n const waitForUpdate = waitForCommentUpdateCycle(commentCid, liveComment);\n requestCommentUpdate(commentCid, liveComment, {\n stopAfterNextUpdate: !hasCommentAutoUpdateSubscribers(commentCid),\n });\n return waitForUpdate;\n },\n };\n});\n\nconst getCommentFromDatabase = async (\n commentCid: string,\n account: Account,\n initialCommentData?: Comment,\n) => {\n const commentData: any = await commentsDatabase.getItem(commentCid);\n if (!commentData) {\n return;\n }\n try {\n const comment = normalizeCommentCommunityAddress(\n await account.pkc.createComment(\n mergeCommentData(commentCid, commentData, initialCommentData),\n ),\n );\n return comment;\n } catch (e) {\n // need to log this always or it could silently fail in production and cache never be used\n console.error(\"failed pkc.createComment(cachedComment)\", {\n cachedComment: commentData,\n error: e,\n });\n }\n};\n\n// reset store in between tests\nconst originalState = commentsStore.getState();\n// async function because some stores have async init\nexport const resetCommentsStore = async () => {\n pkcGetCommentPending = {};\n for (const commentCid in commentAutoUpdateSubscribers) {\n delete commentAutoUpdateSubscribers[commentCid];\n }\n for (const commentCid in stopCommentAfterNextUpdate) {\n delete stopCommentAfterNextUpdate[commentCid];\n }\n for (const commentCid in liveCommentPromises) {\n delete liveCommentPromises[commentCid];\n }\n for (const commentCid in liveComments) {\n delete liveComments[commentCid];\n }\n\n // remove all event listeners\n await Promise.all(\n listeners.map(async (listener: any) => {\n try {\n if (typeof listener?.stop === \"function\") {\n await listener.stop();\n }\n } catch {}\n listener?.removeAllListeners?.();\n }),\n );\n listeners.length = 0;\n\n // destroy all component subscriptions to the store\n commentsStore.destroy();\n // restore original state\n commentsStore.setState(originalState);\n};\n\n// reset database and store in between tests\nexport const resetCommentsDatabaseAndStore = async () => {\n await localForageLru.createInstance({ name: \"bitsocialReactHooks-comments\" }).clear();\n await resetCommentsStore();\n};\n\nexport default commentsStore;\n"]}
|
|
1
|
+
{"version":3,"file":"comments-store.js","sourceRoot":"","sources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CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import localForageLru from \"../../lib/localforage-lru\";\nconst commentsDatabase = localForageLru.createInstance({\n name: \"bitsocialReactHooks-comments\",\n size: 5000,\n});\nimport Logger from \"@pkcprotocol/pkc-logger\";\nexport const log = Logger(\"bitsocial-react-hooks:comments:stores\");\nimport { Comment, Comments, Account } from \"../../types\";\nimport utils from \"../../lib/utils\";\nimport createStore from \"zustand\";\nimport accountsStore from \"../accounts\";\nimport repliesPagesStore from \"../replies-pages\";\nimport { normalizeCommentCommunityAddress } from \"../../lib/pkc-compat\";\n\nlet pkcGetCommentPending: { [key: string]: boolean } = {};\nconst liveComments: { [commentCid: string]: Comment } = {};\nconst liveCommentPromises: { [commentCid: string]: Promise<Comment> | undefined } = {};\nconst commentAutoUpdateSubscribers: {\n [commentCid: string]: { [subscriberId: string]: true };\n} = {};\nconst stopCommentAfterNextUpdate: { [commentCid: string]: boolean } = {};\nconst sparseCommentFollowupRequested: { [commentCid: string]: boolean } = {};\nconst initializedComments = new WeakSet<object>();\nconst trackedListeners = new WeakSet<object>();\n\n// reset all event listeners in between tests\nexport const listeners: any = [];\n\nexport type CommentsState = {\n comments: Comments;\n errors: { [commentCid: string]: Error[] };\n addCommentToStore: Function;\n startCommentAutoUpdate: Function;\n stopCommentAutoUpdate: Function;\n refreshComment: Function;\n};\n\nconst removeCommentListener = (comment: any, event: string, listener: (...args: any[]) => void) => {\n if (typeof comment?.off === \"function\") {\n comment.off(event, listener);\n return;\n }\n if (typeof comment?.removeListener === \"function\") {\n comment.removeListener(event, listener);\n }\n};\n\nconst getCommentAutoUpdateSubscribersCount = (commentCid: string) =>\n Object.keys(commentAutoUpdateSubscribers[commentCid] || {}).length;\n\nconst hasCommentAutoUpdateSubscribers = (commentCid: string) =>\n getCommentAutoUpdateSubscribersCount(commentCid) > 0;\n\nconst mergeCommentData = (\n commentCid: string,\n ...commentDataList: (Comment | undefined)[]\n): Comment => {\n const mergedCommentData: Comment = { cid: commentCid };\n for (const commentData of commentDataList) {\n if (commentData && typeof commentData === \"object\") {\n Object.assign(mergedCommentData, utils.clone(commentData));\n }\n }\n mergedCommentData.cid = commentCid;\n return mergedCommentData;\n};\n\nconst releaseLiveComment = (commentCid: string, comment?: Comment) => {\n const liveComment = comment || liveComments[commentCid];\n if (liveComment) {\n const listenerIndex = listeners.indexOf(liveComment);\n if (listenerIndex !== -1) {\n listeners.splice(listenerIndex, 1);\n }\n }\n if (!comment || liveComments[commentCid] === liveComment) {\n delete liveComments[commentCid];\n }\n};\n\nconst maybeReleaseStoppedLiveComment = (commentCid: string, comment?: Comment) => {\n if (!comment || hasCommentAutoUpdateSubscribers(commentCid)) {\n return;\n }\n if (liveComments[commentCid] !== comment) {\n return;\n }\n releaseLiveComment(commentCid, comment);\n};\n\nconst commentsStore = createStore<CommentsState>((setState: Function, getState: Function) => {\n const addCommentError = (commentCid: string, error: Error) => {\n setState((state: CommentsState) => {\n let commentErrors = state.errors[commentCid] || [];\n commentErrors = [...commentErrors, error];\n return { ...state, errors: { ...state.errors, [commentCid]: commentErrors } };\n });\n };\n\n const persistComment = async (commentCid: string, nextComment: Comment) => {\n const normalizedComment = normalizeCommentCommunityAddress(utils.clone(nextComment)) as Comment;\n await commentsDatabase.setItem(commentCid, normalizedComment);\n log(\"commentsStore comment update\", { commentCid, updatedComment: normalizedComment });\n setState((state: CommentsState) => ({\n comments: { ...state.comments, [commentCid]: normalizedComment },\n }));\n\n // add comment replies pages to repliesPagesStore so they can be used in useComment\n repliesPagesStore.getState().addRepliesPageCommentsToStore(nextComment);\n\n return normalizedComment;\n };\n\n const clearCommentUpdateFollowup = (commentCid: string) => {\n delete sparseCommentFollowupRequested[commentCid];\n };\n\n const stopLiveComment = async (commentCid: string, comment?: Comment) => {\n clearCommentUpdateFollowup(commentCid);\n const liveComment = comment || liveComments[commentCid];\n if (typeof liveComment?.stop !== \"function\") {\n return;\n }\n try {\n await liveComment.stop();\n } catch (error) {\n log.trace(\"comment.stop error\", { commentCid, comment: liveComment, error });\n }\n };\n\n const maybeStopCommentAfterOneShotUpdate = (commentCid: string, comment: Comment) => {\n if (!stopCommentAfterNextUpdate[commentCid]) {\n return;\n }\n delete stopCommentAfterNextUpdate[commentCid];\n if (hasCommentAutoUpdateSubscribers(commentCid)) {\n return;\n }\n void stopLiveComment(commentCid, comment).finally(() => {\n maybeReleaseStoppedLiveComment(commentCid, comment);\n });\n };\n\n const toCommentUpdateError = (error: unknown) =>\n error instanceof Error ? error : Error(\"comment update failed\");\n\n const emitCommentError = (comment: Comment, error: Error) => {\n const emit = (comment as any)?.emit;\n if (typeof emit !== \"function\") {\n return;\n }\n try {\n emit.call(comment, \"error\", error);\n } catch (emitError) {\n if (emitError !== error) {\n log.trace(\"comment.update error event error\", { comment, error: emitError });\n }\n }\n };\n\n const handleCommentUpdateError = (commentCid: string, comment: Comment, error: unknown) => {\n const updateError = toCommentUpdateError(error);\n clearCommentUpdateFollowup(commentCid);\n\n if (!getState().errors[commentCid]?.includes(updateError)) {\n emitCommentError(comment, updateError);\n if (!getState().errors[commentCid]?.includes(updateError)) {\n addCommentError(commentCid, updateError);\n }\n }\n\n maybeStopCommentAfterOneShotUpdate(commentCid, comment);\n return updateError;\n };\n\n const isSparseCommentUpdate = (comment: Comment) => !!comment?.timestamp && !comment?.updatedAt;\n\n // A CID-only comment update can settle after immutable IPFS data; one follow-up\n // update gives PKC a chance to load mutable community data such as replies.\n const shouldRequestSparseCommentFollowup = (commentCid: string, comment: Comment) =>\n !sparseCommentFollowupRequested[commentCid] &&\n (stopCommentAfterNextUpdate[commentCid] || hasCommentAutoUpdateSubscribers(commentCid)) &&\n isSparseCommentUpdate(comment);\n\n const shouldWaitForSparseCommentFollowup = (commentCid: string, comment: Comment) =>\n sparseCommentFollowupRequested[commentCid] && isSparseCommentUpdate(comment);\n\n const initializeComment = (commentCid: string, comment: Comment, account: Account) => {\n if (initializedComments.has(comment as object)) {\n liveComments[commentCid] = comment;\n return;\n }\n initializedComments.add(comment as object);\n liveComments[commentCid] = comment;\n\n comment?.on?.(\"update\", async (updatedComment: Comment) => {\n updatedComment = normalizeCommentCommunityAddress(utils.clone(updatedComment)) as Comment;\n await persistComment(commentCid, updatedComment);\n });\n\n comment?.on?.(\"updatingstatechange\", (updatingState: string) => {\n setState((state: CommentsState) => ({\n comments: {\n ...state.comments,\n [commentCid]: { ...state.comments[commentCid], updatingState },\n },\n }));\n\n if (\n updatingState === \"succeeded\" &&\n shouldRequestSparseCommentFollowup(commentCid, comment)\n ) {\n sparseCommentFollowupRequested[commentCid] = true;\n requestCommentUpdate(commentCid, comment, {\n stopAfterNextUpdate: !!stopCommentAfterNextUpdate[commentCid],\n });\n return;\n }\n\n if (\n updatingState === \"succeeded\" &&\n (comment.updatedAt || sparseCommentFollowupRequested[commentCid])\n ) {\n clearCommentUpdateFollowup(commentCid);\n }\n if (updatingState === \"failed\") {\n clearCommentUpdateFollowup(commentCid);\n }\n\n if (updatingState === \"succeeded\" || updatingState === \"failed\") {\n maybeStopCommentAfterOneShotUpdate(commentCid, comment);\n }\n });\n\n comment?.on?.(\"error\", (error: Error) => {\n addCommentError(commentCid, error);\n });\n\n // set clients on comment so the frontend can display it, dont persist in db because a reload cancels updating\n utils.clientsOnStateChange(\n comment?.clients,\n (clientState: string, clientType: string, clientUrl: string, chainTicker?: string) => {\n setState((state: CommentsState) => {\n // make sure not undefined, sometimes happens in e2e tests\n if (!state.comments[commentCid]) {\n return {};\n }\n const clients = { ...state.comments[commentCid]?.clients };\n const client = { state: clientState };\n if (chainTicker) {\n const chainProviders = { ...clients[clientType][chainTicker], [clientUrl]: client };\n clients[clientType] = { ...clients[clientType], [chainTicker]: chainProviders };\n } else {\n clients[clientType] = { ...clients[clientType], [clientUrl]: client };\n }\n return {\n comments: {\n ...state.comments,\n [commentCid]: { ...state.comments[commentCid], clients },\n },\n };\n });\n },\n );\n\n // when publishing a comment, you don't yet know its CID\n // so when a new comment is fetched, check to see if it's your own\n // comment, and if yes, add the CID to your account comments database\n // if comment.timestamp isn't defined, it means the next update will contain the timestamp and author\n // which is used in addCidToAccountComment\n if (!comment?.timestamp) {\n comment?.once?.(\"update\", () =>\n accountsStore\n .getState()\n .accountsActionsInternal.addCidToAccountComment(comment)\n .catch((error: any) =>\n log.error(\"accountsActionsInternal.addCidToAccountComment error\", { comment, error }),\n ),\n );\n }\n\n if (!trackedListeners.has(comment as object)) {\n trackedListeners.add(comment as object);\n listeners.push(comment);\n }\n };\n\n const ensureLiveComment = async (commentCid: string, account: Account, commentData?: Comment) => {\n if (liveComments[commentCid]) {\n return liveComments[commentCid];\n }\n if (liveCommentPromises[commentCid]) {\n return liveCommentPromises[commentCid] as Promise<Comment>;\n }\n\n const liveCommentPromise = (async () => {\n const initialComment = normalizeCommentCommunityAddress(\n mergeCommentData(commentCid, commentData),\n );\n const liveComment = normalizeCommentCommunityAddress(\n await account.pkc.createComment(initialComment),\n ) as Comment;\n initializeComment(commentCid, liveComment, account);\n return liveComment;\n })();\n liveCommentPromises[commentCid] = liveCommentPromise;\n\n try {\n return await liveCommentPromise;\n } finally {\n if (liveCommentPromises[commentCid] === liveCommentPromise) {\n delete liveCommentPromises[commentCid];\n }\n }\n };\n\n const requestCommentUpdate = (\n commentCid: string,\n comment: Comment,\n options?: { stopAfterNextUpdate?: boolean },\n ) => {\n if (options?.stopAfterNextUpdate) {\n stopCommentAfterNextUpdate[commentCid] = true;\n } else {\n delete stopCommentAfterNextUpdate[commentCid];\n }\n\n comment?.update?.().catch((error: unknown) => {\n const updateError = handleCommentUpdateError(commentCid, comment, error);\n log.trace(\"comment.update error\", { commentCid, comment, error: updateError });\n });\n };\n\n const waitForCommentUpdateCycle = (commentCid: string, comment: Comment) =>\n new Promise<Comment>((resolve, reject) => {\n const onUpdatingStateChange = (updatingState: string) => {\n if (updatingState === \"succeeded\") {\n if (shouldWaitForSparseCommentFollowup(commentCid, comment)) {\n return;\n }\n cleanup();\n resolve(normalizeCommentCommunityAddress(utils.clone(comment)) as Comment);\n return;\n }\n if (updatingState === \"failed\") {\n cleanup();\n reject(getState().errors[commentCid]?.slice(-1)[0] || Error(\"comment update failed\"));\n }\n };\n\n const onError = (error: Error) => {\n cleanup();\n reject(error);\n };\n\n const cleanup = () => {\n removeCommentListener(comment, \"updatingstatechange\", onUpdatingStateChange);\n removeCommentListener(comment, \"error\", onError);\n };\n\n comment?.on?.(\"updatingstatechange\", onUpdatingStateChange);\n comment?.on?.(\"error\", onError);\n });\n\n return {\n comments: {},\n errors: {},\n\n async addCommentToStore(commentCid: string, account: Account, commentData?: Comment) {\n const { comments } = getState();\n const pendingKey = commentCid + account.id;\n\n // comment is in store already, do nothing\n let comment: Comment | undefined = comments[commentCid];\n if (comment || pkcGetCommentPending[pendingKey]) {\n return;\n }\n pkcGetCommentPending[pendingKey] = true;\n\n try {\n // try to find comment in database\n comment = await getCommentFromDatabase(commentCid, account, commentData);\n\n if (!comment) {\n comment = await ensureLiveComment(commentCid, account, commentData);\n comment = normalizeCommentCommunityAddress(comment);\n log(\"commentsStore.addCommentToStore\", { commentCid, comment, account });\n setState((state: CommentsState) => ({\n comments: { ...state.comments, [commentCid]: utils.clone(comment) },\n }));\n } else {\n comment = normalizeCommentCommunityAddress(comment);\n setState((state: CommentsState) => ({\n comments: { ...state.comments, [commentCid]: utils.clone(comment) },\n }));\n\n // add comment replies pages to repliesPagesStore so they can be used in useComment\n repliesPagesStore.getState().addRepliesPageCommentsToStore(comment);\n\n comment = await ensureLiveComment(\n commentCid,\n account,\n mergeCommentData(commentCid, comment, commentData),\n );\n }\n\n if (comment) {\n requestCommentUpdate(commentCid, comment, { stopAfterNextUpdate: true });\n }\n } catch (e: any) {\n addCommentError(commentCid, e);\n throw e;\n } finally {\n pkcGetCommentPending[pendingKey] = false;\n }\n },\n\n async startCommentAutoUpdate(\n commentCid: string,\n subscriberId: string,\n account: Account,\n commentData?: Comment,\n ) {\n const hadAutoUpdateSubscribers = hasCommentAutoUpdateSubscribers(commentCid);\n commentAutoUpdateSubscribers[commentCid] = {\n ...(commentAutoUpdateSubscribers[commentCid] || {}),\n [subscriberId]: true,\n };\n\n if (hadAutoUpdateSubscribers && liveComments[commentCid]) {\n return;\n }\n\n const storedComment = getState().comments[commentCid];\n const liveComment = await ensureLiveComment(\n commentCid,\n account,\n mergeCommentData(commentCid, storedComment, commentData),\n );\n\n if (!storedComment) {\n setState((state: CommentsState) => ({\n comments: { ...state.comments, [commentCid]: utils.clone(liveComment) },\n }));\n }\n\n if (!hasCommentAutoUpdateSubscribers(commentCid)) {\n await stopLiveComment(commentCid, liveComment);\n maybeReleaseStoppedLiveComment(commentCid, liveComment);\n return;\n }\n\n requestCommentUpdate(commentCid, liveComment);\n },\n\n async stopCommentAutoUpdate(commentCid: string, subscriberId: string) {\n if (commentAutoUpdateSubscribers[commentCid]) {\n delete commentAutoUpdateSubscribers[commentCid][subscriberId];\n if (Object.keys(commentAutoUpdateSubscribers[commentCid]).length === 0) {\n delete commentAutoUpdateSubscribers[commentCid];\n }\n }\n\n if (hasCommentAutoUpdateSubscribers(commentCid)) {\n return;\n }\n\n delete stopCommentAfterNextUpdate[commentCid];\n const liveComment = liveComments[commentCid];\n await stopLiveComment(commentCid, liveComment);\n maybeReleaseStoppedLiveComment(commentCid, liveComment);\n },\n\n async refreshComment(commentCid: string, account: Account, commentData?: Comment) {\n const storedComment = getState().comments[commentCid];\n const liveComment = await ensureLiveComment(\n commentCid,\n account,\n mergeCommentData(commentCid, storedComment, commentData),\n );\n\n if (\n !hasCommentAutoUpdateSubscribers(commentCid) &&\n liveComment?.updatingState !== \"stopped\"\n ) {\n await stopLiveComment(commentCid, liveComment);\n }\n\n const waitForUpdate = waitForCommentUpdateCycle(commentCid, liveComment);\n requestCommentUpdate(commentCid, liveComment, {\n stopAfterNextUpdate: !hasCommentAutoUpdateSubscribers(commentCid),\n });\n return waitForUpdate;\n },\n };\n});\n\nconst getCommentFromDatabase = async (\n commentCid: string,\n account: Account,\n initialCommentData?: Comment,\n) => {\n const commentData: any = await commentsDatabase.getItem(commentCid);\n if (!commentData) {\n return;\n }\n try {\n const comment = normalizeCommentCommunityAddress(\n await account.pkc.createComment(\n mergeCommentData(commentCid, commentData, initialCommentData),\n ),\n );\n return comment;\n } catch (e) {\n // need to log this always or it could silently fail in production and cache never be used\n console.error(\"failed pkc.createComment(cachedComment)\", {\n cachedComment: commentData,\n error: e,\n });\n }\n};\n\n// reset store in between tests\nconst originalState = commentsStore.getState();\n// async function because some stores have async init\nexport const resetCommentsStore = async () => {\n pkcGetCommentPending = {};\n for (const commentCid in commentAutoUpdateSubscribers) {\n delete commentAutoUpdateSubscribers[commentCid];\n }\n for (const commentCid in stopCommentAfterNextUpdate) {\n delete stopCommentAfterNextUpdate[commentCid];\n }\n for (const commentCid in sparseCommentFollowupRequested) {\n delete sparseCommentFollowupRequested[commentCid];\n }\n for (const commentCid in liveCommentPromises) {\n delete liveCommentPromises[commentCid];\n }\n for (const commentCid in liveComments) {\n delete liveComments[commentCid];\n }\n\n // remove all event listeners\n await Promise.all(\n listeners.map(async (listener: any) => {\n try {\n if (typeof listener?.stop === \"function\") {\n await listener.stop();\n }\n } catch {}\n listener?.removeAllListeners?.();\n }),\n );\n listeners.length = 0;\n\n // destroy all component subscriptions to the store\n commentsStore.destroy();\n // restore original state\n commentsStore.setState(originalState);\n};\n\n// reset database and store in between tests\nexport const resetCommentsDatabaseAndStore = async () => {\n await localForageLru.createInstance({ name: \"bitsocialReactHooks-comments\" }).clear();\n await resetCommentsStore();\n};\n\nexport default commentsStore;\n"]}
|
package/dist/types.d.ts
CHANGED
|
@@ -320,6 +320,17 @@ export interface UseCreateCommunityResult extends Result {
|
|
|
320
320
|
createdCommunity: Community | undefined;
|
|
321
321
|
createCommunity(): Promise<void>;
|
|
322
322
|
}
|
|
323
|
+
export interface UseExportCommunityOptions extends Options {
|
|
324
|
+
communityAddress?: string;
|
|
325
|
+
communityAddresses?: string[];
|
|
326
|
+
includePrivateKey?: boolean;
|
|
327
|
+
exportPath?: string;
|
|
328
|
+
signal?: AbortSignal;
|
|
329
|
+
}
|
|
330
|
+
export interface UseExportCommunityResult extends Result {
|
|
331
|
+
communityExports: CommunityExport[];
|
|
332
|
+
exportCommunity(): Promise<void>;
|
|
333
|
+
}
|
|
323
334
|
export interface UseSubscribeOptions extends Options {
|
|
324
335
|
communityAddress?: string;
|
|
325
336
|
multisubAddress?: string;
|
|
@@ -402,6 +413,12 @@ export type PublishCommentModerationOptions = {
|
|
|
402
413
|
export type PublishCommunityEditOptions = {
|
|
403
414
|
[key: string]: any;
|
|
404
415
|
};
|
|
416
|
+
export interface ExportCommunityOptions {
|
|
417
|
+
includePrivateKey?: boolean;
|
|
418
|
+
exportPath?: string;
|
|
419
|
+
signal?: AbortSignal;
|
|
420
|
+
[key: string]: unknown;
|
|
421
|
+
}
|
|
405
422
|
export type Challenge = {
|
|
406
423
|
[key: string]: any;
|
|
407
424
|
};
|
|
@@ -435,6 +452,16 @@ export type CommunityEdit = {
|
|
|
435
452
|
export type Community = {
|
|
436
453
|
[key: string]: any;
|
|
437
454
|
};
|
|
455
|
+
export type CommunityExport = {
|
|
456
|
+
communityAddress: string;
|
|
457
|
+
exportId: string;
|
|
458
|
+
name?: string;
|
|
459
|
+
publicKey?: string;
|
|
460
|
+
includePrivateKey?: boolean;
|
|
461
|
+
progress?: number;
|
|
462
|
+
url?: string;
|
|
463
|
+
[key: string]: unknown;
|
|
464
|
+
};
|
|
438
465
|
export type CommunityStats = {
|
|
439
466
|
[key: string]: any;
|
|
440
467
|
};
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAEA;;GAEG;AAEH,MAAM,WAAW,OAAO;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAA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C;IAC7C,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AACF,MAAM,MAAM,mBAAmB,GAAG;IAAE,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// 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 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 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.
|
|
16
|
+
"version": "0.1.15",
|
|
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.
|
|
51
|
+
"@pkcprotocol/pkc-js": "0.0.41",
|
|
52
52
|
"@pkcprotocol/pkc-logger": "0.1.0",
|
|
53
53
|
"assert": "2.0.0",
|
|
54
54
|
"ethers": "5.8.0",
|