@graphprotocol/grc-20 0.20.2 → 0.21.1

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 (249) hide show
  1. package/dist/index.d.ts +14 -14
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +14 -14
  4. package/dist/index.js.map +1 -1
  5. package/dist/src/core/position.d.ts +20 -6
  6. package/dist/src/core/position.d.ts.map +1 -1
  7. package/dist/src/core/position.js +35 -6
  8. package/dist/src/core/position.js.map +1 -1
  9. package/dist/src/core/position.test.d.ts +2 -0
  10. package/dist/src/core/position.test.d.ts.map +1 -0
  11. package/dist/src/core/position.test.js +119 -0
  12. package/dist/src/core/position.test.js.map +1 -0
  13. package/dist/src/position.d.ts +1 -1
  14. package/dist/src/position.d.ts.map +1 -1
  15. package/dist/src/position.js +1 -1
  16. package/dist/src/position.js.map +1 -1
  17. package/package.json +2 -3
  18. package/dist/constants.d.ts +0 -7
  19. package/dist/constants.d.ts.map +0 -1
  20. package/dist/constants.js +0 -8
  21. package/dist/constants.js.map +0 -1
  22. package/dist/convert-ids.d.ts +0 -2
  23. package/dist/convert-ids.d.ts.map +0 -1
  24. package/dist/convert-ids.js +0 -42
  25. package/dist/convert-ids.js.map +0 -1
  26. package/dist/protov2.d.ts +0 -11
  27. package/dist/protov2.d.ts.map +0 -1
  28. package/dist/protov2.js +0 -11
  29. package/dist/protov2.js.map +0 -1
  30. package/dist/src/core/blocks/image.d.ts +0 -15
  31. package/dist/src/core/blocks/image.d.ts.map +0 -1
  32. package/dist/src/core/blocks/image.js +0 -15
  33. package/dist/src/core/blocks/image.js.map +0 -1
  34. package/dist/src/core/idsv2/content.d.ts +0 -59
  35. package/dist/src/core/idsv2/content.d.ts.map +0 -1
  36. package/dist/src/core/idsv2/content.js +0 -59
  37. package/dist/src/core/idsv2/content.js.map +0 -1
  38. package/dist/src/core/idsv2/network.d.ts +0 -5
  39. package/dist/src/core/idsv2/network.d.ts.map +0 -1
  40. package/dist/src/core/idsv2/network.js +0 -5
  41. package/dist/src/core/idsv2/network.js.map +0 -1
  42. package/dist/src/core/idsv2/system.d.ts +0 -222
  43. package/dist/src/core/idsv2/system.d.ts.map +0 -1
  44. package/dist/src/core/idsv2/system.js +0 -230
  45. package/dist/src/core/idsv2/system.js.map +0 -1
  46. package/dist/src/core/image.d.ts +0 -40
  47. package/dist/src/core/image.d.ts.map +0 -1
  48. package/dist/src/core/image.js +0 -76
  49. package/dist/src/core/image.js.map +0 -1
  50. package/dist/src/core/image.test.d.ts +0 -2
  51. package/dist/src/core/image.test.d.ts.map +0 -1
  52. package/dist/src/core/image.test.js +0 -52
  53. package/dist/src/core/image.test.js.map +0 -1
  54. package/dist/src/core/relation.d.ts +0 -88
  55. package/dist/src/core/relation.d.ts.map +0 -1
  56. package/dist/src/core/relation.js +0 -89
  57. package/dist/src/core/relation.js.map +0 -1
  58. package/dist/src/core/relation.test.d.ts +0 -2
  59. package/dist/src/core/relation.test.d.ts.map +0 -1
  60. package/dist/src/core/relation.test.js +0 -45
  61. package/dist/src/core/relation.test.js.map +0 -1
  62. package/dist/src/core/triple.d.ts +0 -50
  63. package/dist/src/core/triple.d.ts.map +0 -1
  64. package/dist/src/core/triple.js +0 -56
  65. package/dist/src/core/triple.js.map +0 -1
  66. package/dist/src/core/triple.test.d.ts +0 -2
  67. package/dist/src/core/triple.test.d.ts.map +0 -1
  68. package/dist/src/core/triple.test.js +0 -37
  69. package/dist/src/core/triple.test.js.map +0 -1
  70. package/dist/src/graph/delete-entity.d.ts +0 -14
  71. package/dist/src/graph/delete-entity.d.ts.map +0 -1
  72. package/dist/src/graph/delete-entity.js +0 -21
  73. package/dist/src/graph/delete-entity.js.map +0 -1
  74. package/dist/src/graph/delete-entity.test.d.ts +0 -2
  75. package/dist/src/graph/delete-entity.test.d.ts.map +0 -1
  76. package/dist/src/graph/delete-entity.test.js +0 -23
  77. package/dist/src/graph/delete-entity.test.js.map +0 -1
  78. package/dist/src/graph/graph.test.d.ts +0 -2
  79. package/dist/src/graph/graph.test.d.ts.map +0 -1
  80. package/dist/src/graph/graph.test.js +0 -46
  81. package/dist/src/graph/graph.test.js.map +0 -1
  82. package/dist/src/graph/helpers/create-default-properties.d.ts +0 -5
  83. package/dist/src/graph/helpers/create-default-properties.d.ts.map +0 -1
  84. package/dist/src/graph/helpers/create-default-properties.js +0 -44
  85. package/dist/src/graph/helpers/create-default-properties.js.map +0 -1
  86. package/dist/src/graph/helpers/create-properties.d.ts +0 -8
  87. package/dist/src/graph/helpers/create-properties.d.ts.map +0 -1
  88. package/dist/src/graph/helpers/create-properties.js +0 -53
  89. package/dist/src/graph/helpers/create-properties.js.map +0 -1
  90. package/dist/src/graphv2/constants.d.ts +0 -2
  91. package/dist/src/graphv2/constants.d.ts.map +0 -1
  92. package/dist/src/graphv2/constants.js +0 -2
  93. package/dist/src/graphv2/constants.js.map +0 -1
  94. package/dist/src/graphv2/create-entity.d.ts +0 -52
  95. package/dist/src/graphv2/create-entity.d.ts.map +0 -1
  96. package/dist/src/graphv2/create-entity.js +0 -140
  97. package/dist/src/graphv2/create-entity.js.map +0 -1
  98. package/dist/src/graphv2/create-entity.test.d.ts +0 -2
  99. package/dist/src/graphv2/create-entity.test.d.ts.map +0 -1
  100. package/dist/src/graphv2/create-entity.test.js +0 -158
  101. package/dist/src/graphv2/create-entity.test.js.map +0 -1
  102. package/dist/src/graphv2/create-image.d.ts +0 -28
  103. package/dist/src/graphv2/create-image.d.ts.map +0 -1
  104. package/dist/src/graphv2/create-image.js +0 -71
  105. package/dist/src/graphv2/create-image.js.map +0 -1
  106. package/dist/src/graphv2/create-image.test.d.ts +0 -2
  107. package/dist/src/graphv2/create-image.test.d.ts.map +0 -1
  108. package/dist/src/graphv2/create-image.test.js +0 -142
  109. package/dist/src/graphv2/create-image.test.js.map +0 -1
  110. package/dist/src/graphv2/create-property.d.ts +0 -22
  111. package/dist/src/graphv2/create-property.d.ts.map +0 -1
  112. package/dist/src/graphv2/create-property.js +0 -129
  113. package/dist/src/graphv2/create-property.js.map +0 -1
  114. package/dist/src/graphv2/create-property.test.d.ts +0 -2
  115. package/dist/src/graphv2/create-property.test.d.ts.map +0 -1
  116. package/dist/src/graphv2/create-property.test.js +0 -82
  117. package/dist/src/graphv2/create-property.test.js.map +0 -1
  118. package/dist/src/graphv2/create-relation.d.ts +0 -33
  119. package/dist/src/graphv2/create-relation.d.ts.map +0 -1
  120. package/dist/src/graphv2/create-relation.js +0 -66
  121. package/dist/src/graphv2/create-relation.js.map +0 -1
  122. package/dist/src/graphv2/create-relation.test.d.ts +0 -2
  123. package/dist/src/graphv2/create-relation.test.d.ts.map +0 -1
  124. package/dist/src/graphv2/create-relation.test.js +0 -208
  125. package/dist/src/graphv2/create-relation.test.js.map +0 -1
  126. package/dist/src/graphv2/create-space.d.ts +0 -13
  127. package/dist/src/graphv2/create-space.d.ts.map +0 -1
  128. package/dist/src/graphv2/create-space.js +0 -21
  129. package/dist/src/graphv2/create-space.js.map +0 -1
  130. package/dist/src/graphv2/create-type.d.ts +0 -22
  131. package/dist/src/graphv2/create-type.d.ts.map +0 -1
  132. package/dist/src/graphv2/create-type.js +0 -64
  133. package/dist/src/graphv2/create-type.js.map +0 -1
  134. package/dist/src/graphv2/create-type.test.d.ts +0 -2
  135. package/dist/src/graphv2/create-type.test.d.ts.map +0 -1
  136. package/dist/src/graphv2/create-type.test.js +0 -109
  137. package/dist/src/graphv2/create-type.test.js.map +0 -1
  138. package/dist/src/graphv2/delete-entity.d.ts +0 -14
  139. package/dist/src/graphv2/delete-entity.d.ts.map +0 -1
  140. package/dist/src/graphv2/delete-entity.js +0 -21
  141. package/dist/src/graphv2/delete-entity.js.map +0 -1
  142. package/dist/src/graphv2/delete-entity.test.d.ts +0 -2
  143. package/dist/src/graphv2/delete-entity.test.d.ts.map +0 -1
  144. package/dist/src/graphv2/delete-entity.test.js +0 -24
  145. package/dist/src/graphv2/delete-entity.test.js.map +0 -1
  146. package/dist/src/graphv2/delete-relation.d.ts +0 -14
  147. package/dist/src/graphv2/delete-relation.d.ts.map +0 -1
  148. package/dist/src/graphv2/delete-relation.js +0 -21
  149. package/dist/src/graphv2/delete-relation.js.map +0 -1
  150. package/dist/src/graphv2/delete-relation.test.d.ts +0 -2
  151. package/dist/src/graphv2/delete-relation.test.d.ts.map +0 -1
  152. package/dist/src/graphv2/delete-relation.test.js +0 -24
  153. package/dist/src/graphv2/delete-relation.test.js.map +0 -1
  154. package/dist/src/graphv2/index.d.ts +0 -12
  155. package/dist/src/graphv2/index.d.ts.map +0 -1
  156. package/dist/src/graphv2/index.js +0 -12
  157. package/dist/src/graphv2/index.js.map +0 -1
  158. package/dist/src/graphv2/remove-entity-properties.d.ts +0 -25
  159. package/dist/src/graphv2/remove-entity-properties.d.ts.map +0 -1
  160. package/dist/src/graphv2/remove-entity-properties.js +0 -24
  161. package/dist/src/graphv2/remove-entity-properties.js.map +0 -1
  162. package/dist/src/graphv2/unset-entity-values.d.ts +0 -21
  163. package/dist/src/graphv2/unset-entity-values.d.ts.map +0 -1
  164. package/dist/src/graphv2/unset-entity-values.js +0 -26
  165. package/dist/src/graphv2/unset-entity-values.js.map +0 -1
  166. package/dist/src/graphv2/unset-entity-values.test.d.ts +0 -2
  167. package/dist/src/graphv2/unset-entity-values.test.d.ts.map +0 -1
  168. package/dist/src/graphv2/unset-entity-values.test.js +0 -40
  169. package/dist/src/graphv2/unset-entity-values.test.js.map +0 -1
  170. package/dist/src/graphv2/unset-relation-fields.d.ts +0 -25
  171. package/dist/src/graphv2/unset-relation-fields.d.ts.map +0 -1
  172. package/dist/src/graphv2/unset-relation-fields.js +0 -34
  173. package/dist/src/graphv2/unset-relation-fields.js.map +0 -1
  174. package/dist/src/graphv2/unset-relation-fields.test.d.ts +0 -2
  175. package/dist/src/graphv2/unset-relation-fields.test.d.ts.map +0 -1
  176. package/dist/src/graphv2/unset-relation-fields.test.js +0 -64
  177. package/dist/src/graphv2/unset-relation-fields.test.js.map +0 -1
  178. package/dist/src/graphv2/update-entity.d.ts +0 -28
  179. package/dist/src/graphv2/update-entity.d.ts.map +0 -1
  180. package/dist/src/graphv2/update-entity.js +0 -73
  181. package/dist/src/graphv2/update-entity.js.map +0 -1
  182. package/dist/src/graphv2/update-entity.test.d.ts +0 -2
  183. package/dist/src/graphv2/update-entity.test.d.ts.map +0 -1
  184. package/dist/src/graphv2/update-entity.test.js +0 -116
  185. package/dist/src/graphv2/update-entity.test.js.map +0 -1
  186. package/dist/src/graphv2/update-relation.d.ts +0 -21
  187. package/dist/src/graphv2/update-relation.d.ts.map +0 -1
  188. package/dist/src/graphv2/update-relation.js +0 -37
  189. package/dist/src/graphv2/update-relation.js.map +0 -1
  190. package/dist/src/idv2.d.ts +0 -27
  191. package/dist/src/idv2.d.ts.map +0 -1
  192. package/dist/src/idv2.js +0 -88
  193. package/dist/src/idv2.js.map +0 -1
  194. package/dist/src/idv2.test.d.ts +0 -2
  195. package/dist/src/idv2.test.d.ts.map +0 -1
  196. package/dist/src/idv2.test.js +0 -26
  197. package/dist/src/idv2.test.js.map +0 -1
  198. package/dist/src/image.d.ts +0 -8
  199. package/dist/src/image.d.ts.map +0 -1
  200. package/dist/src/image.js +0 -8
  201. package/dist/src/image.js.map +0 -1
  202. package/dist/src/ipfsv2.d.ts +0 -96
  203. package/dist/src/ipfsv2.d.ts.map +0 -1
  204. package/dist/src/ipfsv2.js +0 -163
  205. package/dist/src/ipfsv2.js.map +0 -1
  206. package/dist/src/ipfsv2.test.d.ts +0 -2
  207. package/dist/src/ipfsv2.test.d.ts.map +0 -1
  208. package/dist/src/ipfsv2.test.js +0 -22
  209. package/dist/src/ipfsv2.test.js.map +0 -1
  210. package/dist/src/proto/editv2.d.ts +0 -11
  211. package/dist/src/proto/editv2.d.ts.map +0 -1
  212. package/dist/src/proto/editv2.js +0 -81
  213. package/dist/src/proto/editv2.js.map +0 -1
  214. package/dist/src/proto/editv2.test.d.ts +0 -2
  215. package/dist/src/proto/editv2.test.d.ts.map +0 -1
  216. package/dist/src/proto/editv2.test.js +0 -211
  217. package/dist/src/proto/editv2.test.js.map +0 -1
  218. package/dist/src/proto/gen/src/proto/ipfsv2_pb.d.ts +0 -410
  219. package/dist/src/proto/gen/src/proto/ipfsv2_pb.d.ts.map +0 -1
  220. package/dist/src/proto/gen/src/proto/ipfsv2_pb.js +0 -536
  221. package/dist/src/proto/gen/src/proto/ipfsv2_pb.js.map +0 -1
  222. package/dist/src/relation.d.ts +0 -7
  223. package/dist/src/relation.d.ts.map +0 -1
  224. package/dist/src/relation.js +0 -7
  225. package/dist/src/relation.js.map +0 -1
  226. package/dist/src/smart-wallet-2.test-invalid.d.ts +0 -2
  227. package/dist/src/smart-wallet-2.test-invalid.d.ts.map +0 -1
  228. package/dist/src/smart-wallet-2.test-invalid.js +0 -49
  229. package/dist/src/smart-wallet-2.test-invalid.js.map +0 -1
  230. package/dist/src/smart-wallet-2.test.d.ts +0 -2
  231. package/dist/src/smart-wallet-2.test.d.ts.map +0 -1
  232. package/dist/src/smart-wallet-2.test.js +0 -49
  233. package/dist/src/smart-wallet-2.test.js.map +0 -1
  234. package/dist/src/system-ids-v2.d.ts +0 -7
  235. package/dist/src/system-ids-v2.d.ts.map +0 -1
  236. package/dist/src/system-ids-v2.js +0 -7
  237. package/dist/src/system-ids-v2.js.map +0 -1
  238. package/dist/src/triple.d.ts +0 -7
  239. package/dist/src/triple.d.ts.map +0 -1
  240. package/dist/src/triple.js +0 -7
  241. package/dist/src/triple.js.map +0 -1
  242. package/dist/src/types-backup.d.ts +0 -134
  243. package/dist/src/types-backup.d.ts.map +0 -1
  244. package/dist/src/types-backup.js +0 -13
  245. package/dist/src/types-backup.js.map +0 -1
  246. package/dist/src/typesv2.d.ts +0 -173
  247. package/dist/src/typesv2.d.ts.map +0 -1
  248. package/dist/src/typesv2.js +0 -8
  249. package/dist/src/typesv2.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,45 +1,45 @@
