@pkcprotocol/pkc-js 0.0.127 → 0.0.129
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/README.md +16 -5
- package/dist/browser/clients/base-client-manager.d.ts +8 -0
- package/dist/browser/clients/base-client-manager.js +39 -2
- package/dist/browser/clients/base-client-manager.js.map +1 -1
- package/dist/browser/clients/rpc-client/pkc-rpc-client.d.ts +2 -2
- package/dist/browser/clients/rpc-client/pkc-rpc-client.js +8 -3
- package/dist/browser/clients/rpc-client/pkc-rpc-client.js.map +1 -1
- package/dist/browser/clients/rpc-client/schema.d.ts +10 -1
- package/dist/browser/clients/rpc-client/schema.js +8 -1
- package/dist/browser/clients/rpc-client/schema.js.map +1 -1
- package/dist/browser/clients/rpc-client/types.d.ts +5 -1
- package/dist/browser/community/communities-entry-util.d.ts +14 -0
- package/dist/browser/community/communities-entry-util.js +20 -0
- package/dist/browser/community/communities-entry-util.js.map +1 -0
- package/dist/browser/community/community-client-manager.js +2 -1
- package/dist/browser/community/community-client-manager.js.map +1 -1
- package/dist/browser/errors.d.ts +1 -0
- package/dist/browser/errors.js +1 -0
- package/dist/browser/errors.js.map +1 -1
- package/dist/browser/generated-version.d.ts +1 -1
- package/dist/browser/generated-version.js +1 -1
- package/dist/browser/helia/helia-for-pkc.js +88 -22
- package/dist/browser/helia/helia-for-pkc.js.map +1 -1
- package/dist/browser/helia/types.d.ts +4 -1
- package/dist/browser/pkc/pkc-with-rpc-client.d.ts +2 -0
- package/dist/browser/pkc/pkc-with-rpc-client.js +66 -3
- package/dist/browser/pkc/pkc-with-rpc-client.js.map +1 -1
- package/dist/browser/pkc/pkc.d.ts +5 -3
- package/dist/browser/pkc/pkc.js +15 -10
- package/dist/browser/pkc/pkc.js.map +1 -1
- package/dist/browser/pkc-error.d.ts +1 -1
- package/dist/browser/publications/comment/comment-client-manager.d.ts +5 -2
- package/dist/browser/publications/comment/comment-client-manager.js +104 -40
- package/dist/browser/publications/comment/comment-client-manager.js.map +1 -1
- package/dist/browser/publications/comment/comment.d.ts +4 -0
- package/dist/browser/publications/comment/comment.js +4 -0
- package/dist/browser/publications/comment/comment.js.map +1 -1
- package/dist/browser/rpc/src/index.js +10 -8
- package/dist/browser/rpc/src/index.js.map +1 -1
- package/dist/browser/runtime/browser/util.d.ts +1 -0
- package/dist/browser/runtime/browser/util.js +3 -0
- package/dist/browser/runtime/browser/util.js.map +1 -1
- package/dist/browser/runtime/node/community/db-handler.js +2 -4
- package/dist/browser/runtime/node/community/db-handler.js.map +1 -1
- package/dist/browser/runtime/node/community/local-community/editing.js +13 -6
- package/dist/browser/runtime/node/community/local-community/editing.js.map +1 -1
- package/dist/browser/runtime/node/community/local-community.js +9 -1
- package/dist/browser/runtime/node/community/local-community.js.map +1 -1
- package/dist/browser/runtime/node/community/start-lock.d.ts +8 -0
- package/dist/browser/runtime/node/community/start-lock.js +18 -0
- package/dist/browser/runtime/node/community/start-lock.js.map +1 -0
- package/dist/browser/runtime/node/util.d.ts +6 -0
- package/dist/browser/runtime/node/util.js +106 -8
- package/dist/browser/runtime/node/util.js.map +1 -1
- package/dist/browser/test/test-util.d.ts +20 -0
- package/dist/browser/test/test-util.js +25 -0
- package/dist/browser/test/test-util.js.map +1 -1
- package/dist/browser/types.d.ts +7 -3
- package/dist/bundled/bundle-manifest.json +47 -45
- package/dist/bundled/challenges.js +1 -1
- package/dist/bundled/chunks/{helia-for-pkc-BsXEDYPa.js → helia-for-pkc-Cg_zH9dT.js} +67 -13
- package/dist/bundled/chunks/{local-community-FekHR-fd.js → local-community-CufTrjaK.js} +1 -1
- package/dist/bundled/chunks/{local-community-WFQoW5aC.js → local-community-Gj16RMFM.js} +18 -1381
- package/dist/bundled/chunks/{node-pIjburtc.js → node-jDoQBCgW.js} +179 -43
- package/dist/bundled/chunks/{page-sort-scoring-Civ7TOoF.js → page-sort-scoring-B53_j_WT.js} +1 -1
- package/dist/bundled/chunks/{rpc-local-community-BqP9g2Rk.js → rpc-local-community-9DP4Rskv.js} +1604 -51
- package/dist/bundled/chunks/{util-D5Y6i3Nn.js → util-CxVo5EMD.js} +1 -1
- package/dist/bundled/chunks/{util-VrWyIc1x.js → util-D7gst5MT.js} +20 -19
- package/dist/bundled/chunks/{validate-package-factories-CJgjDTZC.js → validate-package-factories-D2LBnQVu.js} +2 -2
- package/dist/bundled/index.js +1 -1
- package/dist/bundled/page-sorts.js +1 -1
- package/dist/bundled/rpc/src/index.js +10 -9
- package/dist/node/clients/base-client-manager.d.ts +8 -0
- package/dist/node/clients/base-client-manager.js +39 -2
- package/dist/node/clients/base-client-manager.js.map +1 -1
- package/dist/node/clients/rpc-client/pkc-rpc-client.d.ts +2 -2
- package/dist/node/clients/rpc-client/pkc-rpc-client.js +8 -3
- package/dist/node/clients/rpc-client/pkc-rpc-client.js.map +1 -1
- package/dist/node/clients/rpc-client/schema.d.ts +10 -1
- package/dist/node/clients/rpc-client/schema.js +8 -1
- package/dist/node/clients/rpc-client/schema.js.map +1 -1
- package/dist/node/clients/rpc-client/types.d.ts +5 -1
- package/dist/node/community/communities-entry-util.d.ts +14 -0
- package/dist/node/community/communities-entry-util.js +20 -0
- package/dist/node/community/communities-entry-util.js.map +1 -0
- package/dist/node/community/community-client-manager.js +2 -1
- package/dist/node/community/community-client-manager.js.map +1 -1
- package/dist/node/errors.d.ts +1 -0
- package/dist/node/errors.js +1 -0
- package/dist/node/errors.js.map +1 -1
- package/dist/node/generated-version.d.ts +1 -1
- package/dist/node/generated-version.js +1 -1
- package/dist/node/helia/helia-for-pkc.js +88 -22
- package/dist/node/helia/helia-for-pkc.js.map +1 -1
- package/dist/node/helia/types.d.ts +4 -1
- package/dist/node/pkc/pkc-with-rpc-client.d.ts +2 -0
- package/dist/node/pkc/pkc-with-rpc-client.js +66 -3
- package/dist/node/pkc/pkc-with-rpc-client.js.map +1 -1
- package/dist/node/pkc/pkc.d.ts +5 -3
- package/dist/node/pkc/pkc.js +15 -10
- package/dist/node/pkc/pkc.js.map +1 -1
- package/dist/node/pkc-error.d.ts +1 -1
- package/dist/node/publications/comment/comment-client-manager.d.ts +5 -2
- package/dist/node/publications/comment/comment-client-manager.js +104 -40
- package/dist/node/publications/comment/comment-client-manager.js.map +1 -1
- package/dist/node/publications/comment/comment.d.ts +4 -0
- package/dist/node/publications/comment/comment.js +4 -0
- package/dist/node/publications/comment/comment.js.map +1 -1
- package/dist/node/rpc/src/index.js +10 -8
- package/dist/node/rpc/src/index.js.map +1 -1
- package/dist/node/runtime/browser/util.d.ts +1 -0
- package/dist/node/runtime/browser/util.js +3 -0
- package/dist/node/runtime/browser/util.js.map +1 -1
- package/dist/node/runtime/node/community/db-handler.js +2 -4
- package/dist/node/runtime/node/community/db-handler.js.map +1 -1
- package/dist/node/runtime/node/community/local-community/editing.js +13 -6
- package/dist/node/runtime/node/community/local-community/editing.js.map +1 -1
- package/dist/node/runtime/node/community/local-community.js +9 -1
- package/dist/node/runtime/node/community/local-community.js.map +1 -1
- package/dist/node/runtime/node/community/start-lock.d.ts +8 -0
- package/dist/node/runtime/node/community/start-lock.js +18 -0
- package/dist/node/runtime/node/community/start-lock.js.map +1 -0
- package/dist/node/runtime/node/util.d.ts +6 -0
- package/dist/node/runtime/node/util.js +106 -8
- package/dist/node/runtime/node/util.js.map +1 -1
- package/dist/node/test/test-util.d.ts +20 -0
- package/dist/node/test/test-util.js +25 -0
- package/dist/node/test/test-util.js.map +1 -1
- package/dist/node/types.d.ts +7 -3
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"challenges.js": {
|
|
4
4
|
"isEntry": true,
|
|
5
5
|
"imports": [
|
|
6
|
-
"chunks/validate-package-factories-
|
|
6
|
+
"chunks/validate-package-factories-D2LBnQVu.js"
|
|
7
7
|
],
|
|
8
8
|
"dynamicImports": [],
|
|
9
9
|
"inputs": [
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"node:module"
|
|
17
17
|
],
|
|
18
18
|
"dynamicImports": [
|
|
19
|
-
"chunks/node-
|
|
19
|
+
"chunks/node-jDoQBCgW.js"
|
|
20
20
|
],
|
|
21
21
|
"inputs": [
|
|
22
22
|
"dist/node/runtime/node/compile-cache.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"index.js": {
|
|
27
27
|
"isEntry": true,
|
|
28
28
|
"imports": [
|
|
29
|
-
"chunks/node-
|
|
29
|
+
"chunks/node-jDoQBCgW.js"
|
|
30
30
|
],
|
|
31
31
|
"dynamicImports": [],
|
|
32
32
|
"inputs": []
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"page-sorts.js": {
|
|
35
35
|
"isEntry": true,
|
|
36
36
|
"imports": [
|
|
37
|
-
"chunks/validate-package-factories-
|
|
37
|
+
"chunks/validate-package-factories-D2LBnQVu.js"
|
|
38
38
|
],
|
|
39
39
|
"dynamicImports": [],
|
|
40
40
|
"inputs": [
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"rpc/src/index.js": {
|
|
45
45
|
"isEntry": true,
|
|
46
46
|
"imports": [
|
|
47
|
-
"chunks/rpc-local-community-
|
|
48
|
-
"chunks/node-
|
|
49
|
-
"chunks/util-
|
|
50
|
-
"chunks/local-community-
|
|
47
|
+
"chunks/rpc-local-community-9DP4Rskv.js",
|
|
48
|
+
"chunks/node-jDoQBCgW.js",
|
|
49
|
+
"chunks/util-D7gst5MT.js",
|
|
50
|
+
"chunks/local-community-Gj16RMFM.js",
|
|
51
51
|
"node:url",
|
|
52
52
|
"path",
|
|
53
53
|
"assert",
|
|
@@ -77,12 +77,12 @@
|
|
|
77
77
|
"\u0000rolldown/runtime.js"
|
|
78
78
|
]
|
|
79
79
|
},
|
|
80
|
-
"chunks/helia-for-pkc-
|
|
80
|
+
"chunks/helia-for-pkc-Cg_zH9dT.js": {
|
|
81
81
|
"isEntry": false,
|
|
82
82
|
"imports": [
|
|
83
83
|
"chunks/chunk-2rV9d50f.js",
|
|
84
|
-
"chunks/util-
|
|
85
|
-
"chunks/util-
|
|
84
|
+
"chunks/util-D7gst5MT.js",
|
|
85
|
+
"chunks/util-CxVo5EMD.js",
|
|
86
86
|
"chunks/src-DKntVmyX.js",
|
|
87
87
|
"chunks/src-Cpx2Sts8.js",
|
|
88
88
|
"node:url",
|
|
@@ -201,21 +201,21 @@
|
|
|
201
201
|
"dist/node/helia/helia-for-pkc.js"
|
|
202
202
|
]
|
|
203
203
|
},
|
|
204
|
-
"chunks/local-community-
|
|
204
|
+
"chunks/local-community-CufTrjaK.js": {
|
|
205
205
|
"isEntry": false,
|
|
206
206
|
"imports": [
|
|
207
|
-
"chunks/local-community-
|
|
207
|
+
"chunks/local-community-Gj16RMFM.js"
|
|
208
208
|
],
|
|
209
209
|
"dynamicImports": [],
|
|
210
210
|
"inputs": []
|
|
211
211
|
},
|
|
212
|
-
"chunks/local-community-
|
|
212
|
+
"chunks/local-community-Gj16RMFM.js": {
|
|
213
213
|
"isEntry": false,
|
|
214
214
|
"imports": [
|
|
215
215
|
"chunks/chunk-2rV9d50f.js",
|
|
216
|
-
"chunks/rpc-local-community-
|
|
217
|
-
"chunks/util-
|
|
218
|
-
"chunks/page-sort-scoring-
|
|
216
|
+
"chunks/rpc-local-community-9DP4Rskv.js",
|
|
217
|
+
"chunks/util-D7gst5MT.js",
|
|
218
|
+
"chunks/page-sort-scoring-B53_j_WT.js",
|
|
219
219
|
"node:crypto",
|
|
220
220
|
"node:url",
|
|
221
221
|
"node:path",
|
|
@@ -238,16 +238,6 @@
|
|
|
238
238
|
"node_modules/remeda/dist/uniqueBy.js",
|
|
239
239
|
"dist/node/runtime/node/community/local-community/identity.js",
|
|
240
240
|
"dist/node/runtime/node/community/local-community/anchor-publishing.js",
|
|
241
|
-
"node_modules/graceful-fs/polyfills.js",
|
|
242
|
-
"node_modules/graceful-fs/legacy-streams.js",
|
|
243
|
-
"node_modules/graceful-fs/clone.js",
|
|
244
|
-
"node_modules/graceful-fs/graceful-fs.js",
|
|
245
|
-
"node_modules/signal-exit/dist/cjs/signals.js",
|
|
246
|
-
"node_modules/signal-exit/dist/cjs/index.js",
|
|
247
|
-
"node_modules/@pkcprotocol/proper-lock-file/dist/src/mtime-precision.js",
|
|
248
|
-
"node_modules/@pkcprotocol/proper-lock-file/dist/src/lockfile.js",
|
|
249
|
-
"node_modules/@pkcprotocol/proper-lock-file/dist/src/adapter.js",
|
|
250
|
-
"node_modules/@pkcprotocol/proper-lock-file/dist/src/index.js",
|
|
251
241
|
"node_modules/uuid/dist-node/native.js",
|
|
252
242
|
"node_modules/uuid/dist-node/rng.js",
|
|
253
243
|
"node_modules/uuid/dist-node/stringify.js",
|
|
@@ -274,13 +264,13 @@
|
|
|
274
264
|
"dist/node/runtime/node/community/local-community.js"
|
|
275
265
|
]
|
|
276
266
|
},
|
|
277
|
-
"chunks/node-
|
|
267
|
+
"chunks/node-jDoQBCgW.js": {
|
|
278
268
|
"isEntry": false,
|
|
279
269
|
"imports": [
|
|
280
270
|
"chunks/chunk-2rV9d50f.js",
|
|
281
|
-
"chunks/rpc-local-community-
|
|
282
|
-
"chunks/util-
|
|
283
|
-
"chunks/util-
|
|
271
|
+
"chunks/rpc-local-community-9DP4Rskv.js",
|
|
272
|
+
"chunks/util-D7gst5MT.js",
|
|
273
|
+
"chunks/util-CxVo5EMD.js",
|
|
284
274
|
"path",
|
|
285
275
|
"assert",
|
|
286
276
|
"fs",
|
|
@@ -291,8 +281,8 @@
|
|
|
291
281
|
"rpc-websockets"
|
|
292
282
|
],
|
|
293
283
|
"dynamicImports": [
|
|
294
|
-
"chunks/helia-for-pkc-
|
|
295
|
-
"chunks/local-community-
|
|
284
|
+
"chunks/helia-for-pkc-Cg_zH9dT.js",
|
|
285
|
+
"chunks/local-community-Gj16RMFM.js"
|
|
296
286
|
],
|
|
297
287
|
"inputs": [
|
|
298
288
|
"dist/node/zod-error-map.js",
|
|
@@ -339,22 +329,22 @@
|
|
|
339
329
|
"dist/node/index.js"
|
|
340
330
|
]
|
|
341
331
|
},
|
|
342
|
-
"chunks/page-sort-scoring-
|
|
332
|
+
"chunks/page-sort-scoring-B53_j_WT.js": {
|
|
343
333
|
"isEntry": false,
|
|
344
334
|
"imports": [
|
|
345
|
-
"chunks/util-
|
|
335
|
+
"chunks/util-D7gst5MT.js"
|
|
346
336
|
],
|
|
347
337
|
"dynamicImports": [],
|
|
348
338
|
"inputs": [
|
|
349
339
|
"dist/node/pages/page-sort-scoring.js"
|
|
350
340
|
]
|
|
351
341
|
},
|
|
352
|
-
"chunks/rpc-local-community-
|
|
342
|
+
"chunks/rpc-local-community-9DP4Rskv.js": {
|
|
353
343
|
"isEntry": false,
|
|
354
344
|
"imports": [
|
|
355
345
|
"chunks/chunk-2rV9d50f.js",
|
|
356
|
-
"chunks/util-
|
|
357
|
-
"chunks/page-sort-scoring-
|
|
346
|
+
"chunks/util-D7gst5MT.js",
|
|
347
|
+
"chunks/page-sort-scoring-B53_j_WT.js",
|
|
358
348
|
"chunks/src-CYIMjhjK.js",
|
|
359
349
|
"node:crypto",
|
|
360
350
|
"node:url",
|
|
@@ -769,6 +759,18 @@
|
|
|
769
759
|
"node_modules/remeda/dist/withPrecision-CqXhgRqZ.js",
|
|
770
760
|
"node_modules/remeda/dist/round.js",
|
|
771
761
|
"node_modules/remeda/dist/stringToPath.js",
|
|
762
|
+
"node_modules/graceful-fs/polyfills.js",
|
|
763
|
+
"node_modules/graceful-fs/legacy-streams.js",
|
|
764
|
+
"node_modules/graceful-fs/clone.js",
|
|
765
|
+
"node_modules/graceful-fs/graceful-fs.js",
|
|
766
|
+
"node_modules/signal-exit/dist/cjs/signals.js",
|
|
767
|
+
"node_modules/signal-exit/dist/cjs/index.js",
|
|
768
|
+
"node_modules/@pkcprotocol/proper-lock-file/dist/src/mtime-precision.js",
|
|
769
|
+
"node_modules/@pkcprotocol/proper-lock-file/dist/src/lockfile.js",
|
|
770
|
+
"node_modules/@pkcprotocol/proper-lock-file/dist/src/adapter.js",
|
|
771
|
+
"node_modules/@pkcprotocol/proper-lock-file/dist/src/index.js",
|
|
772
|
+
"dist/node/runtime/node/community/start-lock.js",
|
|
773
|
+
"dist/node/community/communities-entry-util.js",
|
|
772
774
|
"dist/node/runtime/node/util.js",
|
|
773
775
|
"node_modules/@noble/hashes/utils.js",
|
|
774
776
|
"node_modules/@noble/hashes/_md.js",
|
|
@@ -1306,10 +1308,10 @@
|
|
|
1306
1308
|
"node_modules/it-parallel-batch/dist/src/index.js"
|
|
1307
1309
|
]
|
|
1308
1310
|
},
|
|
1309
|
-
"chunks/util-
|
|
1311
|
+
"chunks/util-CxVo5EMD.js": {
|
|
1310
1312
|
"isEntry": false,
|
|
1311
1313
|
"imports": [
|
|
1312
|
-
"chunks/util-
|
|
1314
|
+
"chunks/util-D7gst5MT.js",
|
|
1313
1315
|
"ipns/selector",
|
|
1314
1316
|
"ipns/validator",
|
|
1315
1317
|
"ipns",
|
|
@@ -1320,7 +1322,7 @@
|
|
|
1320
1322
|
"dist/node/helia/util.js"
|
|
1321
1323
|
]
|
|
1322
1324
|
},
|
|
1323
|
-
"chunks/util-
|
|
1325
|
+
"chunks/util-D7gst5MT.js": {
|
|
1324
1326
|
"isEntry": false,
|
|
1325
1327
|
"imports": [
|
|
1326
1328
|
"chunks/chunk-2rV9d50f.js",
|
|
@@ -1387,6 +1389,7 @@
|
|
|
1387
1389
|
"node_modules/remeda/dist/omitBy.js",
|
|
1388
1390
|
"node_modules/remeda/dist/pickBy.js",
|
|
1389
1391
|
"node_modules/remeda/dist/unique.js",
|
|
1392
|
+
"dist/node/domain-util.js",
|
|
1390
1393
|
"dist/node/schema/schema.js",
|
|
1391
1394
|
"dist/node/signer/constants.js",
|
|
1392
1395
|
"dist/node/publications/comment-edit/schema.js",
|
|
@@ -1401,7 +1404,6 @@
|
|
|
1401
1404
|
"node_modules/sort-keys-length/index.js",
|
|
1402
1405
|
"node_modules/ext-name/index.js",
|
|
1403
1406
|
"dist/node/publications/vote/schema.js",
|
|
1404
|
-
"dist/node/domain-util.js",
|
|
1405
1407
|
"dist/node/community/schema.js",
|
|
1406
1408
|
"dist/node/publications/comment-moderation/schema.js",
|
|
1407
1409
|
"dist/node/publications/community-edit/schema.js",
|
|
@@ -1415,11 +1417,11 @@
|
|
|
1415
1417
|
"dist/node/util.js"
|
|
1416
1418
|
]
|
|
1417
1419
|
},
|
|
1418
|
-
"chunks/validate-package-factories-
|
|
1420
|
+
"chunks/validate-package-factories-D2LBnQVu.js": {
|
|
1419
1421
|
"isEntry": false,
|
|
1420
1422
|
"imports": [
|
|
1421
|
-
"chunks/util-
|
|
1422
|
-
"chunks/page-sort-scoring-
|
|
1423
|
+
"chunks/util-D7gst5MT.js",
|
|
1424
|
+
"chunks/page-sort-scoring-B53_j_WT.js"
|
|
1423
1425
|
],
|
|
1424
1426
|
"dynamicImports": [],
|
|
1425
1427
|
"inputs": [
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as validateChallengeFileFactory } from "./chunks/validate-package-factories-
|
|
1
|
+
import { t as validateChallengeFileFactory } from "./chunks/validate-package-factories-D2LBnQVu.js";
|
|
2
2
|
export { validateChallengeFileFactory };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
|
|
2
|
-
import { C as hideClassPrivateProps, Lr as PKCError, T as ipnsNameToIpnsOverPubsubTopic, n as binaryKeyToPubsubTopic, zr as logger_default } from "./util-
|
|
3
|
-
import { a as directFetchIpnsRecordFromProviders, c as readFreshCachedIpnsRecordFromPubsubLocalStore, i as connectToPubsubPeers, l as selectBitswapSessionSeedPeers, n as REACHABILITY_DOCS_URL, o as fetchBlockWithStalledSessionFailover, r as cacheIpnsRecordInPubsubLocalStore, s as getHeliaDebugContext, u as summarizeProviderReachability } from "./util-
|
|
2
|
+
import { C as hideClassPrivateProps, Lr as PKCError, T as ipnsNameToIpnsOverPubsubTopic, n as binaryKeyToPubsubTopic, zr as logger_default } from "./util-D7gst5MT.js";
|
|
3
|
+
import { a as directFetchIpnsRecordFromProviders, c as readFreshCachedIpnsRecordFromPubsubLocalStore, i as connectToPubsubPeers, l as selectBitswapSessionSeedPeers, n as REACHABILITY_DOCS_URL, o as fetchBlockWithStalledSessionFailover, r as cacheIpnsRecordInPubsubLocalStore, s as getHeliaDebugContext, u as summarizeProviderReachability } from "./util-CxVo5EMD.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";
|
|
@@ -6632,6 +6632,20 @@ async function createLibp2pJsClientOrUseExistingOne(pkcOptions) {
|
|
|
6632
6632
|
}, ms);
|
|
6633
6633
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
6634
6634
|
});
|
|
6635
|
+
const createSeededBitswapSession = (rootCid, scopeIpnsPubsubTopic) => {
|
|
6636
|
+
const session = helia.blockstore.createSession(rootCid, { providers: getBitswapSessionSeedPeers(scopeIpnsPubsubTopic).map((peerId) => peerId.toCID()) });
|
|
6637
|
+
const sessionGet = session.get.bind(session);
|
|
6638
|
+
const fallbackGet = helia.blockstore.get.bind(helia.blockstore);
|
|
6639
|
+
session.get = (blockCid, blockGetOptions) => fetchBlockWithStalledSessionFailover({
|
|
6640
|
+
cid: blockCid,
|
|
6641
|
+
sessionGet,
|
|
6642
|
+
fallbackGet,
|
|
6643
|
+
stallTimeoutMs: heliaWithKuboRpcClientShape._bitswapSessionStalledGetFailoverMs ?? 2500,
|
|
6644
|
+
options: blockGetOptions,
|
|
6645
|
+
log
|
|
6646
|
+
});
|
|
6647
|
+
return session;
|
|
6648
|
+
};
|
|
6635
6649
|
const ipnsPubsubRouter = pubSubIPNSRouting(helia);
|
|
6636
6650
|
const ipnsNameResolver = ipns(helia, { routers: [ipnsPubsubRouter] });
|
|
6637
6651
|
for (let i = ipnsNameResolver.routers.length - 1; i >= 0; i--) if (isLocalStoreIpnsRouter(ipnsNameResolver.routers[i])) ipnsNameResolver.routers.splice(i, 1);
|
|
@@ -6916,17 +6930,7 @@ async function createLibp2pJsClientOrUseExistingOne(pkcOptions) {
|
|
|
6916
6930
|
})), timeoutMs) : void 0;
|
|
6917
6931
|
try {
|
|
6918
6932
|
for (let attempt = 0;; attempt++) {
|
|
6919
|
-
const session =
|
|
6920
|
-
const sessionGet = session.get.bind(session);
|
|
6921
|
-
const fallbackGet = helia.blockstore.get.bind(helia.blockstore);
|
|
6922
|
-
session.get = (blockCid, blockGetOptions) => fetchBlockWithStalledSessionFailover({
|
|
6923
|
-
cid: blockCid,
|
|
6924
|
-
sessionGet,
|
|
6925
|
-
fallbackGet,
|
|
6926
|
-
stallTimeoutMs: heliaWithKuboRpcClientShape._bitswapSessionStalledGetFailoverMs ?? 2500,
|
|
6927
|
-
options: blockGetOptions,
|
|
6928
|
-
log
|
|
6929
|
-
});
|
|
6933
|
+
const session = createSeededBitswapSession(rootCid, bitswapSessionSeedScopeIpnsPubsubTopic);
|
|
6930
6934
|
let yieldedAnyBytes = false;
|
|
6931
6935
|
try {
|
|
6932
6936
|
const catIterable = unixfs({ blockstore: session }).cat(rootCid, {
|
|
@@ -6991,6 +6995,56 @@ async function createLibp2pJsClientOrUseExistingOne(pkcOptions) {
|
|
|
6991
6995
|
if (pubsubEventHandler.listenerCount(topic) === 0) helia.libp2p.services.pubsub.unsubscribe(topic);
|
|
6992
6996
|
}
|
|
6993
6997
|
},
|
|
6998
|
+
async resolve(ipfsPath, options) {
|
|
6999
|
+
throwIfHeliaIsStoppingOrStopped();
|
|
7000
|
+
const [rootCidString, ...subPathSegments] = ipfsPath.replace(/^\/ipfs\//, "").split("/");
|
|
7001
|
+
const timeoutMs = parseKuboStyleTimeoutMs(options?.timeout);
|
|
7002
|
+
const controller = new AbortController();
|
|
7003
|
+
const callerSignal = options?.signal;
|
|
7004
|
+
const abortFromCaller = () => controller.abort(callerSignal?.reason);
|
|
7005
|
+
const abortFromStop = () => controller.abort(new PKCError("ERR_HELIAS_STOPPING_OR_STOPPED", {
|
|
7006
|
+
heliaKey: pkcOptions.key,
|
|
7007
|
+
ipfsPath
|
|
7008
|
+
}));
|
|
7009
|
+
if (callerSignal?.aborted) abortFromCaller();
|
|
7010
|
+
else callerSignal?.addEventListener("abort", abortFromCaller, { once: true });
|
|
7011
|
+
if (catStopController.signal.aborted) abortFromStop();
|
|
7012
|
+
else catStopController.signal.addEventListener("abort", abortFromStop, { once: true });
|
|
7013
|
+
const timeoutTimer = timeoutMs !== void 0 ? setTimeout(() => controller.abort(new PKCError("ERR_FETCH_CID_P2P_TIMEOUT", {
|
|
7014
|
+
ipfsPath,
|
|
7015
|
+
timeoutMs
|
|
7016
|
+
})), timeoutMs) : void 0;
|
|
7017
|
+
try {
|
|
7018
|
+
const rootCid = CID.parse(rootCidString);
|
|
7019
|
+
for (let attempt = 0;; attempt++) {
|
|
7020
|
+
const session = createSeededBitswapSession(rootCid, options?.bitswapSessionSeedScopeIpnsPubsubTopic);
|
|
7021
|
+
try {
|
|
7022
|
+
return `/ipfs/${(await unixfs({ blockstore: session }).stat(rootCid, {
|
|
7023
|
+
path: subPathSegments.length > 0 ? subPathSegments.join("/") : void 0,
|
|
7024
|
+
signal: controller.signal
|
|
7025
|
+
})).cid.toString()}`;
|
|
7026
|
+
} catch (e) {
|
|
7027
|
+
if (controller.signal.aborted) throw controller.signal.reason instanceof Error ? controller.signal.reason : e;
|
|
7028
|
+
if (!isCausedByInsufficientProviders(e)) throw e;
|
|
7029
|
+
log.trace("Bitswap session found no providers for", ipfsPath, "- retrying, attempt", attempt + 1);
|
|
7030
|
+
} finally {
|
|
7031
|
+
session.close();
|
|
7032
|
+
}
|
|
7033
|
+
await delayAbortable(Math.min(SESSION_NO_PROVIDERS_RETRY_BASE_DELAY_MS * 2 ** attempt, 8e3), controller.signal);
|
|
7034
|
+
if (controller.signal.aborted) {
|
|
7035
|
+
if (controller.signal.reason instanceof Error) throw controller.signal.reason;
|
|
7036
|
+
throw new PKCError("ERR_FETCH_CID_P2P_TIMEOUT", {
|
|
7037
|
+
ipfsPath,
|
|
7038
|
+
timeoutMs
|
|
7039
|
+
});
|
|
7040
|
+
}
|
|
7041
|
+
}
|
|
7042
|
+
} finally {
|
|
7043
|
+
if (timeoutTimer) clearTimeout(timeoutTimer);
|
|
7044
|
+
callerSignal?.removeEventListener("abort", abortFromCaller);
|
|
7045
|
+
catStopController.signal.removeEventListener("abort", abortFromStop);
|
|
7046
|
+
}
|
|
7047
|
+
},
|
|
6994
7048
|
async add(entry, options) {
|
|
6995
7049
|
throw Error("Helia 'add' is not supported at the moment in pkc-js API");
|
|
6996
7050
|
},
|
|
@@ -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-Gj16RMFM.js";
|
|
2
2
|
export { LocalCommunity, createNewLocalCommunityDb, updateInstancePropsWithStartedCommunityOrDb };
|