@graphty/graph-io 0.3.47 → 0.3.49

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 (770) hide show
  1. package/dist/chunks/{approximations-wWjCRzKj.js → approximations-Bzn3L-je.js} +2 -2
  2. package/dist/chunks/{approximations-wWjCRzKj.js.map → approximations-Bzn3L-je.js.map} +1 -1
  3. package/dist/chunks/bends-BGXjv_U4.js +129 -0
  4. package/dist/chunks/bends-BGXjv_U4.js.map +1 -0
  5. package/dist/chunks/{block-DiGq58c3.js → block-iptrlMBb.js} +947 -134
  6. package/dist/chunks/block-iptrlMBb.js.map +1 -0
  7. package/dist/chunks/choose-CczZJaX_.js +717 -0
  8. package/dist/chunks/choose-CczZJaX_.js.map +1 -0
  9. package/dist/chunks/codes-BE2xir2k.js +157 -0
  10. package/dist/chunks/codes-BE2xir2k.js.map +1 -0
  11. package/dist/chunks/{constants-BKwqelYD.js → constants-CKkYLPtt.js} +2 -2
  12. package/dist/chunks/{constants-BKwqelYD.js.map → constants-CKkYLPtt.js.map} +1 -1
  13. package/dist/chunks/context-C3p0RQxR.js +664 -0
  14. package/dist/chunks/context-C3p0RQxR.js.map +1 -0
  15. package/dist/chunks/{convert-BcQ8_jMo.js → convert-Ct2zelbQ.js} +7 -2
  16. package/dist/chunks/convert-Ct2zelbQ.js.map +1 -0
  17. package/dist/chunks/credentials-DXHx7nwR.js +349 -0
  18. package/dist/chunks/credentials-DXHx7nwR.js.map +1 -0
  19. package/dist/chunks/cx-export-Bt6NoqTQ.js +259 -0
  20. package/dist/chunks/cx-export-Bt6NoqTQ.js.map +1 -0
  21. package/dist/chunks/descriptor-B28U25x4.js +60 -0
  22. package/dist/chunks/descriptor-B28U25x4.js.map +1 -0
  23. package/dist/chunks/descriptor-C-YDhtsn.js +48 -0
  24. package/dist/chunks/descriptor-C-YDhtsn.js.map +1 -0
  25. package/dist/chunks/descriptor-DLA5kINx.js +142 -0
  26. package/dist/chunks/descriptor-DLA5kINx.js.map +1 -0
  27. package/dist/chunks/{emit-CwU8cUmG.js → emit-BwHQkZle.js} +1690 -103
  28. package/dist/chunks/emit-BwHQkZle.js.map +1 -0
  29. package/dist/chunks/{escape-CgzxiYPg.js → escape-CuCIzNMB.js} +12 -12
  30. package/dist/chunks/{escape-CgzxiYPg.js.map → escape-CuCIzNMB.js.map} +1 -1
  31. package/dist/chunks/{export-BvqAXCKh.js → export-Cha4dRFz.js} +48 -1780
  32. package/dist/chunks/export-Cha4dRFz.js.map +1 -0
  33. package/dist/chunks/{exporter--Mk9gXCJ.js → exporter-BP6otMO6.js} +6 -4
  34. package/dist/chunks/{exporter--Mk9gXCJ.js.map → exporter-BP6otMO6.js.map} +1 -1
  35. package/dist/chunks/{exporter-CrDWIyiq.js → exporter-D2CETOMK.js} +1222 -154
  36. package/dist/chunks/exporter-D2CETOMK.js.map +1 -0
  37. package/dist/chunks/{exporter-DndFlGSa.js → exporter-D9yMtocA.js} +7 -6
  38. package/dist/chunks/{exporter-DndFlGSa.js.map → exporter-D9yMtocA.js.map} +1 -1
  39. package/dist/chunks/exporter-_jrBTnos.js +1009 -0
  40. package/dist/chunks/exporter-_jrBTnos.js.map +1 -0
  41. package/dist/chunks/{exporter-CJgfhF-l.js → exporter-nDfxIK5D.js} +9 -7
  42. package/dist/chunks/{exporter-CJgfhF-l.js.map → exporter-nDfxIK5D.js.map} +1 -1
  43. package/dist/chunks/format-BXiAb-1h.js +408 -0
  44. package/dist/chunks/format-BXiAb-1h.js.map +1 -0
  45. package/dist/chunks/{generic-Dq1ntt9q.js → generic-ymWCETAJ.js} +387 -31
  46. package/dist/chunks/generic-ymWCETAJ.js.map +1 -0
  47. package/dist/chunks/{importer-CMmeMWlC.js → importer-B92x1xY5.js} +15 -263
  48. package/dist/chunks/importer-B92x1xY5.js.map +1 -0
  49. package/dist/chunks/{importer-DiZRmOQG.js → importer-CT9mJ1nn.js} +328 -90
  50. package/dist/chunks/importer-CT9mJ1nn.js.map +1 -0
  51. package/dist/chunks/{importer-COTK9Tsl.js → importer-DaLTjbds.js} +116 -1099
  52. package/dist/chunks/importer-DaLTjbds.js.map +1 -0
  53. package/dist/chunks/{importer-iFYPEKaJ.js → importer-GREKMdIf.js} +28 -16
  54. package/dist/chunks/importer-GREKMdIf.js.map +1 -0
  55. package/dist/chunks/{importer-BSvfrX_h.js → importer-PqaaKKnY.js} +23 -1016
  56. package/dist/chunks/importer-PqaaKKnY.js.map +1 -0
  57. package/dist/chunks/{importer-yh_aBCU6.js → importer-Vn5QvmmJ.js} +66 -12
  58. package/dist/chunks/importer-Vn5QvmmJ.js.map +1 -0
  59. package/dist/chunks/{importer-e6LGpqHB.js → importer-vRq4h3j5.js} +1470 -354
  60. package/dist/chunks/importer-vRq4h3j5.js.map +1 -0
  61. package/dist/chunks/input-CAxt_aV-.js +1397 -0
  62. package/dist/chunks/input-CAxt_aV-.js.map +1 -0
  63. package/dist/chunks/{json-elements-DJZRZ6jd.js → json-elements-Cq76WjnZ.js} +4 -4
  64. package/dist/chunks/{json-elements-DJZRZ6jd.js.map → json-elements-Cq76WjnZ.js.map} +1 -1
  65. package/dist/chunks/{lexicon-CT69Kd87.js → lexicon-Clf4QIyl.js} +299 -77
  66. package/dist/chunks/lexicon-Clf4QIyl.js.map +1 -0
  67. package/dist/chunks/{ontology-export-G4MqRdux.js → ontology-export-OMo91mb0.js} +4 -3
  68. package/dist/chunks/{ontology-export-G4MqRdux.js.map → ontology-export-OMo91mb0.js.map} +1 -1
  69. package/dist/chunks/{records-CiaWZrFH.js → records-NJiYvekn.js} +2 -2
  70. package/dist/chunks/{records-CiaWZrFH.js.map → records-NJiYvekn.js.map} +1 -1
  71. package/dist/chunks/{format-BpQBx8MZ.js → report-CwMfYa9J.js} +70 -127
  72. package/dist/chunks/report-CwMfYa9J.js.map +1 -0
  73. package/dist/chunks/round-trip-Zm3_ivgq.js +79 -0
  74. package/dist/chunks/round-trip-Zm3_ivgq.js.map +1 -0
  75. package/dist/chunks/sigv4-EokFic1V.js +247 -0
  76. package/dist/chunks/sigv4-EokFic1V.js.map +1 -0
  77. package/dist/chunks/{styles-BQnsga7p.js → styles-CCs214_3.js} +1300 -168
  78. package/dist/chunks/styles-CCs214_3.js.map +1 -0
  79. package/dist/chunks/styles-Cm62yyQX.js +2812 -0
  80. package/dist/chunks/styles-Cm62yyQX.js.map +1 -0
  81. package/dist/chunks/styles-DPQQIig4.js +1928 -0
  82. package/dist/chunks/styles-DPQQIig4.js.map +1 -0
  83. package/dist/chunks/styles-yed-UMFdNqze.js +1213 -0
  84. package/dist/chunks/styles-yed-UMFdNqze.js.map +1 -0
  85. package/dist/chunks/{text-CzJNFOS9.js → text-ystE2bYi.js} +2 -2
  86. package/dist/chunks/{text-CzJNFOS9.js.map → text-ystE2bYi.js.map} +1 -1
  87. package/dist/csv.js +7 -5
  88. package/dist/csv.js.map +1 -1
  89. package/dist/cx.js +5 -4
  90. package/dist/cx.js.map +1 -1
  91. package/dist/cx2.js +2 -2
  92. package/dist/cys.js +1 -1
  93. package/dist/dot.js +5 -4
  94. package/dist/dot.js.map +1 -1
  95. package/dist/gexf.js +42 -10
  96. package/dist/gexf.js.map +1 -1
  97. package/dist/gml.js +850 -193
  98. package/dist/gml.js.map +1 -1
  99. package/dist/graph-io.js +1189 -220
  100. package/dist/graph-io.js.map +1 -1
  101. package/dist/graphml.js +3 -3
  102. package/dist/json.js +3 -2
  103. package/dist/neo4j.js +6 -4
  104. package/dist/neo4j.js.map +1 -1
  105. package/dist/obo.js +1 -1
  106. package/dist/pajek.js +1 -1
  107. package/dist/positions.js +45 -3
  108. package/dist/positions.js.map +1 -1
  109. package/dist/sources-cypher.d.ts +1 -0
  110. package/dist/sources-cypher.js +1351 -0
  111. package/dist/sources-cypher.js.map +1 -0
  112. package/dist/sources-ndex.d.ts +1 -0
  113. package/dist/sources-ndex.js +278 -0
  114. package/dist/sources-ndex.js.map +1 -0
  115. package/dist/sources-rest.d.ts +1 -0
  116. package/dist/sources-rest.js +1377 -0
  117. package/dist/sources-rest.js.map +1 -0
  118. package/dist/sources-sparql.d.ts +1 -0
  119. package/dist/sources-sparql.js +405 -0
  120. package/dist/sources-sparql.js.map +1 -0
  121. package/dist/src/common/report.d.ts +6 -3
  122. package/dist/src/common/report.d.ts.map +1 -1
  123. package/dist/src/common/report.js +15 -9
  124. package/dist/src/common/report.js.map +1 -1
  125. package/dist/src/formats/cx/importer.d.ts.map +1 -1
  126. package/dist/src/formats/cx/importer.js +5 -1
  127. package/dist/src/formats/cx/importer.js.map +1 -1
  128. package/dist/src/formats/cx/styles.d.ts +24 -1
  129. package/dist/src/formats/cx/styles.d.ts.map +1 -1
  130. package/dist/src/formats/cx/styles.js +118 -11
  131. package/dist/src/formats/cx/styles.js.map +1 -1
  132. package/dist/src/formats/cx2/importer.d.ts.map +1 -1
  133. package/dist/src/formats/cx2/importer.js +1 -0
  134. package/dist/src/formats/cx2/importer.js.map +1 -1
  135. package/dist/src/formats/cx2/styles.d.ts.map +1 -1
  136. package/dist/src/formats/cx2/styles.js +3 -1
  137. package/dist/src/formats/cx2/styles.js.map +1 -1
  138. package/dist/src/formats/cys/importer.d.ts.map +1 -1
  139. package/dist/src/formats/cys/importer.js +1 -0
  140. package/dist/src/formats/cys/importer.js.map +1 -1
  141. package/dist/src/formats/cys/styles.d.ts +2 -0
  142. package/dist/src/formats/cys/styles.d.ts.map +1 -1
  143. package/dist/src/formats/cys/styles.js +15 -7
  144. package/dist/src/formats/cys/styles.js.map +1 -1
  145. package/dist/src/formats/dot/drawing.d.ts +98 -0
  146. package/dist/src/formats/dot/drawing.d.ts.map +1 -0
  147. package/dist/src/formats/dot/drawing.js +734 -0
  148. package/dist/src/formats/dot/drawing.js.map +1 -0
  149. package/dist/src/formats/dot/importer.d.ts.map +1 -1
  150. package/dist/src/formats/dot/importer.js +108 -31
  151. package/dist/src/formats/dot/importer.js.map +1 -1
  152. package/dist/src/formats/dot/label-places.d.ts +34 -0
  153. package/dist/src/formats/dot/label-places.d.ts.map +1 -0
  154. package/dist/src/formats/dot/label-places.js +179 -0
  155. package/dist/src/formats/dot/label-places.js.map +1 -0
  156. package/dist/src/formats/dot/record.d.ts +50 -0
  157. package/dist/src/formats/dot/record.d.ts.map +1 -0
  158. package/dist/src/formats/dot/record.js +275 -0
  159. package/dist/src/formats/dot/record.js.map +1 -0
  160. package/dist/src/formats/dot/styles.d.ts +62 -2
  161. package/dist/src/formats/dot/styles.d.ts.map +1 -1
  162. package/dist/src/formats/dot/styles.js +1457 -120
  163. package/dist/src/formats/dot/styles.js.map +1 -1
  164. package/dist/src/formats/gexf/dialog-metrics.d.ts +15 -0
  165. package/dist/src/formats/gexf/dialog-metrics.d.ts.map +1 -0
  166. package/dist/src/formats/gexf/dialog-metrics.js +59 -0
  167. package/dist/src/formats/gexf/dialog-metrics.js.map +1 -0
  168. package/dist/src/formats/gexf/importer.d.ts +7 -0
  169. package/dist/src/formats/gexf/importer.d.ts.map +1 -1
  170. package/dist/src/formats/gexf/importer.js +41 -5
  171. package/dist/src/formats/gexf/importer.js.map +1 -1
  172. package/dist/src/formats/gexf/preview.d.ts +77 -0
  173. package/dist/src/formats/gexf/preview.d.ts.map +1 -0
  174. package/dist/src/formats/gexf/preview.js +191 -0
  175. package/dist/src/formats/gexf/preview.js.map +1 -0
  176. package/dist/src/formats/gexf/schema.d.ts.map +1 -1
  177. package/dist/src/formats/gexf/schema.js +2 -1
  178. package/dist/src/formats/gexf/schema.js.map +1 -1
  179. package/dist/src/formats/gexf/styles.d.ts +60 -16
  180. package/dist/src/formats/gexf/styles.d.ts.map +1 -1
  181. package/dist/src/formats/gexf/styles.js +883 -131
  182. package/dist/src/formats/gexf/styles.js.map +1 -1
  183. package/dist/src/formats/gml/importer.d.ts +5 -2
  184. package/dist/src/formats/gml/importer.d.ts.map +1 -1
  185. package/dist/src/formats/gml/importer.js +258 -71
  186. package/dist/src/formats/gml/importer.js.map +1 -1
  187. package/dist/src/formats/gml/index.d.ts +1 -1
  188. package/dist/src/formats/gml/index.d.ts.map +1 -1
  189. package/dist/src/formats/gml/index.js +1 -1
  190. package/dist/src/formats/gml/index.js.map +1 -1
  191. package/dist/src/formats/gml/positions.d.ts +7 -0
  192. package/dist/src/formats/gml/positions.d.ts.map +1 -1
  193. package/dist/src/formats/gml/positions.js +29 -7
  194. package/dist/src/formats/gml/positions.js.map +1 -1
  195. package/dist/src/formats/gml/styles.d.ts.map +1 -1
  196. package/dist/src/formats/gml/styles.js +756 -103
  197. package/dist/src/formats/gml/styles.js.map +1 -1
  198. package/dist/src/formats/graphml/styles-plain.d.ts.map +1 -1
  199. package/dist/src/formats/graphml/styles-plain.js +8 -12
  200. package/dist/src/formats/graphml/styles-plain.js.map +1 -1
  201. package/dist/src/formats/graphml/styles-yed.d.ts +21 -15
  202. package/dist/src/formats/graphml/styles-yed.d.ts.map +1 -1
  203. package/dist/src/formats/graphml/styles-yed.js +749 -148
  204. package/dist/src/formats/graphml/styles-yed.js.map +1 -1
  205. package/dist/src/formats/graphml/styles-yfiles3.d.ts +1 -1
  206. package/dist/src/formats/graphml/styles-yfiles3.d.ts.map +1 -1
  207. package/dist/src/formats/graphml/styles-yfiles3.js +429 -64
  208. package/dist/src/formats/graphml/styles-yfiles3.js.map +1 -1
  209. package/dist/src/formats/graphml/yfiles.d.ts +3 -3
  210. package/dist/src/formats/graphml/yfiles.d.ts.map +1 -1
  211. package/dist/src/formats/graphml/yfiles.js +16 -6
  212. package/dist/src/formats/graphml/yfiles.js.map +1 -1
  213. package/dist/src/formats/json/dialect.d.ts +3 -2
  214. package/dist/src/formats/json/dialect.d.ts.map +1 -1
  215. package/dist/src/formats/json/dialect.js +39 -5
  216. package/dist/src/formats/json/dialect.js.map +1 -1
  217. package/dist/src/formats/json/importer.d.ts +13 -2
  218. package/dist/src/formats/json/importer.d.ts.map +1 -1
  219. package/dist/src/formats/json/importer.js +42 -6
  220. package/dist/src/formats/json/importer.js.map +1 -1
  221. package/dist/src/formats/json/index.d.ts +1 -1
  222. package/dist/src/formats/json/index.d.ts.map +1 -1
  223. package/dist/src/formats/json/index.js +1 -1
  224. package/dist/src/formats/json/index.js.map +1 -1
  225. package/dist/src/formats/json/positions.d.ts +5 -2
  226. package/dist/src/formats/json/positions.d.ts.map +1 -1
  227. package/dist/src/formats/json/positions.js +20 -4
  228. package/dist/src/formats/json/positions.js.map +1 -1
  229. package/dist/src/formats/json/styles.d.ts +12 -1
  230. package/dist/src/formats/json/styles.d.ts.map +1 -1
  231. package/dist/src/formats/json/styles.js +1755 -136
  232. package/dist/src/formats/json/styles.js.map +1 -1
  233. package/dist/src/formats/pajek/draw.d.ts +96 -0
  234. package/dist/src/formats/pajek/draw.d.ts.map +1 -0
  235. package/dist/src/formats/pajek/draw.js +372 -0
  236. package/dist/src/formats/pajek/draw.js.map +1 -0
  237. package/dist/src/formats/pajek/exporter.d.ts.map +1 -1
  238. package/dist/src/formats/pajek/exporter.js +70 -51
  239. package/dist/src/formats/pajek/exporter.js.map +1 -1
  240. package/dist/src/formats/pajek/importer.d.ts +9 -0
  241. package/dist/src/formats/pajek/importer.d.ts.map +1 -1
  242. package/dist/src/formats/pajek/importer.js +233 -102
  243. package/dist/src/formats/pajek/importer.js.map +1 -1
  244. package/dist/src/formats/pajek/index.d.ts +1 -0
  245. package/dist/src/formats/pajek/index.d.ts.map +1 -1
  246. package/dist/src/formats/pajek/index.js.map +1 -1
  247. package/dist/src/formats/pajek/styles.d.ts +15 -7
  248. package/dist/src/formats/pajek/styles.d.ts.map +1 -1
  249. package/dist/src/formats/pajek/styles.js +1279 -114
  250. package/dist/src/formats/pajek/styles.js.map +1 -1
  251. package/dist/src/formats/pajek/syntax.d.ts +10 -1
  252. package/dist/src/formats/pajek/syntax.d.ts.map +1 -1
  253. package/dist/src/formats/pajek/syntax.js +26 -2
  254. package/dist/src/formats/pajek/syntax.js.map +1 -1
  255. package/dist/src/formats/xgmml/emit.d.ts +1 -0
  256. package/dist/src/formats/xgmml/emit.d.ts.map +1 -1
  257. package/dist/src/formats/xgmml/emit.js +65 -5
  258. package/dist/src/formats/xgmml/emit.js.map +1 -1
  259. package/dist/src/formats/xgmml/styles.d.ts +23 -3
  260. package/dist/src/formats/xgmml/styles.d.ts.map +1 -1
  261. package/dist/src/formats/xgmml/styles.js +278 -60
  262. package/dist/src/formats/xgmml/styles.js.map +1 -1
  263. package/dist/src/index.d.ts +10 -2
  264. package/dist/src/index.d.ts.map +1 -1
  265. package/dist/src/index.js +11 -2
  266. package/dist/src/index.js.map +1 -1
  267. package/dist/src/positions/convert.d.ts.map +1 -1
  268. package/dist/src/positions/convert.js +11 -1
  269. package/dist/src/positions/convert.js.map +1 -1
  270. package/dist/src/positions/extract.d.ts.map +1 -1
  271. package/dist/src/positions/extract.js +53 -1
  272. package/dist/src/positions/extract.js.map +1 -1
  273. package/dist/src/positions/index.d.ts +1 -1
  274. package/dist/src/positions/index.d.ts.map +1 -1
  275. package/dist/src/positions/types.d.ts +59 -0
  276. package/dist/src/positions/types.d.ts.map +1 -1
  277. package/dist/src/registry.d.ts +173 -1
  278. package/dist/src/registry.d.ts.map +1 -1
  279. package/dist/src/registry.js +196 -1
  280. package/dist/src/registry.js.map +1 -1
  281. package/dist/src/sources/builtins.d.ts +11 -0
  282. package/dist/src/sources/builtins.d.ts.map +1 -0
  283. package/dist/src/sources/builtins.js +53 -0
  284. package/dist/src/sources/builtins.js.map +1 -0
  285. package/dist/src/sources/codes.d.ts +230 -0
  286. package/dist/src/sources/codes.d.ts.map +1 -0
  287. package/dist/src/sources/codes.js +58 -0
  288. package/dist/src/sources/codes.js.map +1 -0
  289. package/dist/src/sources/context.d.ts +112 -0
  290. package/dist/src/sources/context.d.ts.map +1 -0
  291. package/dist/src/sources/context.js +740 -0
  292. package/dist/src/sources/context.js.map +1 -0
  293. package/dist/src/sources/credentials.d.ts +179 -0
  294. package/dist/src/sources/credentials.d.ts.map +1 -0
  295. package/dist/src/sources/credentials.js +301 -0
  296. package/dist/src/sources/credentials.js.map +1 -0
  297. package/dist/src/sources/cypher/descriptor.d.ts +21 -0
  298. package/dist/src/sources/cypher/descriptor.d.ts.map +1 -0
  299. package/dist/src/sources/cypher/descriptor.js +124 -0
  300. package/dist/src/sources/cypher/descriptor.js.map +1 -0
  301. package/dist/src/sources/cypher/flatten.d.ts +72 -0
  302. package/dist/src/sources/cypher/flatten.d.ts.map +1 -0
  303. package/dist/src/sources/cypher/flatten.js +279 -0
  304. package/dist/src/sources/cypher/flatten.js.map +1 -0
  305. package/dist/src/sources/cypher/index.d.ts +33 -0
  306. package/dist/src/sources/cypher/index.d.ts.map +1 -0
  307. package/dist/src/sources/cypher/index.js +511 -0
  308. package/dist/src/sources/cypher/index.js.map +1 -0
  309. package/dist/src/sources/cypher/params.d.ts +40 -0
  310. package/dist/src/sources/cypher/params.d.ts.map +1 -0
  311. package/dist/src/sources/cypher/params.js +6 -0
  312. package/dist/src/sources/cypher/params.js.map +1 -0
  313. package/dist/src/sources/cypher/profiles.d.ts +44 -0
  314. package/dist/src/sources/cypher/profiles.d.ts.map +1 -0
  315. package/dist/src/sources/cypher/profiles.js +61 -0
  316. package/dist/src/sources/cypher/profiles.js.map +1 -0
  317. package/dist/src/sources/cypher/query-builder.d.ts +123 -0
  318. package/dist/src/sources/cypher/query-builder.d.ts.map +1 -0
  319. package/dist/src/sources/cypher/query-builder.js +267 -0
  320. package/dist/src/sources/cypher/query-builder.js.map +1 -0
  321. package/dist/src/sources/cypher/transports/bolt.d.ts +21 -0
  322. package/dist/src/sources/cypher/transports/bolt.d.ts.map +1 -0
  323. package/dist/src/sources/cypher/transports/bolt.js +185 -0
  324. package/dist/src/sources/cypher/transports/bolt.js.map +1 -0
  325. package/dist/src/sources/cypher/transports/neptune-analytics.d.ts +15 -0
  326. package/dist/src/sources/cypher/transports/neptune-analytics.d.ts.map +1 -0
  327. package/dist/src/sources/cypher/transports/neptune-analytics.js +38 -0
  328. package/dist/src/sources/cypher/transports/neptune-analytics.js.map +1 -0
  329. package/dist/src/sources/cypher/transports/neptune-https.d.ts +31 -0
  330. package/dist/src/sources/cypher/transports/neptune-https.d.ts.map +1 -0
  331. package/dist/src/sources/cypher/transports/neptune-https.js +104 -0
  332. package/dist/src/sources/cypher/transports/neptune-https.js.map +1 -0
  333. package/dist/src/sources/cypher/transports/query-api.d.ts +14 -0
  334. package/dist/src/sources/cypher/transports/query-api.d.ts.map +1 -0
  335. package/dist/src/sources/cypher/transports/query-api.js +80 -0
  336. package/dist/src/sources/cypher/transports/query-api.js.map +1 -0
  337. package/dist/src/sources/cypher/transports/transport.d.ts +78 -0
  338. package/dist/src/sources/cypher/transports/transport.d.ts.map +1 -0
  339. package/dist/src/sources/cypher/transports/transport.js +77 -0
  340. package/dist/src/sources/cypher/transports/transport.js.map +1 -0
  341. package/dist/src/sources/cypher/types-map.d.ts +91 -0
  342. package/dist/src/sources/cypher/types-map.d.ts.map +1 -0
  343. package/dist/src/sources/cypher/types-map.js +306 -0
  344. package/dist/src/sources/cypher/types-map.js.map +1 -0
  345. package/dist/src/sources/define.d.ts +47 -0
  346. package/dist/src/sources/define.d.ts.map +1 -0
  347. package/dist/src/sources/define.js +173 -0
  348. package/dist/src/sources/define.js.map +1 -0
  349. package/dist/src/sources/fail.d.ts +33 -0
  350. package/dist/src/sources/fail.d.ts.map +1 -0
  351. package/dist/src/sources/fail.js +49 -0
  352. package/dist/src/sources/fail.js.map +1 -0
  353. package/dist/src/sources/ids.d.ts +69 -0
  354. package/dist/src/sources/ids.d.ts.map +1 -0
  355. package/dist/src/sources/ids.js +69 -0
  356. package/dist/src/sources/ids.js.map +1 -0
  357. package/dist/src/sources/ndex/client.d.ts +31 -0
  358. package/dist/src/sources/ndex/client.d.ts.map +1 -0
  359. package/dist/src/sources/ndex/client.js +90 -0
  360. package/dist/src/sources/ndex/client.js.map +1 -0
  361. package/dist/src/sources/ndex/descriptor.d.ts +10 -0
  362. package/dist/src/sources/ndex/descriptor.d.ts.map +1 -0
  363. package/dist/src/sources/ndex/descriptor.js +55 -0
  364. package/dist/src/sources/ndex/descriptor.js.map +1 -0
  365. package/dist/src/sources/ndex/expand.d.ts +20 -0
  366. package/dist/src/sources/ndex/expand.d.ts.map +1 -0
  367. package/dist/src/sources/ndex/expand.js +87 -0
  368. package/dist/src/sources/ndex/expand.js.map +1 -0
  369. package/dist/src/sources/ndex/index.d.ts +25 -0
  370. package/dist/src/sources/ndex/index.d.ts.map +1 -0
  371. package/dist/src/sources/ndex/index.js +191 -0
  372. package/dist/src/sources/ndex/index.js.map +1 -0
  373. package/dist/src/sources/ndex/params.d.ts +17 -0
  374. package/dist/src/sources/ndex/params.d.ts.map +1 -0
  375. package/dist/src/sources/ndex/params.js +6 -0
  376. package/dist/src/sources/ndex/params.js.map +1 -0
  377. package/dist/src/sources/ndex/share-url.d.ts +40 -0
  378. package/dist/src/sources/ndex/share-url.d.ts.map +1 -0
  379. package/dist/src/sources/ndex/share-url.js +64 -0
  380. package/dist/src/sources/ndex/share-url.js.map +1 -0
  381. package/dist/src/sources/params.d.ts +31 -0
  382. package/dist/src/sources/params.d.ts.map +1 -0
  383. package/dist/src/sources/params.js +6 -0
  384. package/dist/src/sources/params.js.map +1 -0
  385. package/dist/src/sources/registry.d.ts +118 -0
  386. package/dist/src/sources/registry.d.ts.map +1 -0
  387. package/dist/src/sources/registry.js +193 -0
  388. package/dist/src/sources/registry.js.map +1 -0
  389. package/dist/src/sources/rest/descriptor.d.ts +16 -0
  390. package/dist/src/sources/rest/descriptor.d.ts.map +1 -0
  391. package/dist/src/sources/rest/descriptor.js +76 -0
  392. package/dist/src/sources/rest/descriptor.js.map +1 -0
  393. package/dist/src/sources/rest/index.d.ts +14 -0
  394. package/dist/src/sources/rest/index.d.ts.map +1 -0
  395. package/dist/src/sources/rest/index.js +13 -0
  396. package/dist/src/sources/rest/index.js.map +1 -0
  397. package/dist/src/sources/rest/mapping.d.ts +30 -0
  398. package/dist/src/sources/rest/mapping.d.ts.map +1 -0
  399. package/dist/src/sources/rest/mapping.js +362 -0
  400. package/dist/src/sources/rest/mapping.js.map +1 -0
  401. package/dist/src/sources/rest/openalex.d.ts +27 -0
  402. package/dist/src/sources/rest/openalex.d.ts.map +1 -0
  403. package/dist/src/sources/rest/openalex.js +269 -0
  404. package/dist/src/sources/rest/openalex.js.map +1 -0
  405. package/dist/src/sources/rest/paging.d.ts +53 -0
  406. package/dist/src/sources/rest/paging.d.ts.map +1 -0
  407. package/dist/src/sources/rest/paging.js +138 -0
  408. package/dist/src/sources/rest/paging.js.map +1 -0
  409. package/dist/src/sources/rest/params.d.ts +216 -0
  410. package/dist/src/sources/rest/params.d.ts.map +1 -0
  411. package/dist/src/sources/rest/params.js +7 -0
  412. package/dist/src/sources/rest/params.js.map +1 -0
  413. package/dist/src/sources/rest/records.d.ts +41 -0
  414. package/dist/src/sources/rest/records.d.ts.map +1 -0
  415. package/dist/src/sources/rest/records.js +240 -0
  416. package/dist/src/sources/rest/records.js.map +1 -0
  417. package/dist/src/sources/rest/samples/deps-dev.d.ts +10 -0
  418. package/dist/src/sources/rest/samples/deps-dev.d.ts.map +1 -0
  419. package/dist/src/sources/rest/samples/deps-dev.js +47 -0
  420. package/dist/src/sources/rest/samples/deps-dev.js.map +1 -0
  421. package/dist/src/sources/rest/samples/string.d.ts +9 -0
  422. package/dist/src/sources/rest/samples/string.d.ts.map +1 -0
  423. package/dist/src/sources/rest/samples/string.js +42 -0
  424. package/dist/src/sources/rest/samples/string.js.map +1 -0
  425. package/dist/src/sources/rest/selectors.d.ts +41 -0
  426. package/dist/src/sources/rest/selectors.d.ts.map +1 -0
  427. package/dist/src/sources/rest/selectors.js +81 -0
  428. package/dist/src/sources/rest/selectors.js.map +1 -0
  429. package/dist/src/sources/rest/source.d.ts +67 -0
  430. package/dist/src/sources/rest/source.d.ts.map +1 -0
  431. package/dist/src/sources/rest/source.js +650 -0
  432. package/dist/src/sources/rest/source.js.map +1 -0
  433. package/dist/src/sources/rest/templates.d.ts +38 -0
  434. package/dist/src/sources/rest/templates.d.ts.map +1 -0
  435. package/dist/src/sources/rest/templates.js +125 -0
  436. package/dist/src/sources/rest/templates.js.map +1 -0
  437. package/dist/src/sources/run.d.ts +93 -0
  438. package/dist/src/sources/run.d.ts.map +1 -0
  439. package/dist/src/sources/run.js +673 -0
  440. package/dist/src/sources/run.js.map +1 -0
  441. package/dist/src/sources/sha256.d.ts +12 -0
  442. package/dist/src/sources/sha256.d.ts.map +1 -0
  443. package/dist/src/sources/sha256.js +95 -0
  444. package/dist/src/sources/sha256.js.map +1 -0
  445. package/dist/src/sources/sigv4.d.ts +26 -0
  446. package/dist/src/sources/sigv4.d.ts.map +1 -0
  447. package/dist/src/sources/sigv4.js +184 -0
  448. package/dist/src/sources/sigv4.js.map +1 -0
  449. package/dist/src/sources/sparql/descriptor.d.ts +10 -0
  450. package/dist/src/sources/sparql/descriptor.d.ts.map +1 -0
  451. package/dist/src/sources/sparql/descriptor.js +64 -0
  452. package/dist/src/sources/sparql/descriptor.js.map +1 -0
  453. package/dist/src/sources/sparql/index.d.ts +28 -0
  454. package/dist/src/sources/sparql/index.d.ts.map +1 -0
  455. package/dist/src/sources/sparql/index.js +314 -0
  456. package/dist/src/sources/sparql/index.js.map +1 -0
  457. package/dist/src/sources/sparql/ntriples.d.ts +69 -0
  458. package/dist/src/sources/sparql/ntriples.d.ts.map +1 -0
  459. package/dist/src/sources/sparql/ntriples.js +180 -0
  460. package/dist/src/sources/sparql/ntriples.js.map +1 -0
  461. package/dist/src/sources/sparql/params.d.ts +27 -0
  462. package/dist/src/sources/sparql/params.d.ts.map +1 -0
  463. package/dist/src/sources/sparql/params.js +5 -0
  464. package/dist/src/sources/sparql/params.js.map +1 -0
  465. package/dist/src/sources/sparql/query.d.ts +72 -0
  466. package/dist/src/sources/sparql/query.d.ts.map +1 -0
  467. package/dist/src/sources/sparql/query.js +113 -0
  468. package/dist/src/sources/sparql/query.js.map +1 -0
  469. package/dist/src/sources/testing.d.ts +96 -0
  470. package/dist/src/sources/testing.d.ts.map +1 -0
  471. package/dist/src/sources/testing.js +138 -0
  472. package/dist/src/sources/testing.js.map +1 -0
  473. package/dist/src/sources/types.d.ts +696 -0
  474. package/dist/src/sources/types.d.ts.map +1 -0
  475. package/dist/src/sources/types.js +10 -0
  476. package/dist/src/sources/types.js.map +1 -0
  477. package/dist/src/styles/annotations.d.ts +61 -5
  478. package/dist/src/styles/annotations.d.ts.map +1 -1
  479. package/dist/src/styles/annotations.js +130 -22
  480. package/dist/src/styles/annotations.js.map +1 -1
  481. package/dist/src/styles/canon/bends.d.ts +46 -0
  482. package/dist/src/styles/canon/bends.d.ts.map +1 -1
  483. package/dist/src/styles/canon/bends.js +123 -0
  484. package/dist/src/styles/canon/bends.js.map +1 -1
  485. package/dist/src/styles/canon/color-tables.d.ts +6 -1
  486. package/dist/src/styles/canon/color-tables.d.ts.map +1 -1
  487. package/dist/src/styles/canon/color-tables.js +10 -4
  488. package/dist/src/styles/canon/color-tables.js.map +1 -1
  489. package/dist/src/styles/canon/color.d.ts +3 -1
  490. package/dist/src/styles/canon/color.d.ts.map +1 -1
  491. package/dist/src/styles/canon/color.js +103 -3
  492. package/dist/src/styles/canon/color.js.map +1 -1
  493. package/dist/src/styles/canon/enums.d.ts +2 -2
  494. package/dist/src/styles/canon/enums.d.ts.map +1 -1
  495. package/dist/src/styles/canon/enums.js +82 -7
  496. package/dist/src/styles/canon/enums.js.map +1 -1
  497. package/dist/src/styles/canon/graphviz.d.ts +12 -3
  498. package/dist/src/styles/canon/graphviz.d.ts.map +1 -1
  499. package/dist/src/styles/canon/graphviz.js +57 -9
  500. package/dist/src/styles/canon/graphviz.js.map +1 -1
  501. package/dist/src/styles/canon/number.d.ts +8 -0
  502. package/dist/src/styles/canon/number.d.ts.map +1 -1
  503. package/dist/src/styles/canon/number.js +18 -0
  504. package/dist/src/styles/canon/number.js.map +1 -1
  505. package/dist/src/styles/canon/text.d.ts +29 -2
  506. package/dist/src/styles/canon/text.d.ts.map +1 -1
  507. package/dist/src/styles/canon/text.js +156 -16
  508. package/dist/src/styles/canon/text.js.map +1 -1
  509. package/dist/src/styles/codes.d.ts +2 -0
  510. package/dist/src/styles/codes.d.ts.map +1 -1
  511. package/dist/src/styles/codes.js +2 -0
  512. package/dist/src/styles/codes.js.map +1 -1
  513. package/dist/src/styles/cyjs/cascade.d.ts.map +1 -1
  514. package/dist/src/styles/cyjs/cascade.js +1037 -35
  515. package/dist/src/styles/cyjs/cascade.js.map +1 -1
  516. package/dist/src/styles/cyjs/defaults-table.d.ts.map +1 -1
  517. package/dist/src/styles/cyjs/defaults-table.js +5 -0
  518. package/dist/src/styles/cyjs/defaults-table.js.map +1 -1
  519. package/dist/src/styles/cyjs/emit.d.ts.map +1 -1
  520. package/dist/src/styles/cyjs/emit.js +216 -12
  521. package/dist/src/styles/cyjs/emit.js.map +1 -1
  522. package/dist/src/styles/cyjs/face.d.ts +20 -0
  523. package/dist/src/styles/cyjs/face.d.ts.map +1 -0
  524. package/dist/src/styles/cyjs/face.js +332 -0
  525. package/dist/src/styles/cyjs/face.js.map +1 -0
  526. package/dist/src/styles/cyjs/mappers.d.ts +48 -2
  527. package/dist/src/styles/cyjs/mappers.d.ts.map +1 -1
  528. package/dist/src/styles/cyjs/mappers.js +463 -26
  529. package/dist/src/styles/cyjs/mappers.js.map +1 -1
  530. package/dist/src/styles/cyjs/routes.d.ts +53 -0
  531. package/dist/src/styles/cyjs/routes.d.ts.map +1 -0
  532. package/dist/src/styles/cyjs/routes.js +360 -0
  533. package/dist/src/styles/cyjs/routes.js.map +1 -0
  534. package/dist/src/styles/cytoscape/charts.d.ts +23 -0
  535. package/dist/src/styles/cytoscape/charts.d.ts.map +1 -0
  536. package/dist/src/styles/cytoscape/charts.js +560 -0
  537. package/dist/src/styles/cytoscape/charts.js.map +1 -0
  538. package/dist/src/styles/cytoscape/emit.d.ts.map +1 -1
  539. package/dist/src/styles/cytoscape/emit.js +204 -44
  540. package/dist/src/styles/cytoscape/emit.js.map +1 -1
  541. package/dist/src/styles/cytoscape/lexicon.d.ts +97 -3
  542. package/dist/src/styles/cytoscape/lexicon.d.ts.map +1 -1
  543. package/dist/src/styles/cytoscape/lexicon.js +413 -79
  544. package/dist/src/styles/cytoscape/lexicon.js.map +1 -1
  545. package/dist/src/styles/cytoscape/mappings.d.ts +30 -0
  546. package/dist/src/styles/cytoscape/mappings.d.ts.map +1 -1
  547. package/dist/src/styles/cytoscape/mappings.js +92 -0
  548. package/dist/src/styles/cytoscape/mappings.js.map +1 -1
  549. package/dist/src/styles/cytoscape/resolve.d.ts +46 -3
  550. package/dist/src/styles/cytoscape/resolve.d.ts.map +1 -1
  551. package/dist/src/styles/cytoscape/resolve.js +632 -22
  552. package/dist/src/styles/cytoscape/resolve.js.map +1 -1
  553. package/dist/src/styles/cytoscape/translate.d.ts.map +1 -1
  554. package/dist/src/styles/cytoscape/translate.js +10 -10
  555. package/dist/src/styles/cytoscape/translate.js.map +1 -1
  556. package/dist/src/styles/defaults.d.ts +50 -0
  557. package/dist/src/styles/defaults.d.ts.map +1 -1
  558. package/dist/src/styles/defaults.js +315 -37
  559. package/dist/src/styles/defaults.js.map +1 -1
  560. package/dist/src/styles/index.d.ts +4 -3
  561. package/dist/src/styles/index.d.ts.map +1 -1
  562. package/dist/src/styles/index.js +3 -2
  563. package/dist/src/styles/index.js.map +1 -1
  564. package/dist/src/styles/internal.d.ts +1 -0
  565. package/dist/src/styles/internal.d.ts.map +1 -1
  566. package/dist/src/styles/internal.js +1 -0
  567. package/dist/src/styles/internal.js.map +1 -1
  568. package/dist/src/styles/io/block.d.ts.map +1 -1
  569. package/dist/src/styles/io/block.js +9 -0
  570. package/dist/src/styles/io/block.js.map +1 -1
  571. package/dist/src/styles/io/generic.d.ts.map +1 -1
  572. package/dist/src/styles/io/generic.js +56 -16
  573. package/dist/src/styles/io/generic.js.map +1 -1
  574. package/dist/src/styles/io/round-trip.d.ts +56 -0
  575. package/dist/src/styles/io/round-trip.d.ts.map +1 -0
  576. package/dist/src/styles/io/round-trip.js +138 -0
  577. package/dist/src/styles/io/round-trip.js.map +1 -0
  578. package/dist/src/styles/io/writer.d.ts.map +1 -1
  579. package/dist/src/styles/io/writer.js +13 -4
  580. package/dist/src/styles/io/writer.js.map +1 -1
  581. package/dist/src/styles/notes.d.ts.map +1 -1
  582. package/dist/src/styles/notes.js +1 -0
  583. package/dist/src/styles/notes.js.map +1 -1
  584. package/dist/src/styles/plan/features.d.ts +1 -1
  585. package/dist/src/styles/plan/features.d.ts.map +1 -1
  586. package/dist/src/styles/plan/features.js +22 -2
  587. package/dist/src/styles/plan/features.js.map +1 -1
  588. package/dist/src/styles/plan/index.d.ts +1 -1
  589. package/dist/src/styles/plan/index.d.ts.map +1 -1
  590. package/dist/src/styles/plan/index.js +1 -1
  591. package/dist/src/styles/plan/index.js.map +1 -1
  592. package/dist/src/styles/plan/plan.d.ts.map +1 -1
  593. package/dist/src/styles/plan/plan.js +61 -4
  594. package/dist/src/styles/plan/plan.js.map +1 -1
  595. package/dist/src/styles/plan/resolve.d.ts +13 -1
  596. package/dist/src/styles/plan/resolve.d.ts.map +1 -1
  597. package/dist/src/styles/plan/resolve.js +53 -6
  598. package/dist/src/styles/plan/resolve.js.map +1 -1
  599. package/dist/src/styles/slots.d.ts +14 -0
  600. package/dist/src/styles/slots.d.ts.map +1 -0
  601. package/dist/src/styles/slots.js +20 -0
  602. package/dist/src/styles/slots.js.map +1 -0
  603. package/dist/src/styles/types.d.ts +638 -5
  604. package/dist/src/styles/types.d.ts.map +1 -1
  605. package/dist/src/styles/vocabulary.d.ts +3 -2
  606. package/dist/src/styles/vocabulary.d.ts.map +1 -1
  607. package/dist/src/styles/vocabulary.js +218 -1
  608. package/dist/src/styles/vocabulary.js.map +1 -1
  609. package/dist/src/types.d.ts +19 -5
  610. package/dist/src/types.d.ts.map +1 -1
  611. package/dist/src/types.js.map +1 -1
  612. package/dist/styles.js +29 -238
  613. package/dist/styles.js.map +1 -1
  614. package/dist/xgmml.js +3 -3
  615. package/docs/samples/people.json +6 -0
  616. package/package.json +53 -8
  617. package/src/common/report.ts +27 -7
  618. package/src/formats/cx/importer.ts +6 -1
  619. package/src/formats/cx/styles.ts +144 -9
  620. package/src/formats/cx2/importer.ts +1 -0
  621. package/src/formats/cx2/styles.ts +3 -1
  622. package/src/formats/cys/importer.ts +1 -0
  623. package/src/formats/cys/styles.ts +27 -5
  624. package/src/formats/dot/drawing.ts +799 -0
  625. package/src/formats/dot/importer.ts +120 -35
  626. package/src/formats/dot/label-places.ts +228 -0
  627. package/src/formats/dot/record.ts +336 -0
  628. package/src/formats/dot/styles.ts +1657 -154
  629. package/src/formats/gexf/dialog-metrics.ts +61 -0
  630. package/src/formats/gexf/importer.ts +50 -5
  631. package/src/formats/gexf/preview.ts +217 -0
  632. package/src/formats/gexf/schema.ts +2 -1
  633. package/src/formats/gexf/styles.ts +1144 -142
  634. package/src/formats/gml/importer.ts +291 -76
  635. package/src/formats/gml/index.ts +1 -1
  636. package/src/formats/gml/positions.ts +29 -7
  637. package/src/formats/gml/styles.ts +854 -111
  638. package/src/formats/graphml/styles-plain.ts +8 -23
  639. package/src/formats/graphml/styles-yed.ts +821 -159
  640. package/src/formats/graphml/styles-yfiles3.ts +485 -63
  641. package/src/formats/graphml/yfiles.ts +19 -6
  642. package/src/formats/json/dialect.ts +41 -5
  643. package/src/formats/json/importer.ts +59 -7
  644. package/src/formats/json/index.ts +1 -0
  645. package/src/formats/json/positions.ts +22 -5
  646. package/src/formats/json/styles.ts +2041 -185
  647. package/src/formats/pajek/draw.ts +458 -0
  648. package/src/formats/pajek/exporter.ts +81 -49
  649. package/src/formats/pajek/importer.ts +278 -103
  650. package/src/formats/pajek/index.ts +1 -0
  651. package/src/formats/pajek/styles.ts +1382 -133
  652. package/src/formats/pajek/syntax.ts +27 -2
  653. package/src/formats/xgmml/emit.ts +73 -5
  654. package/src/formats/xgmml/styles.ts +331 -71
  655. package/src/index.ts +94 -0
  656. package/src/positions/convert.ts +12 -1
  657. package/src/positions/extract.ts +55 -1
  658. package/src/positions/index.ts +1 -0
  659. package/src/positions/types.ts +60 -0
  660. package/src/registry.ts +326 -1
  661. package/src/sources/builtins.ts +63 -0
  662. package/src/sources/codes.ts +235 -0
  663. package/src/sources/context.ts +894 -0
  664. package/src/sources/credentials.ts +409 -0
  665. package/src/sources/cypher/descriptor.ts +131 -0
  666. package/src/sources/cypher/flatten.ts +323 -0
  667. package/src/sources/cypher/index.ts +628 -0
  668. package/src/sources/cypher/params.ts +41 -0
  669. package/src/sources/cypher/profiles.ts +78 -0
  670. package/src/sources/cypher/query-builder.ts +327 -0
  671. package/src/sources/cypher/transports/bolt.ts +228 -0
  672. package/src/sources/cypher/transports/neptune-analytics.ts +41 -0
  673. package/src/sources/cypher/transports/neptune-https.ts +122 -0
  674. package/src/sources/cypher/transports/query-api.ts +100 -0
  675. package/src/sources/cypher/transports/transport.ts +139 -0
  676. package/src/sources/cypher/types-map.ts +418 -0
  677. package/src/sources/define.ts +195 -0
  678. package/src/sources/fail.ts +70 -0
  679. package/src/sources/ids.ts +80 -0
  680. package/src/sources/ndex/client.ts +102 -0
  681. package/src/sources/ndex/descriptor.ts +64 -0
  682. package/src/sources/ndex/expand.ts +100 -0
  683. package/src/sources/ndex/index.ts +235 -0
  684. package/src/sources/ndex/params.ts +17 -0
  685. package/src/sources/ndex/share-url.ts +84 -0
  686. package/src/sources/params.ts +32 -0
  687. package/src/sources/registry.ts +325 -0
  688. package/src/sources/rest/descriptor.ts +79 -0
  689. package/src/sources/rest/index.ts +22 -0
  690. package/src/sources/rest/mapping.ts +401 -0
  691. package/src/sources/rest/openalex.ts +288 -0
  692. package/src/sources/rest/paging.ts +180 -0
  693. package/src/sources/rest/params.ts +243 -0
  694. package/src/sources/rest/records.ts +289 -0
  695. package/src/sources/rest/samples/deps-dev.ts +49 -0
  696. package/src/sources/rest/samples/string.ts +44 -0
  697. package/src/sources/rest/selectors.ts +91 -0
  698. package/src/sources/rest/source.ts +776 -0
  699. package/src/sources/rest/templates.ts +151 -0
  700. package/src/sources/run.ts +793 -0
  701. package/src/sources/sha256.ts +99 -0
  702. package/src/sources/sigv4.ts +209 -0
  703. package/src/sources/sparql/descriptor.ts +67 -0
  704. package/src/sources/sparql/index.ts +356 -0
  705. package/src/sources/sparql/ntriples.ts +219 -0
  706. package/src/sources/sparql/params.ts +28 -0
  707. package/src/sources/sparql/query.ts +162 -0
  708. package/src/sources/testing.ts +210 -0
  709. package/src/sources/types.ts +776 -0
  710. package/src/styles/annotations.ts +201 -27
  711. package/src/styles/canon/bends.ts +137 -0
  712. package/src/styles/canon/color-tables.ts +10 -4
  713. package/src/styles/canon/color.ts +105 -3
  714. package/src/styles/canon/enums.ts +99 -8
  715. package/src/styles/canon/graphviz.ts +71 -10
  716. package/src/styles/canon/number.ts +19 -0
  717. package/src/styles/canon/text.ts +187 -16
  718. package/src/styles/codes.ts +2 -0
  719. package/src/styles/cyjs/cascade.ts +1193 -38
  720. package/src/styles/cyjs/defaults-table.ts +5 -0
  721. package/src/styles/cyjs/emit.ts +247 -16
  722. package/src/styles/cyjs/face.ts +372 -0
  723. package/src/styles/cyjs/mappers.ts +498 -28
  724. package/src/styles/cyjs/routes.ts +432 -0
  725. package/src/styles/cytoscape/charts.ts +684 -0
  726. package/src/styles/cytoscape/emit.ts +220 -44
  727. package/src/styles/cytoscape/lexicon.ts +459 -80
  728. package/src/styles/cytoscape/mappings.ts +108 -0
  729. package/src/styles/cytoscape/resolve.ts +763 -23
  730. package/src/styles/cytoscape/translate.ts +11 -11
  731. package/src/styles/defaults.ts +436 -38
  732. package/src/styles/index.ts +5 -0
  733. package/src/styles/internal.ts +1 -0
  734. package/src/styles/io/block.ts +10 -0
  735. package/src/styles/io/generic.ts +79 -23
  736. package/src/styles/io/round-trip.ts +202 -0
  737. package/src/styles/io/writer.ts +14 -4
  738. package/src/styles/notes.ts +1 -0
  739. package/src/styles/plan/features.ts +23 -2
  740. package/src/styles/plan/index.ts +1 -1
  741. package/src/styles/plan/plan.ts +69 -5
  742. package/src/styles/plan/resolve.ts +61 -6
  743. package/src/styles/slots.ts +25 -0
  744. package/src/styles/types.ts +658 -4
  745. package/src/styles/vocabulary.ts +226 -3
  746. package/src/types.ts +19 -5
  747. package/dist/chunks/block-DiGq58c3.js.map +0 -1
  748. package/dist/chunks/choose--jM0yYCo.js +0 -57
  749. package/dist/chunks/choose--jM0yYCo.js.map +0 -1
  750. package/dist/chunks/convert-BcQ8_jMo.js.map +0 -1
  751. package/dist/chunks/emit-CwU8cUmG.js.map +0 -1
  752. package/dist/chunks/export-BvqAXCKh.js.map +0 -1
  753. package/dist/chunks/exporter-CrDWIyiq.js.map +0 -1
  754. package/dist/chunks/format-BpQBx8MZ.js.map +0 -1
  755. package/dist/chunks/generic-Dq1ntt9q.js.map +0 -1
  756. package/dist/chunks/importer-BSvfrX_h.js.map +0 -1
  757. package/dist/chunks/importer-CMmeMWlC.js.map +0 -1
  758. package/dist/chunks/importer-COTK9Tsl.js.map +0 -1
  759. package/dist/chunks/importer-DiZRmOQG.js.map +0 -1
  760. package/dist/chunks/importer-e6LGpqHB.js.map +0 -1
  761. package/dist/chunks/importer-iFYPEKaJ.js.map +0 -1
  762. package/dist/chunks/importer-yh_aBCU6.js.map +0 -1
  763. package/dist/chunks/lexicon-CT69Kd87.js.map +0 -1
  764. package/dist/chunks/styles-BQnsga7p.js.map +0 -1
  765. package/dist/chunks/styles-D3fRphrO.js +0 -690
  766. package/dist/chunks/styles-D3fRphrO.js.map +0 -1
  767. package/dist/chunks/styles-yed-BF5x3_Y5.js +0 -842
  768. package/dist/chunks/styles-yed-BF5x3_Y5.js.map +0 -1
  769. package/dist/chunks/writer-DMKvthQE.js +0 -448
  770. package/dist/chunks/writer-DMKvthQE.js.map +0 -1