1
- export * from './src/types.js';
1
+ export * from "./src/types.js";
2
2
  /**
3
3
  * This module provides utility functions for working knowledge graph
4
4
  * identifiers in TypeScript.
5
5
  *
6
6
  * @since 0.0.6
7
7
  */
8
- export * as Id from './src/id.js';
9
- export { getAcceptEditorArguments, getAcceptSubspaceArguments, getCalldataForSpaceGovernanceType, getProcessGeoProposalArguments, getRemoveEditorArguments, getRemoveSubspaceArguments, } from './src/encodings/index.js';
8
+ export * as Id from "./src/id.js";
9
+ export { getAcceptEditorArguments, getAcceptSubspaceArguments, getCalldataForSpaceGovernanceType, getProcessGeoProposalArguments, getRemoveEditorArguments, getRemoveSubspaceArguments, } from "./src/encodings/index.js";
10
10
  /**
11
11
  * This module provides utility functions for working with knowledge graph
12
12
  * images in TypeScript.
13
13
  *
14
14
  * @since 0.0.6
15
15
  */
16
- export { Account } from './src/account.js';
17
- export { DataBlock, TextBlock } from './src/blocks.js';
18
- export * as Encoding from './src/encoding.js';
19
- export { getChecksumAddress } from './src/core/get-checksum-address.js';
20
- export * as Graph from './src/graph/index.js';
16
+ export { Account } from "./src/account.js";
17
+ export { DataBlock, TextBlock } from "./src/blocks.js";
18
+ export * as Encoding from "./src/encoding.js";
19
+ export { getChecksumAddress } from "./src/core/get-checksum-address.js";
20
+ export * as Graph from "./src/graph/index.js";
21
21
  /**
22
22
  * This module provides utility functions for interacting with the default
23
23
  * IPFS gateway in TypeScript.
24
24
  *
25
25
  * @since 0.1.1
26
26
  */
