@pkcprotocol/pkc-js 0.0.68 → 0.0.69
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/helia/helia-for-pkc.js +28 -4
- package/dist/browser/helia/helia-for-pkc.js.map +1 -1
- package/dist/browser/helia/util.d.ts +19 -0
- package/dist/browser/helia/util.js +20 -0
- package/dist/browser/helia/util.js.map +1 -1
- package/dist/browser/runtime/node/community/local-community/comment-updates.d.ts +5 -1
- package/dist/browser/runtime/node/community/local-community/comment-updates.js +7 -3
- package/dist/browser/runtime/node/community/local-community/comment-updates.js.map +1 -1
- package/dist/bundled/bundle-manifest.json +98 -96
- package/dist/bundled/chunks/{helia-for-pkc-R4yRqnHx.js → helia-for-pkc-x-xe-CrX.js} +16 -4
- package/dist/bundled/chunks/{local-community-BlGJFwN6.js → local-community-B6IwJoBu.js} +35 -29
- package/dist/bundled/chunks/{local-community-BD1ADX4_.js → local-community-BuseLMgO.js} +1 -1
- package/dist/bundled/chunks/{node-LHrRDb4V.js → node-Dz5IKip2.js} +5 -5
- package/dist/bundled/chunks/{rpc-local-community-DCOszS5C.js → rpc-local-community-D8woL19t.js} +17 -17
- package/dist/bundled/chunks/{schema-V4BgFltI.js → schema-C_l9RSe0.js} +2 -2
- package/dist/bundled/chunks/{util-BOhb3f5T.js → util-bpDx_Vq2.js} +12 -2
- 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/helia/helia-for-pkc.js +28 -4
- package/dist/node/helia/helia-for-pkc.js.map +1 -1
- package/dist/node/helia/util.d.ts +19 -0
- package/dist/node/helia/util.js +20 -0
- package/dist/node/helia/util.js.map +1 -1
- package/dist/node/runtime/node/community/local-community/comment-updates.d.ts +5 -1
- package/dist/node/runtime/node/community/local-community/comment-updates.js +7 -3
- package/dist/node/runtime/node/community/local-community/comment-updates.js.map +1 -1
- package/package.json +1 -1
- package/dist/bundled/chunks/{src-0J9-Tmgd.js → src-o_MYSn-E.js} +1 -1
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"node:module"
|
|
15
15
|
],
|
|
16
16
|
"dynamicImports": [
|
|
17
|
-
"chunks/node-
|
|
17
|
+
"chunks/node-Dz5IKip2.js"
|
|
18
18
|
],
|
|
19
19
|
"inputs": [
|
|
20
20
|
"dist/node/runtime/node/compile-cache.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"index.js": {
|
|
25
25
|
"isEntry": true,
|
|
26
26
|
"imports": [
|
|
27
|
-
"chunks/node-
|
|
27
|
+
"chunks/node-Dz5IKip2.js"
|
|
28
28
|
],
|
|
29
29
|
"dynamicImports": [],
|
|
30
30
|
"inputs": []
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"rpc/src/index.js": {
|
|
33
33
|
"isEntry": true,
|
|
34
34
|
"imports": [
|
|
35
|
-
"chunks/rpc-local-community-
|
|
36
|
-
"chunks/node-
|
|
37
|
-
"chunks/schema-
|
|
38
|
-
"chunks/local-community-
|
|
35
|
+
"chunks/rpc-local-community-D8woL19t.js",
|
|
36
|
+
"chunks/node-Dz5IKip2.js",
|
|
37
|
+
"chunks/schema-C_l9RSe0.js",
|
|
38
|
+
"chunks/local-community-B6IwJoBu.js",
|
|
39
39
|
"node:url",
|
|
40
40
|
"path",
|
|
41
41
|
"assert",
|
|
@@ -64,11 +64,11 @@
|
|
|
64
64
|
"\u0000rolldown/runtime.js"
|
|
65
65
|
]
|
|
66
66
|
},
|
|
67
|
-
"chunks/helia-for-pkc-
|
|
67
|
+
"chunks/helia-for-pkc-x-xe-CrX.js": {
|
|
68
68
|
"isEntry": false,
|
|
69
69
|
"imports": [
|
|
70
|
-
"chunks/schema-
|
|
71
|
-
"chunks/util-
|
|
70
|
+
"chunks/schema-C_l9RSe0.js",
|
|
71
|
+
"chunks/util-bpDx_Vq2.js",
|
|
72
72
|
"multiformats/cid",
|
|
73
73
|
"@libp2p/peer-id",
|
|
74
74
|
"events",
|
|
@@ -94,20 +94,12 @@
|
|
|
94
94
|
"dist/node/helia/helia-for-pkc.js"
|
|
95
95
|
]
|
|
96
96
|
},
|
|
97
|
-
"chunks/local-community-
|
|
98
|
-
"isEntry": false,
|
|
99
|
-
"imports": [
|
|
100
|
-
"chunks/local-community-BlGJFwN6.js"
|
|
101
|
-
],
|
|
102
|
-
"dynamicImports": [],
|
|
103
|
-
"inputs": []
|
|
104
|
-
},
|
|
105
|
-
"chunks/local-community-BlGJFwN6.js": {
|
|
97
|
+
"chunks/local-community-B6IwJoBu.js": {
|
|
106
98
|
"isEntry": false,
|
|
107
99
|
"imports": [
|
|
108
100
|
"chunks/chunk-2rV9d50f.js",
|
|
109
|
-
"chunks/rpc-local-community-
|
|
110
|
-
"chunks/schema-
|
|
101
|
+
"chunks/rpc-local-community-D8woL19t.js",
|
|
102
|
+
"chunks/schema-C_l9RSe0.js",
|
|
111
103
|
"node:crypto",
|
|
112
104
|
"node:url",
|
|
113
105
|
"node:path",
|
|
@@ -160,13 +152,21 @@
|
|
|
160
152
|
"dist/node/runtime/node/community/local-community.js"
|
|
161
153
|
]
|
|
162
154
|
},
|
|
163
|
-
"chunks/
|
|
155
|
+
"chunks/local-community-BuseLMgO.js": {
|
|
156
|
+
"isEntry": false,
|
|
157
|
+
"imports": [
|
|
158
|
+
"chunks/local-community-B6IwJoBu.js"
|
|
159
|
+
],
|
|
160
|
+
"dynamicImports": [],
|
|
161
|
+
"inputs": []
|
|
162
|
+
},
|
|
163
|
+
"chunks/node-Dz5IKip2.js": {
|
|
164
164
|
"isEntry": false,
|
|
165
165
|
"imports": [
|
|
166
166
|
"chunks/chunk-2rV9d50f.js",
|
|
167
|
-
"chunks/rpc-local-community-
|
|
168
|
-
"chunks/schema-
|
|
169
|
-
"chunks/util-
|
|
167
|
+
"chunks/rpc-local-community-D8woL19t.js",
|
|
168
|
+
"chunks/schema-C_l9RSe0.js",
|
|
169
|
+
"chunks/util-bpDx_Vq2.js",
|
|
170
170
|
"path",
|
|
171
171
|
"assert",
|
|
172
172
|
"fs",
|
|
@@ -177,8 +177,8 @@
|
|
|
177
177
|
"rpc-websockets"
|
|
178
178
|
],
|
|
179
179
|
"dynamicImports": [
|
|
180
|
-
"chunks/helia-for-pkc-
|
|
181
|
-
"chunks/local-community-
|
|
180
|
+
"chunks/helia-for-pkc-x-xe-CrX.js",
|
|
181
|
+
"chunks/local-community-B6IwJoBu.js"
|
|
182
182
|
],
|
|
183
183
|
"inputs": [
|
|
184
184
|
"node_modules/zod/v4/locales/en.js",
|
|
@@ -231,11 +231,11 @@
|
|
|
231
231
|
"dist/node/index.js"
|
|
232
232
|
]
|
|
233
233
|
},
|
|
234
|
-
"chunks/rpc-local-community-
|
|
234
|
+
"chunks/rpc-local-community-D8woL19t.js": {
|
|
235
235
|
"isEntry": false,
|
|
236
236
|
"imports": [
|
|
237
237
|
"chunks/chunk-2rV9d50f.js",
|
|
238
|
-
"chunks/schema-
|
|
238
|
+
"chunks/schema-C_l9RSe0.js",
|
|
239
239
|
"chunks/src-CYIMjhjK.js",
|
|
240
240
|
"node:http",
|
|
241
241
|
"node:crypto",
|
|
@@ -791,7 +791,7 @@
|
|
|
791
791
|
"dist/node/community/rpc-local-community.js"
|
|
792
792
|
]
|
|
793
793
|
},
|
|
794
|
-
"chunks/schema-
|
|
794
|
+
"chunks/schema-C_l9RSe0.js": {
|
|
795
795
|
"isEntry": false,
|
|
796
796
|
"imports": [
|
|
797
797
|
"chunks/chunk-2rV9d50f.js",
|
|
@@ -805,7 +805,7 @@
|
|
|
805
805
|
"@libp2p/peer-id"
|
|
806
806
|
],
|
|
807
807
|
"dynamicImports": [
|
|
808
|
-
"chunks/src-
|
|
808
|
+
"chunks/src-o_MYSn-E.js"
|
|
809
809
|
],
|
|
810
810
|
"inputs": [
|
|
811
811
|
"node_modules/zod/v4/core/core.js",
|
|
@@ -883,70 +883,6 @@
|
|
|
883
883
|
"dist/node/pubsub-messages/schema.js"
|
|
884
884
|
]
|
|
885
885
|
},
|
|
886
|
-
"chunks/src-0J9-Tmgd.js": {
|
|
887
|
-
"isEntry": false,
|
|
888
|
-
"imports": [
|
|
889
|
-
"chunks/chunk-2rV9d50f.js",
|
|
890
|
-
"chunks/src-BOzgM7Fp.js",
|
|
891
|
-
"multiformats/cid",
|
|
892
|
-
"uint8arrays/from-string",
|
|
893
|
-
"uint8arrays/concat",
|
|
894
|
-
"uint8arrays/alloc",
|
|
895
|
-
"uint8arrays/equals",
|
|
896
|
-
"uint8arrays/with-array-buffer",
|
|
897
|
-
"multiformats/codecs/raw",
|
|
898
|
-
"multiformats/hashes/sha2",
|
|
899
|
-
"@multiformats/murmur3",
|
|
900
|
-
"blockstore-core/black-hole"
|
|
901
|
-
],
|
|
902
|
-
"dynamicImports": [],
|
|
903
|
-
"inputs": [
|
|
904
|
-
"node_modules/it-batch/dist/src/index.js",
|
|
905
|
-
"node_modules/it-parallel-batch/dist/src/index.js",
|
|
906
|
-
"node_modules/ipfs-unixfs-importer/node_modules/uint8arraylist/dist/src/index.js",
|
|
907
|
-
"node_modules/ipfs-unixfs-importer/dist/src/constants.js",
|
|
908
|
-
"node_modules/ipfs-unixfs-importer/dist/src/chunker/fixed-size.js",
|
|
909
|
-
"node_modules/ipfs-unixfs-importer/node_modules/ipfs-unixfs/dist/src/errors.js",
|
|
910
|
-
"node_modules/ipfs-unixfs-importer/node_modules/uint8-varint/dist/src/index.js",
|
|
911
|
-
"node_modules/ipfs-unixfs-importer/node_modules/protons-runtime/dist/src/utils/float.js",
|
|
912
|
-
"node_modules/ipfs-unixfs-importer/node_modules/protons-runtime/dist/src/utils/longbits.js",
|
|
913
|
-
"node_modules/ipfs-unixfs-importer/node_modules/protons-runtime/dist/src/utils/utf8.js",
|
|
914
|
-
"node_modules/ipfs-unixfs-importer/node_modules/protons-runtime/dist/src/utils/reader.js",
|
|
915
|
-
"node_modules/ipfs-unixfs-importer/node_modules/protons-runtime/dist/src/decode.js",
|
|
916
|
-
"node_modules/ipfs-unixfs-importer/node_modules/protons-runtime/dist/src/utils/pool.js",
|
|
917
|
-
"node_modules/ipfs-unixfs-importer/node_modules/protons-runtime/dist/src/utils/writer.js",
|
|
918
|
-
"node_modules/ipfs-unixfs-importer/node_modules/protons-runtime/dist/src/encode.js",
|
|
919
|
-
"node_modules/ipfs-unixfs-importer/node_modules/protons-runtime/dist/src/stream.js",
|
|
920
|
-
"node_modules/ipfs-unixfs-importer/node_modules/protons-runtime/dist/src/codec.js",
|
|
921
|
-
"node_modules/ipfs-unixfs-importer/node_modules/protons-runtime/dist/src/codecs/enum.js",
|
|
922
|
-
"node_modules/ipfs-unixfs-importer/node_modules/protons-runtime/dist/src/codecs/message.js",
|
|
923
|
-
"node_modules/ipfs-unixfs-importer/node_modules/protons-runtime/dist/src/index.js",
|
|
924
|
-
"node_modules/ipfs-unixfs-importer/node_modules/ipfs-unixfs/dist/src/unixfs.js",
|
|
925
|
-
"node_modules/ipfs-unixfs-importer/node_modules/ipfs-unixfs/dist/src/index.js",
|
|
926
|
-
"node_modules/progress-events/dist/src/index.js",
|
|
927
|
-
"node_modules/ipfs-unixfs-importer/dist/src/utils/persist.js",
|
|
928
|
-
"node_modules/ipfs-unixfs-importer/dist/src/dag-builder/buffer-importer.js",
|
|
929
|
-
"node_modules/ipfs-unixfs-importer/dist/src/errors.js",
|
|
930
|
-
"node_modules/ipfs-unixfs-importer/dist/src/dag-builder/dir.js",
|
|
931
|
-
"node_modules/ipfs-unixfs-importer/dist/src/dag-builder/file.js",
|
|
932
|
-
"node_modules/ipfs-unixfs-importer/dist/src/dag-builder/index.js",
|
|
933
|
-
"node_modules/ipfs-unixfs-importer/dist/src/dag-builder/validate-chunks.js",
|
|
934
|
-
"node_modules/ipfs-unixfs-importer/dist/src/layout/balanced.js",
|
|
935
|
-
"node_modules/ipfs-unixfs-importer/dist/src/dir.js",
|
|
936
|
-
"node_modules/ipfs-unixfs-importer/dist/src/utils/pb-size.js",
|
|
937
|
-
"node_modules/ipfs-unixfs-importer/dist/src/dir-flat.js",
|
|
938
|
-
"node_modules/sparse-array/index.js",
|
|
939
|
-
"node_modules/hamt-sharding/dist/src/bucket.js",
|
|
940
|
-
"node_modules/hamt-sharding/dist/src/consumable-buffer.js",
|
|
941
|
-
"node_modules/hamt-sharding/dist/src/consumable-hash.js",
|
|
942
|
-
"node_modules/hamt-sharding/dist/src/index.js",
|
|
943
|
-
"node_modules/ipfs-unixfs-importer/dist/src/dir-sharded.js",
|
|
944
|
-
"node_modules/ipfs-unixfs-importer/dist/src/flat-to-shard.js",
|
|
945
|
-
"node_modules/ipfs-unixfs-importer/dist/src/utils/to-path-components.js",
|
|
946
|
-
"node_modules/ipfs-unixfs-importer/dist/src/tree-builder.js",
|
|
947
|
-
"node_modules/ipfs-unixfs-importer/dist/src/index.js"
|
|
948
|
-
]
|
|
949
|
-
},
|
|
950
886
|
"chunks/src-4u0f92eE.js": {
|
|
951
887
|
"isEntry": false,
|
|
952
888
|
"imports": [
|
|
@@ -1228,10 +1164,76 @@
|
|
|
1228
1164
|
"node_modules/it-all/dist/src/index.js"
|
|
1229
1165
|
]
|
|
1230
1166
|
},
|
|
1231
|
-
"chunks/
|
|
1167
|
+
"chunks/src-o_MYSn-E.js": {
|
|
1168
|
+
"isEntry": false,
|
|
1169
|
+
"imports": [
|
|
1170
|
+
"chunks/chunk-2rV9d50f.js",
|
|
1171
|
+
"chunks/src-BOzgM7Fp.js",
|
|
1172
|
+
"multiformats/cid",
|
|
1173
|
+
"uint8arrays/from-string",
|
|
1174
|
+
"uint8arrays/concat",
|
|
1175
|
+
"uint8arrays/equals",
|
|
1176
|
+
"uint8arrays/alloc",
|
|
1177
|
+
"uint8arrays/with-array-buffer",
|
|
1178
|
+
"multiformats/codecs/raw",
|
|
1179
|
+
"multiformats/hashes/sha2",
|
|
1180
|
+
"@multiformats/murmur3",
|
|
1181
|
+
"blockstore-core/black-hole"
|
|
1182
|
+
],
|
|
1183
|
+
"dynamicImports": [],
|
|
1184
|
+
"inputs": [
|
|
1185
|
+
"node_modules/it-batch/dist/src/index.js",
|
|
1186
|
+
"node_modules/it-parallel-batch/dist/src/index.js",
|
|
1187
|
+
"node_modules/ipfs-unixfs-importer/node_modules/uint8arraylist/dist/src/index.js",
|
|
1188
|
+
"node_modules/ipfs-unixfs-importer/dist/src/constants.js",
|
|
1189
|
+
"node_modules/ipfs-unixfs-importer/dist/src/chunker/fixed-size.js",
|
|
1190
|
+
"node_modules/ipfs-unixfs-importer/node_modules/ipfs-unixfs/dist/src/errors.js",
|
|
1191
|
+
"node_modules/ipfs-unixfs-importer/node_modules/uint8-varint/dist/src/index.js",
|
|
1192
|
+
"node_modules/ipfs-unixfs-importer/node_modules/protons-runtime/dist/src/utils/float.js",
|
|
1193
|
+
"node_modules/ipfs-unixfs-importer/node_modules/protons-runtime/dist/src/utils/longbits.js",
|
|
1194
|
+
"node_modules/ipfs-unixfs-importer/node_modules/protons-runtime/dist/src/utils/utf8.js",
|
|
1195
|
+
"node_modules/ipfs-unixfs-importer/node_modules/protons-runtime/dist/src/utils/reader.js",
|
|
1196
|
+
"node_modules/ipfs-unixfs-importer/node_modules/protons-runtime/dist/src/decode.js",
|
|
1197
|
+
"node_modules/ipfs-unixfs-importer/node_modules/protons-runtime/dist/src/utils/pool.js",
|
|
1198
|
+
"node_modules/ipfs-unixfs-importer/node_modules/protons-runtime/dist/src/utils/writer.js",
|
|
1199
|
+
"node_modules/ipfs-unixfs-importer/node_modules/protons-runtime/dist/src/encode.js",
|
|
1200
|
+
"node_modules/ipfs-unixfs-importer/node_modules/protons-runtime/dist/src/stream.js",
|
|
1201
|
+
"node_modules/ipfs-unixfs-importer/node_modules/protons-runtime/dist/src/codec.js",
|
|
1202
|
+
"node_modules/ipfs-unixfs-importer/node_modules/protons-runtime/dist/src/codecs/enum.js",
|
|
1203
|
+
"node_modules/ipfs-unixfs-importer/node_modules/protons-runtime/dist/src/codecs/message.js",
|
|
1204
|
+
"node_modules/ipfs-unixfs-importer/node_modules/protons-runtime/dist/src/index.js",
|
|
1205
|
+
"node_modules/ipfs-unixfs-importer/node_modules/ipfs-unixfs/dist/src/unixfs.js",
|
|
1206
|
+
"node_modules/ipfs-unixfs-importer/node_modules/ipfs-unixfs/dist/src/index.js",
|
|
1207
|
+
"node_modules/progress-events/dist/src/index.js",
|
|
1208
|
+
"node_modules/ipfs-unixfs-importer/dist/src/utils/persist.js",
|
|
1209
|
+
"node_modules/ipfs-unixfs-importer/dist/src/dag-builder/buffer-importer.js",
|
|
1210
|
+
"node_modules/ipfs-unixfs-importer/dist/src/errors.js",
|
|
1211
|
+
"node_modules/ipfs-unixfs-importer/dist/src/dag-builder/dir.js",
|
|
1212
|
+
"node_modules/ipfs-unixfs-importer/dist/src/dag-builder/file.js",
|
|
1213
|
+
"node_modules/ipfs-unixfs-importer/dist/src/dag-builder/index.js",
|
|
1214
|
+
"node_modules/ipfs-unixfs-importer/dist/src/dag-builder/validate-chunks.js",
|
|
1215
|
+
"node_modules/ipfs-unixfs-importer/dist/src/layout/balanced.js",
|
|
1216
|
+
"node_modules/ipfs-unixfs-importer/dist/src/dir.js",
|
|
1217
|
+
"node_modules/ipfs-unixfs-importer/dist/src/utils/pb-size.js",
|
|
1218
|
+
"node_modules/ipfs-unixfs-importer/dist/src/dir-flat.js",
|
|
1219
|
+
"node_modules/sparse-array/index.js",
|
|
1220
|
+
"node_modules/hamt-sharding/dist/src/bucket.js",
|
|
1221
|
+
"node_modules/hamt-sharding/dist/src/consumable-buffer.js",
|
|
1222
|
+
"node_modules/hamt-sharding/dist/src/consumable-hash.js",
|
|
1223
|
+
"node_modules/hamt-sharding/dist/src/index.js",
|
|
1224
|
+
"node_modules/ipfs-unixfs-importer/dist/src/dir-sharded.js",
|
|
1225
|
+
"node_modules/ipfs-unixfs-importer/dist/src/flat-to-shard.js",
|
|
1226
|
+
"node_modules/ipfs-unixfs-importer/dist/src/utils/to-path-components.js",
|
|
1227
|
+
"node_modules/ipfs-unixfs-importer/dist/src/tree-builder.js",
|
|
1228
|
+
"node_modules/ipfs-unixfs-importer/dist/src/index.js"
|
|
1229
|
+
]
|
|
1230
|
+
},
|
|
1231
|
+
"chunks/util-bpDx_Vq2.js": {
|
|
1232
1232
|
"isEntry": false,
|
|
1233
1233
|
"imports": [
|
|
1234
|
-
"chunks/schema-
|
|
1234
|
+
"chunks/schema-C_l9RSe0.js",
|
|
1235
|
+
"ipns/selector",
|
|
1236
|
+
"uint8arrays/equals"
|
|
1235
1237
|
],
|
|
1236
1238
|
"dynamicImports": [],
|
|
1237
1239
|
"inputs": [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as hideClassPrivateProps, R as ipnsNameToIpnsOverPubsubTopic, _r as PKCError, yr as logger_default } from "./schema-
|
|
2
|
-
import {
|
|
1
|
+
import { L as hideClassPrivateProps, R as ipnsNameToIpnsOverPubsubTopic, _r as PKCError, yr as logger_default } from "./schema-C_l9RSe0.js";
|
|
2
|
+
import { a as selectBitswapSessionSeedPeers, i as getHeliaDebugContext, n as connectToPubsubPeers, r as directFetchIpnsRecordFromProviders, t as cacheIpnsRecordInPubsubLocalStore } from "./util-bpDx_Vq2.js";
|
|
3
3
|
import { CID } from "multiformats/cid";
|
|
4
4
|
import { peerIdFromString } from "@libp2p/peer-id";
|
|
5
5
|
import { EventEmitter as EventEmitter$1 } from "events";
|
|
@@ -181,7 +181,9 @@ async function createLibp2pJsClientOrUseExistingOne(pkcOptions) {
|
|
|
181
181
|
}, ms);
|
|
182
182
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
183
183
|
});
|
|
184
|
-
const
|
|
184
|
+
const ipnsPubsubRouter = pubsub(helia);
|
|
185
|
+
const ipnsPubsubLocalStore = ipnsPubsubRouter.localStore;
|
|
186
|
+
const ipnsNameResolver = ipns(helia, { routers: [ipnsPubsubRouter] });
|
|
185
187
|
ipnsNameResolver.routers = ipnsNameResolver.routers.filter((r) => r?.constructor?.name !== "LocalStoreRouting");
|
|
186
188
|
const WARMUP_MAX_PEERS = 4;
|
|
187
189
|
const warmupPromisesByTopic = /* @__PURE__ */ new Map();
|
|
@@ -240,7 +242,17 @@ async function createLibp2pJsClientOrUseExistingOne(pkcOptions) {
|
|
|
240
242
|
source: direct.source,
|
|
241
243
|
peerId: direct.peerId
|
|
242
244
|
};
|
|
243
|
-
|
|
245
|
+
const record = unmarshalIPNSRecord(direct.recordBytes);
|
|
246
|
+
try {
|
|
247
|
+
await cacheIpnsRecordInPubsubLocalStore({
|
|
248
|
+
localStore: ipnsPubsubLocalStore,
|
|
249
|
+
routingKey,
|
|
250
|
+
marshalledRecord: direct.recordBytes
|
|
251
|
+
});
|
|
252
|
+
} catch (cacheErr) {
|
|
253
|
+
log.trace("Failed to cache direct-fetched IPNS record at the pubsub routing layer for", ipnsPubsubTopic, cacheErr);
|
|
254
|
+
}
|
|
255
|
+
yield record.value;
|
|
244
256
|
return;
|
|
245
257
|
}
|
|
246
258
|
directFetchOutcome = {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
|
|
2
|
-
import { $ as pubsubTopicToDhtKey, $n as t$7, At as trackStartedCommunity, Bt as CommunityEditPublicationPubsubReservedFields, C as contentContainsMarkdownAudio, Ct as findUpdatingCommunity, En as CommentUpdateSchema, F as getIpnsRecordInLocalKuboNode, Fn as CommentEditPubsubMessagePublicationSchema, Ft as untrackUpdatingCommunity, G as isLinkOfAudio, Gt as CommentModerationPubsubMessagePublicationSchema, In as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, It as require_sha256, J as isLinkOfVideo, Jt as CommentModerationsTableRowSchema, K as isLinkOfImage, Kt as CommentModerationReservedFields, L as hideClassPrivateProps, Ln as CommentEditReservedFields, M as genToArray, Mr as ZodError, Mt as trackUpdatingCommunity, N as getEquivalentCommunityAddresses, Nt as untrackStartedCommunity, O as derivePublicationFromChallengeRequest, On as CommentUpdateTableRowSchema, P as getErrorCodeFromMessage, Q as isStringDomain, Qn as n$3, R as ipnsNameToIpnsOverPubsubTopic, Rt as pTimeout, S as calculateStringSizeSameAsIpfsAddCidV0, T as contentContainsMarkdownVideos, Un as AuthorReservedFields, W as isLinkOfAnimatedImage, Xn as n$4, Y as isLinkValid, Zn as t$8, _r as PKCError, _t as timestamp, a as ChallengeRequestMessageSchema, ar as t$4, at as removeNullUndefinedValues, b as areEquivalentCommunityAddresses, bt as findCommunityInRegistry, cr as t$5, d as DecryptedChallengeRequestSchema, dr as require_retry, dt as retryKuboIpfsAddAndProvide, er as t$6, fn as VotePubsubMessagePublicationSchema, hn as VoteTablesRowSchema, ht as statMfsPathSafely, ir as r$1, k as doesDomainAddressHaveCapitalLetter, kn as CommentsTableRowSchema, kt as syncCommunityRegistryEntry, lr as t$3, lt as retryKuboBlockPutPinAndProvidePubsubTopic, mt as sleepUntilTimeoutOrAbort, nn as CommunityIpfsSchema, nr as e$1, nt as removeBlocksFromKuboNode, pn as VotePubsubReservedFields, q as isLinkOfMedia, r as ChallengeMessageSchema, rn as CommunitySignedPropertyNames, rt as removeMfsFilesSafely, s as ChallengeVerificationMessageSchema, t as ChallengeAnswerMessageSchema, tr as e, u as DecryptedChallengeRequestPublicationSchema, vn as CommentIpfsSchema, vr as messages, w as contentContainsMarkdownImages, x as calculateIpfsCidV0, xt as findStartedCommunity, y as version_default, yn as CommentPubsubMessageReservedFields, yr as logger_default, yt as writeKuboFilesWithTimeout, zn as CommentEditsTableRowSchema } from "./schema-
|
|
3
|
-
import { $n as t$10, A as deriveDbPosts, At as verifyCommunityEdit, Bt as getCommunityPublicKeyFromWire, C as BackupAbortError, Dt as verifyCommentPubsubMessage, E as calculateInlineRepliesBudget, Et as verifyCommentModeration, F as importSignerIntoKuboNode, Ft as getAuthorNameFromWire, G as REPLY_REPLIES_SORT_TYPES, Gt as getIpfsKeyFromPrivateKey, Ht as decode, Jn as r$2, Jt as getPublicKeyFromPrivateKey, K as TIMEFRAMES_TO_SECONDS, Kn as t$9, Kt as getPKCAddressFromPublicKey, M as getDefaultCommunityDbConfig, Mt as buildRuntimeAuthor, Nt as cleanWireAuthor, O as deleteOldCommunityInWindows, Ot as verifyCommentUpdate, P as getThumbnailPropsOfLink, R as moveCommunityDbToDeletedDirectory, S as encryptEd25519AesGcmPublicKeyBuffer, St as verifyChallengeRequest, T as calculateExpectedSignatureSize, Tt as verifyCommentIpfs, U as POSTS_SORT_TYPES, Ut as encode, W as POST_REPLIES_SORT_TYPES, Xn as n$6, Yn as t$11, Yt as createSchemaRowParser, Z as iterateOverPageCidsToFindAllCids, Zn as n$5, _ as SignerWithPublicKeyAddress, _t as signCommunity, a as pkcJsChallenges, b as decryptEd25519AesGcmPublicKeyBuffer, bt as verifyChallengeAnswer, cn as parseCommunityIpfsSchemaPassthroughWithPKCErrorIfItFails, d as MAX_FILE_SIZE_BYTES_FOR_COMMUNITY_IPFS, dt as signChallengeVerification, er as stringify, f as KeyvBetterSqlite3, ft as signComment, gt as signCommentUpdateForChallengeVerification, ht as signCommentUpdate, i as getCommunityChallengeFromCommunityChallengeSettings, it as pLimit, j as deriveDbReplies, jt as verifyVote, k as deriveCommentIpfsFromCommentTableRow, kt as verifyCommunity, l as normalizeSelfAddrsForProvider, lt as signChallengeMessage, nr as require_lodash_merge, o as TrackedInstanceRegistry, on as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, pt as signCommentEdit, qn as t$12, qt as getPKCAddressFromPublicKeySync, r as getChallengeVerification, s as LRUCache, st as cleanUpBeforePublishing, t as RpcLocalCommunity, tr as STORAGE_KEYS, vn as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, w as backupCommunityDb, wt as verifyCommentEdit, xn as parseJsonWithPKCErrorIfFails, z as resolveDbPostsCidRefs, zt as getCommunityNameFromWire } from "./rpc-local-community-
|
|
2
|
+
import { $ as pubsubTopicToDhtKey, $n as t$7, At as trackStartedCommunity, Bt as CommunityEditPublicationPubsubReservedFields, C as contentContainsMarkdownAudio, Ct as findUpdatingCommunity, En as CommentUpdateSchema, F as getIpnsRecordInLocalKuboNode, Fn as CommentEditPubsubMessagePublicationSchema, Ft as untrackUpdatingCommunity, G as isLinkOfAudio, Gt as CommentModerationPubsubMessagePublicationSchema, In as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, It as require_sha256, J as isLinkOfVideo, Jt as CommentModerationsTableRowSchema, K as isLinkOfImage, Kt as CommentModerationReservedFields, L as hideClassPrivateProps, Ln as CommentEditReservedFields, M as genToArray, Mr as ZodError, Mt as trackUpdatingCommunity, N as getEquivalentCommunityAddresses, Nt as untrackStartedCommunity, O as derivePublicationFromChallengeRequest, On as CommentUpdateTableRowSchema, P as getErrorCodeFromMessage, Q as isStringDomain, Qn as n$3, R as ipnsNameToIpnsOverPubsubTopic, Rt as pTimeout, S as calculateStringSizeSameAsIpfsAddCidV0, T as contentContainsMarkdownVideos, Un as AuthorReservedFields, W as isLinkOfAnimatedImage, Xn as n$4, Y as isLinkValid, Zn as t$8, _r as PKCError, _t as timestamp, a as ChallengeRequestMessageSchema, ar as t$4, at as removeNullUndefinedValues, b as areEquivalentCommunityAddresses, bt as findCommunityInRegistry, cr as t$5, d as DecryptedChallengeRequestSchema, dr as require_retry, dt as retryKuboIpfsAddAndProvide, er as t$6, fn as VotePubsubMessagePublicationSchema, hn as VoteTablesRowSchema, ht as statMfsPathSafely, ir as r$1, k as doesDomainAddressHaveCapitalLetter, kn as CommentsTableRowSchema, kt as syncCommunityRegistryEntry, lr as t$3, lt as retryKuboBlockPutPinAndProvidePubsubTopic, mt as sleepUntilTimeoutOrAbort, nn as CommunityIpfsSchema, nr as e$1, nt as removeBlocksFromKuboNode, pn as VotePubsubReservedFields, q as isLinkOfMedia, r as ChallengeMessageSchema, rn as CommunitySignedPropertyNames, rt as removeMfsFilesSafely, s as ChallengeVerificationMessageSchema, t as ChallengeAnswerMessageSchema, tr as e, u as DecryptedChallengeRequestPublicationSchema, vn as CommentIpfsSchema, vr as messages, w as contentContainsMarkdownImages, x as calculateIpfsCidV0, xt as findStartedCommunity, y as version_default, yn as CommentPubsubMessageReservedFields, yr as logger_default, yt as writeKuboFilesWithTimeout, zn as CommentEditsTableRowSchema } from "./schema-C_l9RSe0.js";
|
|
3
|
+
import { $n as t$10, A as deriveDbPosts, At as verifyCommunityEdit, Bt as getCommunityPublicKeyFromWire, C as BackupAbortError, Dt as verifyCommentPubsubMessage, E as calculateInlineRepliesBudget, Et as verifyCommentModeration, F as importSignerIntoKuboNode, Ft as getAuthorNameFromWire, G as REPLY_REPLIES_SORT_TYPES, Gt as getIpfsKeyFromPrivateKey, Ht as decode, Jn as r$2, Jt as getPublicKeyFromPrivateKey, K as TIMEFRAMES_TO_SECONDS, Kn as t$9, Kt as getPKCAddressFromPublicKey, M as getDefaultCommunityDbConfig, Mt as buildRuntimeAuthor, Nt as cleanWireAuthor, O as deleteOldCommunityInWindows, Ot as verifyCommentUpdate, P as getThumbnailPropsOfLink, R as moveCommunityDbToDeletedDirectory, S as encryptEd25519AesGcmPublicKeyBuffer, St as verifyChallengeRequest, T as calculateExpectedSignatureSize, Tt as verifyCommentIpfs, U as POSTS_SORT_TYPES, Ut as encode, W as POST_REPLIES_SORT_TYPES, Xn as n$6, Yn as t$11, Yt as createSchemaRowParser, Z as iterateOverPageCidsToFindAllCids, Zn as n$5, _ as SignerWithPublicKeyAddress, _t as signCommunity, a as pkcJsChallenges, b as decryptEd25519AesGcmPublicKeyBuffer, bt as verifyChallengeAnswer, cn as parseCommunityIpfsSchemaPassthroughWithPKCErrorIfItFails, d as MAX_FILE_SIZE_BYTES_FOR_COMMUNITY_IPFS, dt as signChallengeVerification, er as stringify, f as KeyvBetterSqlite3, ft as signComment, gt as signCommentUpdateForChallengeVerification, ht as signCommentUpdate, i as getCommunityChallengeFromCommunityChallengeSettings, it as pLimit, j as deriveDbReplies, jt as verifyVote, k as deriveCommentIpfsFromCommentTableRow, kt as verifyCommunity, l as normalizeSelfAddrsForProvider, lt as signChallengeMessage, nr as require_lodash_merge, o as TrackedInstanceRegistry, on as parseCommunityEditOptionsSchemaWithPKCErrorIfItFails, pt as signCommentEdit, qn as t$12, qt as getPKCAddressFromPublicKeySync, r as getChallengeVerification, s as LRUCache, st as cleanUpBeforePublishing, t as RpcLocalCommunity, tr as STORAGE_KEYS, vn as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, w as backupCommunityDb, wt as verifyCommentEdit, xn as parseJsonWithPKCErrorIfFails, z as resolveDbPostsCidRefs, zt as getCommunityNameFromWire } from "./rpc-local-community-D8woL19t.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 from "path";
|
|
9
|
+
import path$1 from "path";
|
|
10
10
|
import assert from "assert";
|
|
11
11
|
import fs from "fs";
|
|
12
12
|
import Database from "better-sqlite3";
|
|
@@ -77,7 +77,8 @@ function calculateLocalMfsPathForCommentUpdate(community, postDbComment, timesta
|
|
|
77
77
|
"update"
|
|
78
78
|
].join("/");
|
|
79
79
|
}
|
|
80
|
-
async function calculateNewCommentUpdate(
|
|
80
|
+
async function calculateNewCommentUpdate(opts) {
|
|
81
|
+
const { community, comment, batchStartTimestamp } = opts;
|
|
81
82
|
const log = logger_default("pkc-js:local-community:_calculateNewCommentUpdate");
|
|
82
83
|
log.trace(`Attempting to calculate new CommentUpdate for comment (${comment.cid}) on community`, community.address);
|
|
83
84
|
const storedCommentUpdate = community._dbHandler.queryCommentUpdateTimestampBucketReplies({ cid: comment.cid });
|
|
@@ -139,7 +140,7 @@ async function calculateNewCommentUpdate(community, comment) {
|
|
|
139
140
|
}),
|
|
140
141
|
postUpdatesBucket: newPostUpdateBucket,
|
|
141
142
|
publishedToPostUpdatesMFS: false,
|
|
142
|
-
insertedAt:
|
|
143
|
+
insertedAt: batchStartTimestamp
|
|
143
144
|
},
|
|
144
145
|
localMfsPath: newLocalMfsPath,
|
|
145
146
|
pendingApproval: comment.pendingApproval
|
|
@@ -166,6 +167,7 @@ async function validateCommentUpdateSignature(community, newCommentUpdate, comme
|
|
|
166
167
|
}
|
|
167
168
|
async function updateCommentsThatNeedToBeUpdated(community) {
|
|
168
169
|
const log = logger_default(`pkc-js:local-community:_updateCommentsThatNeedToBeUpdated`);
|
|
170
|
+
const batchStartTimestamp = timestamp();
|
|
169
171
|
const commentsToUpdate = community._dbHandler.queryCommentsToBeUpdated();
|
|
170
172
|
if (commentsToUpdate.length === 0) return [];
|
|
171
173
|
community._communityUpdateTrigger = true;
|
|
@@ -181,7 +183,11 @@ async function updateCommentsThatNeedToBeUpdated(community) {
|
|
|
181
183
|
for (const depthKey of depthsKeySorted) {
|
|
182
184
|
const commentsAtDepth = commentsByDepth[depthKey];
|
|
183
185
|
const depthLimit = pLimit(50);
|
|
184
|
-
const depthUpdatePromises = commentsAtDepth.map((comment) => depthLimit(async () => await calculateNewCommentUpdate(
|
|
186
|
+
const depthUpdatePromises = commentsAtDepth.map((comment) => depthLimit(async () => await calculateNewCommentUpdate({
|
|
187
|
+
community,
|
|
188
|
+
comment,
|
|
189
|
+
batchStartTimestamp
|
|
190
|
+
})));
|
|
185
191
|
const depthResults = await Promise.all(depthUpdatePromises);
|
|
186
192
|
community._dbHandler.upsertCommentUpdates(depthResults.map((r) => r.newCommentUpdateToWriteToDb));
|
|
187
193
|
postUpdateRows.push(...depthResults);
|
|
@@ -3273,9 +3279,9 @@ var DbHandler = class {
|
|
|
3273
3279
|
if (needToMigrate) {
|
|
3274
3280
|
if (dbExistsAlready && currentDbVersion > 0) {
|
|
3275
3281
|
this.destoryConnection();
|
|
3276
|
-
backupDbPath = path.join(path.dirname(dbPath), ".backup_before_migration", `${path.basename(dbPath)}.${currentDbVersion}.${timestamp()}`);
|
|
3277
|
-
log(`Copying db ${path.basename(dbPath)} to ${backupDbPath} before migration`);
|
|
3278
|
-
if (!fs.existsSync(path.dirname(backupDbPath))) await fs.promises.mkdir(path.dirname(backupDbPath), { recursive: true });
|
|
3282
|
+
backupDbPath = path$1.join(path$1.dirname(dbPath), ".backup_before_migration", `${path$1.basename(dbPath)}.${currentDbVersion}.${timestamp()}`);
|
|
3283
|
+
log(`Copying db ${path$1.basename(dbPath)} to ${backupDbPath} before migration`);
|
|
3284
|
+
if (!fs.existsSync(path$1.dirname(backupDbPath))) await fs.promises.mkdir(path$1.dirname(backupDbPath), { recursive: true });
|
|
3279
3285
|
const sourceDb = new Database(dbPath, { fileMustExist: true });
|
|
3280
3286
|
await sourceDb.backup(backupDbPath);
|
|
3281
3287
|
sourceDb.close();
|
|
@@ -5078,10 +5084,10 @@ var DbHandler = class {
|
|
|
5078
5084
|
if (this._db || this._keyv) await this.destoryConnection();
|
|
5079
5085
|
this._transactionDepth = 0;
|
|
5080
5086
|
const dataPath = this._community._pkc.dataPath;
|
|
5081
|
-
const oldPathString = path.join(dataPath, "communities", oldDbName);
|
|
5082
|
-
const newPathString = path.join(dataPath, "communities", newDbName);
|
|
5083
|
-
await fs.promises.mkdir(path.dirname(oldPathString), { recursive: true });
|
|
5084
|
-
await fs.promises.mkdir(path.dirname(newPathString), { recursive: true });
|
|
5087
|
+
const oldPathString = path$1.join(dataPath, "communities", oldDbName);
|
|
5088
|
+
const newPathString = path$1.join(dataPath, "communities", newDbName);
|
|
5089
|
+
await fs.promises.mkdir(path$1.dirname(oldPathString), { recursive: true });
|
|
5090
|
+
await fs.promises.mkdir(path$1.dirname(newPathString), { recursive: true });
|
|
5085
5091
|
try {
|
|
5086
5092
|
if (!fs.existsSync(oldPathString)) log(`Old DB file ${oldPathString} does not exist. Cannot backup/rename.`);
|
|
5087
5093
|
else {
|
|
@@ -5103,8 +5109,8 @@ var DbHandler = class {
|
|
|
5103
5109
|
}
|
|
5104
5110
|
async lockCommunityStart(communityAddress = this._community.address) {
|
|
5105
5111
|
const log = logger_default("pkc-js:local-community:db-handler:lock:start");
|
|
5106
|
-
const lockfilePath = path.join(this._community._pkc.dataPath, "communities", `${communityAddress}.start.lock`);
|
|
5107
|
-
const communityDbPath = path.join(this._community._pkc.dataPath, "communities", communityAddress);
|
|
5112
|
+
const lockfilePath = path$1.join(this._community._pkc.dataPath, "communities", `${communityAddress}.start.lock`);
|
|
5113
|
+
const communityDbPath = path$1.join(this._community._pkc.dataPath, "communities", communityAddress);
|
|
5108
5114
|
try {
|
|
5109
5115
|
await import_src.default.lock(communityDbPath, {
|
|
5110
5116
|
lockfilePath,
|
|
@@ -5125,8 +5131,8 @@ var DbHandler = class {
|
|
|
5125
5131
|
async unlockCommunityStart(communityAddress = this._community.address) {
|
|
5126
5132
|
const log = logger_default("pkc-js:local-community:db-handler:unlock:start");
|
|
5127
5133
|
log.trace(`Attempting to unlock the start of community (${communityAddress})`);
|
|
5128
|
-
const lockfilePath = path.join(this._community._pkc.dataPath, "communities", `${communityAddress}.start.lock`);
|
|
5129
|
-
const communityDbPath = path.join(this._community._pkc.dataPath, "communities", communityAddress);
|
|
5134
|
+
const lockfilePath = path$1.join(this._community._pkc.dataPath, "communities", `${communityAddress}.start.lock`);
|
|
5135
|
+
const communityDbPath = path$1.join(this._community._pkc.dataPath, "communities", communityAddress);
|
|
5130
5136
|
if (!fs.existsSync(lockfilePath) || !fs.existsSync(communityDbPath)) return;
|
|
5131
5137
|
try {
|
|
5132
5138
|
await import_src.default.unlock(communityDbPath, { lockfilePath });
|
|
@@ -5137,8 +5143,8 @@ var DbHandler = class {
|
|
|
5137
5143
|
}
|
|
5138
5144
|
}
|
|
5139
5145
|
async isCommunityStartLocked(communityAddress = this._community.address) {
|
|
5140
|
-
const lockfilePath = path.join(this._community._pkc.dataPath, "communities", `${communityAddress}.start.lock`);
|
|
5141
|
-
const communityDbPath = path.join(this._community._pkc.dataPath, "communities", communityAddress);
|
|
5146
|
+
const lockfilePath = path$1.join(this._community._pkc.dataPath, "communities", `${communityAddress}.start.lock`);
|
|
5147
|
+
const communityDbPath = path$1.join(this._community._pkc.dataPath, "communities", communityAddress);
|
|
5142
5148
|
return await import_src.default.check(communityDbPath, {
|
|
5143
5149
|
lockfilePath,
|
|
5144
5150
|
realpath: false,
|
|
@@ -5147,8 +5153,8 @@ var DbHandler = class {
|
|
|
5147
5153
|
}
|
|
5148
5154
|
async lockCommunityState() {
|
|
5149
5155
|
const log = logger_default("pkc-js:local-community:db-handler:lock:lockCommunityState");
|
|
5150
|
-
const lockfilePath = path.join(this._community._pkc.dataPath, "communities", `${this._community.address}.state.lock`);
|
|
5151
|
-
const communityDbPath = path.join(this._community._pkc.dataPath, "communities", this._community.address);
|
|
5156
|
+
const lockfilePath = path$1.join(this._community._pkc.dataPath, "communities", `${this._community.address}.state.lock`);
|
|
5157
|
+
const communityDbPath = path$1.join(this._community._pkc.dataPath, "communities", this._community.address);
|
|
5152
5158
|
try {
|
|
5153
5159
|
await import_src.default.lock(communityDbPath, {
|
|
5154
5160
|
lockfilePath,
|
|
@@ -5165,8 +5171,8 @@ var DbHandler = class {
|
|
|
5165
5171
|
}
|
|
5166
5172
|
async unlockCommunityState() {
|
|
5167
5173
|
const log = logger_default("pkc-js:local-community:db-handler:lock:unlockCommunityState");
|
|
5168
|
-
const lockfilePath = path.join(this._community._pkc.dataPath, "communities", `${this._community.address}.state.lock`);
|
|
5169
|
-
const communityDbPath = path.join(this._community._pkc.dataPath, "communities", this._community.address);
|
|
5174
|
+
const lockfilePath = path$1.join(this._community._pkc.dataPath, "communities", `${this._community.address}.state.lock`);
|
|
5175
|
+
const communityDbPath = path$1.join(this._community._pkc.dataPath, "communities", this._community.address);
|
|
5170
5176
|
if (!fs.existsSync(lockfilePath)) return;
|
|
5171
5177
|
try {
|
|
5172
5178
|
await import_src.default.unlock(communityDbPath, { lockfilePath });
|
|
@@ -5176,7 +5182,7 @@ var DbHandler = class {
|
|
|
5176
5182
|
}
|
|
5177
5183
|
}
|
|
5178
5184
|
communityDbExists() {
|
|
5179
|
-
const communityDbPath = path.join(this._community._pkc.dataPath, "communities", this._community.address);
|
|
5185
|
+
const communityDbPath = path$1.join(this._community._pkc.dataPath, "communities", this._community.address);
|
|
5180
5186
|
return fs.existsSync(communityDbPath);
|
|
5181
5187
|
}
|
|
5182
5188
|
markCommentsAsPublishedToPostUpdates(commentCids) {
|
|
@@ -6867,11 +6873,11 @@ async function edit(community, newCommunityOptions) {
|
|
|
6867
6873
|
const EXPORTS_KEY = STORAGE_KEYS[STORAGE_KEYS.EXPORTS];
|
|
6868
6874
|
function defaultExportPathFor(community, exportId) {
|
|
6869
6875
|
if (typeof community._pkc.dataPath !== "string") throw new PKCError("ERR_DATA_PATH_IS_NOT_DEFINED", { communityAddress: community.address });
|
|
6870
|
-
return
|
|
6876
|
+
return path.join(community._pkc.dataPath, "exports", `${exportId}.sqlite`);
|
|
6871
6877
|
}
|
|
6872
6878
|
function sourceDbPathFor(community) {
|
|
6873
6879
|
if (typeof community._pkc.dataPath !== "string") throw new PKCError("ERR_DATA_PATH_IS_NOT_DEFINED", { communityAddress: community.address });
|
|
6874
|
-
return
|
|
6880
|
+
return path.join(community._pkc.dataPath, "communities", community.address);
|
|
6875
6881
|
}
|
|
6876
6882
|
async function persistExports(community) {
|
|
6877
6883
|
if (!community._dbHandler) return;
|
|
@@ -6947,9 +6953,9 @@ async function runExportTask(community, exportId, opts) {
|
|
|
6947
6953
|
async function exportCommunityEmbedded(community, options = {}) {
|
|
6948
6954
|
if (options.signal?.aborted) throw options.signal.reason ?? new DOMException("The operation was aborted.", "AbortError");
|
|
6949
6955
|
const exportId = v4();
|
|
6950
|
-
const destPath = options.exportPath ?
|
|
6956
|
+
const destPath = options.exportPath ? path.resolve(options.exportPath) : defaultExportPathFor(community, exportId);
|
|
6951
6957
|
const includePrivateKey = options.includePrivateKey === true;
|
|
6952
|
-
if (
|
|
6958
|
+
if (path.resolve(destPath) === path.resolve(sourceDbPathFor(community))) throw new PKCError("ERR_EXPORT_PATH_TARGETS_LIVE_DB", {
|
|
6953
6959
|
communityAddress: community.address,
|
|
6954
6960
|
exportPath: destPath
|
|
6955
6961
|
});
|
|
@@ -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-B6IwJoBu.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 { B as isIpfsCid, Cn as CommentUpdateForChallengeVerificationSchema, Ct as findUpdatingCommunity, D as deepMergeRuntimeFields, Dt as refreshTrackedCommentAliases, E as createAbortError, En as CommentUpdateSchema, Et as listUpdatingCommunities, Fr as stringifyPrimitive, H as isIpns, It as require_sha256, L as hideClassPrivateProps, Lt as TimeoutError, Nr as joinValues, Pr as parsedType, Pt as untrackUpdatingComment, Q as isStringDomain, Qn as n$1, R as ipnsNameToIpnsOverPubsubTopic, Rt as pTimeout, Sr as setErrorMap, St as findUpdatingComment, Tt as listUpdatingComments, Xn as n$2, _r as PKCError, _t as timestamp, a as ChallengeRequestMessageSchema, b as areEquivalentCommunityAddresses, br as require_supports_color, cn as PubsubTopicSchema, ct as resolveWhenPredicateIsTrue, dr as require_retry, er as t$1, fr as FailedToFetchCommentIpfsFromGatewaysError, ft as shortifyAddress, ir as r, jt as trackUpdatingComment, k as doesDomainAddressHaveCapitalLetter, mt as sleepUntilTimeoutOrAbort, nn as CommunityIpfsSchema, nr as e$1, ot as removeUndefinedValuesRecursively, pt as shortifyCid, r as ChallengeMessageSchema, s as ChallengeVerificationMessageSchema, st as replaceXWithY, t as ChallengeAnswerMessageSchema, tr as e, ut as retryKuboIpfsAdd, vn as CommentIpfsSchema, vr as messages, vt as waitForUpdateInCommunityInstanceWithErrorAndTimeout, wt as listStartedCommunities, xt as findStartedCommunity, y as version_default, yr as logger_default, z as isAbortError } from "./schema-
|
|
3
|
-
import { $ as RepliesPages, $n as t$5, $t as parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, An as RpcCidParamSchema, At as verifyCommunityEdit, B as setNativeFunctions$1, Bn as RpcFetchCidResultSchema, Bt as getCommunityPublicKeyFromWire, Cn as parseRpcCommentEventWithPKCErrorIfItFails, Ct as verifyChallengeVerification, D as createKuboRpcClient, Dn as parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails, Dt as verifyCommentPubsubMessage, Et as verifyCommentModeration, Fn as RpcExportCommunityModLogsParamSchema, Gn as RpcUnsubscribeParamSchema, H as CommentClientsManager, Hn as RpcResolveAuthorNameResultSchema, Ht as decode, I as listCommunitiesSync, In as RpcExportCommunityModLogsResultSchema, It as normalizeCreatePublicationAuthor, Kn as t$4, L as monitorCommunitiesDirectory, Ln as RpcExportCommunityParamSchema, Lt as buildRuntimeCommunityFields, Mn as RpcCommunityIdentifierParamSchema, Mt as buildRuntimeAuthor, N as getDefaultDataPath, Nn as RpcCommunityPageParamSchema, Nt as cleanWireAuthor, On as RpcAuthorNameParamSchema, Ot as verifyCommentUpdate, Pn as RpcEditCommunityParamSchema, Pt as getAuthorNameFromRuntime, Q as parseRawPages, Qn as t$2, Rn as RpcExportCommunityResultSchema, Rt as getCommunityAddressFromRecord, Sn as parsePKCUserOptionsSchemaWithPKCErrorIfItFails, Tn as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, Tt as verifyCommentIpfs, Un as RpcSubscriptionIdResultSchema, V as tryToDeleteCommunitiesThatFailedToBeDeletedBefore, Vn as RpcPublishChallengeAnswersParamSchema, Vt as normalizeCommunityInputFromCommunity, Wn as RpcSuccessResultSchema, Wt as getBufferedPKCAddressFromPublicKey, X as findCommentInPageInstanceRecursively, Xn as n$3, Xt as parseCidStringSchemaWithPKCErrorIfItFails, Y as extractCommunityRuntimeFieldsFromParsedPages, Yn as t$3, _n as parseCreateVoteOptionsSchemaWithPKCErrorIfItFails, a as pkcJsChallenges, at as PKCTypedEmitter, bn as parseDecryptedChallengeWithPKCErrorIfItFails, c as AddressesRewriterProxyServer, ct as signChallengeAnswer, dn as parseCreateCommentOptionsSchemaWithPKCErrorIfItFails, en as parseCommentIpfsSchemaWithPKCErrorIfItFails, et as PublicationClientsManager, f as KeyvBetterSqlite3, fn as parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails, ft as signComment, g as decodeRpcChallengeVerificationPubsubMsg, gn as parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, h as decodeRpcChallengeRequestPubsubMsg, hn as parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, in as parseCommunityAddressWithPKCErrorIfItFails, ir as require_undici, jn as RpcCommentRepliesPageParamSchema, jt as verifyVote, kn as RpcCancelExportParamSchema, ln as parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails, m as decodeRpcChallengePubsubMsg, mt as signCommentModeration, n as RpcRemoteCommunity, nn as parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails, nt as InflightFetchManager, o as TrackedInstanceRegistry, ot as require_lib$1, p as decodeRpcChallengeAnswerPubsubMsg, pt as signCommentEdit, rn as parseCommentPubsubMessagePublicationWithPKCErrorIfItFails, rr as nativeFunctions$2, s as LRUCache, sn as parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, st as cleanUpBeforePublishing, t as RpcLocalCommunity, tt as PKCClientsManager, u as RemoteCommunity, un as parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails, ut as signChallengeRequest, v as createSigner, vn as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, vt as signCommunityEdit, wn as parseRpcCommentUpdateEventWithPKCErrorIfItFails, wt as verifyCommentEdit, x as encryptEd25519AesGcm, xn as parseJsonWithPKCErrorIfFails, xt as verifyChallengeMessage, y as decryptEd25519AesGcm, yn as parseDecryptedChallengeVerification, yt as signVote, zn as RpcFetchCidParamSchema, zt as getCommunityNameFromWire } from "./rpc-local-community-
|
|
4
|
-
import {
|
|
2
|
+
import { B as isIpfsCid, Cn as CommentUpdateForChallengeVerificationSchema, Ct as findUpdatingCommunity, D as deepMergeRuntimeFields, Dt as refreshTrackedCommentAliases, E as createAbortError, En as CommentUpdateSchema, Et as listUpdatingCommunities, Fr as stringifyPrimitive, H as isIpns, It as require_sha256, L as hideClassPrivateProps, Lt as TimeoutError, Nr as joinValues, Pr as parsedType, Pt as untrackUpdatingComment, Q as isStringDomain, Qn as n$1, R as ipnsNameToIpnsOverPubsubTopic, Rt as pTimeout, Sr as setErrorMap, St as findUpdatingComment, Tt as listUpdatingComments, Xn as n$2, _r as PKCError, _t as timestamp, a as ChallengeRequestMessageSchema, b as areEquivalentCommunityAddresses, br as require_supports_color, cn as PubsubTopicSchema, ct as resolveWhenPredicateIsTrue, dr as require_retry, er as t$1, fr as FailedToFetchCommentIpfsFromGatewaysError, ft as shortifyAddress, ir as r, jt as trackUpdatingComment, k as doesDomainAddressHaveCapitalLetter, mt as sleepUntilTimeoutOrAbort, nn as CommunityIpfsSchema, nr as e$1, ot as removeUndefinedValuesRecursively, pt as shortifyCid, r as ChallengeMessageSchema, s as ChallengeVerificationMessageSchema, st as replaceXWithY, t as ChallengeAnswerMessageSchema, tr as e, ut as retryKuboIpfsAdd, vn as CommentIpfsSchema, vr as messages, vt as waitForUpdateInCommunityInstanceWithErrorAndTimeout, wt as listStartedCommunities, xt as findStartedCommunity, y as version_default, yr as logger_default, z as isAbortError } from "./schema-C_l9RSe0.js";
|
|
3
|
+
import { $ as RepliesPages, $n as t$5, $t as parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, An as RpcCidParamSchema, At as verifyCommunityEdit, B as setNativeFunctions$1, Bn as RpcFetchCidResultSchema, Bt as getCommunityPublicKeyFromWire, Cn as parseRpcCommentEventWithPKCErrorIfItFails, Ct as verifyChallengeVerification, D as createKuboRpcClient, Dn as parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails, Dt as verifyCommentPubsubMessage, Et as verifyCommentModeration, Fn as RpcExportCommunityModLogsParamSchema, Gn as RpcUnsubscribeParamSchema, H as CommentClientsManager, Hn as RpcResolveAuthorNameResultSchema, Ht as decode, I as listCommunitiesSync, In as RpcExportCommunityModLogsResultSchema, It as normalizeCreatePublicationAuthor, Kn as t$4, L as monitorCommunitiesDirectory, Ln as RpcExportCommunityParamSchema, Lt as buildRuntimeCommunityFields, Mn as RpcCommunityIdentifierParamSchema, Mt as buildRuntimeAuthor, N as getDefaultDataPath, Nn as RpcCommunityPageParamSchema, Nt as cleanWireAuthor, On as RpcAuthorNameParamSchema, Ot as verifyCommentUpdate, Pn as RpcEditCommunityParamSchema, Pt as getAuthorNameFromRuntime, Q as parseRawPages, Qn as t$2, Rn as RpcExportCommunityResultSchema, Rt as getCommunityAddressFromRecord, Sn as parsePKCUserOptionsSchemaWithPKCErrorIfItFails, Tn as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, Tt as verifyCommentIpfs, Un as RpcSubscriptionIdResultSchema, V as tryToDeleteCommunitiesThatFailedToBeDeletedBefore, Vn as RpcPublishChallengeAnswersParamSchema, Vt as normalizeCommunityInputFromCommunity, Wn as RpcSuccessResultSchema, Wt as getBufferedPKCAddressFromPublicKey, X as findCommentInPageInstanceRecursively, Xn as n$3, Xt as parseCidStringSchemaWithPKCErrorIfItFails, Y as extractCommunityRuntimeFieldsFromParsedPages, Yn as t$3, _n as parseCreateVoteOptionsSchemaWithPKCErrorIfItFails, a as pkcJsChallenges, at as PKCTypedEmitter, bn as parseDecryptedChallengeWithPKCErrorIfItFails, c as AddressesRewriterProxyServer, ct as signChallengeAnswer, dn as parseCreateCommentOptionsSchemaWithPKCErrorIfItFails, en as parseCommentIpfsSchemaWithPKCErrorIfItFails, et as PublicationClientsManager, f as KeyvBetterSqlite3, fn as parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails, ft as signComment, g as decodeRpcChallengeVerificationPubsubMsg, gn as parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, h as decodeRpcChallengeRequestPubsubMsg, hn as parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, in as parseCommunityAddressWithPKCErrorIfItFails, ir as require_undici, jn as RpcCommentRepliesPageParamSchema, jt as verifyVote, kn as RpcCancelExportParamSchema, ln as parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails, m as decodeRpcChallengePubsubMsg, mt as signCommentModeration, n as RpcRemoteCommunity, nn as parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails, nt as InflightFetchManager, o as TrackedInstanceRegistry, ot as require_lib$1, p as decodeRpcChallengeAnswerPubsubMsg, pt as signCommentEdit, rn as parseCommentPubsubMessagePublicationWithPKCErrorIfItFails, rr as nativeFunctions$2, s as LRUCache, sn as parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, st as cleanUpBeforePublishing, t as RpcLocalCommunity, tt as PKCClientsManager, u as RemoteCommunity, un as parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails, ut as signChallengeRequest, v as createSigner, vn as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, vt as signCommunityEdit, wn as parseRpcCommentUpdateEventWithPKCErrorIfItFails, wt as verifyCommentEdit, x as encryptEd25519AesGcm, xn as parseJsonWithPKCErrorIfFails, xt as verifyChallengeMessage, y as decryptEd25519AesGcm, yn as parseDecryptedChallengeVerification, yt as signVote, zn as RpcFetchCidParamSchema, zt as getCommunityNameFromWire } from "./rpc-local-community-D8woL19t.js";
|
|
4
|
+
import { i as getHeliaDebugContext } from "./util-bpDx_Vq2.js";
|
|
5
5
|
import path from "path";
|
|
6
6
|
import assert from "assert";
|
|
7
7
|
import fs from "fs";
|
|
@@ -8875,7 +8875,7 @@ var PKC$1 = class extends PKCTypedEmitter {
|
|
|
8875
8875
|
this.clients.libp2pJsClients = {};
|
|
8876
8876
|
if (!this.libp2pJsClientsOptions) return;
|
|
8877
8877
|
if (!this.httpRoutersOptions) throw Error("httpRoutersOptions is required for libp2pJsClient");
|
|
8878
|
-
const { createLibp2pJsClientOrUseExistingOne } = await import("./helia-for-pkc-
|
|
8878
|
+
const { createLibp2pJsClientOrUseExistingOne } = await import("./helia-for-pkc-x-xe-CrX.js");
|
|
8879
8879
|
for (const clientOptions of this.libp2pJsClientsOptions) {
|
|
8880
8880
|
const heliaNode = await createLibp2pJsClientOrUseExistingOne({
|
|
8881
8881
|
...clientOptions,
|
|
@@ -9123,7 +9123,7 @@ var PKC$1 = class extends PKCTypedEmitter {
|
|
|
9123
9123
|
const log = logger_default("pkc-js:pkc:createLocalCommunity");
|
|
9124
9124
|
log.trace("Received community options to create a local community instance:", options);
|
|
9125
9125
|
if (!this._canCreateNewLocalCommunity()) throw new PKCError("ERR_CAN_NOT_CREATE_A_LOCAL_COMMUNITY", { pkcOptions: this._userPKCOptions });
|
|
9126
|
-
const { LocalCommunity, createNewLocalCommunityDb, updateInstancePropsWithStartedCommunityOrDb } = await import("./local-community-
|
|
9126
|
+
const { LocalCommunity, createNewLocalCommunityDb, updateInstancePropsWithStartedCommunityOrDb } = await import("./local-community-BuseLMgO.js");
|
|
9127
9127
|
const isLocalCommunity = (await listCommunitiesSync(this)).includes(options.address);
|
|
9128
9128
|
const community = new LocalCommunity(this);
|
|
9129
9129
|
if (isLocalCommunity) {
|