package/dist/graph-io.js CHANGED
@@ -1,49 +1,65 @@
1
1
  import { INVALID_INDEX, GraphFormatError, GraphBuilder } from "@graphty/graph-format";
2
2
  import { GraphBuilder as GraphBuilder2, GraphFormatError as GraphFormatError2, INVALID_INDEX as INVALID_INDEX2 } from "@graphty/graph-format";
3
- import { Z as ImportReportBuilder, aj as isAbortError, ak as BAD_LINE_CODE, al as messageOf, p as plural, am as UNKNOWN_OPTION_CODE, E as EMPTY_INPUT_CODE, an as ImportError, ao as FETCH_CODE, a5 as STYLES_NOT_IMPORTED_CODE, a as agree, ap as EDGES_MERGED_CODE, aq as SELF_LOOPS_DROPPED_CODE, O as OPTION_IGNORED_CODE, ar as WEIGHT_NOT_FOUND_CODE } from "./chunks/format-BpQBx8MZ.js";
4
- import { a2, Q, K, B, ae, Y, a9, as, C, at, x, au, h, g, f, av, D, b, l, aw, j, q, k, y, ax, r, t, ay, az, ag, a3, H, I, aA, A, z, aB, u, v, aC, W, n, o, M, i, L, J, aD, af, aE, N, aF, G, a6, aG, P, ai, aa, F, R, aH, a4, S, T, V, aI, c, a8, aJ, aK, aL, a1, ah, U, d, s, m, e, aM, aN, a7, ac, X, w, aO, $, a0, aP, ad, aQ } from "./chunks/format-BpQBx8MZ.js";
5
- import { g as resolveImportOptions, j as reportSinkOptions, i as reportUnusedOptions, I as IdCoercer, l as DirectionResolver, P as LineReader, h as throwIfAborted, s as parseWeightText, Q as describe, f as chooseGraph, S as normalizeInput, U as foreignKind, V as lockReader, W as abortable } from "./chunks/export-BvqAXCKh.js";
6
- import { X as X2, Y as Y2, L as L2, Z, _, $ as $2, R as R2, a0 as a02, a1 as a12, c as c2, a, a2 as a22, a3 as a32, y as y2, d as d2, a4 as a42, a5, e as e2, a6 as a62, k as k2, a7 as a72, O, a8 as a82, a9 as a92, o as o2, aa as aa2, p, ab, ac as ac2, r as r2, G as G2, t as t2 } from "./chunks/export-BvqAXCKh.js";
7
- import { T as TextCellWriter } from "./chunks/text-CzJNFOS9.js";
8
- import { W as W2, i as i2, a as a10, p as p2 } from "./chunks/text-CzJNFOS9.js";
9
- import { C as C2, c as c3, a as a11 } from "./chunks/children-CA4coBi0.js";
3
+ import { K as ImportReportBuilder, ao as isAbortError, ap as BAD_LINE_CODE, aq as messageOf, p as plural, ah as ImportError, o as MISSING_ID_CODE, ar as UNKNOWN_OPTION_CODE, E as EMPTY_INPUT_CODE, aa as FETCH_CODE, a0 as STYLES_NOT_IMPORTED_CODE, a as agree, as as EDGES_MERGED_CODE, at as SELF_LOOPS_DROPPED_CODE, O as OPTION_IGNORED_CODE, au as WEIGHT_NOT_FOUND_CODE } from "./chunks/report-CwMfYa9J.js";
4
+ import { W, a3, L, B, ac, T, a8, av, C, aw, x, a6, h, g, f, ax, D, b, l, ay, j, q, k, y, az, r, t, aA, a7, ae, Y, H, I, aj, A, z, aB, u, v, aC, Z, n, M, i, $, J, al, ad, aD, N, aE, G, a1, aF, P, ag, a9, F, R, aG, _, S, a5, a4, aH, c, Q, aI, aJ, aK, V, af, U, d, s, m, e, aL, ak, a2, ab, X, w, an } from "./chunks/report-CwMfYa9J.js";
5
+ import { D as DirectionResolver } from "./chunks/format-BXiAb-1h.js";
6
+ import { g as g2, M as M2, P as P2, d as d2, f as f2, a, e as e2, c as c2, p } from "./chunks/format-BXiAb-1h.js";
7
+ import { b as resolveImportOptions, f as reportSinkOptions, d as reportUnusedOptions, I as IdCoercer, p as parseWeightText, W as describe, g as chooseGraph } from "./chunks/export-Cha4dRFz.js";
8
+ import { X as X2, L as L2, Y as Y2, R as R2, Z as Z2, H as H2, c as c3, a as a10, _ as _2, Q as Q2, n as n2, i as i2, $ as $2, e as e3, a0, h as h2, F as F2, U as U2, k as k2, V as V2, a1 as a12, r as r2, z as z2 } from "./chunks/export-Cha4dRFz.js";
9
+ import { L as LineReader, b as throwIfAborted, f as readBytes, n as normalizeInput, g as foreignKind, l as lockReader, h as abortable } from "./chunks/input-CAxt_aV-.js";
10
+ import { e as e4, d as d3, i as i3, r as r3, t as t2 } from "./chunks/input-CAxt_aV-.js";
11
+ import { T as TextCellWriter } from "./chunks/text-ystE2bYi.js";
12
+ import { W as W2, i as i4, a as a11, p as p2 } from "./chunks/text-ystE2bYi.js";
13
+ import { C as C2, c as c4, a as a13 } from "./chunks/children-CA4coBi0.js";
10
14
  import { c as collectBytes } from "./chunks/writer-DxjgHwSe.js";