27
- export * as Ipfs from './src/ipfs.js';
28
- export { Position, PositionRange } from './src/position.js';
27
+ export * as Ipfs from "./src/ipfs.js";
28
+ export { Position } from "./src/position.js";
29
29
  /**
30
30
  * This module provides utility functions for working with Graph URIs in TypeScript.
31
31
  *
32
32
  * @since 0.0.6
33
33
  */
34
- export { GraphUrl } from './src/scheme.js';
35
- export { getSmartAccountWalletClient } from './src/smart-wallet.js';
34
+ export { GraphUrl } from "./src/scheme.js";
35
+ export { getSmartAccountWalletClient } from "./src/smart-wallet.js";
36
36
  /**
37
37
  * Provides ids for commonly used entities across the Knowledge Graph.
38
38
  */
39
- export { ContentIds, NetworkIds, SystemIds } from './src/system-ids.js';
39
+ export { ContentIds, NetworkIds, SystemIds } from "./src/system-ids.js";
40
40
  /**
41
41
  * This module provides utility functions for working with base58 ids
42
42
  * in TypeScript.
43
43
  */
44
- export * as Base58 from './src/core/base58.js';
44
+ export * as Base58 from "./src/core/base58.js";
45
45
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAE/B;;;;;GAKG;AACH,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAElC,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,iCAAiC,EACjC,8BAA8B,EAC9B,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAElC;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAExE,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAC9C;;;;;GAKG;AACH,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE5D;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAEpE;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAExE;;;GAGG;AACH,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAE/B;;;;;GAKG;AACH,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAElC,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,iCAAiC,EACjC,8BAA8B,EAC9B,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAElC;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAExE,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAC9C;;;;;GAKG;AACH,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAEpE;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAExE;;;GAGG;AACH,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -1,45 +1,45 @@
1
- export * from './src/types.js';
1
+ export * from "./src/types.js";
2
2
  /**
3
3
  * This module provides utility functions for working knowledge graph
4
4
  * identifiers in TypeScript.
5
5
  *
6
6
  * @since 0.0.6
7
7
  */
