@helia/ipns 10.0.1 → 10.0.2-ef258e7e

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.
Files changed (81) hide show
  1. package/README.md +3 -7
  2. package/dist/index.min.js +16 -5
  3. package/dist/index.min.js.map +4 -4
  4. package/dist/src/errors.d.ts +0 -8
  5. package/dist/src/errors.d.ts.map +1 -1
  6. package/dist/src/errors.js +0 -8
  7. package/dist/src/errors.js.map +1 -1
  8. package/dist/src/index.d.ts +58 -20
  9. package/dist/src/index.d.ts.map +1 -1
  10. package/dist/src/index.js +11 -11
  11. package/dist/src/index.js.map +1 -1
  12. package/dist/src/ipns/publisher.d.ts.map +1 -1
  13. package/dist/src/ipns/publisher.js +27 -14
  14. package/dist/src/ipns/publisher.js.map +1 -1
  15. package/dist/src/ipns/republisher.d.ts.map +1 -1
  16. package/dist/src/ipns/republisher.js +22 -9
  17. package/dist/src/ipns/republisher.js.map +1 -1
  18. package/dist/src/ipns/resolver.d.ts.map +1 -1
  19. package/dist/src/ipns/resolver.js +39 -17
  20. package/dist/src/ipns/resolver.js.map +1 -1
  21. package/dist/src/ipns.d.ts.map +1 -1
  22. package/dist/src/ipns.js +8 -8
  23. package/dist/src/ipns.js.map +1 -1
  24. package/dist/src/local-store.d.ts +4 -4
  25. package/dist/src/local-store.d.ts.map +1 -1
  26. package/dist/src/local-store.js +2 -1
  27. package/dist/src/local-store.js.map +1 -1
  28. package/dist/src/pb/ipns.d.ts +29 -29
  29. package/dist/src/pb/ipns.d.ts.map +1 -1
  30. package/dist/src/pb/ipns.js +15 -15
  31. package/dist/src/records.d.ts +27 -142
  32. package/dist/src/records.d.ts.map +1 -1
  33. package/dist/src/records.js +39 -46
  34. package/dist/src/records.js.map +1 -1
  35. package/dist/src/routing/helia.d.ts +5 -5
  36. package/dist/src/routing/helia.d.ts.map +1 -1
  37. package/dist/src/routing/helia.js +3 -3
  38. package/dist/src/routing/helia.js.map +1 -1
  39. package/dist/src/routing/index.d.ts +7 -7
  40. package/dist/src/routing/index.d.ts.map +1 -1
  41. package/dist/src/routing/index.js +2 -2
  42. package/dist/src/routing/index.js.map +1 -1
  43. package/dist/src/routing/local-store.d.ts +1 -1
  44. package/dist/src/routing/local-store.d.ts.map +1 -1
  45. package/dist/src/routing/local-store.js +3 -3
  46. package/dist/src/routing/local-store.js.map +1 -1
  47. package/dist/src/routing/pubsub.d.ts +11 -11
  48. package/dist/src/routing/pubsub.d.ts.map +1 -1
  49. package/dist/src/routing/pubsub.js +11 -12
  50. package/dist/src/routing/pubsub.js.map +1 -1
  51. package/dist/src/selector.d.ts +2 -2
  52. package/dist/src/selector.d.ts.map +1 -1
  53. package/dist/src/selector.js +13 -9
  54. package/dist/src/selector.js.map +1 -1
  55. package/dist/src/utils.d.ts +9 -10
  56. package/dist/src/utils.d.ts.map +1 -1
  57. package/dist/src/utils.js +20 -128
  58. package/dist/src/utils.js.map +1 -1
  59. package/dist/src/validator.d.ts +9 -3
  60. package/dist/src/validator.d.ts.map +1 -1
  61. package/dist/src/validator.js +57 -14
  62. package/dist/src/validator.js.map +1 -1
  63. package/package.json +6 -31
  64. package/src/errors.ts +0 -10
  65. package/src/index.ts +75 -25
  66. package/src/ipns/publisher.ts +27 -14
  67. package/src/ipns/republisher.ts +31 -13
  68. package/src/ipns/resolver.ts +39 -21
  69. package/src/ipns.ts +8 -8
  70. package/src/local-store.ts +8 -7
  71. package/src/pb/ipns.proto +1 -1
  72. package/src/pb/ipns.ts +37 -37
  73. package/src/records.ts +57 -210
  74. package/src/routing/helia.ts +6 -6
  75. package/src/routing/index.ts +7 -7
  76. package/src/routing/local-store.ts +6 -6
  77. package/src/routing/pubsub.ts +24 -25
  78. package/src/selector.ts +14 -11
  79. package/src/utils.ts +25 -147
  80. package/src/validator.ts +73 -16
  81. package/dist/typedoc-urls.json +0 -50
package/README.md CHANGED
@@ -66,7 +66,6 @@ value.
66
66
  import { createHelia } from 'helia'
67
67
  import { ipns } from '@helia/ipns'
68
68
  import { unixfs } from '@helia/unixfs'
69
- import { generateKeyPair } from '@libp2p/crypto/keys'
70
69
 
71
70
  const helia = await createHelia()
72
71
  const name = ipns(helia)
@@ -95,7 +94,6 @@ It is possible to publish CIDs with an associated path.
95
94
  import { createHelia } from 'helia'
96
95
  import { ipns } from '@helia/ipns'
97
96
  import { unixfs } from '@helia/unixfs'
98
- import { generateKeyPair } from '@libp2p/crypto/keys'
99
97
 
100
98
  const helia = await createHelia()
101
99
  const name = ipns(helia)
@@ -134,15 +132,13 @@ and multiple peers are listening on the topic(s), otherwise update messages
134
132
  may fail to be published with "Insufficient peers" errors.
135
133
 
136
134
  ```TypeScript
137
- import { ipns } from '@helia/ipns'
138
- import { pubsub } from '@helia/ipns/routing'
135
+ import { ipns, pubSubIPNSRouting } from '@helia/ipns'
139
136
  import { withLibp2p, libp2pDefaults } from '@helia/libp2p'
140
137
  import { unixfs } from '@helia/unixfs'
141
- import { generateKeyPair } from '@libp2p/crypto/keys'
142
138
  import { floodsub } from '@libp2p/floodsub'
143
139
  import { createHelia } from 'helia'
144
140
  import type { Helia } from '@helia/interface'
145
- import type { PubSub } from '@helia/ipns/routing'
141
+ import type { PubSub } from '@helia/ipns'
146
142
  import type { DefaultLibp2pServices } from '@helia/libp2p'
147
143
  import type { FloodSub } from '@libp2p/floodsub'
148
144
  import type { Libp2p } from '@libp2p/interface'
@@ -154,7 +150,7 @@ const helia = await withLibp2p<Helia, { pubsub: FloodSub }>(createHelia(), libp2
154
150
 
155
151
  const name = ipns(helia, {
156
152
  routers: [
157
- pubsub(helia)
153
+ pubSubIPNSRouting(helia)
158
154
  ]
159
155
  })
160
156