11
- import { D as D2, d as d3, e as e3, j as j2, t as t3 } from "./chunks/writer-DxjgHwSe.js";
15
+ import { D as D2, d as d4, e as e5, j as j2, t as t3 } from "./chunks/writer-DxjgHwSe.js";
12
16
  import { csvImporter, csvExporter } from "./csv.js";
13
17
  import { CSV_CAPABILITIES, CSV_ISSUE, CSV_LOSS } from "./csv.js";
14
- import { d as cxImporter, c as cxExporter } from "./chunks/importer-BSvfrX_h.js";
15
- import { C as C3, a as a13, b as b2 } from "./chunks/importer-BSvfrX_h.js";
16
- import { c as cx2Exporter } from "./chunks/exporter-CJgfhF-l.js";
17
- import { C as C4, a as a14 } from "./chunks/exporter-CJgfhF-l.js";
18
- import { c as cx2Importer } from "./chunks/importer-CMmeMWlC.js";
19
- import { C as C5 } from "./chunks/importer-CMmeMWlC.js";
20
- import { d as cysImporter, c as cysExporter } from "./chunks/importer-iFYPEKaJ.js";
21
- import { C as C6, a as a15, b as b3 } from "./chunks/importer-iFYPEKaJ.js";
22
- import { c as dotImporter, d as dotExporter } from "./chunks/importer-COTK9Tsl.js";
23
- import { D as D3, a as a16, b as b4 } from "./chunks/importer-COTK9Tsl.js";
18
+ import { c as cxExporter } from "./chunks/exporter-_jrBTnos.js";
19
+ import { C as C3, a as a14 } from "./chunks/exporter-_jrBTnos.js";
20
+ import { c as cxImporter } from "./chunks/importer-PqaaKKnY.js";
21
+ import { C as C4 } from "./chunks/importer-PqaaKKnY.js";
22
+ import { c as cx2Exporter } from "./chunks/exporter-nDfxIK5D.js";
23
+ import { C as C5, a as a15 } from "./chunks/exporter-nDfxIK5D.js";
24
+ import { c as cx2Importer } from "./chunks/importer-B92x1xY5.js";
25
+ import { C as C6 } from "./chunks/importer-B92x1xY5.js";
26
+ import { r as readZipDirectory, e as readZipEntry, d as cysImporter, c as cysExporter } from "./chunks/importer-GREKMdIf.js";
27
+ import { C as C7, a as a16, b as b2 } from "./chunks/importer-GREKMdIf.js";
28
+ import { b as dotImporter, d as dotExporter } from "./chunks/importer-DaLTjbds.js";
29
+ import { D as D3, a as a17 } from "./chunks/importer-DaLTjbds.js";
24
30
  import { gexfImporter, gexfExporter } from "./gexf.js";