8
- export * as Id from './src/id.js';
9
- export { getAcceptEditorArguments, getAcceptSubspaceArguments, getCalldataForSpaceGovernanceType, getProcessGeoProposalArguments, getRemoveEditorArguments, getRemoveSubspaceArguments, } from './src/encodings/index.js';
8
+ export * as Id from "./src/id.js";
9
+ export { getAcceptEditorArguments, getAcceptSubspaceArguments, getCalldataForSpaceGovernanceType, getProcessGeoProposalArguments, getRemoveEditorArguments, getRemoveSubspaceArguments, } from "./src/encodings/index.js";
10
10
  /**
11
11
  * This module provides utility functions for working with knowledge graph
12
12
  * images in TypeScript.
13
13
  *
14
14
  * @since 0.0.6
15
15
  */
16
- export { Account } from './src/account.js';
17
- export { DataBlock, TextBlock } from './src/blocks.js';
18
- export * as Encoding from './src/encoding.js';
19
- export { getChecksumAddress } from './src/core/get-checksum-address.js';
20
- export * as Graph from './src/graph/index.js';
16
+ export { Account } from "./src/account.js";
17
+ export { DataBlock, TextBlock } from "./src/blocks.js";
18
+ export * as Encoding from "./src/encoding.js";
19
+ export { getChecksumAddress } from "./src/core/get-checksum-address.js";
20
+ export * as Graph from "./src/graph/index.js";
21
21
  /**
22
22
  * This module provides utility functions for interacting with the default
23
23
  * IPFS gateway in TypeScript.
24
24
  *
25
25
  * @since 0.1.1
26
26
  */
