@pkcprotocol/pkc-js 0.0.96 → 0.0.97
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/dist/browser/generated-version.d.ts +1 -1
- package/dist/browser/generated-version.js +1 -1
- package/dist/browser/runtime/node/community/local-community/cleanup.d.ts +1 -0
- package/dist/browser/runtime/node/community/local-community/cleanup.js +33 -11
- package/dist/browser/runtime/node/community/local-community/cleanup.js.map +1 -1
- package/dist/browser/runtime/node/community/local-community/ipns-publishing.js +14 -5
- package/dist/browser/runtime/node/community/local-community/ipns-publishing.js.map +1 -1
- package/dist/bundled/bundle-manifest.json +25 -25
- package/dist/bundled/chunks/{helia-for-pkc-CmSUHQVn.js → helia-for-pkc-BvZheFmK.js} +33 -33
- package/dist/bundled/chunks/{local-community-DK5HhKZf.js → local-community-CE8orbFt.js} +42 -38
- package/dist/bundled/chunks/{local-community-DVG9tyIW.js → local-community-bPjJm35w.js} +1 -1
- package/dist/bundled/chunks/{node-CyXajPvJ.js → node-DmZww4LL.js} +5 -5
- package/dist/bundled/chunks/{rpc-local-community-CdG4JLzO.js → rpc-local-community-CH7vnXLI.js} +1 -1
- package/dist/bundled/chunks/{schema-BIik7LGj.js → schema-DzFAY-My.js} +1 -1
- package/dist/bundled/chunks/{util-y_hIxyCS.js → util-BiM-_F_H.js} +1 -1
- package/dist/bundled/index.js +1 -1
- package/dist/bundled/rpc/src/index.js +4 -4
- package/dist/node/generated-version.d.ts +1 -1
- package/dist/node/generated-version.js +1 -1
- package/dist/node/runtime/node/community/local-community/cleanup.d.ts +1 -0
- package/dist/node/runtime/node/community/local-community/cleanup.js +33 -11
- package/dist/node/runtime/node/community/local-community/cleanup.js.map +1 -1
- package/dist/node/runtime/node/community/local-community/ipns-publishing.js +14 -5
- package/dist/node/runtime/node/community/local-community/ipns-publishing.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
|
|
2
|
-
import { B as ipnsNameToIpnsOverPubsubTopic, R as hideClassPrivateProps, Sr as PKCError, wr as logger_default, x as binaryKeyToPubsubTopic } from "./schema-
|
|
3
|
-
import { a as fetchBlockWithStalledSessionFailover, c as selectBitswapSessionSeedPeers, i as directFetchIpnsRecordFromProviders, n as cacheIpnsRecordInPubsubLocalStore, o as getHeliaDebugContext, r as connectToPubsubPeers, s as readFreshCachedIpnsRecordFromPubsubLocalStore } from "./util-
|
|
2
|
+
import { B as ipnsNameToIpnsOverPubsubTopic, R as hideClassPrivateProps, Sr as PKCError, wr as logger_default, x as binaryKeyToPubsubTopic } from "./schema-DzFAY-My.js";
|
|
3
|
+
import { a as fetchBlockWithStalledSessionFailover, c as selectBitswapSessionSeedPeers, i as directFetchIpnsRecordFromProviders, n as cacheIpnsRecordInPubsubLocalStore, o as getHeliaDebugContext, r as connectToPubsubPeers, s as readFreshCachedIpnsRecordFromPubsubLocalStore } from "./util-BiM-_F_H.js";
|
|
4
4
|
import { t as map } from "./src-Cpx2Sts8.js";
|
|
5
5
|
import { t as parallelBatch } from "./src-DKntVmyX.js";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
7
7
|
import fsp, { rename, writeFile } from "node:fs/promises";
|
|
8
|
-
import
|
|
9
|
-
import path
|
|
8
|
+
import Path, { basename, dirname, join } from "node:path";
|
|
9
|
+
import path from "path";
|
|
10
10
|
import { CID } from "multiformats/cid";
|
|
11
11
|
import { peerIdFromString } from "@libp2p/peer-id";
|
|
12
12
|
import * as Digest from "multiformats/hashes/digest";
|
|
@@ -149,7 +149,7 @@ var require_path = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
149
149
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
150
150
|
exports.convertPosixPathToPattern = exports.convertWindowsPathToPattern = exports.convertPathToPattern = exports.escapePosixPath = exports.escapeWindowsPath = exports.escape = exports.removeLeadingDotSegment = exports.makeAbsolute = exports.unixify = void 0;
|
|
151
151
|
const os$1 = __require("os");
|
|
152
|
-
const path$
|
|
152
|
+
const path$9 = __require("path");
|
|
153
153
|
const IS_WINDOWS_PLATFORM = os$1.platform() === "win32";
|
|
154
154
|
const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
|
|
155
155
|
/**
|
|
@@ -178,7 +178,7 @@ var require_path = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
178
178
|
}
|
|
179
179
|
exports.unixify = unixify;
|
|
180
180
|
function makeAbsolute(cwd, filepath) {
|
|
181
|
-
return path$
|
|
181
|
+
return path$9.resolve(cwd, filepath);
|
|
182
182
|
}
|
|
183
183
|
exports.makeAbsolute = makeAbsolute;
|
|
184
184
|
function removeLeadingDotSegment(entry) {
|
|
@@ -1430,7 +1430,7 @@ var require_braces = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1430
1430
|
//#endregion
|
|
1431
1431
|
//#region node_modules/picomatch/lib/constants.js
|
|
1432
1432
|
var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1433
|
-
const path$
|
|
1433
|
+
const path$8 = __require("path");
|
|
1434
1434
|
const WIN_SLASH = "\\\\/";
|
|
1435
1435
|
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
1436
1436
|
const DEFAULT_MAX_EXTGLOB_RECURSION = 0;
|
|
@@ -1555,7 +1555,7 @@ var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1555
1555
|
CHAR_UNDERSCORE: 95,
|
|
1556
1556
|
CHAR_VERTICAL_LINE: 124,
|
|
1557
1557
|
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
|
1558
|
-
SEP: path$
|
|
1558
|
+
SEP: path$8.sep,
|
|
1559
1559
|
/**
|
|
1560
1560
|
* Create EXTGLOB_CHARS
|
|
1561
1561
|
*/
|
|
@@ -1599,7 +1599,7 @@ var require_constants$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1599
1599
|
//#endregion
|
|
1600
1600
|
//#region node_modules/picomatch/lib/utils.js
|
|
1601
1601
|
var require_utils$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
1602
|
-
const path$
|
|
1602
|
+
const path$7 = __require("path");
|
|
1603
1603
|
const win32 = process.platform === "win32";
|
|
1604
1604
|
const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = require_constants$1();
|
|
1605
1605
|
exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
|
@@ -1619,7 +1619,7 @@ var require_utils$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
1619
1619
|
};
|
|
1620
1620
|
exports.isWindows = (options) => {
|
|
1621
1621
|
if (options && typeof options.windows === "boolean") return options.windows;
|
|
1622
|
-
return win32 === true || path$
|
|
1622
|
+
return win32 === true || path$7.sep === "\\";
|
|
1623
1623
|
};
|
|
1624
1624
|
exports.escapeLast = (input, char, lastIdx) => {
|
|
1625
1625
|
const idx = input.lastIndexOf(char, lastIdx);
|
|
@@ -2989,7 +2989,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2989
2989
|
//#endregion
|
|
2990
2990
|
//#region node_modules/picomatch/lib/picomatch.js
|
|
2991
2991
|
var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2992
|
-
const path$
|
|
2992
|
+
const path$6 = __require("path");
|
|
2993
2993
|
const scan = require_scan();
|
|
2994
2994
|
const parse = require_parse();
|
|
2995
2995
|
const utils = require_utils$2();
|
|
@@ -3128,7 +3128,7 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3128
3128
|
* @api public
|
|
3129
3129
|
*/
|
|
3130
3130
|
picomatch.matchBase = (input, glob, options, posix = utils.isWindows(options)) => {
|
|
3131
|
-
return (glob instanceof RegExp ? glob : picomatch.makeRe(glob, options)).test(path$
|
|
3131
|
+
return (glob instanceof RegExp ? glob : picomatch.makeRe(glob, options)).test(path$6.basename(input));
|
|
3132
3132
|
};
|
|
3133
3133
|
/**
|
|
3134
3134
|
* Returns true if **any** of the given glob `patterns` match the specified `string`.
|
|
@@ -3683,7 +3683,7 @@ var require_micromatch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3683
3683
|
var require_pattern = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3684
3684
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3685
3685
|
exports.isAbsolute = exports.partitionAbsoluteAndRelative = exports.removeDuplicateSlashes = exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0;
|
|
3686
|
-
const path$
|
|
3686
|
+
const path$5 = __require("path");
|
|
3687
3687
|
const globParent = require_glob_parent();
|
|
3688
3688
|
const micromatch = require_micromatch();
|
|
3689
3689
|
const GLOBSTAR = "**";
|
|
@@ -3791,7 +3791,7 @@ var require_pattern = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3791
3791
|
}
|
|
3792
3792
|
exports.endsWithSlashGlobStar = endsWithSlashGlobStar;
|
|
3793
3793
|
function isAffectDepthOfReadingPattern(pattern) {
|
|
3794
|
-
const basename = path$
|
|
3794
|
+
const basename = path$5.basename(pattern);
|
|
3795
3795
|
return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
|
|
3796
3796
|
}
|
|
3797
3797
|
exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
|
|
@@ -3865,7 +3865,7 @@ var require_pattern = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3865
3865
|
}
|
|
3866
3866
|
exports.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
|
|
3867
3867
|
function isAbsolute(pattern) {
|
|
3868
|
-
return path$
|
|
3868
|
+
return path$5.isAbsolute(pattern);
|
|
3869
3869
|
}
|
|
3870
3870
|
exports.isAbsolute = isAbsolute;
|
|
3871
3871
|
}));
|
|
@@ -4493,7 +4493,7 @@ var require_fs = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4493
4493
|
//#region node_modules/@nodelib/fs.scandir/out/settings.js
|
|
4494
4494
|
var require_settings$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4495
4495
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4496
|
-
const path$
|
|
4496
|
+
const path$4 = __require("path");
|
|
4497
4497
|
const fsStat = require_out$3();
|
|
4498
4498
|
const fs = require_fs();
|
|
4499
4499
|
var Settings = class {
|
|
@@ -4501,7 +4501,7 @@ var require_settings$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4501
4501
|
this._options = _options;
|
|
4502
4502
|
this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
|
|
4503
4503
|
this.fs = fs.createFileSystemAdapter(this._options.fs);
|
|
4504
|
-
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path$
|
|
4504
|
+
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path$4.sep);
|
|
4505
4505
|
this.stats = this._getValue(this._options.stats, false);
|
|
4506
4506
|
this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
|
|
4507
4507
|
this.fsStatSettings = new fsStat.Settings({
|
|
@@ -5095,7 +5095,7 @@ var require_sync$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5095
5095
|
//#region node_modules/@nodelib/fs.walk/out/settings.js
|
|
5096
5096
|
var require_settings$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5097
5097
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5098
|
-
const path$
|
|
5098
|
+
const path$3 = __require("path");
|
|
5099
5099
|
const fsScandir = require_out$2();
|
|
5100
5100
|
var Settings = class {
|
|
5101
5101
|
constructor(_options = {}) {
|
|
@@ -5105,7 +5105,7 @@ var require_settings$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5105
5105
|
this.deepFilter = this._getValue(this._options.deepFilter, null);
|
|
5106
5106
|
this.entryFilter = this._getValue(this._options.entryFilter, null);
|
|
5107
5107
|
this.errorFilter = this._getValue(this._options.errorFilter, null);
|
|
5108
|
-
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path$
|
|
5108
|
+
this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path$3.sep);
|
|
5109
5109
|
this.fsScandirSettings = new fsScandir.Settings({
|
|
5110
5110
|
followSymbolicLinks: this._options.followSymbolicLinks,
|
|
5111
5111
|
fs: this._options.fs,
|
|
@@ -5157,7 +5157,7 @@ var require_out$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5157
5157
|
//#region node_modules/fast-glob/out/readers/reader.js
|
|
5158
5158
|
var require_reader = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5159
5159
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5160
|
-
const path$
|
|
5160
|
+
const path$2 = __require("path");
|
|
5161
5161
|
const fsStat = require_out$3();
|
|
5162
5162
|
const utils = require_utils$1();
|
|
5163
5163
|
var Reader = class {
|
|
@@ -5170,7 +5170,7 @@ var require_reader = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5170
5170
|
});
|
|
5171
5171
|
}
|
|
5172
5172
|
_getFullEntryPath(filepath) {
|
|
5173
|
-
return path$
|
|
5173
|
+
return path$2.resolve(this._settings.cwd, filepath);
|
|
5174
5174
|
}
|
|
5175
5175
|
_makeEntry(stats, pattern) {
|
|
5176
5176
|
const entry = {
|
|
@@ -5505,7 +5505,7 @@ var require_entry = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5505
5505
|
//#region node_modules/fast-glob/out/providers/provider.js
|
|
5506
5506
|
var require_provider = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
5507
5507
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5508
|
-
const path$
|
|
5508
|
+
const path$1 = __require("path");
|
|
5509
5509
|
const deep_1 = require_deep();
|
|
5510
5510
|
const entry_1 = require_entry$1();
|
|
5511
5511
|
const error_1 = require_error();
|
|
@@ -5519,7 +5519,7 @@ var require_provider = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5519
5519
|
this.entryTransformer = new entry_2.default(this._settings);
|
|
5520
5520
|
}
|
|
5521
5521
|
_getRootDirectory(task) {
|
|
5522
|
-
return path$
|
|
5522
|
+
return path$1.resolve(this._settings.cwd, task.base);
|
|
5523
5523
|
}
|
|
5524
5524
|
_getReaderOptions(task) {
|
|
5525
5525
|
const basePath = task.base === "." ? "" : task.base;
|
|
@@ -5850,7 +5850,7 @@ var import_out = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((export
|
|
|
5850
5850
|
* Async iterable filename pattern matcher
|
|
5851
5851
|
*/
|
|
5852
5852
|
async function* glob(dir, pattern, options = {}) {
|
|
5853
|
-
const absoluteDir =
|
|
5853
|
+
const absoluteDir = Path.resolve(dir);
|
|
5854
5854
|
const stats = await fsp.stat(absoluteDir);
|
|
5855
5855
|
for await (const entry of import_out.default.stream(pattern, {
|
|
5856
5856
|
...options,
|
|
@@ -6020,7 +6020,7 @@ var NextToLast = class {
|
|
|
6020
6020
|
};
|
|
6021
6021
|
}
|
|
6022
6022
|
decode(str) {
|
|
6023
|
-
let fileName =
|
|
6023
|
+
let fileName = Path.basename(str);
|
|
6024
6024
|
if (fileName.endsWith(this.extension)) fileName = fileName.substring(0, fileName.length - this.extension.length);
|
|
6025
6025
|
return CID.decode(this.base.decoder.decode(fileName));
|
|
6026
6026
|
}
|
|
@@ -6046,7 +6046,7 @@ var NextToLast = class {
|
|
|
6046
6046
|
async function writeFile$1(file, contents, options) {
|
|
6047
6047
|
try {
|
|
6048
6048
|
options?.signal?.throwIfAborted();
|
|
6049
|
-
await raceSignal(fsp.mkdir(
|
|
6049
|
+
await raceSignal(fsp.mkdir(Path.dirname(file), { recursive: true }), options?.signal);
|
|
6050
6050
|
const writer = new Writer(file);
|
|
6051
6051
|
options?.signal?.throwIfAborted();
|
|
6052
6052
|
await writer.write(contents);
|
|
@@ -6071,7 +6071,7 @@ var FsBlockstore = class {
|
|
|
6071
6071
|
deleteManyConcurrency;
|
|
6072
6072
|
shardingStrategy;
|
|
6073
6073
|
constructor(location, init = {}) {
|
|
6074
|
-
this.path =
|
|
6074
|
+
this.path = Path.resolve(location);
|
|
6075
6075
|
this.createIfMissing = init.createIfMissing ?? true;
|
|
6076
6076
|
this.errorIfExists = init.errorIfExists ?? false;
|
|
6077
6077
|
this.deleteManyConcurrency = init.deleteManyConcurrency ?? 50;
|
|
@@ -6097,7 +6097,7 @@ var FsBlockstore = class {
|
|
|
6097
6097
|
async put(key, val, options) {
|
|
6098
6098
|
const { dir, file } = this.shardingStrategy.encode(key);
|
|
6099
6099
|
try {
|
|
6100
|
-
await writeFile$1(
|
|
6100
|
+
await writeFile$1(Path.join(this.path, dir, file), val, options);
|
|
6101
6101
|
return key;
|
|
6102
6102
|
} catch (err) {
|
|
6103
6103
|
throw new PutFailedError(String(err));
|
|
@@ -6116,7 +6116,7 @@ var FsBlockstore = class {
|
|
|
6116
6116
|
let handle;
|
|
6117
6117
|
try {
|
|
6118
6118
|
options?.signal?.throwIfAborted();
|
|
6119
|
-
handle = await raceSignal(fsp.open(
|
|
6119
|
+
handle = await raceSignal(fsp.open(Path.join(this.path, dir, file)), options?.signal);
|
|
6120
6120
|
yield* handle.createReadStream();
|
|
6121
6121
|
} catch (err) {
|
|
6122
6122
|
if (handle != null) await raceSignal(handle.close(), options?.signal);
|
|
@@ -6137,7 +6137,7 @@ var FsBlockstore = class {
|
|
|
6137
6137
|
const { dir, file } = this.shardingStrategy.encode(key);
|
|
6138
6138
|
try {
|
|
6139
6139
|
options?.signal?.throwIfAborted();
|
|
6140
|
-
await raceSignal(fsp.unlink(
|
|
6140
|
+
await raceSignal(fsp.unlink(Path.join(this.path, dir, file)), options?.signal);
|
|
6141
6141
|
} catch (err) {
|
|
6142
6142
|
if (err.code === "ENOENT") return;
|
|
6143
6143
|
throw new DeleteFailedError(String(err));
|
|
@@ -6155,14 +6155,14 @@ var FsBlockstore = class {
|
|
|
6155
6155
|
const { dir, file } = this.shardingStrategy.encode(key);
|
|
6156
6156
|
try {
|
|
6157
6157
|
options?.signal?.throwIfAborted();
|
|
6158
|
-
await raceSignal(fsp.access(
|
|
6158
|
+
await raceSignal(fsp.access(Path.join(this.path, dir, file)), options?.signal);
|
|
6159
6159
|
} catch (err) {
|
|
6160
6160
|
return false;
|
|
6161
6161
|
}
|
|
6162
6162
|
return true;
|
|
6163
6163
|
}
|
|
6164
6164
|
async *getAll(options) {
|
|
6165
|
-
const pattern = `**/*${this.shardingStrategy.extension}`.split(
|
|
6165
|
+
const pattern = `**/*${this.shardingStrategy.extension}`.split(Path.sep).join("/");
|
|
6166
6166
|
const files = glob(this.path, pattern, { absolute: true });
|
|
6167
6167
|
for await (const file of files) try {
|
|
6168
6168
|
options?.signal?.throwIfAborted();
|
|
@@ -6214,7 +6214,7 @@ async function createBlockstoreForLibp2pJsClient({ dataPath, key }) {
|
|
|
6214
6214
|
defaultMaxBytes: DEFAULT_IN_MEMORY_BLOCKSTORE_MAX_BYTES,
|
|
6215
6215
|
close: async () => {}
|
|
6216
6216
|
};
|
|
6217
|
-
const store = new FsBlockstore(path
|
|
6217
|
+
const store = new FsBlockstore(path.join(dataPath, "blockstore", key));
|
|
6218
6218
|
await store.open();
|
|
6219
6219
|
return {
|
|
6220
6220
|
blockstore: store,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
|
|
2
|
-
import { A as doesDomainAddressHaveCapitalLetter, B as ipnsNameToIpnsOverPubsubTopic, Bn as CommentEditPubsubMessagePublicationSchema, Bt as require_sha256, C as calculateStringSizeSameAsIpfsAddCidV0, Cn as CommentIpfsSchema, Cr as messages, Ct as writeKuboFilesWithTimeout, Dt as findUpdatingCommunity, E as contentContainsMarkdownVideos, F as getErrorCodeFromMessage, Hn as CommentEditReservedFields, I as getIpnsRecordInLocalKuboNode, It as trackUpdatingCommunity, J as isLinkOfImage, Jn as AuthorReservedFields, K as isLinkOfAnimatedImage, Lr as ZodError, Lt as untrackStartedCommunity, N as genToArray, Nn as CommentUpdateTableRowSchema, Nt as syncCommunityRegistryEntry, P as getEquivalentCommunityAddresses, Pn as CommentsTableRowSchema, Pt as trackStartedCommunity, Qt as CommentModerationsTableRowSchema, R as hideClassPrivateProps, S as calculateIpfsCidV0, Sr as PKCError, T as contentContainsMarkdownImages, Tt as findStartedCommunity, Vn as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, Wn as CommentEditsTableRowSchema, Wt as CommunityEditPublicationPubsubReservedFields, X as isLinkOfVideo, Xt as CommentModerationReservedFields, Y as isLinkOfMedia, Yt as CommentModerationPubsubMessagePublicationSchema, Z as isLinkValid, _n as VotePubsubMessagePublicationSchema, a as ChallengeRequestMessageSchema, ar as t$6, b as areEquivalentCommunityAddresses, bn as VoteTablesRowSchema, cn as CommunitySignedPropertyNames, d as DecryptedChallengeRequestSchema, et as isStringDomain, gr as require_retry, ht as retryKuboIpfsAddAndProvide, ir as t$7, jn as CommentUpdateSchema, k as derivePublicationFromChallengeRequest, lr as r$1, lt as removeNullUndefinedValues, mr as t$3, nr as t$8, or as e, ot as removeBlocksFromKuboNode, pr as t$5, pt as retryKuboBlockPutPinAndProvidePubsubTopic, q as isLinkOfAudio, r as ChallengeMessageSchema, rr as n$3, s as ChallengeVerificationMessageSchema, sn as CommunityIpfsSchema, sr as e$1, st as removeMfsFilesSafely, t as ChallengeAnswerMessageSchema, tr as n$4, tt as pubsubTopicToDhtKey, u as DecryptedChallengeRequestPublicationSchema, ur as t$4, vn as VotePubsubReservedFields, vt as sleepUntilTimeoutOrAbort, w as contentContainsMarkdownAudio, wn as CommentPubsubMessageReservedFields, wr as logger_default, wt as findCommunityInRegistry, xt as timestamp, y as version_default, yt as statMfsPathSafely, zt as untrackUpdatingCommunity } from "./schema-
|
|
3
|
-
import { $t as getPublicKeyFromPrivateKey, A as deriveDbPosts, At as verifyCommentIpfs, Bt as getAuthorNameFromWire, C as BackupAbortError, Cn as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, Dt as verifyChallengeRequest, E as calculateInlineRepliesBudget, En as parseJsonWithPKCErrorIfFails, F as importSignerIntoKuboNode, Ft as verifyCommunityEdit, G as REPLY_REPLIES_SORT_TYPES, Gt as getCommunityPublicKeyFromWire, It as verifyVote, Jt as encode, K as TIMEFRAMES_TO_SECONDS, Lt as buildRuntimeAuthor, M as getDefaultCommunityDbConfig, Mt as verifyCommentPubsubMessage, Nt as verifyCommentUpdate, O as deleteOldCommunityInWindows, P as getThumbnailPropsOfLink, Pt as verifyCommunity, Qt as getPKCAddressFromPublicKeySync, R as moveCommunityDbToDeletedDirectory, Rt as cleanWireAuthor, S as encryptEd25519AesGcmPublicKeyBuffer, St as signCommunity, T as calculateExpectedSignatureSize, Tt as verifyChallengeAnswer, U as POSTS_SORT_TYPES, W as POST_REPLIES_SORT_TYPES, Wt as getCommunityNameFromWire, Xt as getIpfsKeyFromPrivateKey, Z as iterateOverPageCidsToFindAllCids, Zt as getPKCAddressFromPublicKey, _t as signComment, a as loadChallengeFileFromCommunityChallengeSettings, ar as t$11, b as decryptEd25519AesGcmPublicKeyBuffer, bt as signCommentUpdate, c as LRUCache, d as KeyvBetterSqlite3, dn as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, dr as STORAGE_KEYS, en as createSchemaRowParser, er as crosspostChainDepthUpTo, fr as require_lodash_merge, ft as cleanUpBeforePublishing, g as SignerWithPublicKeyAddress, gt as signChallengeVerification, i as getCommunityChallengeFromCommunityChallengeSettings, ir as r$2, j as deriveDbReplies, jt as verifyCommentModeration, k as deriveCommentIpfsFromCommentTableRow, kt as verifyCommentEdit, lr as t$10, lt as pLimit, mt as signChallengeMessage, nr as t$9, o as pkcJsChallenges, or as n$6, pn as parseCommunityIpfsSchemaPassthroughWithPKCErrorIfItFails, qt as decode, r as getChallengeVerification, rr as t$12, s as TrackedInstanceRegistry, sr as n$5, t as RpcLocalCommunity, tr as effectiveMaxCrosspostDepth, u as MAX_FILE_SIZE_BYTES_FOR_COMMUNITY_IPFS, ur as stringify, vt as signCommentEdit, w as backupCommunityDb, xt as signCommentUpdateForChallengeVerification, z as resolveDbPostsCidRefs } from "./rpc-local-community-
|
|
2
|
+
import { A as doesDomainAddressHaveCapitalLetter, B as ipnsNameToIpnsOverPubsubTopic, Bn as CommentEditPubsubMessagePublicationSchema, Bt as require_sha256, C as calculateStringSizeSameAsIpfsAddCidV0, Cn as CommentIpfsSchema, Cr as messages, Ct as writeKuboFilesWithTimeout, Dt as findUpdatingCommunity, E as contentContainsMarkdownVideos, F as getErrorCodeFromMessage, Hn as CommentEditReservedFields, I as getIpnsRecordInLocalKuboNode, It as trackUpdatingCommunity, J as isLinkOfImage, Jn as AuthorReservedFields, K as isLinkOfAnimatedImage, Lr as ZodError, Lt as untrackStartedCommunity, N as genToArray, Nn as CommentUpdateTableRowSchema, Nt as syncCommunityRegistryEntry, P as getEquivalentCommunityAddresses, Pn as CommentsTableRowSchema, Pt as trackStartedCommunity, Qt as CommentModerationsTableRowSchema, R as hideClassPrivateProps, S as calculateIpfsCidV0, Sr as PKCError, T as contentContainsMarkdownImages, Tt as findStartedCommunity, Vn as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, Wn as CommentEditsTableRowSchema, Wt as CommunityEditPublicationPubsubReservedFields, X as isLinkOfVideo, Xt as CommentModerationReservedFields, Y as isLinkOfMedia, Yt as CommentModerationPubsubMessagePublicationSchema, Z as isLinkValid, _n as VotePubsubMessagePublicationSchema, a as ChallengeRequestMessageSchema, ar as t$6, b as areEquivalentCommunityAddresses, bn as VoteTablesRowSchema, cn as CommunitySignedPropertyNames, d as DecryptedChallengeRequestSchema, et as isStringDomain, gr as require_retry, ht as retryKuboIpfsAddAndProvide, ir as t$7, jn as CommentUpdateSchema, k as derivePublicationFromChallengeRequest, lr as r$1, lt as removeNullUndefinedValues, mr as t$3, nr as t$8, or as e, ot as removeBlocksFromKuboNode, pr as t$5, pt as retryKuboBlockPutPinAndProvidePubsubTopic, q as isLinkOfAudio, r as ChallengeMessageSchema, rr as n$3, s as ChallengeVerificationMessageSchema, sn as CommunityIpfsSchema, sr as e$1, st as removeMfsFilesSafely, t as ChallengeAnswerMessageSchema, tr as n$4, tt as pubsubTopicToDhtKey, u as DecryptedChallengeRequestPublicationSchema, ur as t$4, vn as VotePubsubReservedFields, vt as sleepUntilTimeoutOrAbort, w as contentContainsMarkdownAudio, wn as CommentPubsubMessageReservedFields, wr as logger_default, wt as findCommunityInRegistry, xt as timestamp, y as version_default, yt as statMfsPathSafely, zt as untrackUpdatingCommunity } from "./schema-DzFAY-My.js";
|
|
3
|
+
import { $t as getPublicKeyFromPrivateKey, A as deriveDbPosts, At as verifyCommentIpfs, Bt as getAuthorNameFromWire, C as BackupAbortError, Cn as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, Dt as verifyChallengeRequest, E as calculateInlineRepliesBudget, En as parseJsonWithPKCErrorIfFails, F as importSignerIntoKuboNode, Ft as verifyCommunityEdit, G as REPLY_REPLIES_SORT_TYPES, Gt as getCommunityPublicKeyFromWire, It as verifyVote, Jt as encode, K as TIMEFRAMES_TO_SECONDS, Lt as buildRuntimeAuthor, M as getDefaultCommunityDbConfig, Mt as verifyCommentPubsubMessage, Nt as verifyCommentUpdate, O as deleteOldCommunityInWindows, P as getThumbnailPropsOfLink, Pt as verifyCommunity, Qt as getPKCAddressFromPublicKeySync, R as moveCommunityDbToDeletedDirectory, Rt as cleanWireAuthor, S as encryptEd25519AesGcmPublicKeyBuffer, St as signCommunity, T as calculateExpectedSignatureSize, Tt as verifyChallengeAnswer, U as POSTS_SORT_TYPES, W as POST_REPLIES_SORT_TYPES, Wt as getCommunityNameFromWire, Xt as getIpfsKeyFromPrivateKey, Z as iterateOverPageCidsToFindAllCids, Zt as getPKCAddressFromPublicKey, _t as signComment, a as loadChallengeFileFromCommunityChallengeSettings, ar as t$11, b as decryptEd25519AesGcmPublicKeyBuffer, bt as signCommentUpdate, c as LRUCache, d as KeyvBetterSqlite3, dn as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, dr as STORAGE_KEYS, en as createSchemaRowParser, er as crosspostChainDepthUpTo, fr as require_lodash_merge, ft as cleanUpBeforePublishing, g as SignerWithPublicKeyAddress, gt as signChallengeVerification, i as getCommunityChallengeFromCommunityChallengeSettings, ir as r$2, j as deriveDbReplies, jt as verifyCommentModeration, k as deriveCommentIpfsFromCommentTableRow, kt as verifyCommentEdit, lr as t$10, lt as pLimit, mt as signChallengeMessage, nr as t$9, o as pkcJsChallenges, or as n$6, pn as parseCommunityIpfsSchemaPassthroughWithPKCErrorIfItFails, qt as decode, r as getChallengeVerification, rr as t$12, s as TrackedInstanceRegistry, sr as n$5, t as RpcLocalCommunity, tr as effectiveMaxCrosspostDepth, u as MAX_FILE_SIZE_BYTES_FOR_COMMUNITY_IPFS, ur as stringify, vt as signCommentEdit, w as backupCommunityDb, xt as signCommentUpdateForChallengeVerification, z as resolveDbPostsCidRefs } from "./rpc-local-community-CH7vnXLI.js";
|
|
4
4
|
import { randomFillSync, randomUUID } from "node:crypto";
|
|
5
5
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
6
|
-
import
|
|
6
|
+
import Path from "node:path";
|
|
7
7
|
import os from "os";
|
|
8
8
|
import { existsSync, promises } from "node:fs";
|
|
9
|
-
import path
|
|
9
|
+
import path from "path";
|
|
10
10
|
import assert from "assert";
|
|
11
11
|
import fs from "fs";
|
|
12
12
|
import Database from "better-sqlite3";
|
|
@@ -445,7 +445,7 @@ async function repinCommentsIPFSIfNeeded(community) {
|
|
|
445
445
|
log(`${unpinnedCommentsFromDb.length} comments' IPFS have been repinned`);
|
|
446
446
|
}
|
|
447
447
|
const cidsToUnpinFirstSeenAtMsByCommunity = /* @__PURE__ */ new WeakMap();
|
|
448
|
-
const communitiesWithPendingPurgeFlush = /* @__PURE__ */ new
|
|
448
|
+
const communitiesWithPendingPurgeFlush = /* @__PURE__ */ new WeakMap();
|
|
449
449
|
async function unpinStaleCids(community, options = {}) {
|
|
450
450
|
const log = logger_default("pkc-js:local-community:sync:unpinStaleCids");
|
|
451
451
|
if (community._cidsToUnPin.size > 0) {
|
|
@@ -455,7 +455,8 @@ async function unpinStaleCids(community, options = {}) {
|
|
|
455
455
|
for (const cid of firstSeenAtMs.keys()) if (!community._cidsToUnPin.has(cid)) firstSeenAtMs.delete(cid);
|
|
456
456
|
const now = Date.now();
|
|
457
457
|
for (const cid of community._cidsToUnPin) if (!firstSeenAtMs.has(cid)) firstSeenAtMs.set(cid, now);
|
|
458
|
-
const
|
|
458
|
+
const purgeFlushArmedAtMs = communitiesWithPendingPurgeFlush.get(community);
|
|
459
|
+
const flushGraceForPendingPurge = purgeFlushArmedAtMs !== void 0 || community._blocksToRm.length > 0;
|
|
459
460
|
const cidsToUnpinNow = Array.from(community._cidsToUnPin.values()).filter((cid) => options.bypassGracePeriod || flushGraceForPendingPurge || now - (firstSeenAtMs.get(cid) ?? now) >= 18e5);
|
|
460
461
|
if (cidsToUnpinNow.length === 0) {
|
|
461
462
|
log.trace(`All ${sizeBefore} stale cids of community (${community.address}) are within their unpin grace period, keeping them pinned for now`);
|
|
@@ -476,7 +477,9 @@ async function unpinStaleCids(community, options = {}) {
|
|
|
476
477
|
} else log.trace("Failed to unpin cid", cid, "on community", community.address, "due to error", error);
|
|
477
478
|
}
|
|
478
479
|
})));
|
|
479
|
-
if (flushGraceForPendingPurge && community._cidsToUnPin.size === 0)
|
|
480
|
+
if (flushGraceForPendingPurge && community._cidsToUnPin.size === 0) {
|
|
481
|
+
if (purgeFlushArmedAtMs === void 0 || options.cycleStartedAtMs !== void 0 && options.cycleStartedAtMs > purgeFlushArmedAtMs) communitiesWithPendingPurgeFlush.delete(community);
|
|
482
|
+
}
|
|
480
483
|
log.trace(`unpinned ${sizeBefore - community._cidsToUnPin.size} stale cids from ipfs node for community (${community.address})`);
|
|
481
484
|
}
|
|
482
485
|
}
|
|
@@ -599,7 +602,7 @@ async function _runRepoGcIfDue({ community, kuboUrl, force, log }) {
|
|
|
599
602
|
}));
|
|
600
603
|
}
|
|
601
604
|
async function addAllCidsUnderPurgedCommentToBeRemoved(community, purgedCommentAndCommentUpdate) {
|
|
602
|
-
communitiesWithPendingPurgeFlush.
|
|
605
|
+
communitiesWithPendingPurgeFlush.set(community, Date.now());
|
|
603
606
|
community._cidsToUnPin.add(purgedCommentAndCommentUpdate.commentTableRow.cid);
|
|
604
607
|
community._blocksToRm.push(purgedCommentAndCommentUpdate.commentTableRow.cid);
|
|
605
608
|
if (typeof purgedCommentAndCommentUpdate.commentUpdateTableRow?.postUpdatesBucket === "number") {
|
|
@@ -1868,15 +1871,15 @@ async function throwIfChallengeSettingsAreInvalid({ challengeSettings, pkc, comm
|
|
|
1868
1871
|
const processStartedCommunities = new TrackedInstanceRegistry();
|
|
1869
1872
|
function normalizeRegistryDataPath(dataPath) {
|
|
1870
1873
|
if (dataPath === void 0) return void 0;
|
|
1871
|
-
const resolved = path
|
|
1874
|
+
const resolved = path.resolve(dataPath);
|
|
1872
1875
|
let existing = resolved;
|
|
1873
1876
|
let tail = "";
|
|
1874
1877
|
while (true) try {
|
|
1875
|
-
return path
|
|
1878
|
+
return path.join(fs.realpathSync.native(existing), tail);
|
|
1876
1879
|
} catch {
|
|
1877
|
-
const parent = path
|
|
1880
|
+
const parent = path.dirname(existing);
|
|
1878
1881
|
if (parent === existing) return resolved;
|
|
1879
|
-
tail = path
|
|
1882
|
+
tail = path.join(path.basename(existing), tail);
|
|
1880
1883
|
existing = parent;
|
|
1881
1884
|
}
|
|
1882
1885
|
}
|
|
@@ -3632,9 +3635,9 @@ var DbHandler = class {
|
|
|
3632
3635
|
if (needToMigrate) {
|
|
3633
3636
|
if (dbExistsAlready && currentDbVersion > 0) {
|
|
3634
3637
|
this.destoryConnection();
|
|
3635
|
-
backupDbPath = path
|
|
3636
|
-
log(`Copying db ${path
|
|
3637
|
-
if (!fs.existsSync(path
|
|
3638
|
+
backupDbPath = path.join(path.dirname(dbPath), ".backup_before_migration", `${path.basename(dbPath)}.${currentDbVersion}.${timestamp()}`);
|
|
3639
|
+
log(`Copying db ${path.basename(dbPath)} to ${backupDbPath} before migration`);
|
|
3640
|
+
if (!fs.existsSync(path.dirname(backupDbPath))) await fs.promises.mkdir(path.dirname(backupDbPath), { recursive: true });
|
|
3638
3641
|
const sourceDb = new Database(dbPath, { fileMustExist: true });
|
|
3639
3642
|
await sourceDb.backup(backupDbPath);
|
|
3640
3643
|
sourceDb.close();
|
|
@@ -5452,10 +5455,10 @@ var DbHandler = class {
|
|
|
5452
5455
|
if (this._db || this._keyv) await this.destoryConnection();
|
|
5453
5456
|
this._transactionDepth = 0;
|
|
5454
5457
|
const dataPath = this._community._pkc.dataPath;
|
|
5455
|
-
const oldPathString = path
|
|
5456
|
-
const newPathString = path
|
|
5457
|
-
await fs.promises.mkdir(path
|
|
5458
|
-
await fs.promises.mkdir(path
|
|
5458
|
+
const oldPathString = path.join(dataPath, "communities", oldDbName);
|
|
5459
|
+
const newPathString = path.join(dataPath, "communities", newDbName);
|
|
5460
|
+
await fs.promises.mkdir(path.dirname(oldPathString), { recursive: true });
|
|
5461
|
+
await fs.promises.mkdir(path.dirname(newPathString), { recursive: true });
|
|
5459
5462
|
try {
|
|
5460
5463
|
if (!fs.existsSync(oldPathString)) log(`Old DB file ${oldPathString} does not exist. Cannot backup/rename.`);
|
|
5461
5464
|
else {
|
|
@@ -5477,8 +5480,8 @@ var DbHandler = class {
|
|
|
5477
5480
|
}
|
|
5478
5481
|
async lockCommunityStart(communityAddress = this._community.address) {
|
|
5479
5482
|
const log = logger_default("pkc-js:local-community:db-handler:lock:start");
|
|
5480
|
-
const lockfilePath = path
|
|
5481
|
-
const communityDbPath = path
|
|
5483
|
+
const lockfilePath = path.join(this._community._pkc.dataPath, "communities", `${communityAddress}.start.lock`);
|
|
5484
|
+
const communityDbPath = path.join(this._community._pkc.dataPath, "communities", communityAddress);
|
|
5482
5485
|
try {
|
|
5483
5486
|
await import_src.default.lock(communityDbPath, {
|
|
5484
5487
|
lockfilePath,
|
|
@@ -5499,8 +5502,8 @@ var DbHandler = class {
|
|
|
5499
5502
|
async unlockCommunityStart(communityAddress = this._community.address) {
|
|
5500
5503
|
const log = logger_default("pkc-js:local-community:db-handler:unlock:start");
|
|
5501
5504
|
log.trace(`Attempting to unlock the start of community (${communityAddress})`);
|
|
5502
|
-
const lockfilePath = path
|
|
5503
|
-
const communityDbPath = path
|
|
5505
|
+
const lockfilePath = path.join(this._community._pkc.dataPath, "communities", `${communityAddress}.start.lock`);
|
|
5506
|
+
const communityDbPath = path.join(this._community._pkc.dataPath, "communities", communityAddress);
|
|
5504
5507
|
if (!fs.existsSync(lockfilePath) || !fs.existsSync(communityDbPath)) return;
|
|
5505
5508
|
try {
|
|
5506
5509
|
await import_src.default.unlock(communityDbPath, { lockfilePath });
|
|
@@ -5511,8 +5514,8 @@ var DbHandler = class {
|
|
|
5511
5514
|
}
|
|
5512
5515
|
}
|
|
5513
5516
|
async isCommunityStartLocked(communityAddress = this._community.address) {
|
|
5514
|
-
const lockfilePath = path
|
|
5515
|
-
const communityDbPath = path
|
|
5517
|
+
const lockfilePath = path.join(this._community._pkc.dataPath, "communities", `${communityAddress}.start.lock`);
|
|
5518
|
+
const communityDbPath = path.join(this._community._pkc.dataPath, "communities", communityAddress);
|
|
5516
5519
|
return await import_src.default.check(communityDbPath, {
|
|
5517
5520
|
lockfilePath,
|
|
5518
5521
|
realpath: false,
|
|
@@ -5521,8 +5524,8 @@ var DbHandler = class {
|
|
|
5521
5524
|
}
|
|
5522
5525
|
async lockCommunityState() {
|
|
5523
5526
|
const log = logger_default("pkc-js:local-community:db-handler:lock:lockCommunityState");
|
|
5524
|
-
const lockfilePath = path
|
|
5525
|
-
const communityDbPath = path
|
|
5527
|
+
const lockfilePath = path.join(this._community._pkc.dataPath, "communities", `${this._community.address}.state.lock`);
|
|
5528
|
+
const communityDbPath = path.join(this._community._pkc.dataPath, "communities", this._community.address);
|
|
5526
5529
|
try {
|
|
5527
5530
|
await import_src.default.lock(communityDbPath, {
|
|
5528
5531
|
lockfilePath,
|
|
@@ -5539,8 +5542,8 @@ var DbHandler = class {
|
|
|
5539
5542
|
}
|
|
5540
5543
|
async unlockCommunityState() {
|
|
5541
5544
|
const log = logger_default("pkc-js:local-community:db-handler:lock:unlockCommunityState");
|
|
5542
|
-
const lockfilePath = path
|
|
5543
|
-
const communityDbPath = path
|
|
5545
|
+
const lockfilePath = path.join(this._community._pkc.dataPath, "communities", `${this._community.address}.state.lock`);
|
|
5546
|
+
const communityDbPath = path.join(this._community._pkc.dataPath, "communities", this._community.address);
|
|
5544
5547
|
if (!fs.existsSync(lockfilePath)) return;
|
|
5545
5548
|
try {
|
|
5546
5549
|
await import_src.default.unlock(communityDbPath, { lockfilePath });
|
|
@@ -5550,7 +5553,7 @@ var DbHandler = class {
|
|
|
5550
5553
|
}
|
|
5551
5554
|
}
|
|
5552
5555
|
communityDbExists() {
|
|
5553
|
-
const communityDbPath = path
|
|
5556
|
+
const communityDbPath = path.join(this._community._pkc.dataPath, "communities", this._community.address);
|
|
5554
5557
|
return fs.existsSync(communityDbPath);
|
|
5555
5558
|
}
|
|
5556
5559
|
markCommentsAsPublishedToPostUpdates(commentCids) {
|
|
@@ -6545,7 +6548,7 @@ async function validateAndSignCommunityRecord(community, build) {
|
|
|
6545
6548
|
await community._validateCommunitySizeSchemaAndSignatureBeforePublishing(newCommunityRecord);
|
|
6546
6549
|
return newCommunityRecord;
|
|
6547
6550
|
}
|
|
6548
|
-
async function publishCommunityRecordToIpns(community, build, newCommunityRecord) {
|
|
6551
|
+
async function publishCommunityRecordToIpns(community, build, newCommunityRecord, cycleStartedAtMs) {
|
|
6549
6552
|
const { log, newIpns, newModQueue, editIdsToIncludeInNextUpdate } = build;
|
|
6550
6553
|
const kuboRpcClient = community._clientsManager.getDefaultKuboRpcClient();
|
|
6551
6554
|
const contentToPublish = stringify(newCommunityRecord);
|
|
@@ -6578,7 +6581,8 @@ async function publishCommunityRecordToIpns(community, build, newCommunityRecord
|
|
|
6578
6581
|
log(`Published a new IPNS record for community(${community.address}) on IPNS (${publishRes.name}) that points to file (${publishRes.value}) with updatedAt (${newCommunityRecord.updatedAt}) and TTL (${ttl})`);
|
|
6579
6582
|
community._clientsManager.updateKuboRpcState("stopped", kuboRpcClient.url);
|
|
6580
6583
|
addOldPageCidsToCidsToUnpin(community, community.raw.communityIpfs?.modQueue, newIpns.modQueue).catch((err) => log.error("Failed to add old page cids of community.modQueue to _cidsToUnpin", err));
|
|
6581
|
-
|
|
6584
|
+
if (community.updateCid && community.updateCid !== file.path) community._cidsToUnPin.add(community.updateCid);
|
|
6585
|
+
await unpinStaleCids(community, { cycleStartedAtMs });
|
|
6582
6586
|
if (community._blocksToRm.length > 0) {
|
|
6583
6587
|
const removedBlocks = await removeBlocksFromKuboNode({
|
|
6584
6588
|
ipfsClient: community._clientsManager.getDefaultKuboRpcClient()._client,
|
|
@@ -6589,7 +6593,6 @@ async function publishCommunityRecordToIpns(community, build, newCommunityRecord
|
|
|
6589
6593
|
log("Removed blocks", removedBlocks, "from kubo node");
|
|
6590
6594
|
community._blocksToRm = community._blocksToRm.filter((blockCid) => !removedBlocks.includes(blockCid));
|
|
6591
6595
|
}
|
|
6592
|
-
if (community.updateCid) community._cidsToUnPin.add(community.updateCid);
|
|
6593
6596
|
const configuredPubsubTopic = community.pubsubTopic;
|
|
6594
6597
|
const editedPubsubTopic = community._pendingEditProps.filter((editProps) => editProps.editId && editIdsToIncludeInNextUpdate.includes(editProps.editId)).map((editProps) => editProps.pubsubTopic).filter((topic) => typeof topic === "string").pop();
|
|
6595
6598
|
community.initCommunityIpfsPropsNoMerge(newCommunityRecord);
|
|
@@ -6626,8 +6629,9 @@ async function updateCommunityIpnsIfNeeded(community, commentUpdateRowsToPublish
|
|
|
6626
6629
|
const log = logger_default("pkc-js:local-community:start:updateCommunityIpnsIfNeeded");
|
|
6627
6630
|
community._calculateLatestUpdateTrigger();
|
|
6628
6631
|
if (!community._communityUpdateTrigger) return;
|
|
6632
|
+
const cycleStartedAtMs = Date.now();
|
|
6629
6633
|
const build = await calculateNextCommunityRecord(community, commentUpdateRowsToPublishToIpfs, log);
|
|
6630
|
-
await publishCommunityRecordToIpns(community, build, await validateAndSignCommunityRecord(community, build));
|
|
6634
|
+
await publishCommunityRecordToIpns(community, build, await validateAndSignCommunityRecord(community, build), cycleStartedAtMs);
|
|
6631
6635
|
}
|
|
6632
6636
|
async function syncIpnsWithDb(community) {
|
|
6633
6637
|
const log = logger_default("pkc-js:local-community:sync");
|
|
@@ -7288,11 +7292,11 @@ async function edit(community, newCommunityOptions) {
|
|
|
7288
7292
|
const EXPORTS_KEY = STORAGE_KEYS[STORAGE_KEYS.EXPORTS];
|
|
7289
7293
|
function defaultExportPathFor(community, exportId) {
|
|
7290
7294
|
if (typeof community._pkc.dataPath !== "string") throw new PKCError("ERR_DATA_PATH_IS_NOT_DEFINED", { communityAddress: community.address });
|
|
7291
|
-
return
|
|
7295
|
+
return Path.join(community._pkc.dataPath, "exports", `${exportId}.sqlite`);
|
|
7292
7296
|
}
|
|
7293
7297
|
function sourceDbPathFor(community) {
|
|
7294
7298
|
if (typeof community._pkc.dataPath !== "string") throw new PKCError("ERR_DATA_PATH_IS_NOT_DEFINED", { communityAddress: community.address });
|
|
7295
|
-
return
|
|
7299
|
+
return Path.join(community._pkc.dataPath, "communities", community.address);
|
|
7296
7300
|
}
|
|
7297
7301
|
async function persistExports(community) {
|
|
7298
7302
|
if (!community._dbHandler) return;
|
|
@@ -7368,9 +7372,9 @@ async function runExportTask(community, exportId, opts) {
|
|
|
7368
7372
|
async function exportCommunityEmbedded(community, options = {}) {
|
|
7369
7373
|
if (options.signal?.aborted) throw options.signal.reason ?? new DOMException("The operation was aborted.", "AbortError");
|
|
7370
7374
|
const exportId = v4();
|
|
7371
|
-
const destPath = options.exportPath ?
|
|
7375
|
+
const destPath = options.exportPath ? Path.resolve(options.exportPath) : defaultExportPathFor(community, exportId);
|
|
7372
7376
|
const includePrivateKey = options.includePrivateKey === true;
|
|
7373
|
-
if (
|
|
7377
|
+
if (Path.resolve(destPath) === Path.resolve(sourceDbPathFor(community))) throw new PKCError("ERR_EXPORT_PATH_TARGETS_LIVE_DB", {
|
|
7374
7378
|
communityAddress: community.address,
|
|
7375
7379
|
exportPath: destPath
|
|
7376
7380
|
});
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as createNewLocalCommunityDb, r as updateInstancePropsWithStartedCommunityOrDb, t as LocalCommunity } from "./local-community-
|
|
1
|
+
import { n as createNewLocalCommunityDb, r as updateInstancePropsWithStartedCommunityOrDb, t as LocalCommunity } from "./local-community-CE8orbFt.js";
|
|
2
2
|
export { LocalCommunity, createNewLocalCommunityDb, updateInstancePropsWithStartedCommunityOrDb };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
|
|
2
|
-
import { A as doesDomainAddressHaveCapitalLetter, At as listUpdatingCommunities, B as ipnsNameToIpnsOverPubsubTopic, Br as stringifyPrimitive, Bt as require_sha256, Cn as CommentIpfsSchema, Cr as messages, D as createAbortError, Dr as setErrorMap, Dt as findUpdatingCommunity, Et as findUpdatingComment, Ft as trackUpdatingComment, H as isIpfsCid, Ht as pTimeout, O as deepMergeRuntimeFields, On as CommentUpdateForChallengeVerificationSchema, Ot as listStartedCommunities, R as hideClassPrivateProps, Rr as joinValues, Rt as untrackUpdatingComment, Sr as PKCError, St as waitForUpdateInCommunityInstanceWithErrorAndTimeout, Tt as findStartedCommunity, V as isAbortError, Vt as TimeoutError, W as isIpns, _r as FailedToFetchCommentIpfsFromGatewaysError, _t as shortifyCid, a as ChallengeRequestMessageSchema, ar as t$1, at as rejectWhenCommunityStopsOrAborts, b as areEquivalentCommunityAddresses, bt as throwIfAbortSignalAborted, dt as replaceXWithY, et as isStringDomain, ft as resolveWhenPredicateIsTrue, gr as require_retry, gt as shortifyAddress, it as rejectWhenAbortSignalFires, jn as CommentUpdateSchema, jt as refreshTrackedCommentAliases, kt as listUpdatingComments, lr as r, mt as retryKuboIpfsAdd, nn as CommunityAnchorSchema, or as e, pn as PubsubTopicSchema, r as ChallengeMessageSchema, rr as n$1, s as ChallengeVerificationMessageSchema, sn as CommunityIpfsSchema, sr as e$1, t as ChallengeAnswerMessageSchema, tr as n$2, ut as removeUndefinedValuesRecursively, vt as sleepUntilTimeoutOrAbort, wr as logger_default, xt as timestamp, y as version_default, zr as parsedType } from "./schema-
|
|
3
|
-
import { $ as RepliesPages, $n as RpcUnsubscribeParamSchema, An as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, At as verifyCommentIpfs, B as setNativeFunctions$1, Bn as RpcEditCommunityParamSchema, Cn as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, Ct as signCommunityEdit, D as createKuboRpcClient, Dn as parsePKCUserOptionsSchemaWithPKCErrorIfItFails, En as parseJsonWithPKCErrorIfFails, Et as verifyChallengeMessage, Fn as RpcCancelExportParamSchema, Ft as verifyCommunityEdit, Gn as RpcFetchCidParamSchema, Gt as getCommunityPublicKeyFromWire, H as CommentClientsManager, Hn as RpcExportCommunityModLogsResultSchema, Ht as buildRuntimeCommunityFields, I as listCommunitiesSync, In as RpcCidParamSchema, It as verifyVote, Jn as RpcPublishChallengeAnswersParamSchema, Kn as RpcFetchCidResultSchema, Kt as normalizeCommunityInputFromCommunity, L as monitorCommunitiesDirectory, Ln as RpcCommentRepliesPageParamSchema, Lt as buildRuntimeAuthor, Mn as parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails, Mt as verifyCommentPubsubMessage, N as getDefaultDataPath, Nn as RpcAnchorPublishPreparationResultSchema, Nt as verifyCommentUpdate, On as parseRpcCommentEventWithPKCErrorIfItFails, Ot as verifyChallengeVerification, Pn as RpcAuthorNameParamSchema, Q as parseRawPages, Qn as RpcSuccessResultSchema, Qt as getPKCAddressFromPublicKeySync, Rn as RpcCommunityIdentifierParamSchema, Rt as cleanWireAuthor, Sn as parseCreateVoteOptionsSchemaWithPKCErrorIfItFails, Tn as parseDecryptedChallengeWithPKCErrorIfItFails, Un as RpcExportCommunityParamSchema, Ut as getCommunityAddressFromRecord, V as tryToDeleteCommunitiesThatFailedToBeDeletedBefore, Vn as RpcExportCommunityModLogsParamSchema, Vt as normalizeCreatePublicationAuthor, Wn as RpcExportCommunityResultSchema, Wt as getCommunityNameFromWire, X as findCommentInPageInstanceRecursively, Xn as RpcResolveAuthorNameResultSchema, Y as extractCommunityRuntimeFieldsFromParsedPages, Yn as RpcPublishedAnchorRecordResultSchema, Yt as getBufferedPKCAddressFromPublicKey, Zn as RpcSubscriptionIdResultSchema, _ as createSigner, _n as parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails, _t as signComment, an as parseCommentIpfsSchemaWithPKCErrorIfItFails, ar as t$3, at as PublicationClientsManager, bn as parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, c as LRUCache, cn as parseCommentPubsubMessagePublicationWithPKCErrorIfItFails, cr as t$2, d as KeyvBetterSqlite3, dt as require_lib$1, et as applyNameResolvedCacheToCrosspost, f as decodeRpcChallengeAnswerPubsubMsg, fn as parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, ft as cleanUpBeforePublishing, gn as parseCreateCommentOptionsSchemaWithPKCErrorIfItFails, h as decodeRpcChallengeVerificationPubsubMsg, hn as parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails, ht as signChallengeRequest, in as parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, it as stripNameResolvedFromCrosspost, jt as verifyCommentModeration, kn as parseRpcCommentUpdateEventWithPKCErrorIfItFails, kt as verifyCommentEdit, l as RemoteCommunity, ln as parseCommunityAddressWithPKCErrorIfItFails, lr as t$5, m as decodeRpcChallengeRequestPubsubMsg, mn as parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails, mr as require_undici, n as RpcRemoteCommunity, nr as t$4, nt as collectCrosspostAuthorsToResolve, o as pkcJsChallenges, or as n$3, ot as PKCClientsManager, p as decodeRpcChallengePubsubMsg, pr as nativeFunctions$2, pt as signChallengeAnswer, qn as RpcPublishAnchorRecordParamSchema, qt as decode, s as TrackedInstanceRegistry, sn as parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails, st as InflightFetchManager, t as RpcLocalCommunity, tn as parseCidStringSchemaWithPKCErrorIfItFails, tt as cloneCrosspostForRuntime, ut as PKCTypedEmitter, v as createAnchorIpnsRecord$1, vt as signCommentEdit, wn as parseDecryptedChallengeVerification, wt as signVote, x as encryptEd25519AesGcm, xn as parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, y as decryptEd25519AesGcm, yt as signCommentModeration, zn as RpcCommunityPageParamSchema, zt as getAuthorNameFromRuntime } from "./rpc-local-community-
|
|
4
|
-
import { o as getHeliaDebugContext } from "./util-
|
|
2
|
+
import { A as doesDomainAddressHaveCapitalLetter, At as listUpdatingCommunities, B as ipnsNameToIpnsOverPubsubTopic, Br as stringifyPrimitive, Bt as require_sha256, Cn as CommentIpfsSchema, Cr as messages, D as createAbortError, Dr as setErrorMap, Dt as findUpdatingCommunity, Et as findUpdatingComment, Ft as trackUpdatingComment, H as isIpfsCid, Ht as pTimeout, O as deepMergeRuntimeFields, On as CommentUpdateForChallengeVerificationSchema, Ot as listStartedCommunities, R as hideClassPrivateProps, Rr as joinValues, Rt as untrackUpdatingComment, Sr as PKCError, St as waitForUpdateInCommunityInstanceWithErrorAndTimeout, Tt as findStartedCommunity, V as isAbortError, Vt as TimeoutError, W as isIpns, _r as FailedToFetchCommentIpfsFromGatewaysError, _t as shortifyCid, a as ChallengeRequestMessageSchema, ar as t$1, at as rejectWhenCommunityStopsOrAborts, b as areEquivalentCommunityAddresses, bt as throwIfAbortSignalAborted, dt as replaceXWithY, et as isStringDomain, ft as resolveWhenPredicateIsTrue, gr as require_retry, gt as shortifyAddress, it as rejectWhenAbortSignalFires, jn as CommentUpdateSchema, jt as refreshTrackedCommentAliases, kt as listUpdatingComments, lr as r, mt as retryKuboIpfsAdd, nn as CommunityAnchorSchema, or as e, pn as PubsubTopicSchema, r as ChallengeMessageSchema, rr as n$1, s as ChallengeVerificationMessageSchema, sn as CommunityIpfsSchema, sr as e$1, t as ChallengeAnswerMessageSchema, tr as n$2, ut as removeUndefinedValuesRecursively, vt as sleepUntilTimeoutOrAbort, wr as logger_default, xt as timestamp, y as version_default, zr as parsedType } from "./schema-DzFAY-My.js";
|
|
3
|
+
import { $ as RepliesPages, $n as RpcUnsubscribeParamSchema, An as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, At as verifyCommentIpfs, B as setNativeFunctions$1, Bn as RpcEditCommunityParamSchema, Cn as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, Ct as signCommunityEdit, D as createKuboRpcClient, Dn as parsePKCUserOptionsSchemaWithPKCErrorIfItFails, En as parseJsonWithPKCErrorIfFails, Et as verifyChallengeMessage, Fn as RpcCancelExportParamSchema, Ft as verifyCommunityEdit, Gn as RpcFetchCidParamSchema, Gt as getCommunityPublicKeyFromWire, H as CommentClientsManager, Hn as RpcExportCommunityModLogsResultSchema, Ht as buildRuntimeCommunityFields, I as listCommunitiesSync, In as RpcCidParamSchema, It as verifyVote, Jn as RpcPublishChallengeAnswersParamSchema, Kn as RpcFetchCidResultSchema, Kt as normalizeCommunityInputFromCommunity, L as monitorCommunitiesDirectory, Ln as RpcCommentRepliesPageParamSchema, Lt as buildRuntimeAuthor, Mn as parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails, Mt as verifyCommentPubsubMessage, N as getDefaultDataPath, Nn as RpcAnchorPublishPreparationResultSchema, Nt as verifyCommentUpdate, On as parseRpcCommentEventWithPKCErrorIfItFails, Ot as verifyChallengeVerification, Pn as RpcAuthorNameParamSchema, Q as parseRawPages, Qn as RpcSuccessResultSchema, Qt as getPKCAddressFromPublicKeySync, Rn as RpcCommunityIdentifierParamSchema, Rt as cleanWireAuthor, Sn as parseCreateVoteOptionsSchemaWithPKCErrorIfItFails, Tn as parseDecryptedChallengeWithPKCErrorIfItFails, Un as RpcExportCommunityParamSchema, Ut as getCommunityAddressFromRecord, V as tryToDeleteCommunitiesThatFailedToBeDeletedBefore, Vn as RpcExportCommunityModLogsParamSchema, Vt as normalizeCreatePublicationAuthor, Wn as RpcExportCommunityResultSchema, Wt as getCommunityNameFromWire, X as findCommentInPageInstanceRecursively, Xn as RpcResolveAuthorNameResultSchema, Y as extractCommunityRuntimeFieldsFromParsedPages, Yn as RpcPublishedAnchorRecordResultSchema, Yt as getBufferedPKCAddressFromPublicKey, Zn as RpcSubscriptionIdResultSchema, _ as createSigner, _n as parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails, _t as signComment, an as parseCommentIpfsSchemaWithPKCErrorIfItFails, ar as t$3, at as PublicationClientsManager, bn as parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, c as LRUCache, cn as parseCommentPubsubMessagePublicationWithPKCErrorIfItFails, cr as t$2, d as KeyvBetterSqlite3, dt as require_lib$1, et as applyNameResolvedCacheToCrosspost, f as decodeRpcChallengeAnswerPubsubMsg, fn as parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, ft as cleanUpBeforePublishing, gn as parseCreateCommentOptionsSchemaWithPKCErrorIfItFails, h as decodeRpcChallengeVerificationPubsubMsg, hn as parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails, ht as signChallengeRequest, in as parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, it as stripNameResolvedFromCrosspost, jt as verifyCommentModeration, kn as parseRpcCommentUpdateEventWithPKCErrorIfItFails, kt as verifyCommentEdit, l as RemoteCommunity, ln as parseCommunityAddressWithPKCErrorIfItFails, lr as t$5, m as decodeRpcChallengeRequestPubsubMsg, mn as parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails, mr as require_undici, n as RpcRemoteCommunity, nr as t$4, nt as collectCrosspostAuthorsToResolve, o as pkcJsChallenges, or as n$3, ot as PKCClientsManager, p as decodeRpcChallengePubsubMsg, pr as nativeFunctions$2, pt as signChallengeAnswer, qn as RpcPublishAnchorRecordParamSchema, qt as decode, s as TrackedInstanceRegistry, sn as parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails, st as InflightFetchManager, t as RpcLocalCommunity, tn as parseCidStringSchemaWithPKCErrorIfItFails, tt as cloneCrosspostForRuntime, ut as PKCTypedEmitter, v as createAnchorIpnsRecord$1, vt as signCommentEdit, wn as parseDecryptedChallengeVerification, wt as signVote, x as encryptEd25519AesGcm, xn as parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, y as decryptEd25519AesGcm, yt as signCommentModeration, zn as RpcCommunityPageParamSchema, zt as getAuthorNameFromRuntime } from "./rpc-local-community-CH7vnXLI.js";
|
|
4
|
+
import { o as getHeliaDebugContext } from "./util-BiM-_F_H.js";
|
|
5
5
|
import path from "path";
|
|
6
6
|
import assert from "assert";
|
|
7
7
|
import fs from "fs";
|
|
@@ -7025,7 +7025,7 @@ var PKC$1 = class extends PKCTypedEmitter {
|
|
|
7025
7025
|
this.clients.libp2pJsClients = {};
|
|
7026
7026
|
if (!this.libp2pJsClientsOptions) return;
|
|
7027
7027
|
if (!this.httpRoutersOptions) throw Error("httpRoutersOptions is required for libp2pJsClient");
|
|
7028
|
-
const { createLibp2pJsClientOrUseExistingOne } = await import("./helia-for-pkc-
|
|
7028
|
+
const { createLibp2pJsClientOrUseExistingOne } = await import("./helia-for-pkc-BvZheFmK.js");
|
|
7029
7029
|
for (const clientOptions of this.libp2pJsClientsOptions) {
|
|
7030
7030
|
const heliaNode = await createLibp2pJsClientOrUseExistingOne({
|
|
7031
7031
|
...clientOptions,
|
|
@@ -7304,7 +7304,7 @@ var PKC$1 = class extends PKCTypedEmitter {
|
|
|
7304
7304
|
const log = logger_default("pkc-js:pkc:createLocalCommunity");
|
|
7305
7305
|
log.trace("Received community options to create a local community instance:", options);
|
|
7306
7306
|
if (!this._canCreateNewLocalCommunity()) throw new PKCError("ERR_CAN_NOT_CREATE_A_LOCAL_COMMUNITY", { pkcOptions: this._userPKCOptions });
|
|
7307
|
-
const { LocalCommunity, createNewLocalCommunityDb, updateInstancePropsWithStartedCommunityOrDb } = await import("./local-community-
|
|
7307
|
+
const { LocalCommunity, createNewLocalCommunityDb, updateInstancePropsWithStartedCommunityOrDb } = await import("./local-community-bPjJm35w.js");
|
|
7308
7308
|
const isLocalCommunity = (await listCommunitiesSync(this)).includes(options.address);
|
|
7309
7309
|
const community = new LocalCommunity(this);
|
|
7310
7310
|
if (isLocalCommunity) {
|
package/dist/bundled/chunks/{rpc-local-community-CdG4JLzO.js → rpc-local-community-CH7vnXLI.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as __toESM, n as __exportAll, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
|
|
2
|
-
import { $ as isRequestPubsubPublicationOfReply, $n as CommunityAuthorChallengeReservedFieldNames, $t as CreateCommentModerationOptionsWithRefinementSchema, A as doesDomainAddressHaveCapitalLetter, An as CommentUpdateReservedFields, Ar as boolean, At as listUpdatingCommunities, B as ipnsNameToIpnsOverPubsubTopic, Bt as require_sha256$1, Cn as CommentIpfsSchema, Cr as messages, D as createAbortError, Dn as CommentUpdateChallengeReservedFieldNames, Dt as findUpdatingCommunity, En as CommentSignedPropertyNames, Er as require_ms$1, Et as findUpdatingComment, Fn as CreateCommentOptionsWithRefinementSchema, Fr as record, G as isIpnsPath, Gn as CreateCommentEditOptionsWithRefinementSchema, Gt as CommunityEditPublicationSignedPropertyNames, H as isIpfsCid, Ht as pTimeout, In as GetPageParamSchema, Ir as string, It as trackUpdatingCommunity, Jt as CommentModerationChallengeRequestToEncryptSchema, Kn as AuthorAddressSchema, Kt as CommunityEditPubsubMessagePublicationSchema, L as getPostUpdateTimestampRange, Ln as ModQueuePageIpfsSchema, Lt as untrackStartedCommunity, M as fetchAndValidateIpnsRecordFromGateway, Mn as CommentUpdateSignedPropertyNames, Mr as literal, Mt as refreshTrackedCommunityAliases, Nr as number, O as deepMergeRuntimeFields, Or as _enum, Ot as listStartedCommunities, Pr as object, Pt as trackStartedCommunity, Q as isRequestPubsubPublicationOfPost, Qn as CommunityAddressSchema, Qt as CommentModerationsTableRowSchema, R as hideClassPrivateProps, Rn as PageIpfsSchema, Rt as untrackUpdatingComment, S as calculateIpfsCidV0, Sn as CommentIpfsReservedFields, Sr as PKCError, St as waitForUpdateInCommunityInstanceWithErrorAndTimeout, Tn as CommentPubsubMessageWithFlexibleAuthorRefinementSchema, Tr as require_supports_color, Tt as findStartedCommunity, U as isIpfsPath, Un as CommentEditSignedPropertyNames, Ut as CommunityEditPublicationChallengeRequestToEncryptSchema, V as isAbortError, Vn as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, W as isIpns, Xn as CidPathSchema, Yn as ChallengeAnswersSchema, Yt as CommentModerationPubsubMessagePublicationSchema, Zn as CidStringSchema, Zt as CommentModerationSignedPropertyNames, _ as PKCUserOptionBaseSchema, _n as VotePubsubMessagePublicationSchema, _r as FailedToFetchCommentIpfsFromGatewaysError, _t as shortifyCid, an as CommunityExportRecordsSchema, ar as t$13, b as areEquivalentCommunityAddresses, br as FailedToFetchGenericIpfsFromGatewaysError, bt as throwIfAbortSignalAborted, c as ChallengeVerificationMessageSignedPropertyNames, cn as CommunitySignedPropertyNames, cr as t$11, ct as removeNullUndefinedEmptyObjectsValuesRecursively, dn as CreateRpcCommunityFunctionArgumentSchema, dr as n$8, en as ChallengeFileFactorySchema, er as CreateSignerSchema, et as isStringDomain, f as DecryptedChallengeSchema, fn as ExportCommunityModLogsOptionsSchema, fr as r$7, ft as resolveWhenPredicateIsTrue, g as PKCParsedOptionsSchema, gn as VoteChallengeRequestToEncryptSchema, gr as require_retry$1, gt as shortifyAddress, h as NameResolverSerializedSchema, hn as CreateVoteUserOptionsWithRefinementSchema, hr as e$4, i as ChallengeMessageSignedPropertyNames, in as CommunityEditOptionsSchema, j as extractNetworkErrorDetails, jn as CommentUpdateSchema, jr as custom, k as derivePublicationFromChallengeRequest, kn as CommentUpdateForChallengeVerificationSignedPropertyNames, kr as array, l as DecryptedChallengeAnswerSchema, ln as CreateNewLocalCommunityUserOptionsSchema, lr as r$8, m as NameResolveCacheOptionsSchema, mn as RpcRemoteCommunityUpdateEventResultSchema, mr as t$9, n as ChallengeAnswerMessageSignedPropertyNames, o as ChallengeRequestMessageSignedPropertyNames, on as CommunityIpfsReservedFields, or as e$6, p as DecryptedChallengeVerificationSchema, pr as t$10, qn as AuthorCommentIpfsReservedFields, qt as CreateCommunityEditPublicationOptionsWithRefinementSchema, rn as CommunityChallengeSettingSchema, rr as n$9, rt as raceAgainstAbort, sn as CommunityIpfsSchema, sr as e$5, tn as ChallengeFileSchema, tr as n$10, tt as pubsubTopicToDhtKey, un as CreateRemoteCommunityFunctionArgumentSchema, ur as t$12, v as PKCUserOptionsSchema, vr as FailedToFetchCommentUpdateFromGatewaysError, vt as sleepUntilTimeoutOrAbort, wr as logger_default, xn as CommentChallengeRequestToEncryptSchema, xr as FailedToFetchPageIpfsFromGatewaysError, xt as timestamp, yn as VoteSignedPropertyNames, yr as FailedToFetchCommunityFromGatewaysError, z as interruptibleSleep, zn as CommentEditChallengeRequestToEncryptSchema, zt as untrackUpdatingCommunity } from "./schema-
|
|
2
|
+
import { $ as isRequestPubsubPublicationOfReply, $n as CommunityAuthorChallengeReservedFieldNames, $t as CreateCommentModerationOptionsWithRefinementSchema, A as doesDomainAddressHaveCapitalLetter, An as CommentUpdateReservedFields, Ar as boolean, At as listUpdatingCommunities, B as ipnsNameToIpnsOverPubsubTopic, Bt as require_sha256$1, Cn as CommentIpfsSchema, Cr as messages, D as createAbortError, Dn as CommentUpdateChallengeReservedFieldNames, Dt as findUpdatingCommunity, En as CommentSignedPropertyNames, Er as require_ms$1, Et as findUpdatingComment, Fn as CreateCommentOptionsWithRefinementSchema, Fr as record, G as isIpnsPath, Gn as CreateCommentEditOptionsWithRefinementSchema, Gt as CommunityEditPublicationSignedPropertyNames, H as isIpfsCid, Ht as pTimeout, In as GetPageParamSchema, Ir as string, It as trackUpdatingCommunity, Jt as CommentModerationChallengeRequestToEncryptSchema, Kn as AuthorAddressSchema, Kt as CommunityEditPubsubMessagePublicationSchema, L as getPostUpdateTimestampRange, Ln as ModQueuePageIpfsSchema, Lt as untrackStartedCommunity, M as fetchAndValidateIpnsRecordFromGateway, Mn as CommentUpdateSignedPropertyNames, Mr as literal, Mt as refreshTrackedCommunityAliases, Nr as number, O as deepMergeRuntimeFields, Or as _enum, Ot as listStartedCommunities, Pr as object, Pt as trackStartedCommunity, Q as isRequestPubsubPublicationOfPost, Qn as CommunityAddressSchema, Qt as CommentModerationsTableRowSchema, R as hideClassPrivateProps, Rn as PageIpfsSchema, Rt as untrackUpdatingComment, S as calculateIpfsCidV0, Sn as CommentIpfsReservedFields, Sr as PKCError, St as waitForUpdateInCommunityInstanceWithErrorAndTimeout, Tn as CommentPubsubMessageWithFlexibleAuthorRefinementSchema, Tr as require_supports_color, Tt as findStartedCommunity, U as isIpfsPath, Un as CommentEditSignedPropertyNames, Ut as CommunityEditPublicationChallengeRequestToEncryptSchema, V as isAbortError, Vn as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, W as isIpns, Xn as CidPathSchema, Yn as ChallengeAnswersSchema, Yt as CommentModerationPubsubMessagePublicationSchema, Zn as CidStringSchema, Zt as CommentModerationSignedPropertyNames, _ as PKCUserOptionBaseSchema, _n as VotePubsubMessagePublicationSchema, _r as FailedToFetchCommentIpfsFromGatewaysError, _t as shortifyCid, an as CommunityExportRecordsSchema, ar as t$13, b as areEquivalentCommunityAddresses, br as FailedToFetchGenericIpfsFromGatewaysError, bt as throwIfAbortSignalAborted, c as ChallengeVerificationMessageSignedPropertyNames, cn as CommunitySignedPropertyNames, cr as t$11, ct as removeNullUndefinedEmptyObjectsValuesRecursively, dn as CreateRpcCommunityFunctionArgumentSchema, dr as n$8, en as ChallengeFileFactorySchema, er as CreateSignerSchema, et as isStringDomain, f as DecryptedChallengeSchema, fn as ExportCommunityModLogsOptionsSchema, fr as r$7, ft as resolveWhenPredicateIsTrue, g as PKCParsedOptionsSchema, gn as VoteChallengeRequestToEncryptSchema, gr as require_retry$1, gt as shortifyAddress, h as NameResolverSerializedSchema, hn as CreateVoteUserOptionsWithRefinementSchema, hr as e$4, i as ChallengeMessageSignedPropertyNames, in as CommunityEditOptionsSchema, j as extractNetworkErrorDetails, jn as CommentUpdateSchema, jr as custom, k as derivePublicationFromChallengeRequest, kn as CommentUpdateForChallengeVerificationSignedPropertyNames, kr as array, l as DecryptedChallengeAnswerSchema, ln as CreateNewLocalCommunityUserOptionsSchema, lr as r$8, m as NameResolveCacheOptionsSchema, mn as RpcRemoteCommunityUpdateEventResultSchema, mr as t$9, n as ChallengeAnswerMessageSignedPropertyNames, o as ChallengeRequestMessageSignedPropertyNames, on as CommunityIpfsReservedFields, or as e$6, p as DecryptedChallengeVerificationSchema, pr as t$10, qn as AuthorCommentIpfsReservedFields, qt as CreateCommunityEditPublicationOptionsWithRefinementSchema, rn as CommunityChallengeSettingSchema, rr as n$9, rt as raceAgainstAbort, sn as CommunityIpfsSchema, sr as e$5, tn as ChallengeFileSchema, tr as n$10, tt as pubsubTopicToDhtKey, un as CreateRemoteCommunityFunctionArgumentSchema, ur as t$12, v as PKCUserOptionsSchema, vr as FailedToFetchCommentUpdateFromGatewaysError, vt as sleepUntilTimeoutOrAbort, wr as logger_default, xn as CommentChallengeRequestToEncryptSchema, xr as FailedToFetchPageIpfsFromGatewaysError, xt as timestamp, yn as VoteSignedPropertyNames, yr as FailedToFetchCommunityFromGatewaysError, z as interruptibleSleep, zn as CommentEditChallengeRequestToEncryptSchema, zt as untrackUpdatingCommunity } from "./schema-DzFAY-My.js";
|
|
3
3
|
import { t as all } from "./src-CYIMjhjK.js";
|
|
4
4
|
import { createHash } from "node:crypto";
|
|
5
5
|
import { pathToFileURL } from "node:url";
|
|
@@ -16223,7 +16223,7 @@ function extractNetworkErrorDetails(err, depth = 0) {
|
|
|
16223
16223
|
}
|
|
16224
16224
|
//#endregion
|
|
16225
16225
|
//#region dist/node/generated-version.js
|
|
16226
|
-
const version = "0.0.
|
|
16226
|
+
const version = "0.0.97";
|
|
16227
16227
|
//#endregion
|
|
16228
16228
|
//#region dist/node/version.js
|
|
16229
16229
|
const protocolVersion = ProtocolVersionSchema.parse("1.0.0");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Sr as PKCError, nt as pubsubTopicToDhtKeyCid } from "./schema-
|
|
1
|
+
import { Sr as PKCError, nt as pubsubTopicToDhtKeyCid } from "./schema-DzFAY-My.js";
|
|
2
2
|
import { ipnsSelector } from "ipns/selector";
|
|
3
3
|
import { ipnsValidator } from "ipns/validator";
|
|
4
4
|
import { unmarshalIPNSRecord } from "ipns";
|
package/dist/bundled/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as getShortCid, i as getShortAddress, n as challenges, o as nativeFunctions, r as createAnchorIpnsRecord, s as setNativeFunctions, t as PKC } from "./chunks/node-
|
|
1
|
+
import { a as getShortCid, i as getShortAddress, n as challenges, o as nativeFunctions, r as createAnchorIpnsRecord, s as setNativeFunctions, t as PKC } from "./chunks/node-DmZww4LL.js";
|
|
2
2
|
export { challenges, createAnchorIpnsRecord, PKC as default, getShortAddress, getShortCid, nativeFunctions, setNativeFunctions };
|