25
31
  import { GEXF_1_2_CAPABILITIES, GEXF_ISSUE, GEXF_LOSS } from "./gexf.js";
26
32
  import { gmlImporter, gmlExporter } from "./gml.js";
27
33
  import { GML_ISSUE, GML_LOSS, GML_STYLE_BLOCK_KEY, GML_STYLE_CAPABILITIES } from "./gml.js";
28
- import { a as graphmlImporter, g as graphmlExporter } from "./chunks/importer-DiZRmOQG.js";
29
- import { r as rankFormats, S as SNIFF_HEAD_BYTES, e as jsonImporter, c as jsonExporter } from "./chunks/exporter-CrDWIyiq.js";
30
- import { G as G3, J as J2, a as a17, b as b5, d as d4, g as g2, h as h2, j as j3, f as f2, n as n2, s as s2, i as i3 } from "./chunks/exporter-CrDWIyiq.js";
34
+ import { a as graphmlImporter, g as graphmlExporter } from "./chunks/importer-CT9mJ1nn.js";
35
+ import { S as SNIFF_HEAD_BYTES, r as rankFormats, e as jsonImporter, c as jsonExporter } from "./chunks/exporter-D2CETOMK.js";
36
+ import { G as G2, J as J2, a as a18, b as b3, d as d5, g as g3, h as h3, j as j3, f as f3, n as n3, i as i5, s as s2, k as k3 } from "./chunks/exporter-D2CETOMK.js";
31
37
  import { neo4jImporter, neo4jExporter } from "./neo4j.js";
32
38
  import { ID_SPACE_COLUMN, LABELS_COLUMN, NEO4J_CAPABILITIES, NEO4J_ISSUE, NEO4J_LOSS, ORIGINAL_ID_COLUMN, TYPE_COLUMN, exportNeo4jFiles } from "./neo4j.js";
33
- import { c as oboImporter, o as oboExporter } from "./chunks/exporter--Mk9gXCJ.js";
34
- import { O as O2, a as a18, b as b6 } from "./chunks/exporter--Mk9gXCJ.js";
35
- import { d as pajekImporter, p as pajekExporter } from "./chunks/importer-e6LGpqHB.js";
36
- import { P as P2, a as a19, b as b7, c as c4 } from "./chunks/importer-e6LGpqHB.js";
37
- import { x as xgmmlExporter } from "./chunks/exporter-DndFlGSa.js";
38
- import { x as xgmmlImporter } from "./chunks/importer-yh_aBCU6.js";
39
- import { e as extractStyles } from "./chunks/generic-Dq1ntt9q.js";
40
- import { p as prepareStyleExport, i as isKeptGraphtyProperty } from "./chunks/writer-DMKvthQE.js";
41
- import { G as G4, a as a20 } from "./chunks/constants-BKwqelYD.js";
42
- import { G as G5 } from "./chunks/styles-yed-BF5x3_Y5.js";
43
- import { X as X3, a as a21 } from "./chunks/styles-BQnsga7p.js";
44
- import { M as M2, d as d5, c as c5, f as f3, h as h3, t as t4, x as x2 } from "./chunks/escape-CgzxiYPg.js";
45
- import { S as S2 } from "./chunks/block-DiGq58c3.js";
46
- import { j as j4, a as a23 } from "./chunks/styles-D3fRphrO.js";
39
+ import { c as oboImporter, o as oboExporter } from "./chunks/exporter-BP6otMO6.js";
40
+ import { O, a as a19, b as b4 } from "./chunks/exporter-BP6otMO6.js";
41
+ import { d as pajekImporter, p as pajekExporter } from "./chunks/importer-vRq4h3j5.js";
42
+ import { P as P3, a as a20, b as b5, c as c5 } from "./chunks/importer-vRq4h3j5.js";
43
+ import { x as xgmmlExporter } from "./chunks/exporter-D9yMtocA.js";
44
+ import { x as xgmmlImporter } from "./chunks/importer-Vn5QvmmJ.js";
45
+ import { C as CYPHER_DESCRIPTOR, N as NEO4J_DESCRIPTOR, a as NEPTUNE_DESCRIPTOR } from "./chunks/codes-BE2xir2k.js";
46
+ import { S as S2 } from "./chunks/codes-BE2xir2k.js";
47
+ import { N as NDEX_SOURCE_ID, C as CYPHER_SOURCE_ID, h as NEO4J_SOURCE_ID, i as NEPTUNE_SOURCE_ID, R as REST_SOURCE_ID, O as OPENALEX_SOURCE_ID, S as SPARQL_SOURCE_ID, j as SOURCE_FORMAT_PREFIX, f as failOn, k as checkParams, w as warnOn, o as originOf, l as checkLazySource, m as checkSource, b as failAlone } from "./chunks/credentials-DXHx7nwR.js";
48
+ import { n as n4, p as p3, e as e6, g as g4, c as c6, d as d6, q as q2, s as s3 } from "./chunks/credentials-DXHx7nwR.js";
49
+ import { N as NDEX_DESCRIPTOR } from "./chunks/descriptor-C-YDhtsn.js";
50
+ import { R as REST_DESCRIPTOR, O as OPENALEX_DESCRIPTOR } from "./chunks/descriptor-DLA5kINx.js";
51
+ import { S as SPARQL_DESCRIPTOR } from "./chunks/descriptor-B28U25x4.js";
52
+ import { c as createSourceContext, L as LimitStop, d as detectRuntime } from "./chunks/context-C3p0RQxR.js";
53
+ import { e as extractStyles } from "./chunks/generic-ymWCETAJ.js";
54
+ import { s as prepareStyleExport, t as isKeptGraphtyProperty } from "./chunks/styles-Cm62yyQX.js";
55
+ import { D as D4 } from "./chunks/styles-Cm62yyQX.js";
56
+ import { sha256Hex } from "./chunks/sigv4-EokFic1V.js";
57
+ import { G as G3, a as a21 } from "./chunks/constants-CKkYLPtt.js";
58
+ import { G as G4 } from "./chunks/styles-yed-UMFdNqze.js";
59
+ import { X as X3, a as a22 } from "./chunks/styles-CCs214_3.js";
60
+ import { M as M3, d as d7, c as c7, p as p4, o, t as t4, x as x2 } from "./chunks/escape-CuCIzNMB.js";
61
+ import { S as S3 } from "./chunks/block-iptrlMBb.js";
62
+ import { j as j4, a as a23 } from "./chunks/styles-DPQQIig4.js";
47
63
  const USED = /* @__PURE__ */ new Set(["ids", "defaultDirected", "weightFrom", "addMissingNodes"]);