27
- export * as Ipfs from './src/ipfs.js';
28
- export { Position, PositionRange } from './src/position.js';
27
+ export * as Ipfs from "./src/ipfs.js";
28
+ export { Position } from "./src/position.js";
29
29
  /**
30
30
  * This module provides utility functions for working with Graph URIs in TypeScript.
31
31
  *
32
32
  * @since 0.0.6
33
33
  */
34
- export { GraphUrl } from './src/scheme.js';
35
- export { getSmartAccountWalletClient } from './src/smart-wallet.js';
34
+ export { GraphUrl } from "./src/scheme.js";
35
+ export { getSmartAccountWalletClient } from "./src/smart-wallet.js";
36
36
  /**
37
37
  * Provides ids for commonly used entities across the Knowledge Graph.
38
38
  */
39
- export { ContentIds, NetworkIds, SystemIds } from './src/system-ids.js';
39
+ export { ContentIds, NetworkIds, SystemIds } from "./src/system-ids.js";
40
40
  /**
41
41
  * This module provides utility functions for working with base58 ids
42
42
  * in TypeScript.
43
43
  */
44
- export * as Base58 from './src/core/base58.js';
44
+ export * as Base58 from "./src/core/base58.js";
45
45
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAE/B;;;;;GAKG;AACH,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAElC,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,iCAAiC,EACjC,8BAA8B,EAC9B,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAElC;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAExE,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAC9C;;;;;GAKG;AACH,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE5D;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAEpE;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAExE;;;GAGG;AACH,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAE/B;;;;;GAKG;AACH,OAAO,KAAK,EAAE,MAAM,aAAa,CAAC;AAElC,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,iCAAiC,EACjC,8BAA8B,EAC9B,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAElC;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAExE,OAAO,KAAK,KAAK,MAAM,sBAAsB,CAAC;AAC9C;;;;;GAKG;AACH,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAEpE;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAExE;;;GAGG;AACH,OAAO,KAAK,MAAM,MAAM,sBAAsB,CAAC"}
@@ -3,10 +3,24 @@
3
3
  *
4
4
  * @since 0.0.6
5
5
  */
6
- import { PositionSource } from 'position-strings';
7
- export declare const Position: PositionSource;
8
- export declare const PositionRange: {
9
- FIRST: string;
10
- LAST: string;
11
- };
6
+ export declare function generateBetween(first: string | null, second: string | null): string;
7
+ /**
8
+ * Generates a random position with jittering.
9
+ *
10
+ * @returns A random position as a string.
11
+ */
12
+ export declare function generate(): string;
13
+ type MaybePosition = string | null;
14
+ export declare function compare(a: MaybePosition, b: MaybePosition): number;
15
+ /**
16
+ * Sorts a list of positions in ascending order. In
17
+ * the knowledge graph positions are optional. This
18
+ * function sorts null positions so they are always
19
+ * at the bottom.
20
+ *
21
+ * @param positions - The list of positions to sort.
22
+ * @returns The sorted list of positions.
23
+ */
24
+ export declare function sort(positions: MaybePosition[]): MaybePosition[];
25
+ export {};
12
26
  //# sourceMappingURL=position.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../../../src/core/position.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,eAAO,MAAM,QAAQ,gBAAuB,CAAC;AAE7C,eAAO,MAAM,aAAa;;;CAGzB,CAAC"}
1
+ {"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../../../src/core/position.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,UAE1E;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,IAAI,MAAM,CAEjC;AAED,KAAK,aAAa,GAAG,MAAM,GAAG,IAAI,CAAA;AAElC,wBAAgB,OAAO,CAAC,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,aAAa,UAOzD;AAED;;;;;;;;GAQG;AACH,wBAAgB,IAAI,CAAC,SAAS,EAAE,aAAa,EAAE,GAAG,aAAa,EAAE,CAEhE"}
@@ -3,10 +3,39 @@
3
3
  *
4
4
  * @since 0.0.6
5
5
  */