48
64
  function defineLineFormat(definition) {
49
65
  const { format, extensions, mimeTypes = [], directed = false, comment = "#", sniff: sniff2, parseLine } = definition;
@@ -84,9 +100,9 @@ function defineLineFormat(definition) {
84
100
  edge: (source, target, attributes2) => {
85
101
  const raw = opts.weightFrom === null ? void 0 : attributes2?.[opts.weightFrom];
86
102
  const weight = raw === null || raw === void 0 ? void 0 : parseWeightText(String(raw), report);
87
- const [s3, t5] = [ids.text(source), ids.text(target)];
88
- const added = new Set([s3, t5].filter((id) => sink.indexOf(id) === INVALID_INDEX)).size;
89
- const edge = edges.addEdge(s3, t5, kind, weight, { line });
103
+ const [s4, t5] = [ids.text(source), ids.text(target)];
104
+ const added = new Set([s4, t5].filter((id) => sink.indexOf(id) === INVALID_INDEX)).size;
105
+ const edge = edges.addEdge(s4, t5, kind, weight, { line });
90
106
  report.counts.nodes += added;
91
107
  report.counts.edges++;
92
108
  write("edge", edge, attributes2);
@@ -181,18 +197,18 @@ function compareSnapshots(expected, actual, options = {}) {
181
197
  const tolerance = options.tolerance ?? 0;
182
198
  const ctx = {
183
199
  options,
184
- diff: (path, e4, a24, message) => {
200
+ diff: (path, e7, a24, message) => {
185
201
  diffs.push({
186
202
  path,
187
- expected: e4,
203
+ expected: e7,
188
204
  actual: a24,
189
- message: message ?? `${path}: expected ${show(e4)}, got ${show(a24)}`
205
+ message: message ?? `${path}: expected ${show(e7)}, got ${show(a24)}`
190
206
  });
191
207
  if (diffs.length >= limit) {
192
208
  throw new LimitReached();
193
209
  }
194
210
  },
195
- same: (e4, a24) => valuesEqual(e4, a24, tolerance)
211
+ same: (e7, a24) => valuesEqual(e7, a24, tolerance)
196
212
  };
197
213
  try {
198
214
  compareGraphs(expected, actual, ctx);
@@ -232,10 +248,10 @@ function compareGraphs(expected, actual, ctx) {
232
248
  function compareIds(expected, actual, diff) {
233
249
  const expectedIds = expected.ids.toArray();
234
250
  const actualIds = actual.ids.toArray();
235
- const n3 = Math.min(expectedIds.length, actualIds.length);
236
- for (let i4 = 0; i4 < n3; i4++) {
237
- if (!Object.is(expectedIds[i4], actualIds[i4])) {
238
- diff(`ids[${i4}]`, expectedIds[i4], actualIds[i4]);
251
+ const n5 = Math.min(expectedIds.length, actualIds.length);
252
+ for (let i6 = 0; i6 < n5; i6++) {
253
+ if (!Object.is(expectedIds[i6], actualIds[i6])) {
254
+ diff(`ids[${i6}]`, expectedIds[i6], actualIds[i6]);
239
255
  }
240
256
  }
241
257
  }
@@ -247,10 +263,10 @@ function compareTopology(expected, actual, diff) {
247
263
  diff("colIdx", expected.colIdx, actual.colIdx, "colIdx differs");
248
264
  }
249
265
  const el = expected.edgeList();
250
- const al = actual.edgeList();
251
- for (let e4 = 0; e4 < expected.edgeCount; e4++) {
252
- if (el.src[e4] !== al.src[e4] || el.dst[e4] !== al.dst[e4]) {
253
- diff(`edge[${e4}]`, `${el.src[e4]}->${el.dst[e4]}`, `${al.src[e4]}->${al.dst[e4]}`);
266
+ const al2 = actual.edgeList();
267
+ for (let e7 = 0; e7 < expected.edgeCount; e7++) {
268
+ if (el.src[e7] !== al2.src[e7] || el.dst[e7] !== al2.dst[e7]) {
269
+ diff(`edge[${e7}]`, `${el.src[e7]}->${el.dst[e7]}`, `${al2.src[e7]}->${al2.dst[e7]}`);
254
270
  }
255
271
  }
256
272
  }
@@ -278,22 +294,22 @@ function compareWeights(expected, actual, ctx) {
278
294
  }
279
295
  const ew = expected.edgeList().weights;
280
296
  const aw2 = actual.edgeList().weights;
281
- for (let e4 = 0; e4 < expected.edgeCount; e4++) {
282
- const ev = ew === null ? 1 : ew[e4];
283
- const av2 = aw2 === null ? 1 : aw2[e4];
297
+ for (let e7 = 0; e7 < expected.edgeCount; e7++) {
298
+ const ev = ew === null ? 1 : ew[e7];
299
+ const av2 = aw2 === null ? 1 : aw2[e7];
284
300
  if (!ctx.same(ev, av2)) {
285
- ctx.diff(`weight[${e4}]`, ev, av2);
301
+ ctx.diff(`weight[${e7}]`, ev, av2);
286
302
  }
287
303
  }
288
304
  }
289
305
  function compareExactWeights(edgeCount, expected, actual, ctx) {
290
- for (let e4 = 0; e4 < edgeCount; e4++) {
291
- const eSet = expected.isSet(e4);
292
- const aSet = actual.isSet(e4);
306
+ for (let e7 = 0; e7 < edgeCount; e7++) {
307
+ const eSet = expected.isSet(e7);
308
+ const aSet = actual.isSet(e7);
293
309
  if (ctx.options.weightExplicitness !== false && eSet !== aSet) {
294
- ctx.diff(`weightExplicit[${e4}]`, eSet, aSet);
295
- } else if (eSet && aSet && !ctx.same(expected.value(e4), actual.value(e4))) {
296
- ctx.diff(`weight[${e4}]`, expected.value(e4), actual.value(e4));
310
+ ctx.diff(`weightExplicit[${e7}]`, eSet, aSet);
311
+ } else if (eSet && aSet && !ctx.same(expected.value(e7), actual.value(e7))) {
312
+ ctx.diff(`weight[${e7}]`, expected.value(e7), actual.value(e7));
297
313
  }
298
314
  }
299
315
  }
@@ -350,35 +366,35 @@ function compareColumn(path, column, other, ctx) {
350
366
  ctx.diff(`${path}.length`, column.length, other.length);
351
367
  return;
352
368
  }
353
- for (let r3 = 0; r3 < column.length; r3++) {
354
- const eSet = column.isSet(r3);
355
- const aSet = other.isSet(r3);
369
+ for (let r4 = 0; r4 < column.length; r4++) {
370
+ const eSet = column.isSet(r4);
371
+ const aSet = other.isSet(r4);
356
372
  if (eSet !== aSet) {
357
- ctx.diff(`${path}[${r3}]`, eSet ? column.value(r3) : void 0, aSet ? other.value(r3) : void 0);
373
+ ctx.diff(`${path}[${r4}]`, eSet ? column.value(r4) : void 0, aSet ? other.value(r4) : void 0);
358
374
  } else if (eSet) {
359
- const ev = cellValue(column, r3);
360
- const av2 = cellValue(other, r3);
375
+ const ev = cellValue(column, r4);
376
+ const av2 = cellValue(other, r4);
361
377
  if (!ctx.same(ev, av2)) {
362
- ctx.diff(`${path}[${r3}]`, ev, av2);
378
+ ctx.diff(`${path}[${r4}]`, ev, av2);
363
379
  }
364
380
  }
365
381
  }
366
382
  }
367
383
  function compareDeclaration(path, column, other, ctx) {
368
384
  const { options, diff } = ctx;
369
- const e4 = column.meta;
385
+ const e7 = column.meta;
370
386
  const a24 = other.meta;
371
387
  if (options.dtypes !== false) {
372
388
  for (const key of ["dtype", "itemDtype", "components"]) {
373
- if (e4[key] !== a24[key]) {
374
- diff(`${path}.${key}`, e4[key], a24[key]);
389
+ if (e7[key] !== a24[key]) {
390
+ diff(`${path}.${key}`, e7[key], a24[key]);
375
391
  }
376
392
  }
377
393
  }
378
- if (options.roles !== false && e4.role !== a24.role) {
379
- diff(`${path}.role`, e4.role, a24.role);
394
+ if (options.roles !== false && e7.role !== a24.role) {
395
+ diff(`${path}.role`, e7.role, a24.role);
380
396
  }
381
- const eType = e4.origin?.type ?? null;
397
+ const eType = e7.origin?.type ?? null;
382
398
  const aType = a24.origin?.type ?? null;
383
399
  if (options.originType === true && eType !== aType) {
384
400
  diff(`${path}.origin.type`, eType, aType);
@@ -396,38 +412,38 @@ function cellValue(column, row) {
396
412
  }
397
413
  }
398
414
  }
399
- function valuesEqual(e4, a24, tolerance) {
400
- if (typeof e4 === "number" && typeof a24 === "number") {
401
- if (Object.is(e4, a24)) {
415
+ function valuesEqual(e7, a24, tolerance) {
416
+ if (typeof e7 === "number" && typeof a24 === "number") {
417
+ if (Object.is(e7, a24)) {
402
418
  return true;
403
419
  }
404
- return Number.isFinite(e4) && Number.isFinite(a24) && Math.abs(e4 - a24) <= tolerance;
420
+ return Number.isFinite(e7) && Number.isFinite(a24) && Math.abs(e7 - a24) <= tolerance;
405
421
  }
406
- if (Array.isArray(e4) || ArrayBuffer.isView(e4)) {
407
- const ea = Array.from(e4);
422
+ if (Array.isArray(e7) || ArrayBuffer.isView(e7)) {
423
+ const ea = Array.from(e7);
408
424
  if (!(Array.isArray(a24) || ArrayBuffer.isView(a24))) {
409
425
  return false;
410
426
  }
411
- const aa3 = Array.from(a24);
412
- return ea.length === aa3.length && ea.every((v2, i4) => valuesEqual(v2, aa3[i4], tolerance));
427
+ const aa = Array.from(a24);
428
+ return ea.length === aa.length && ea.every((v2, i6) => valuesEqual(v2, aa[i6], tolerance));
413
429
  }
414
- if (typeof e4 === "object" && e4 !== null && typeof a24 === "object" && a24 !== null) {
415
- const eo = e4;
430
+ if (typeof e7 === "object" && e7 !== null && typeof a24 === "object" && a24 !== null) {
431
+ const eo = e7;
416
432
  const ao = a24;
417
433
  const keys = Object.keys(eo);
418
434
  if (keys.length !== Object.keys(ao).length) {
419
435
  return false;
420
436
  }
421
- return keys.every((k3) => Object.hasOwn(ao, k3) && valuesEqual(eo[k3], ao[k3], tolerance));
437
+ return keys.every((k4) => Object.hasOwn(ao, k4) && valuesEqual(eo[k4], ao[k4], tolerance));
422
438
  }
423
- return Object.is(e4, a24);
439
+ return Object.is(e7, a24);
424
440
  }
425
- function typedEqual(a24, b8) {
426
- if (a24.length !== b8.length) {
441
+ function typedEqual(a24, b6) {
442
+ if (a24.length !== b6.length) {
427
443
  return false;
428
444
  }
429
- for (let i4 = 0; i4 < a24.length; i4++) {
430
- if (a24[i4] !== b8[i4]) {
445
+ for (let i6 = 0; i6 < a24.length; i6++) {
446
+ if (a24[i6] !== b6[i6]) {
431
447
  return false;
432
448
  }
433
449
  }
@@ -446,7 +462,7 @@ function show(v2) {
446
462
  }
447
463
  }
448
464
  function describeDiffs(diffs) {
449
- return diffs.length === 0 ? "no differences" : diffs.map((d6) => ` - ${d6.message}`).join("\n");
465
+ return diffs.length === 0 ? "no differences" : diffs.map((d8) => ` - ${d8.message}`).join("\n");
450
466
  }
451
467
  const TOO_MANY_EMPTY_CELLS_CODE = "E_TOO_MANY_EMPTY_CELLS";
452
468
  const DEFAULT_MAX_EMPTY_CELLS = 2 ** 24;
@@ -571,6 +587,716 @@ class CellBudgetBuilder extends GraphBuilder {
571
587
  }
572
588
  }
573
589
  }
590
+ function builtinSources() {
591
+ return [
592
+ {
593
+ id: NDEX_SOURCE_ID,
594
+ descriptor: NDEX_DESCRIPTOR,
595
+ load: async () => (await import("./sources-ndex.js")).ndexSource
596
+ },
597
+ {
598
+ id: CYPHER_SOURCE_ID,
599
+ descriptor: CYPHER_DESCRIPTOR,
600
+ load: async () => (await import("./sources-cypher.js")).cypherSource
601
+ },
602
+ {
603
+ id: NEO4J_SOURCE_ID,
604
+ descriptor: NEO4J_DESCRIPTOR,
605
+ load: async () => (await import("./sources-cypher.js")).neo4jSource
606
+ },
607
+ {
608
+ id: NEPTUNE_SOURCE_ID,
609
+ descriptor: NEPTUNE_DESCRIPTOR,
610
+ load: async () => (await import("./sources-cypher.js")).neptuneSource
611
+ },
612
+ {
613
+ id: REST_SOURCE_ID,
614
+ descriptor: REST_DESCRIPTOR,
615
+ load: async () => (await import("./sources-rest.js")).restMappingSource
616
+ },
617
+ {
618
+ id: OPENALEX_SOURCE_ID,
619
+ descriptor: OPENALEX_DESCRIPTOR,
620
+ load: async () => (await import("./sources-rest.js")).openalexSource
621
+ },
622
+ {
623
+ id: SPARQL_SOURCE_ID,
624
+ descriptor: SPARQL_DESCRIPTOR,
625
+ load: async () => (await import("./sources-sparql.js")).sparqlSource
626
+ }
627
+ ];
628
+ }
629
+ const CURSOR_VERSION_KEY = "~v";
630
+ const SOURCE_OPTION_KEYS = /* @__PURE__ */ new Set([
631
+ "endpoint",
632
+ "credential",
633
+ "cursor",
634
+ "limits",
635
+ "retry",
636
+ "idPrefix",
637
+ "allowInsecure",
638
+ "fetch",
639
+ "userAgent",
640
+ "builder",
641
+ "freeze",
642
+ "onProgress",
643
+ "signal"
644
+ ]);
645
+ const AUTH_CODES = /* @__PURE__ */ new Set(["E_SOURCE_AUTH", "E_SOURCE_FORBIDDEN"]);
646
+ function sourceFormat(id) {
647
+ return `${SOURCE_FORMAT_PREFIX}${id}`;
648
+ }
649
+ function wrapCursor(next, version) {
650
+ return next === null || next === void 0 ? null : Object.freeze({ ...next, [CURSOR_VERSION_KEY]: version });
651
+ }
652
+ function prepare(source, rawParams, options, unit) {
653
+ const { descriptor } = source;
654
+ const version = descriptor?.version ?? 1;
655
+ const report = new ImportReportBuilder(sourceFormat(source.id), options.errorLimit ?? 100);
656
+ checkRuntime(source, report);
657
+ checkParams(rawParams, descriptor, report);
658
+ const params = {};
659
+ for (const p5 of descriptor?.params ?? []) {
660
+ if (p5.default !== void 0) {
661
+ params[p5.name] = p5.default;
662
+ }
663
+ }
664
+ Object.assign(params, rawParams);
665
+ const endpoint = resolveEndpoint(options.endpoint ?? descriptor?.defaultEndpoint ?? null, report);
666
+ if (options.credential?.origins.length === 0 && endpoint === null) {
667
+ failOn(report, "E_SOURCE_PARAM", "a credential needs an endpoint or its own origins", {
668
+ name: "credential",
669
+ reason: "credential-unbound"
670
+ });
671
+ }
672
+ const cursor = resumeCursor(options.cursor, version, report);
673
+ const counts = { nodes: /* @__PURE__ */ new Set(), edgesAtStart: 0, sink: null };
674
+ const created = createSourceContext({
675
+ id: source.id,
676
+ descriptor,
677
+ options,
678
+ report,
679
+ endpoint,
680
+ cursor,
681
+ unit,
682
+ counts: () => ({
683
+ nodes: counts.nodes.size,
684
+ edges: counts.sink === null ? 0 : counts.sink.edgeCount - counts.edgesAtStart
685
+ })
686
+ });
687
+ return { report, created, params, counts };
688
+ }
689
+ function checkRuntime(source, report) {
690
+ const { descriptor } = source;
691
+ const runtime = detectRuntime();
692
+ const support = descriptor?.runtimes?.[runtime];
693
+ if (support?.supported === false) {
694
+ failOn(report, "E_SOURCE_RUNTIME", `source ${source.id} cannot run in ${runtime}`, {
695
+ runtime,
696
+ reason: support.reason ?? "unsupported"
697
+ });
698
+ }
699
+ if (descriptor?.needs?.secureContext === true && runtime === "browser" && globalThis.isSecureContext === false) {
700
+ failOn(report, "E_SOURCE_RUNTIME", `source ${source.id} needs a secure context`, {
701
+ runtime,
702
+ reason: "needs-secure-context"
703
+ });
704
+ }
705
+ }
706
+ function resolveEndpoint(given, report) {
707
+ if (given === null) {
708
+ return null;
709
+ }
710
+ let endpoint;
711
+ try {
712
+ endpoint = new URL(given);
713
+ } catch {
714
+ failOn(report, "E_SOURCE_PARAM", "the endpoint is not a URL", { name: "endpoint", reason: "type" });
715
+ }
716
+ if (endpoint.username !== "" || endpoint.password !== "") {
717
+ failOn(report, "E_SOURCE_PARAM", "the endpoint may not carry a user name or password", {
718
+ name: "endpoint",
719
+ reason: "credentials-in-url"
720
+ });
721
+ }
722
+ return endpoint;
723
+ }
724
+ function resumeCursor(given, version, report) {
725
+ if (given === void 0 || given === null) {
726
+ return null;
727
+ }
728
+ const { [CURSOR_VERSION_KEY]: recorded, ...rest } = given;
729
+ if (recorded !== void 0 && recorded !== version) {
730
+ failOn(report, "E_SOURCE_PARAM", "the cursor was made by another version of the source", {
731
+ name: "cursor",
732
+ reason: "stale-cursor"
733
+ });
734
+ }
735
+ return Object.freeze(rest);
736
+ }
737
+ function wrapSink(sink, prepared, prefix) {
738
+ prepared.counts.sink = sink;
739
+ prepared.counts.edgesAtStart = sink.edgeCount;
740
+ const seen = prepared.counts.nodes;
741
+ const id = (value) => prefix === void 0 || prefix === "" ? value : `${prefix}${String(value)}`;
742
+ const node = (index) => {
743
+ seen.add(index);
744
+ return index;
745
+ };
746
+ const ends = (edge) => {
747
+ const [a24, b6] = sink.edgeEndpoints(edge);
748
+ seen.add(a24);
749
+ seen.add(b6);
750
+ return edge;
751
+ };
752
+ return new Proxy(sink, {
753
+ get(target, key) {
754
+ switch (key) {
755
+ case "addNode":
756
+ return (v2) => node(target.addNode(id(v2)));
757
+ case "addNodeRecord":
758
+ return (v2, attrs) => node(target.addNodeRecord(id(v2), attrs));
759
+ case "addNodes":
760
+ return (ids, out) => {
761
+ const result2 = target.addNodes(Array.from(ids, id), out);
762
+ result2.forEach((i6) => seen.add(i6));
763
+ return result2;
764
+ };
765
+ case "addEdge":
766
+ return (s4, t5, w2) => ends(target.addEdge(id(s4), id(t5), w2));
767
+ case "addEdgeRecord":
768
+ return (s4, t5, attrs, weightKey) => ends(target.addEdgeRecord(id(s4), id(t5), attrs, weightKey));
769
+ case "indexOf":
770
+ return (v2) => target.indexOf(id(v2));
771
+ default: {
772
+ const value = Reflect.get(target, key, target);
773
+ return typeof value === "function" ? value.bind(target) : value;
774
+ }
775
+ }
776
+ }
777
+ });
778
+ }
779
+ function importerOptions$1(options, signal) {
780
+ const out = { signal };
781
+ for (const [key, value] of Object.entries(options)) {
782
+ if (!SOURCE_OPTION_KEYS.has(key)) {
783
+ out[key] = value;
784
+ }
785
+ }
786
+ return out;
787
+ }
788
+ function writeMeta(sink, meta) {
789
+ const patch = {};
790
+ for (const [key, value] of Object.entries(meta)) {
791
+ if ((key === "name" || key === "description" || key === "modified") && typeof value === "string") {
792
+ patch[key] = value;
793
+ } else if (key !== "directed" && (typeof value === "string" || typeof value === "number" || typeof value === "boolean")) {
794
+ sink.setGraphValue(key, value);
795
+ }
796
+ }
797
+ if (Object.keys(patch).length > 0) {
798
+ sink.setMeta(patch);
799
+ }
800
+ }
801
+ function writeBatch(batch, sink, source, prepared, first) {
802
+ const idKey = source.idKey ?? "id";
803
+ const sourceKey = source.sourceKey ?? "source";
804
+ const targetKey = source.targetKey ?? "target";
805
+ const meta = batch.meta ?? {};
806
+ if (first && typeof meta.directed === "boolean" && sink.edgeCount === 0) {
807
+ sink.setDirected(meta.directed);
808
+ }
809
+ writeMeta(sink, meta);
810
+ const n5 = writeNodes(batch, sink, idKey, prepared);
811
+ writeEdges(batch, sink, sourceKey, targetKey, prepared, n5);
812
+ }
813
+ function writeNodes(batch, sink, idKey, prepared) {
814
+ const { report } = prepared;
815
+ const { signal } = prepared.created.ctx;
816
+ let n5 = 0;
817
+ for (const record of batch.nodes ?? []) {
818
+ if (n5++ % 64 === 0) {
819
+ throwIfAborted(signal);
820
+ }
821
+ const { [idKey]: id, ...attrs } = record;
822
+ if (typeof id !== "string" && typeof id !== "number") {
823
+ report.error("missing-value", MISSING_ID_CODE, `a node record has no ${idKey}`);
824
+ report.counts.skippedNodes++;
825
+ continue;
826
+ }
827
+ try {
828
+ sink.addNodeRecord(id, attrs);
829
+ report.counts.nodes++;
830
+ } catch (err) {
831
+ report.recordError(err, { element: String(id) });
832
+ report.counts.skippedNodes++;
833
+ }
834
+ }
835
+ return n5;
836
+ }
837
+ function writeEdges(batch, sink, sourceKey, targetKey, prepared, start) {
838
+ const { report } = prepared;
839
+ const { signal } = prepared.created.ctx;
840
+ let n5 = start;
841
+ let edgeIds = null;
842
+ for (const record of batch.edges ?? []) {
843
+ if (n5++ % 64 === 0) {
844
+ throwIfAborted(signal);
845
+ }
846
+ const s4 = record[sourceKey];
847
+ const t5 = record[targetKey];
848
+ const edgeId = record.id;
849
+ const fields = Object.fromEntries(
850
+ Object.entries(record).filter(([k4]) => k4 !== sourceKey && k4 !== targetKey && k4 !== "id")
851
+ );
852
+ if (typeof s4 !== "string" && typeof s4 !== "number" || typeof t5 !== "string" && typeof t5 !== "number") {
853
+ report.error("missing-value", MISSING_ID_CODE, `an edge record has no ${sourceKey} or ${targetKey}`);
854
+ report.counts.skippedEdges++;
855
+ continue;
856
+ }
857
+ try {
858
+ const e7 = sink.addEdgeRecord(s4, t5, fields);
859
+ if (typeof edgeId === "string" || typeof edgeId === "number") {
860
+ edgeIds ??= edgeIdColumn(sink);
861
+ sink.setEdgeValue(edgeIds, e7, String(edgeId));
862
+ }
863
+ report.counts.edges++;
864
+ } catch (err) {
865
+ report.recordError(err, { element: `${String(s4)} -> ${String(t5)}` });
866
+ report.counts.skippedEdges++;
867
+ }
868
+ }
869
+ }
870
+ function endpointOrigin(endpoint) {
871
+ return endpoint === null ? "" : originOf(endpoint);
872
+ }
873
+ function edgeIdColumn(sink) {
874
+ const existing = sink.edgeColumn("id");
875
+ return existing === INVALID_INDEX ? sink.declareEdgeColumn({ name: "id", dtype: "string", role: "id", nullable: true }) : existing;
876
+ }
877
+ function pages(out) {
878
+ if (Symbol.asyncIterator in out) {
879
+ return out[Symbol.asyncIterator]();
880
+ }
881
+ let done = false;
882
+ return {
883
+ async next() {
884
+ if (done) {
885
+ return { done: true, value: void 0 };
886
+ }
887
+ done = true;
888
+ return { done: false, value: await out };
889
+ }
890
+ };
891
+ }
892
+ function stopOrThrow(err, page, prepared) {
893
+ if (err instanceof LimitStop) {
894
+ return;
895
+ }
896
+ if (page > 0 && err instanceof ImportError && AUTH_CODES.has(String(err.issue?.code))) {
897
+ const p5 = err.issue?.params ?? {};
898
+ warnOn(prepared.report, "W_SOURCE_AUTH", "a later page needs a credential; the pages before it are kept", {
899
+ origin: typeof p5.origin === "string" ? p5.origin : endpointOrigin(prepared.created.ctx.endpoint),
900
+ status: typeof p5.status === "number" ? p5.status : null
901
+ });
902
+ return;
903
+ }
904
+ throw err;
905
+ }
906
+ async function runRecords(source, sink, prepared) {
907
+ const { ctx } = prepared.created;
908
+ const records = source.records;
909
+ const iterator = pages(records(prepared.params, ctx));
910
+ let next = ctx.cursor;
911
+ let page = 0;
912
+ let stopped = false;
913
+ try {
914
+ for (; ; ) {
915
+ let step;
916
+ try {
917
+ step = await iterator.next();
918
+ } catch (err) {
919
+ stopOrThrow(err, page, prepared);
920
+ stopped = true;
921
+ return next;
922
+ }
923
+ if (step.done === true) {
924
+ return page === 0 ? null : next;
925
+ }
926
+ writeBatch(step.value, sink, source, prepared, page === 0);
927
+ page++;
928
+ next = step.value.next ?? null;
929
+ ctx.progress(prepared.report.counts.nodes + prepared.report.counts.edges, void 0, "items");
930
+ if (ctx.limits.reached()) {
931
+ stopped = true;
932
+ return next;
933
+ }
934
+ }
935
+ } finally {
936
+ if (stopped) {
937
+ await iterator.return?.().catch(() => void 0);
938
+ }
939
+ }
940
+ }
941
+ async function fileInput(file, formats, signal) {
942
+ let input = file.body instanceof Response ? file.body.body ?? new Uint8Array(0) : file.body;
943
+ let { filename } = file;
944
+ let mimeType = file.mimeType ?? (file.body instanceof Response ? file.body.headers.get("content-type") ?? void 0 : void 0);
945
+ const gzip = /\.gz$/i.test(filename ?? "") || /gzip/i.test(mimeType ?? "");
946
+ const zip = /\.zip$/i.test(filename ?? "") || /\/(x-)?zip\b/i.test(mimeType ?? "");
947
+ if (gzip) {
948
+ const stream = input instanceof ReadableStream ? input : new Response(await bytesOf(input, signal)).body;
949
+ input = (stream ?? new Response("").body ?? new ReadableStream()).pipeThrough(
950
+ new DecompressionStream("gzip")
951
+ );
952
+ filename = filename?.replace(/\.gz$/i, "");
953
+ mimeType = void 0;
954
+ } else if (zip) {
955
+ const bytes = await bytesOf(input, signal);
956
+ const entry = readZipDirectory(bytes).find((e7) => !e7.directory && formats.sniff({ filename: e7.name }) !== null);
957
+ if (entry === void 0) {
958
+ throw new ImportError("the zip holds no graph file", new ImportReportBuilder("zip", 0).finish());
959
+ }
960
+ input = await readZipEntry(bytes, entry, { signal, maxBytes: Number.MAX_SAFE_INTEGER, maxRatio: 1e3 });
961
+ filename = entry.name;
962
+ mimeType = void 0;
963
+ }
964
+ return { input, filename, mimeType };
965
+ }
966
+ async function bytesOf(input, signal) {
967
+ return await readBytes(input, { signal }) ?? new TextEncoder().encode(typeof input === "string" ? input : "");
968
+ }
969
+ async function runFile(source, sink, prepared, formats, options) {
970
+ const { ctx } = prepared.created;
971
+ const read = source.file;
972
+ const file = await read(prepared.params, ctx);
973
+ const { input, filename, mimeType } = await fileInput(file, formats, ctx.signal);
974
+ let { format } = file;
975
+ let body = input;
976
+ if (format === void 0) {
977
+ const bytes = await bytesOf(input, ctx.signal);
978
+ format = formats.sniff({ filename, mimeType, head: bytes.subarray(0, SNIFF_HEAD_BYTES) })?.format;
979
+ body = bytes;
980
+ if (format === void 0) {
981
+ failOn(prepared.report, "E_SOURCE_RESPONSE", "the file is in no format graph-io reads", {
982
+ expected: "graph-file",
983
+ contentType: mimeType ?? null
984
+ });
985
+ }
986
+ }
987
+ const importer = formats.importer(format);
988
+ prepared.report.include(await importer.import(body, sink, importerOptions$1(options, ctx.signal)));
989
+ writeMeta(sink, file.meta ?? {});
990
+ return format;
991
+ }
992
+ async function runIntoSink(source, params, sink, options, formats) {
993
+ const prepared = prepare(source, params, options, typeof source.file === "function" ? "bytes" : "items");
994
+ const { ctx } = prepared.created;
995
+ const version = source.descriptor?.version ?? 1;
996
+ const wrapped = wrapSink(sink, prepared, options.idPrefix);
997
+ try {
998
+ if (typeof source.records === "function") {
999
+ const next = await runRecords(source, wrapped, prepared);
1000
+ throwIfAborted(ctx.signal);
1001
+ return {
1002
+ report: withSource(prepared.report.finish(), prepared, wrapCursor(next, version)),
1003
+ format: sourceFormat(source.id)
1004
+ };
1005
+ }
1006
+ if (typeof source.file === "function") {
1007
+ const format = await runFile(source, wrapped, prepared, formats, options);
1008
+ return { report: withSource(prepared.report.finish(), prepared, null), format };
1009
+ }
1010
+ const run = source.import;
1011
+ const report = await stopAtLimit(run(prepared.params, wrapped, ctx), prepared);
1012
+ throwIfAborted(ctx.signal);
1013
+ return {
1014
+ report: withSource(report, prepared, wrapCursor(prepared.created.state.finish?.next, version)),
1015
+ format: sourceFormat(source.id)
1016
+ };
1017
+ } catch (err) {
1018
+ throw settle(err, prepared);
1019
+ } finally {
1020
+ prepared.created.dispose();
1021
+ }
1022
+ }
1023
+ async function runMethod(source, feature, params, options, call) {
1024
+ if (typeof source[feature] !== "function") {
1025
+ failOn(
1026
+ new ImportReportBuilder(sourceFormat(source.id), 0),
1027
+ "E_SOURCE_UNSUPPORTED",
1028
+ `source ${source.id} has no ${feature}`,
1029
+ {
1030
+ feature
1031
+ }
1032
+ );
1033
+ }
1034
+ const prepared = prepare(source, params, options, "items");
1035
+ try {
1036
+ const out = await call(prepared);
1037
+ throwIfAborted(prepared.created.ctx.signal);
1038
+ return out;
1039
+ } catch (err) {
1040
+ throw settle(err, prepared);
1041
+ } finally {
1042
+ prepared.created.dispose();
1043
+ }
1044
+ }
1045
+ function withSource(report, prepared, next) {
1046
+ const own = prepared.report.finish();
1047
+ const missing = own.issues.filter((i6) => !report.issues.includes(i6));
1048
+ return Object.freeze({
1049
+ ...report,
1050
+ issues: missing.length === 0 ? report.issues : Object.freeze([...report.issues, ...missing]),
1051
+ warningCount: report.warningCount + missing.filter((i6) => i6.severity === "warning").length,
1052
+ errorCount: report.errorCount + missing.filter((i6) => i6.severity === "error").length,
1053
+ source: prepared.created.info(next)
1054
+ });
1055
+ }
1056
+ function settle(err, prepared) {
1057
+ const { signal } = prepared.created.ctx;
1058
+ if (signal.aborted) {
1059
+ return signal.reason;
1060
+ }
1061
+ if (err instanceof LimitStop) {
1062
+ return settle(limitError(err, prepared), prepared);
1063
+ }
1064
+ if (err instanceof ImportError && err.report.source === void 0) {
1065
+ const withInfo = new ImportError(
1066
+ err.message,
1067
+ { ...err.report, source: prepared.created.info(null) },
1068
+ err.details
1069
+ );
1070
+ withInfo.stack = err.stack;
1071
+ return withInfo;
1072
+ }
1073
+ return err;
1074
+ }
1075
+ function limitError(stop, prepared) {
1076
+ try {
1077
+ return failOn(prepared.report, "E_SOURCE_LIMIT", stop.message, { limit: stop.limit, value: stop.value });
1078
+ } catch (err) {
1079
+ return err;
1080
+ }
1081
+ }
1082
+ async function stopAtLimit(run, prepared) {
1083
+ try {
1084
+ return await run;
1085
+ } catch (err) {
1086
+ if (err instanceof LimitStop) {
1087
+ return prepared.report.finish();
1088
+ }
1089
+ throw err;
1090
+ }
1091
+ }
1092
+ function isLazy(value) {
1093
+ const v2 = value;
1094
+ return typeof v2.load === "function" && v2.records === void 0 && v2.file === void 0 && v2.import === void 0;
1095
+ }
1096
+ class SourceRegistry {
1097
+ /**
1098
+ * Create one for a format registry, whose importers read `file` sources.
1099
+ * @param formats - the format registry
1100
+ * @param building - how it builds and freezes graphs
1101
+ */
1102
+ constructor(formats, building) {
1103
+ this.formats = formats;
1104
+ this.building = building;
1105
+ this.entries = /* @__PURE__ */ new Map();
1106
+ }
1107
+ /**
1108
+ * Register a source or a lazy source. A malformed one, or an id already taken, throws an
1109
+ * ImportError with E_SOURCE_INVALID.
1110
+ * @param source - the source
1111
+ */
1112
+ register(source) {
1113
+ if (isLazy(source)) {
1114
+ checkLazySource(source);
1115
+ } else {
1116
+ checkSource(source);
1117
+ }
1118
+ if (this.entries.has(source.id)) {
1119
+ failAlone("E_SOURCE_INVALID", `a source with id ${source.id} is already registered`, {
1120
+ id: source.id,
1121
+ reason: "duplicate"
1122
+ });
1123
+ }
1124
+ const lazy = isLazy(source) ? source : null;
1125
+ this.entries.set(source.id, {
1126
+ descriptor: source.descriptor ?? { plainName: source.id, params: [] },
1127
+ lazy,
1128
+ source: lazy === null ? source : null,
1129
+ loading: null
1130
+ });
1131
+ }
1132
+ /**
1133
+ * Whether a source id is registered.
1134
+ * @param id - the id
1135
+ * @returns true when registered
1136
+ */
1137
+ has(id) {
1138
+ return this.entries.has(id);
1139
+ }
1140
+ /**
1141
+ * Every registered source, without loading any code.
1142
+ * @returns one entry per source, in registration order
1143
+ */
1144
+ list() {
1145
+ return Object.freeze(
1146
+ [...this.entries].map(
1147
+ ([id, e7]) => Object.freeze({ id, descriptor: e7.descriptor, loaded: e7.source !== null })
1148
+ )
1149
+ );
1150
+ }
1151
+ /**
1152
+ * A source by id, loading a lazy one; a source object passes through after its checks.
1153
+ * @param source - the id or the source
1154
+ * @returns the loaded source
1155
+ */
1156
+ async resolve(source) {
1157
+ if (typeof source !== "string") {
1158
+ checkSource(source);
1159
+ return source;
1160
+ }
1161
+ const entry = this.entries.get(source);
1162
+ if (entry === void 0) {
1163
+ return failAlone(
1164
+ "E_SOURCE_UNKNOWN",
1165
+ `no source has id ${JSON.stringify(source)}`,
1166
+ { id: source, known: [...this.entries.keys()] },
1167
+ sourceFormat(source)
1168
+ );
1169
+ }
1170
+ if (entry.source !== null) {
1171
+ return entry.source;
1172
+ }
1173
+ const lazy = entry.lazy;
1174
+ entry.loading ??= lazy.load().then(
1175
+ (loaded) => {
1176
+ if (loaded.id !== lazy.id) {
1177
+ failAlone("E_SOURCE_INVALID", `lazy source ${lazy.id} loaded a source with id ${loaded.id}`, {
1178
+ id: lazy.id,
1179
+ reason: "lazy"
1180
+ });
1181
+ }
1182
+ checkSource(loaded, lazy.descriptor);
1183
+ entry.source = loaded.descriptor === void 0 ? { ...loaded, descriptor: lazy.descriptor } : loaded;
1184
+ return entry.source;
1185
+ },
1186
+ (err) => {
1187
+ entry.loading = null;
1188
+ throw err;
1189
+ }
1190
+ );
1191
+ return entry.loading;
1192
+ }
1193
+ /**
1194
+ * Load a graph from a source.
1195
+ * @param source - the id or the source
1196
+ * @param params - its params
1197
+ * @param options - endpoint, credential, cursor, caps and the import options
1198
+ * @returns the graph and the report
1199
+ */
1200
+ async load(source, params, options = {}) {
1201
+ const resolved = await this.resolve(source);
1202
+ const builder = this.building.newBuilder(options, sourceFormat(resolved.id));
1203
+ const { report, format } = await runIntoSink(resolved, params, builder, options, this.formats);
1204
+ return this.building.freeze(format, builder, report, options);
1205
+ }
1206
+ /**
1207
+ * Load from a source into a sink you own.
1208
+ * @param source - the id or the source
1209
+ * @param params - its params
1210
+ * @param sink - where to write
1211
+ * @param options - the options
1212
+ * @returns the report
1213
+ */
1214
+ async import(source, params, sink, options = {}) {
1215
+ const resolved = await this.resolve(source);
1216
+ return (await runIntoSink(resolved, params, sink, options, this.formats)).report;
1217
+ }
1218
+ /**
1219
+ * Fetch the neighborhood of some nodes: a snapshot of only what was fetched.
1220
+ * @param source - the id or the source
1221
+ * @param request - the seeds and how far to go
1222
+ * @param options - the options
1223
+ * @returns the fetched part and the report
1224
+ */
1225
+ async expand(source, request, options = {}) {
1226
+ const resolved = await this.resolve(source);
1227
+ const builder = this.building.newBuilder(options, sourceFormat(resolved.id));
1228
+ const report = await runMethod(resolved, "expand", request.params, options, async (prepared) => {
1229
+ const sink = wrapSink(builder, prepared, options.idPrefix);
1230
+ const run = resolved.expand?.({ ...request, params: prepared.params }, sink, prepared.created.ctx);
1231
+ const out = await stopAtLimit(run, prepared);
1232
+ return withSource(
1233
+ out,
1234
+ prepared,
1235
+ wrapCursor(prepared.created.state.finish?.next, resolved.descriptor?.version ?? 1)
1236
+ );
1237
+ });
1238
+ return this.building.freeze(sourceFormat(resolved.id), builder, report, options);
1239
+ }
1240
+ /**
1241
+ * Check params and credential without loading.
1242
+ * @param source - the id or the source
1243
+ * @param params - its params
1244
+ * @param options - the options
1245
+ * @returns what the service said
1246
+ */
1247
+ async probe(source, params, options = {}) {
1248
+ const resolved = await this.resolve(source);
1249
+ return runMethod(
1250
+ resolved,
1251
+ "probe",
1252
+ params,
1253
+ options,
1254
+ (prepared) => resolved.probe?.(prepared.params, prepared.created.ctx)
1255
+ );
1256
+ }
1257
+ /**
1258
+ * Search what a source holds.
1259
+ * @param source - the id or the source
1260
+ * @param query - the search
1261
+ * @param options - the options
1262
+ * @returns one page of results
1263
+ */
1264
+ async search(source, query, options = {}) {
1265
+ const resolved = await this.resolve(source);
1266
+ const partial = resolved.descriptor === void 0 ? void 0 : {
1267
+ ...resolved.descriptor,
1268
+ params: resolved.descriptor.params.map((p5) => ({ ...p5, required: false }))
1269
+ };
1270
+ return runMethod(
1271
+ { ...resolved, descriptor: partial },
1272
+ "list",
1273
+ query.params,
1274
+ options,
1275
+ (prepared) => resolved.list?.(
1276
+ { ...query, params: prepared.params },
1277
+ prepared.created.ctx
1278
+ )
1279
+ );
1280
+ }
1281
+ /**
1282
+ * Tell whether data loaded earlier changed.
1283
+ * @param source - the id or the source
1284
+ * @param params - the params it was loaded with
1285
+ * @param seen - the validators recorded then
1286
+ * @param options - the options
1287
+ * @returns whether it changed
1288
+ */
1289
+ async validate(source, params, seen, options = {}) {
1290
+ const resolved = await this.resolve(source);
1291
+ return runMethod(
1292
+ resolved,
1293
+ "validate",
1294
+ params,
1295
+ options,
1296
+ (prepared) => resolved.validate?.(prepared.params, seen, prepared.created.ctx)
1297
+ );
1298
+ }
1299
+ }
574
1300
  const UNKNOWN_FORMAT_CODE = "E_UNKNOWN_FORMAT";
575
1301
  const SNIFF_FAILED_CODE = "W_SNIFF_FAILED";
576
1302
  const FUNCTION_OPTIONS = /* @__PURE__ */ new Set([
@@ -615,6 +1341,112 @@ class FormatRegistry {
615
1341
  constructor() {
616
1342
  this.importerMap = /* @__PURE__ */ new Map();
617
1343
  this.exporterMap = /* @__PURE__ */ new Map();
1344
+ this.sources = new SourceRegistry(this, {
1345
+ newBuilder: (options, format) => seededBuilder(options, format),
1346
+ freeze: (format, builder, report, options) => result(
1347
+ { importer: { format }, sniff: null, warnings: [] },
1348
+ builder,
1349
+ report,
1350
+ options
1351
+ )
1352
+ });
1353
+ }
1354
+ /**
1355
+ * Register a network source, or a lazy one whose code loads on first use. Source ids are their
1356
+ * own name space, apart from format names. Throws an ImportError with E_SOURCE_INVALID for a
1357
+ * malformed source or an id already taken. Experimental.
1358
+ * @param source - the source
1359
+ * @returns this registry
1360
+ */
1361
+ registerSource(source) {
1362
+ this.sources.register(source);
1363
+ return this;
1364
+ }
1365
+ /**
1366
+ * A registered source by id, its code loaded. Rejects with E_SOURCE_UNKNOWN for an id no
1367
+ * source has. Experimental.
1368
+ * @param id - the source id
1369
+ * @returns the source
1370
+ */
1371
+ source(id) {
1372
+ return this.sources.resolve(id);
1373
+ }
1374
+ /**
1375
+ * Whether a source id is registered. Experimental.
1376
+ * @param id - the source id
1377
+ * @returns true when registered
1378
+ */
1379
+ hasSource(id) {
1380
+ return this.sources.has(id);
1381
+ }
1382
+ /**
1383
+ * Every registered source with its descriptor, loading no source code. Experimental.
1384
+ * @returns one entry per source
1385
+ */
1386
+ listSources() {
1387
+ return this.sources.list();
1388
+ }
1389
+ /**
1390
+ * Load a graph from a network source; see the top-level loadFromSource(). Experimental.
1391
+ * @param source - the source id or the source
1392
+ * @param params - its params
1393
+ * @param options - endpoint, credential, cursor, caps and import options
1394
+ * @returns the graph and the report
1395
+ */
1396
+ loadFromSource(source, params, options) {
1397
+ return this.sources.load(source, params, options);
1398
+ }
1399
+ /**
1400
+ * Load from a network source into a sink you own. Experimental.
1401
+ * @param source - the source id or the source
1402
+ * @param params - its params
1403
+ * @param sink - where to write
1404
+ * @param options - the options
1405
+ * @returns the report
1406
+ */
1407
+ importFromSource(source, params, sink, options) {
1408
+ return this.sources.import(source, params, sink, options);
1409
+ }
1410
+ /**
1411
+ * Fetch the neighborhood of some nodes from a network source. Experimental.
1412
+ * @param source - the source id or the source
1413
+ * @param request - the seeds and how far to go
1414
+ * @param options - the options
1415
+ * @returns a graph of only what was fetched
1416
+ */
1417
+ expandFromSource(source, request, options) {
1418
+ return this.sources.expand(source, request, options);
1419
+ }
1420
+ /**
1421
+ * Check a source's params and credential without loading. Experimental.
1422
+ * @param source - the source id or the source
1423
+ * @param params - its params
1424
+ * @param options - the options
1425
+ * @returns what the service said
1426
+ */
1427
+ probeSource(source, params, options) {
1428
+ return this.sources.probe(source, params, options);
1429
+ }
1430
+ /**
1431
+ * Search what a source holds. Experimental.
1432
+ * @param source - the source id or the source
1433
+ * @param query - the search
1434
+ * @param options - the options
1435
+ * @returns one page of results
1436
+ */
1437
+ listFromSource(source, query, options) {
1438
+ return this.sources.search(source, query, options);
1439
+ }
1440
+ /**
1441
+ * Tell whether data loaded from a source changed. Experimental.
1442
+ * @param source - the source id or the source
1443
+ * @param params - the params it was loaded with
1444
+ * @param seen - the validators recorded then (`report.source.validators`)
1445
+ * @param options - the options
1446
+ * @returns whether it changed
1447
+ */
1448
+ validateSource(source, params, seen, options) {
1449
+ return this.sources.validate(source, params, seen, options);
618
1450
  }
619
1451
  /**
620
1452
  * Register an importer under its format name, replacing one of the same name in place (the
@@ -740,7 +1572,7 @@ class FormatRegistry {
740
1572
  const { importer } = chosen;
741
1573
  if ((opts.graphIndex !== void 0 || opts.graphName !== void 0) && importer.importAll !== void 0 && importer.listGraphs === void 0) {
742
1574
  const all = await this.readAll(chosen, opts);
743
- const names = all.map((r3) => r3.snapshot.meta.name);
1575
+ const names = all.map((r4) => r4.snapshot.meta.name);
744
1576
  return all[chooseGraph(names, opts, new ImportReportBuilder(importer.format, 0))];
745
1577
  }
746
1578
  let builder;
@@ -846,11 +1678,11 @@ class FormatRegistry {
846
1678
  builders.length - 1
847
1679
  );
848
1680
  }
849
- return reports.map((report, i4) => {
1681
+ return reports.map((report, i6) => {
850
1682
  try {
851
- return result(chosen, builders[i4], report, options);
1683
+ return result(chosen, builders[i6], report, options);
852
1684
  } catch (err) {
853
- throw inGraph(err, i4);
1685
+ throw inGraph(err, i6);
854
1686
  }
855
1687
  });
856
1688
  }
@@ -1038,11 +1870,11 @@ class FormatRegistry {
1038
1870
  if (styled === null) {
1039
1871
  notes = this.exporter(format).check(snapshot, options);
1040
1872
  } else if (styled.refusal === null) {
1041
- const key = (n3) => `${n3.code}\0${n3.style?.target ?? ""}\0${n3.style?.property ?? ""}`;
1042
- const reported = new Set(styled.notes.filter((n3) => n3.style !== void 0).map(key));
1873
+ const key = (n5) => `${n5.code}\0${n5.style?.target ?? ""}\0${n5.style?.property ?? ""}`;
1874
+ const reported = new Set(styled.notes.filter((n5) => n5.style !== void 0).map(key));
1043
1875
  notes = [
1044
1876
  ...styled.exporter.check(styled.snapshot, styled.options).filter(
1045
- (n3) => n3.style === void 0 || !reported.has(key(n3)) && !isKeptGraphtyProperty(n3, styled.exporter)
1877
+ (n5) => n5.style === void 0 || !reported.has(key(n5)) && !isKeptGraphtyProperty(n5, styled.exporter)
1046
1878
  ),
1047
1879
  ...styled.notes
1048
1880
  ];
@@ -1135,7 +1967,11 @@ class FormatRegistry {
1135
1967
  }
1136
1968
  }
1137
1969
  function createRegistry() {
1138
- return new FormatRegistry().registerImporter(jsonImporter).registerExporter(jsonExporter).registerImporter(graphmlImporter).registerExporter(graphmlExporter).registerImporter(gexfImporter).registerExporter(gexfExporter).registerImporter(csvImporter).registerExporter(csvExporter).registerImporter(gmlImporter).registerExporter(gmlExporter).registerImporter(dotImporter).registerExporter(dotExporter).registerImporter(pajekImporter).registerExporter(pajekExporter).registerImporter(neo4jImporter).registerExporter(neo4jExporter).registerImporter(xgmmlImporter).registerExporter(xgmmlExporter).registerImporter(cx2Importer).registerExporter(cx2Exporter).registerImporter(cxImporter).registerExporter(cxExporter).registerImporter(oboImporter).registerExporter(oboExporter).registerImporter(cysImporter).registerExporter(cysExporter);
1970
+ const formats = new FormatRegistry().registerImporter(jsonImporter).registerExporter(jsonExporter).registerImporter(graphmlImporter).registerExporter(graphmlExporter).registerImporter(gexfImporter).registerExporter(gexfExporter).registerImporter(csvImporter).registerExporter(csvExporter).registerImporter(gmlImporter).registerExporter(gmlExporter).registerImporter(dotImporter).registerExporter(dotExporter).registerImporter(pajekImporter).registerExporter(pajekExporter).registerImporter(neo4jImporter).registerExporter(neo4jExporter).registerImporter(xgmmlImporter).registerExporter(xgmmlExporter).registerImporter(cx2Importer).registerExporter(cx2Exporter).registerImporter(cxImporter).registerExporter(cxExporter).registerImporter(oboImporter).registerExporter(oboExporter).registerImporter(cysImporter).registerExporter(cysExporter);
1971
+ for (const source of builtinSources()) {
1972
+ formats.registerSource(source);
1973
+ }
1974
+ return formats;
1139
1975
  }
1140
1976
  const registry = /* @__PURE__ */ createRegistry();
1141
1977
  function importGraph(input, options) {
@@ -1295,7 +2131,7 @@ function result(chosen, builder, report, options) {
1295
2131
  return Object.freeze(result2);
1296
2132
  }
1297
2133
  function withoutStylesNotImported(report) {
1298
- const issues = report.issues.filter((i4) => i4.code !== STYLES_NOT_IMPORTED_CODE);
2134
+ const issues = report.issues.filter((i6) => i6.code !== STYLES_NOT_IMPORTED_CODE);
1299
2135
  if (issues.length === report.issues.length) {
1300
2136
  return report;
1301
2137
  }
@@ -1326,7 +2162,7 @@ function unknownOptionText(name) {
1326
2162
  return `option ${JSON.stringify(name)} is not an option of any format or of the load and save functions, so it has no effect; check its spelling`;
1327
2163
  }
1328
2164
  function weightNotFound(report, snapshot, weightFrom) {
1329
- if (typeof weightFrom !== "string" || snapshot.edgeCount === 0 || snapshot.edgeList().weights !== null || report.issues.some((i4) => i4.code === OPTION_IGNORED_CODE && i4.element === "weightFrom")) {
2165
+ if (typeof weightFrom !== "string" || snapshot.edgeCount === 0 || snapshot.edgeList().weights !== null || report.issues.some((i6) => i6.code === OPTION_IGNORED_CODE && i6.element === "weightFrom")) {
1330
2166
  return report;
1331
2167
  }
1332
2168
  const issue = Object.freeze({
@@ -1441,10 +2277,10 @@ async function peekHead(input, bytes, signal) {
1441
2277
  return { head: joinHead(buffered, bytes), input: replayed, close: () => replayed.close() };
1442
2278
  }
1443
2279
  function joinHead(chunks, bytes) {
1444
- if (chunks.every((c6) => c6 instanceof Uint8Array)) {
2280
+ if (chunks.every((c8) => c8 instanceof Uint8Array)) {
1445
2281
  const total = Math.min(
1446
2282
  bytes,
1447
- chunks.reduce((sum, c6) => sum + c6.byteLength, 0)
2283
+ chunks.reduce((sum, c8) => sum + c8.byteLength, 0)
1448
2284
  );
1449
2285
  const head = new Uint8Array(total);
1450
2286
  let offset = 0;
@@ -1537,61 +2373,166 @@ function readerIterator(stream, signal) {
1537
2373
  }
1538
2374
  };
1539
2375
  }
2376
+ function loadFromSource(source, params, options) {
2377
+ return registry.loadFromSource(source, params, options);
2378
+ }
2379
+ function importFromSource(source, params, sink, options) {
2380
+ return registry.importFromSource(source, params, sink, options);
2381
+ }
2382
+ function expandFromSource(source, request, options) {
2383
+ return registry.expandFromSource(source, request, options);
2384
+ }
2385
+ function probeSource(source, params, options) {
2386
+ return registry.probeSource(source, params, options);
2387
+ }
2388
+ function listFromSource(source, query, options) {
2389
+ return registry.listFromSource(source, query, options);
2390
+ }
2391
+ function validateSource(source, params, seen, options) {
2392
+ return registry.validateSource(source, params, seen, options);
2393
+ }
2394
+ function registerSource(source) {
2395
+ registry.registerSource(source);
2396
+ }
2397
+ function listSources() {
2398
+ return registry.listSources();
2399
+ }
2400
+ function replayFetch(recordings, options = {}) {
2401
+ const secretQuery = new Set(options.secretQuery ?? []);
2402
+ const secretHeaders = ["authorization", ...(options.secretHeaders ?? []).map((h4) => h4.toLowerCase())];
2403
+ const used = /* @__PURE__ */ new Set();
2404
+ const calls = [];
2405
+ const key = (url) => {
2406
+ const params = [...url.searchParams].filter(([k4]) => !secretQuery.has(k4)).sort(compare);
2407
+ return `${url.origin}${url.pathname}?${new URLSearchParams(params).toString()}`;
2408
+ };
2409
+ const replay2 = async (input, init) => {
2410
+ const request = new Request(input, init);
2411
+ request.signal.throwIfAborted();
2412
+ const url = new URL(request.url);
2413
+ const method = request.method.toUpperCase();
2414
+ const body = method === "GET" || method === "HEAD" ? "" : await request.clone().text();
2415
+ const credential = secretHeaders.some((h4) => request.headers.has(h4)) || [...url.searchParams.keys()].some((k4) => secretQuery.has(k4));
2416
+ const wanted = key(url);
2417
+ const matches = [];
2418
+ recordings.forEach((r22, i6) => {
2419
+ if ((r22.method ?? "GET").toUpperCase() === method && key(new URL(r22.url)) === wanted && (r22.credential === void 0 || r22.credential === credential) && (r22.requestBody === void 0 || sameBody(r22.requestBody, body))) {
2420
+ matches.push(i6);
2421
+ }
2422
+ });
2423
+ const index = matches.find((i6) => !used.has(i6)) ?? matches.at(-1);
2424
+ if (index === void 0) {
2425
+ throw new Error(`replayFetch: no recording for ${method} ${url.origin}${url.pathname}`);
2426
+ }
2427
+ used.add(index);
2428
+ calls.push({ method, url: `${url.origin}${url.pathname}`, credential });
2429
+ const r4 = recordings[index];
2430
+ const status = r4.status ?? 200;
2431
+ const text = bodyText(r4.body);
2432
+ const headers = new Headers(r4.headers);
2433
+ if (text !== null && typeof r4.body !== "string" && !headers.has("content-type")) {
2434
+ headers.set("content-type", "application/json");
2435
+ }
2436
+ const nullBody = status === 204 || status === 304 || status >= 300 && status < 400 && text === null;
2437
+ return new Response(nullBody ? null : text, { status, headers });
2438
+ };
2439
+ return Object.assign(replay2, { calls });
2440
+ }
2441
+ function bodyText(body) {
2442
+ if (body === void 0 || body === null) {
2443
+ return null;
2444
+ }
2445
+ return typeof body === "string" ? body : JSON.stringify(body);
2446
+ }
2447
+ function compare(a24, b6) {
2448
+ return a24[0] === b6[0] ? a24[1].localeCompare(b6[1]) : a24[0].localeCompare(b6[0]);
2449
+ }
2450
+ function sameBody(recorded, sent) {
2451
+ try {
2452
+ return JSON.stringify(JSON.parse(recorded)) === JSON.stringify(JSON.parse(sent));
2453
+ } catch {
2454
+ return recorded === sent;
2455
+ }
2456
+ }
2457
+ async function recordingFrom(request, response, options = {}) {
2458
+ const headers = {};
2459
+ for (const name of ["content-type", ...options.keepHeaders ?? []]) {
2460
+ const value = response.headers.get(name);
2461
+ if (value !== null) {
2462
+ headers[name.toLowerCase()] = value;
2463
+ }
2464
+ }
2465
+ const url = new URL(request.url);
2466
+ for (const name of options.secretQuery ?? []) {
2467
+ url.searchParams.delete(name);
2468
+ }
2469
+ const method = request.method.toUpperCase();
2470
+ const requestBody = method === "GET" || method === "HEAD" ? void 0 : await request.clone().text();
2471
+ return {
2472
+ method,
2473
+ url: url.toString(),
2474
+ ...requestBody === void 0 || requestBody === "" ? {} : { requestBody },
2475
+ status: response.status,
2476
+ headers,
2477
+ body: await response.text()
2478
+ };
2479
+ }
1540
2480
  export {
1541
- a2 as AMBIGUOUS_GRAPH_NAME_CODE,
1542
- Q as ASPECT_ORDER_CODE,
1543
- K as BAD_ASPECT_BLOCK_CODE,
2481
+ W as AMBIGUOUS_GRAPH_NAME_CODE,
2482
+ a3 as ASPECT_ORDER_CODE,
2483
+ L as BAD_ASPECT_BLOCK_CODE,
1544
2484
  B as BAD_DEFAULT_CODE,
1545
2485
  BAD_LINE_CODE,
1546
- ae as BAD_OPTIONS_CODE,
1547
- Y as BAD_VALUE_CODE,
1548
- a9 as COLUMN_AS_PROPERTY_VALUE_CODE,
1549
- as as COLUMN_DROPPED_CODE,
2486
+ ac as BAD_OPTIONS_CODE,
2487
+ T as BAD_VALUE_CODE,
2488
+ a8 as COLUMN_AS_PROPERTY_VALUE_CODE,
2489
+ av as COLUMN_DROPPED_CODE,
1550
2490
  C as COLUMN_RENAMED_CODE,
1551
- at as COLUMN_RENAMED_LOSS_CODE,
2491
+ aw as COLUMN_RENAMED_LOSS_CODE,
1552
2492
  x as COLUMN_TYPE_CODE,
1553
- au as CONTROL_CHARACTER_CODE,
2493
+ a6 as CONTROL_CHARACTER_CODE,
1554
2494
  h as COUNT_HINT_CODE,
1555
2495
  g as COUNT_MISMATCH_CODE,
1556
2496
  CSV_CAPABILITIES,
1557
2497
  CSV_ISSUE,
1558
2498
  CSV_LOSS,
1559
- C4 as CX2_CAPABILITIES,
1560
- C5 as CX2_ISSUE,
1561
- a14 as CX2_LOSS,
2499
+ C5 as CX2_CAPABILITIES,
2500
+ C6 as CX2_ISSUE,
2501
+ a15 as CX2_LOSS,
1562
2502
  C3 as CX_CAPABILITIES,
1563
- a13 as CX_ISSUE,
1564
- b2 as CX_LOSS,
1565
- C6 as CYS_CAPABILITIES,
1566
- a15 as CYS_ISSUE,
1567
- b3 as CYS_LOSS,
2503
+ C4 as CX_ISSUE,
2504
+ a14 as CX_LOSS,
2505
+ CYPHER_SOURCE_ID,
2506
+ C7 as CYS_CAPABILITIES,
2507
+ a16 as CYS_ISSUE,
2508
+ b2 as CYS_LOSS,
1568
2509
  C2 as ChildrenCsr,
1569
2510
  f as DANGLING_REFERENCE_CODE,
1570
2511
  D2 as DEFAULT_CHUNK_BYTES,
1571
2512
  X2 as DEFAULT_ERROR_LIMIT,
1572
- Y2 as DIRECTED_COLUMN,
1573
- av as DIRECTION_DROPPED_CODE,
2513
+ g2 as DIRECTED_COLUMN,
2514
+ ax as DIRECTION_DROPPED_CODE,
1574
2515
  D as DIRECTION_FORCED_CODE,
1575
2516
  b as DIRECTION_REFUSED_CODE,
1576
2517
  D3 as DOT_ISSUE,
1577
- a16 as DOT_LOSS,
1578
- S2 as DOT_STYLE_BLOCK_ATTRIBUTE,
1579
- b4 as DOT_STYLE_CAPABILITIES,
2518
+ a17 as DOT_LOSS,
2519
+ S3 as DOT_STYLE_BLOCK_ATTRIBUTE,
2520
+ D4 as DOT_STYLE_CAPABILITIES,
1580
2521
  l as DUPLICATE_ATTRIBUTE_CODE,
1581
- aw as DUPLICATE_EDGE_CODE,
2522
+ ay as DUPLICATE_EDGE_CODE,
1582
2523
  j as DUPLICATE_EDGE_ID_CODE,
1583
2524
  q as DUPLICATE_KEY_CODE,
1584
2525
  k as DUPLICATE_NODE_CODE,
1585
2526
  DirectionResolver,
1586
2527
  EDGES_MERGED_CODE,
1587
2528
  y as ELEMENT_ISSUE,
1588
- ax as EMPTY_COLUMN_DROPPED_CODE,
2529
+ az as EMPTY_COLUMN_DROPPED_CODE,
1589
2530
  EMPTY_INPUT_CODE,
1590
2531
  r as ENCODING_CONFLICT_CODE,
1591
2532
  t as ENCODING_FALLBACK_CODE,
1592
- ay as EQUATION_AS_TEXT_CODE,
2533
+ aA as EQUATION_AS_TEXT_CODE,
1593
2534
  FETCH_CODE,
1594
- az as FOREIGN_FORMAT_CODE,
2535
+ a7 as FOREIGN_FORMAT_CODE,
1595
2536
  FormatRegistry,
1596
2537
  GEXF_1_2_CAPABILITIES,
1597
2538
  GEXF_ISSUE,
@@ -1601,19 +2542,19 @@ export {
1601
2542
  GML_LOSS,
1602
2543
  GML_STYLE_BLOCK_KEY,
1603
2544
  GML_STYLE_CAPABILITIES,
1604
- G4 as GRAPHML_ISSUE,
1605
- a20 as GRAPHML_LOSS,
1606
- G5 as GRAPHML_STYLE_CAPABILITIES,
2545
+ G3 as GRAPHML_ISSUE,
2546
+ a21 as GRAPHML_LOSS,
2547
+ G4 as GRAPHML_STYLE_CAPABILITIES,
1607
2548
  a23 as GRAPHTY_XML_NAMESPACE,
1608
- ag as GRAPH_COLUMN_AS_METADATA_CODE,
1609
- G3 as GRAPH_FORMATS,
1610
- a3 as GRAPH_NOT_FOUND_CODE,
2549
+ ae as GRAPH_COLUMN_AS_METADATA_CODE,
2550
+ G2 as GRAPH_FORMATS,
2551
+ Y as GRAPH_NOT_FOUND_CODE,
1611
2552
  GraphBuilder2 as GraphBuilder,
1612
2553
  GraphFormatError2 as GraphFormatError,
1613
2554
  H as HYPEREDGE_CODE,
1614
2555
  I as ID_MERGED_CODE,
1615
2556
  ID_SPACE_COLUMN,
1616
- aA as ID_TEXT_COLLISION_CODE,
2557
+ aj as ID_TEXT_COLLISION_CODE,
1617
2558
  A as ID_TEXT_TYPE_CODE,
1618
2559
  z as INPUT_ISSUE,
1619
2560
  aB as INTEGRAL_F64_CODE,
@@ -1625,65 +2566,77 @@ export {
1625
2566
  ImportError,
1626
2567
  ImportReportBuilder,
1627
2568
  J2 as JSON_DIALECTS,
1628
- a17 as JSON_ISSUE,
1629
- b5 as JSON_LOSS,
1630
- W as JSON_NONSTANDARD_NUMBER_CODE,
2569
+ a18 as JSON_ISSUE,
2570
+ b3 as JSON_LOSS,
2571
+ Z as JSON_NONSTANDARD_NUMBER_CODE,
1631
2572
  LABELS_COLUMN,
1632
2573
  L2 as LOSS,
1633
2574
  LineReader,
1634
- M2 as MAX_XML_DEPTH,
2575
+ M3 as MAX_XML_DEPTH,
1635
2576
  n as MISSING_ENDPOINT_CODE,
1636
- o as MISSING_ID_CODE,
2577
+ MISSING_ID_CODE,
1637
2578
  M as MIXED_DIRECTION_CODE,
1638
2579
  i as MULTIPLE_GRAPHS_CODE,
1639
- L as MULTI_ASPECT_FRAGMENT_CODE,
2580
+ $ as MULTI_ASPECT_FRAGMENT_CODE,
1640
2581
  J as MUTUAL_AS_UNDIRECTED_CODE,
1641
- Z as MUTUAL_COLUMN,
1642
- aD as MUTUAL_EXPANDED_CODE,
2582
+ M2 as MUTUAL_COLUMN,
2583
+ al as MUTUAL_EXPANDED_CODE,
2584
+ NDEX_SOURCE_ID,
1643
2585
  NEO4J_CAPABILITIES,
1644
2586
  NEO4J_ISSUE,
1645
2587
  NEO4J_LOSS,
1646
- af as NODE_ORDER_CODE,
1647
- aE as NONFINITE_AS_NULL_CODE,
1648
- _ as NO_CAPABILITIES,
2588
+ NEO4J_SOURCE_ID,
2589
+ NEPTUNE_SOURCE_ID,
2590
+ ad as NODE_ORDER_CODE,
2591
+ aD as NONFINITE_AS_NULL_CODE,
2592
+ Y2 as NO_CAPABILITIES,
1649
2593
  N as NO_GRAPH_CODE,
1650
- O2 as OBO_CAPABILITIES,
1651
- a18 as OBO_ISSUE,
1652
- b6 as OBO_LOSS,
1653
- aF as OPTIONS_GAINED_CODE,
2594
+ O as OBO_CAPABILITIES,
2595
+ a19 as OBO_ISSUE,
2596
+ b4 as OBO_LOSS,
2597
+ OPENALEX_SOURCE_ID,
2598
+ aE as OPTIONS_GAINED_CODE,
1654
2599
  OPTION_IGNORED_CODE,
1655
2600
  ORIGINAL_ID_COLUMN,
1656
- $2 as PAIR_COLUMN,
1657
- P2 as PAJEK_ISSUE,
1658
- a19 as PAJEK_LOSS,
1659
- b7 as PAJEK_STYLE_CAPABILITIES,
1660
- c4 as PAJEK_STYLE_COMMENT,
2601
+ P2 as PAIR_COLUMN,
2602
+ P3 as PAJEK_ISSUE,
2603
+ a20 as PAJEK_LOSS,
2604
+ b5 as PAJEK_STYLE_CAPABILITIES,
2605
+ c5 as PAJEK_STYLE_COMMENT,
1661
2606
  G as PARENTS_DROPPED_CODE,
1662
- a6 as PARENT_CYCLE_CODE,
1663
- aG as PARSE_ERROR_CODE,
2607
+ a1 as PARENT_CYCLE_CODE,
2608
+ aF as PARSE_ERROR_CODE,
1664
2609
  P as PRECISION_CODE,
1665
- ai as RELATION_ASSUMED_CODE,
2610
+ ag as RELATION_ASSUMED_CODE,
1666
2611
  R2 as RENAMED_CODE,
1667
- aa as ROLE_ASSUMED_CODE,
2612
+ REST_SOURCE_ID,
2613
+ a9 as ROLE_ASSUMED_CODE,
1668
2614
  F as ROLE_DROPPED_CODE,
1669
2615
  R as ROLE_TAKEN_CODE,
1670
2616
  SELF_LOOPS_DROPPED_CODE,
1671
- aH as SELF_LOOP_CODE,
1672
- a4 as SINGLE_OBJECT_ASPECT_CODE,
2617
+ aG as SELF_LOOP_CODE,
2618
+ _ as SINGLE_OBJECT_ASPECT_CODE,
1673
2619
  S as SINK_OPTION_CODE,
1674
2620
  SNIFF_FAILED_CODE,
1675
2621
  SNIFF_HEAD_BYTES,
1676
- T as STATUS_FAILED_CODE,
1677
- V as STATUS_WARNING_CODE,
1678
- aI as STORAGE_CLASS_CODE,
2622
+ n4 as SOURCE_ATTR_PREFIX,
2623
+ p3 as SOURCE_DEGREE_ATTR,
2624
+ e6 as SOURCE_ENTITY_ATTR,
2625
+ SOURCE_FORMAT_PREFIX,
2626
+ S2 as SOURCE_ISSUE,
2627
+ g4 as SOURCE_STUB_ATTR,
2628
+ SPARQL_SOURCE_ID,
2629
+ a5 as STATUS_FAILED_CODE,
2630
+ a4 as STATUS_WARNING_CODE,
2631
+ aH as STORAGE_CLASS_CODE,
1679
2632
  c as STRAY_TEXT_CODE,
1680
2633
  STYLES_NOT_IMPORTED_CODE,
1681
- a8 as SYNTAX_CODE,
1682
- aJ as TEMPORAL_DROPPED_CODE,
1683
- aK as TEMPORAL_TEXT_DROPPED_CODE,
1684
- aL as TEXT_INFERRED_CODE,
1685
- a1 as TOO_LARGE_CODE,
1686
- ah as TYPEDEF_NODES_CODE,
2634
+ Q as SYNTAX_CODE,
2635
+ aI as TEMPORAL_DROPPED_CODE,
2636
+ aJ as TEMPORAL_TEXT_DROPPED_CODE,
2637
+ aK as TEXT_INFERRED_CODE,
2638
+ V as TOO_LARGE_CODE,
2639
+ af as TYPEDEF_NODES_CODE,
1687
2640
  TYPE_COLUMN,
1688
2641
  TextCellWriter,
1689
2642
  U as UNKNOWN_ATTR_TYPE_CODE,
@@ -1692,33 +2645,34 @@ export {
1692
2645
  UNKNOWN_FORMAT_CODE,
1693
2646
  UNKNOWN_OPTION_CODE,
1694
2647
  m as UNKNOWN_PARENT_CODE,
1695
- a02 as UNKNOWN_TYPE_CODE,
2648
+ Z2 as UNKNOWN_TYPE_CODE,
1696
2649
  e as UNKNOWN_XML_ATTRIBUTE_CODE,
1697
- aM as WEIGHTS_DROPPED_CODE,
1698
- aN as WEIGHT_KEY_CLASH_CODE,
2650
+ aL as WEIGHTS_DROPPED_CODE,
2651
+ ak as WEIGHT_KEY_CLASH_CODE,
1699
2652
  WEIGHT_NOT_FOUND_CODE,
1700
- a7 as WIDENED_CODE,
2653
+ a2 as WIDENED_CODE,
1701
2654
  W2 as WIDENING_UNSUPPORTED_CODE,
1702
2655
  X3 as XGMML_ISSUE,
1703
- a21 as XGMML_LOSS,
1704
- ac as XML_ILLEGAL_CHAR_CODE,
2656
+ a22 as XGMML_LOSS,
2657
+ ab as XML_ILLEGAL_CHAR_CODE,
1705
2658
  X as XML_NESTING_CODE,
1706
2659
  w as XML_SYNTAX_CODE,
1707
- d5 as XmlNestingError,
1708
- c5 as XmlSyntaxError,
1709
- f3 as XmlTokenizer,
1710
- a12 as canonicalId,
1711
- c2 as capabilities,
1712
- a as checkCapabilities,
2660
+ d7 as XmlNestingError,
2661
+ c7 as XmlSyntaxError,
2662
+ p4 as XmlTokenizer,
2663
+ H2 as canonicalId,
2664
+ c3 as capabilities,
2665
+ a10 as checkCapabilities,
1713
2666
  checkExport,
1714
- c3 as childrenCsr,
1715
- a11 as childrenFromColumn,
2667
+ c4 as childrenCsr,
2668
+ a13 as childrenFromColumn,
1716
2669
  chooseGraph,
1717
- a22 as coerceId,
1718
- a32 as coerceIdText,
2670
+ _2 as coerceId,
2671
+ Q2 as coerceIdText,
1719
2672
  collectBytes,
1720
2673
  compareSnapshots,
1721
2674
  createRegistry,
2675
+ c6 as credentials,
1722
2676
  csvExporter,
1723
2677
  csvImporter,
1724
2678
  cx2Exporter,
@@ -1727,64 +2681,71 @@ export {
1727
2681
  cxImporter,
1728
2682
  cysExporter,
1729
2683
  cysImporter,
1730
- y2 as declareCompanion,
1731
- d2 as declareResolved,
1732
- d3 as decodeChunks,
1733
- a42 as decodeEntryName,
2684
+ n2 as declareCompanion,
2685
+ i2 as declareResolved,
2686
+ d4 as decodeChunks,
2687
+ e4 as decodeEntryName,
1734
2688
  defineLineFormat,
2689
+ d6 as defineSource,
1735
2690
  describeDiffs,
1736
- d4 as dialectCapabilities,
2691
+ d5 as dialectCapabilities,
1737
2692
  dotExporter,
1738
2693
  dotImporter,
1739
2694
  downloadGraph,
1740
- a5 as edgeWeights,
1741
- e3 as encodeChunks,
1742
- e2 as explicitWeights,
2695
+ $2 as edgeWeights,
2696
+ e5 as encodeChunks,
2697
+ expandFromSource,
2698
+ e3 as explicitWeights,
1743
2699
  exportGraph,
1744
2700
  exportGraphToBlob,
1745
2701
  exportGraphToBytes,
1746
2702
  exportGraphToString,
1747
2703
  exportNeo4jFiles,
1748
- g2 as extensionOf,
1749
- a62 as forDecodedText,
1750
- aO as formatDecimal,
1751
- $ as formatF32,
1752
- a0 as formatF64,
1753
- aP as formatGmlReal,
1754
- ad as formatInteger,
2704
+ g3 as extensionOf,
2705
+ a0 as forDecodedText,
2706
+ d2 as formatDecimal,
2707
+ f2 as formatF32,
2708
+ a as formatF64,
2709
+ e2 as formatGmlReal,
2710
+ c2 as formatInteger,
2711
+ q2 as fromStorableCredential,
1755
2712
  gexfExporter,
1756
2713
  gexfImporter,
1757
2714
  gmlExporter,
1758
2715
  gmlImporter,
1759
- k2 as graphChosen,
2716
+ h2 as graphChosen,
1760
2717
  graphmlExporter,
1761
2718
  graphmlImporter,
1762
- h3 as hasIllegalXmlChar,
1763
- h2 as headBytes,
2719
+ o as hasIllegalXmlChar,
2720
+ h3 as headBytes,
1764
2721
  importAllGraphs,
2722
+ importFromSource,
1765
2723
  importGraph,
1766
- i2 as inferTextDtype,
1767
- a72 as inputLength,
2724
+ i4 as inferTextDtype,
2725
+ d3 as inputLength,
1768
2726
  isAbortError,
1769
- O as isCanonicalIntegerText,
1770
- a82 as isImportInput,
1771
- a92 as isNmtoken,
1772
- a10 as isNumericText,
1773
- o2 as isWeightField,
2727
+ F2 as isCanonicalIntegerText,
2728
+ i3 as isImportInput,
2729
+ U2 as isNmtoken,
2730
+ a11 as isNumericText,
2731
+ k2 as isWeightField,
1774
2732
  j2 as joinText,
1775
2733
  j3 as jsonCapabilities,
1776
2734
  jsonExporter,
1777
2735
  jsonImporter,
1778
- f2 as jsonShapeOf,
1779
- aQ as keptForStyles,
2736
+ f3 as jsonShapeOf,
2737
+ an as keptForStyles,
1780
2738
  listFormats,
2739
+ listFromSource,
1781
2740
  listGraphs,
2741
+ listSources,
1782
2742
  loadFromFile,
2743
+ loadFromSource,
1783
2744
  loadFromUrl,
1784
- aa2 as mangleNmtoken,
2745
+ V2 as mangleNmtoken,
1785
2746
  neo4jExporter,
1786
2747
  neo4jImporter,
1787
- n2 as normalizeMimeType,
2748
+ n3 as normalizeMimeType,
1788
2749
  oboExporter,
1789
2750
  oboImporter,
1790
2751
  p as pairFolding,
@@ -1792,22 +2753,30 @@ export {
1792
2753
  pajekImporter,
1793
2754
  p2 as parseTextCell,
1794
2755
  parseWeightText,
2756
+ probeSource,
1795
2757
  rankFormats,
1796
- ab as readText,
1797
- ac2 as refusedSave,
2758
+ r3 as readText,
2759
+ recordingFrom,
2760
+ a12 as refusedSave,
2761
+ registerSource,
1798
2762
  registry,
2763
+ replayFetch,
1799
2764
  reportSinkOptions,
1800
2765
  reportUnusedOptions,
1801
2766
  r2 as resolveExportOptions,
1802
2767
  resolveImportOptions,
1803
- G2 as sanitizeIds,
2768
+ z2 as sanitizeIds,
2769
+ sha256Hex,
1804
2770
  sniff,
1805
- s2 as sniffFormat,
1806
- i3 as sniffJsonDialectHead,
2771
+ i5 as sniffFormat,
2772
+ s2 as sniffJsonDialect,
2773
+ k3 as sniffJsonDialectHead,
2774
+ s3 as storableCredential,
1807
2775
  t2 as textChunks,
1808
2776
  throwIfAborted,
1809
2777
  t3 as toReadableStream,
1810
2778
  t4 as tokenizeXml,
2779
+ validateSource,
1811
2780
  xgmmlExporter,
1812
2781
  xgmmlImporter,
1813
2782
  x2 as xmlIllegalTextNotes