6
- import { PositionSource } from 'position-strings';
7
- export const Position = new PositionSource();
8
- export const PositionRange = {
9
- FIRST: PositionSource.FIRST,
10
- LAST: PositionSource.LAST,
11
- };
6
+ import { generateJitteredKeyBetween } from "fractional-indexing-jittered";
7
+ export function generateBetween(first, second) {
8
+ return generateJitteredKeyBetween(first, second);
9
+ }
10
+ /**
11
+ * Generates a random position with jittering.
12
+ *
13
+ * @returns A random position as a string.
14
+ */
15
+ export function generate() {
16
+ return generateBetween(null, null);
17
+ }
18
+ export function compare(a, b) {
19
+ // This ALWAYS puts nulls at the bottom, regardless of what
20
+ // fractional indexes exist
21
+ if (a === null && b === null)
22
+ return 0;
23
+ if (a === null)
24
+ return 1; // a goes to bottom
25
+ if (b === null)
26
+ return -1; // b goes to bottom
27
+ return a.localeCompare(b);
28
+ }
29
+ /**
30
+ * Sorts a list of positions in ascending order. In
31
+ * the knowledge graph positions are optional. This
32
+ * function sorts null positions so they are always
33
+ * at the bottom.
34
+ *
35
+ * @param positions - The list of positions to sort.
36
+ * @returns The sorted list of positions.
37
+ */
38
+ export function sort(positions) {
39
+ return positions.sort(compare);
40
+ }
12
41
  //# sourceMappingURL=position.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"position.js","sourceRoot":"","sources":["../../../src/core/position.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,cAAc,EAAE,CAAC;AAE7C,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,KAAK,EAAE,cAAc,CAAC,KAAK;IAC3B,IAAI,EAAE,cAAc,CAAC,IAAI;CAC1B,CAAC"}
1
+ {"version":3,"file":"position.js","sourceRoot":"","sources":["../../../src/core/position.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE1E,MAAM,UAAU,eAAe,CAAC,KAAoB,EAAE,MAAqB;IACzE,OAAO,0BAA0B,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AACnD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ;IACtB,OAAO,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;AACpC,CAAC;AAID,MAAM,UAAU,OAAO,CAAC,CAAgB,EAAE,CAAgB;IACxD,4DAA4D;IAC5D,2BAA2B;IAC3B,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,CAAC,CAAC;IACvC,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,CAAC,CAAC,CAAE,mBAAmB;IAC9C,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,CAAC,CAAC,CAAC,CAAC,mBAAmB;IAC9C,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;AAC5B,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,IAAI,CAAC,SAA0B;IAC7C,OAAO,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=position.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"position.test.d.ts","sourceRoot":"","sources":["../../../src/core/position.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,119 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { sort } from './position.js'; // Adjust import path as needed
3
+ describe('fractional index sorting', () => {
4
+ describe('sort function', () => {
5
+ it('should handle empty array', () => {
6
+ const result = sort([]);
7
+ expect(result).toEqual([]);
8
+ });
9
+ it('should handle array with only nulls', () => {
10
+ const positions = [null, null, null];
11
+ const result = sort(positions);
12
+ expect(result).toEqual([null, null, null]);
13
+ });
14
+ it('should handle array with only strings', () => {
15
+ const positions = ['c', 'a', 'b'];
16
+ const result = sort(positions);
17
+ expect(result).toEqual(['a', 'b', 'c']);
18
+ });
19
+ it('should put null values at the bottom when mixed with strings', () => {
20
+ const positions = ['b', null, 'a', null, 'c'];
21
+ const result = sort(positions);
22
+ expect(result).toEqual(['a', 'b', 'c', null, null]);
23
+ });
24
+ it('should sort fractional indexes correctly', () => {
25
+ const positions = ['a1', 'a0', 'a2'];
26
+ const result = sort(positions);
27
+ expect(result).toEqual(['a0', 'a1', 'a2']);
28
+ });
29
+ it('should handle complex fractional indexes', () => {
30
+ const positions = ['a0V', 'a0', 'a0G', 'a1'];
31
+ const result = sort(positions);
32
+ expect(result).toEqual(['a0', 'a0G', 'a0V', 'a1']);
33
+ });
34
+ it('should maintain stable sort for identical values', () => {
35
+ const positions = ['a0', 'a0', 'a1'];
36
+ const result = sort(positions);
37
+ expect(result).toEqual(['a0', 'a0', 'a1']);
38
+ });
39
+ it('should handle single null value', () => {
40
+ const positions = [null];
41
+ const result = sort(positions);
42
+ expect(result).toEqual([null]);
43
+ });
44
+ it('should handle single string value', () => {
45
+ const positions = ['a0'];
46
+ const result = sort(positions);
47
+ expect(result).toEqual(['a0']);
48
+ });
49
+ it('should sort with nulls at bottom regardless of position in input', () => {
50
+ const positions1 = [null, 'a', 'b'];
51
+ const positions2 = ['a', null, 'b'];
52
+ const positions3 = ['a', 'b', null];
53
+ const expected = ['a', 'b', null];
54
+ expect(sort(positions1)).toEqual(expected);
55
+ expect(sort(positions2)).toEqual(expected);
56
+ expect(sort(positions3)).toEqual(expected);
57
+ });
58
+ it('should handle very long fractional indexes', () => {
59
+ const positions = [`a0${'x'.repeat(50)}`, 'a0', `a0${'y'.repeat(30)}`];
60
+ const result = sort(positions);
61
+ expect(result).toEqual(['a0', `a0${'x'.repeat(50)}`, `a0${'y'.repeat(30)}`]);
62
+ });
63
+ it('should handle mixed case and special characters', () => {
64
+ const positions = ['Z', 'a', 'A', 'z'];
65
+ const result = sort(positions);
66
+ // JavaScript's localeCompare should handle this correctly
67
+ expect(result).toEqual(['a', 'A', 'z', 'Z']);
68
+ });
69
+ it('should handle large arrays efficiently', () => {
70
+ const positions = [];
71
+ // Create a large array with mixed values
72
+ for (let i = 100; i >= 0; i--) {
73
+ positions.push(`a${i}`);
74
+ if (i % 10 === 0)
75
+ positions.push(null);
76
+ }
77
+ const result = sort(positions);
78
+ // Check that all string values are sorted before nulls
79
+ const stringValues = result.filter(p => p !== null);
80
+ const nullValues = result.filter(p => p === null);
81
+ // String values should be sorted
82
+ for (let i = 1; i < stringValues.length; i++) {
83
+ const left = stringValues[i - 1];
84
+ const right = stringValues[i];
85
+ if (left && right) {
86
+ expect(left.localeCompare(right)).toBeLessThanOrEqual(0);
87
+ }
88
+ }
89
+ // All nulls should be at the end
90
+ const firstNullIndex = result.indexOf(null);
91
+ if (firstNullIndex !== -1) {
92
+ expect(result.slice(firstNullIndex)).toEqual(nullValues);
93
+ }
94
+ });
95
+ it('should handle edge case fractional indexes that might cause sorting issues', () => {
96
+ const positions = [
97
+ 'z'.repeat(10), // Very "high" value
98
+ 'a0',
99
+ null,
100
+ '', // Empty string
101
+ 'a',
102
+ ];
103
+ const result = sort(positions);
104
+ // Empty string should come first, then sorted strings, then nulls
105
+ expect(result[0]).toBe('');
106
+ expect(result[result.length - 1]).toBe(null);
107
+ // Check that non-null, non-empty strings are sorted
108
+ const nonEmptyStrings = result.filter(p => p !== null && p !== '');
109
+ for (let i = 1; i < nonEmptyStrings.length; i++) {
110
+ const left = nonEmptyStrings[i - 1];
111
+ const right = nonEmptyStrings[i];
112
+ if (left && right) {
113
+ expect(left.localeCompare(right)).toBeLessThanOrEqual(0);
114
+ }
115
+ }
116
+ });
117
+ });
118
+ });
119
+ //# sourceMappingURL=position.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"position.test.js","sourceRoot":"","sources":["../../../src/core/position.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC,CAAC,+BAA+B;AAErE,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACxC,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;QAC7B,EAAE,CAAC,2BAA2B,EAAE,GAAG,EAAE;YACnC,MAAM,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;YACxB,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,qCAAqC,EAAE,GAAG,EAAE;YAC7C,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;YACrC,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC;YAC/B,MAAM,CAAC,MAAM,CAAC,CAAC,OAA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EAAE;YACpF,MAAM,SAAS,GAAG;gBAChB,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,oBAAoB;gBACpC,IAAI;gBACJ,IAAI;gBACJ,EAAE,EAAE,eAAe;gBACnB,GAAG;aACJ,CAAC;YAEF,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC;YAE/B,kEAAkE;YAClE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAC3B,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAE7C,oDAAoD;YACpD,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,EAAE,CAAa,CAAC;YAC/E,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAChD,MAAM,IAAI,GAAG,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;gBACpC,MAAM,KAAK,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;gBAEjC,IAAI,IAAI,IAAI,KAAK,EAAE,CAAC;oBAClB,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC;gBAC3D,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -3,5 +3,5 @@
3
3
  *
4
4
  * @since 0.0.6
5
5
  */
6
- export { PositionRange, Position } from './core/position.js';
6
+ export * as Position from "./core/position.js";
7
7
  //# sourceMappingURL=position.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../../src/position.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"position.d.ts","sourceRoot":"","sources":["../../src/position.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAC"}
@@ -3,5 +3,5 @@
3
3
  *
4
4
  * @since 0.0.6
5
5
  */
6
- export { PositionRange, Position } from './core/position.js';
6
+ export * as Position from "./core/position.js";
7
7
  //# sourceMappingURL=position.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"position.js","sourceRoot":"","sources":["../../src/position.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"position.js","sourceRoot":"","sources":["../../src/position.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,QAAQ,MAAM,oBAAoB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphprotocol/grc-20",
3
- "version": "0.20.2",
3
+ "version": "0.21.1",
4
4
  "license": "MIT",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -13,7 +13,6 @@
13
13
  "exports": {
14
14
  "./package.json": "./package.json",
15
15
  ".": "./dist/index.js",
16
- "./constants": "./dist/constants.js",
17
16
  "./proto": "./dist/proto.js",
18
17
  "./contracts": "./dist/contracts.js",
19
18
  "./abis": "./dist/abis.js"
@@ -24,10 +23,10 @@
24
23
  "effect": "^3.13.6",
25
24
  "ethers": "^5.7.2",
26
25
  "fflate": "^0.8.2",
26
+ "fractional-indexing-jittered": "^1.0.0",
27
27
  "graphql-request": "^7.1.2",
28
28
  "image-size": "^2.0.0",
29
29
  "permissionless": "^0.2.35",
30
- "position-strings": "^2.0.1",
31
30
  "uuid": "^11.1.0",
32
31
  "viem": "^2.23.6"
33
32
  },
@@ -1,7 +0,0 @@
1
- /**
2
- * This module provides common constants used in the knowledge graph.
3
- *
4
- * @since 0.0.6
5
- */
6
- export declare const INITIAL_RELATION_INDEX_VALUE: string;
7
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,eAAO,MAAM,4BAA4B,QAA8C,CAAC"}
package/dist/constants.js DELETED
@@ -1,8 +0,0 @@
1
- /**
2
- * This module provides common constants used in the knowledge graph.
3
- *
4
- * @since 0.0.6
5
- */
6
- import { Position, PositionRange } from './src/position.js';
7
- export const INITIAL_RELATION_INDEX_VALUE = Position.createBetween(PositionRange.FIRST);
8
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE5D,MAAM,CAAC,MAAM,4BAA4B,GAAG,QAAQ,CAAC,aAAa,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=convert-ids.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"convert-ids.d.ts","sourceRoot":"","sources":["../convert-ids.ts"],"names":[],"mappings":""}
@@ -1,42 +0,0 @@
1
- import { readFile, writeFile } from 'node:fs/promises';
2
- import { dirname, join } from 'node:path';
3
- import { fileURLToPath } from 'node:url';
4
- import { decodeBase58ToUUID } from './src/core/base58.js';
5
- // Helper function to check if a string is a UUID
6
- function isUUID(str) {
7
- const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
8
- return uuidRegex.test(str);
9
- }
10
- async function convertIds() {
11
- const __filename = fileURLToPath(import.meta.url);
12
- const __dirname = dirname(__filename);
13
- const filePath = join(__dirname, 'src/core/idsv2/content.ts');
14
- // Read the file content
15
- const content = await readFile(filePath, 'utf-8');
16
- // Find all Id() calls and convert them
17
- const updatedContent = content.replace(/Id\(['"]([^'"]+)['"]\)/g, (match, id) => {
18
- if (isUUID(id)) {
19
- console.log(`Already a UUID: ${id}`);
20
- return match;
21
- }
22
- try {
23
- const uuid = decodeBase58ToUUID(id);
24
- console.log(`Converting ${id} to UUID ${uuid}`);
25
- return `Id('${uuid}')`;
26
- }
27
- catch (error) {
28
- if (error instanceof Error) {
29
- console.error(`Error converting ${id}: ${error.message}`);
30
- }
31
- else {
32
- console.error(`Error converting ${id}: Unknown error`);
33
- }
34
- return match;
35
- }
36
- });
37
- // Write the updated content back to the file
38
- await writeFile(filePath, updatedContent, 'utf-8');
39
- console.log('File has been updated with converted UUIDs');
40
- }
41
- convertIds().catch(console.error);
42
- //# sourceMappingURL=convert-ids.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"convert-ids.js","sourceRoot":"","sources":["../convert-ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,iDAAiD;AACjD,SAAS,MAAM,CAAC,GAAW;IACzB,MAAM,SAAS,GAAG,iEAAiE,CAAC;IACpF,OAAO,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7B,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,MAAM,UAAU,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAClD,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACtC,MA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4
- */
5
- export * from './src/proto/gen/src/proto/ipfsv2_pb.js';
6
- /**
7
- * This module provides utility functions for working with the GRC-20 Edit
8
- * protobuf in TypeScript.
9
- */
10
- export * as EditProposal from './src/proto/editv2.js';
11
- //# sourceMappingURL=protov2.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"protov2.d.ts","sourceRoot":"","sources":["../protov2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,wCAAwC,CAAC;AAEvD;;;GAGG;AACH,OAAO,KAAK,YAAY,MAAM,uBAAuB,CAAC"}
package/dist/protov2.js DELETED
@@ -1,11 +0,0 @@
1
- /**
2
- * This module provides utility functions for working with GRC-20 protobufs
3
- * in TypeScript.
4
- */
5
- export * from './src/proto/gen/src/proto/ipfsv2_pb.js';
6
- /**
7
- * This module provides utility functions for working with the GRC-20 Edit
8
- * protobuf in TypeScript.
9
- */
10
- export * as EditProposal from './src/proto/editv2.js';
11
- //# sourceMappingURL=protov2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"protov2.js","sourceRoot":"","sources":["../protov2.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,wCAAwC,CAAC;AAEvD;;;GAGG;AACH,OAAO,KAAK,YAAY,MAAM,uBAAuB,CAAC"}
@@ -1,15 +0,0 @@
1
- /**
2
- * This module provides utility functions for working with image blocks
3
- * in TypeScript.
4
- *
5
- * @since 0.0.6
6
- */
7
- /**
8
- * Image entities and Image Blocks are functionally the same thing. The
9
- * relation consuming the entity is what gives it contextual meaning. e.g.,
10
- * if the Image is consumed by an Avatar relation, then we know the image
11
- * is an avatar. If it's consumed by a Block relation, then we know the
12
- * image is a block.
13
- */
14
- export { make } from '../image.js';
15
- //# sourceMappingURL=image.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../../src/core/blocks/image.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;GAMG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC"}
@@ -1,15 +0,0 @@
1
- /**
2
- * This module provides utility functions for working with image blocks
3
- * in TypeScript.
4
- *
5
- * @since 0.0.6
6
- */
7
- /**
8
- * Image entities and Image Blocks are functionally the same thing. The
9
- * relation consuming the entity is what gives it contextual meaning. e.g.,
10
- * if the Image is consumed by an Avatar relation, then we know the image
11
- * is an avatar. If it's consumed by a Block relation, then we know the
12
- * image is a block.
13
- */
14
- export { make } from '../image.js';
15
- //# sourceMappingURL=image.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"image.js","sourceRoot":"","sources":["../../../../src/core/blocks/image.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;GAMG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC"}