@graphty/graph-io 0.3.49 → 0.3.50

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 (208) hide show
  1. package/dist/chunks/{approximations-Bzn3L-je.js → approximations-BRXsll0T.js} +2 -2
  2. package/dist/chunks/{approximations-Bzn3L-je.js.map → approximations-BRXsll0T.js.map} +1 -1
  3. package/dist/chunks/{block-iptrlMBb.js → block-yl0f_qLO.js} +27 -2
  4. package/dist/chunks/block-yl0f_qLO.js.map +1 -0
  5. package/dist/chunks/{context-C3p0RQxR.js → context-DizmppHy.js} +2 -2
  6. package/dist/chunks/{context-C3p0RQxR.js.map → context-DizmppHy.js.map} +1 -1
  7. package/dist/chunks/{credentials-DXHx7nwR.js → credentials-CmvJXYeH.js} +58 -9
  8. package/dist/chunks/credentials-CmvJXYeH.js.map +1 -0
  9. package/dist/chunks/{descriptor-DLA5kINx.js → descriptor-Dhez_Cew.js} +5 -1
  10. package/dist/chunks/{descriptor-DLA5kINx.js.map → descriptor-Dhez_Cew.js.map} +1 -1
  11. package/dist/chunks/{emit-BwHQkZle.js → emit-7Jkpg0yd.js} +132 -4
  12. package/dist/chunks/emit-7Jkpg0yd.js.map +1 -0
  13. package/dist/chunks/{exporter-nDfxIK5D.js → exporter-1Ajud15J.js} +4 -4
  14. package/dist/chunks/{exporter-nDfxIK5D.js.map → exporter-1Ajud15J.js.map} +1 -1
  15. package/dist/chunks/{exporter-D9yMtocA.js → exporter-B6yvL3wy.js} +3 -3
  16. package/dist/chunks/{exporter-D9yMtocA.js.map → exporter-B6yvL3wy.js.map} +1 -1
  17. package/dist/chunks/{exporter-_jrBTnos.js → exporter-CA5q8ROP.js} +4 -4
  18. package/dist/chunks/{exporter-_jrBTnos.js.map → exporter-CA5q8ROP.js.map} +1 -1
  19. package/dist/chunks/{exporter-D2CETOMK.js → exporter-CQQZFJ2v.js} +72 -10
  20. package/dist/chunks/exporter-CQQZFJ2v.js.map +1 -0
  21. package/dist/chunks/{generic-ymWCETAJ.js → generic-Dc21MAdg.js} +3 -3
  22. package/dist/chunks/{generic-ymWCETAJ.js.map → generic-Dc21MAdg.js.map} +1 -1
  23. package/dist/chunks/{importer-CT9mJ1nn.js → importer-C6NVpCXp.js} +7 -6
  24. package/dist/chunks/importer-C6NVpCXp.js.map +1 -0
  25. package/dist/chunks/{importer-GREKMdIf.js → importer-CKFe4q54.js} +4 -4
  26. package/dist/chunks/{importer-GREKMdIf.js.map → importer-CKFe4q54.js.map} +1 -1
  27. package/dist/chunks/{importer-PqaaKKnY.js → importer-CKbUbsJA.js} +4 -4
  28. package/dist/chunks/{importer-PqaaKKnY.js.map → importer-CKbUbsJA.js.map} +1 -1
  29. package/dist/chunks/{importer-DaLTjbds.js → importer-ClCsdgTJ.js} +97 -7
  30. package/dist/chunks/importer-ClCsdgTJ.js.map +1 -0
  31. package/dist/chunks/{importer-B92x1xY5.js → importer-CyVZTrf0.js} +3 -3
  32. package/dist/chunks/{importer-B92x1xY5.js.map → importer-CyVZTrf0.js.map} +1 -1
  33. package/dist/chunks/{importer-vRq4h3j5.js → importer-DgG4v1Ms.js} +89 -20
  34. package/dist/chunks/importer-DgG4v1Ms.js.map +1 -0
  35. package/dist/chunks/{importer-Vn5QvmmJ.js → importer-asFUrIsj.js} +2 -2
  36. package/dist/chunks/{importer-Vn5QvmmJ.js.map → importer-asFUrIsj.js.map} +1 -1
  37. package/dist/chunks/{lexicon-Clf4QIyl.js → lexicon-IVRq2Uoo.js} +2 -2
  38. package/dist/chunks/{lexicon-Clf4QIyl.js.map → lexicon-IVRq2Uoo.js.map} +1 -1
  39. package/dist/chunks/{round-trip-Zm3_ivgq.js → round-trip-Cy3_SHRZ.js} +2 -2
  40. package/dist/chunks/{round-trip-Zm3_ivgq.js.map → round-trip-Cy3_SHRZ.js.map} +1 -1
  41. package/dist/chunks/{sigv4-EokFic1V.js → sigv4-BXwVbza3.js} +3 -3
  42. package/dist/chunks/{sigv4-EokFic1V.js.map → sigv4-BXwVbza3.js.map} +1 -1
  43. package/dist/chunks/{styles-CCs214_3.js → styles-CAVmBLgp.js} +4 -4
  44. package/dist/chunks/{styles-CCs214_3.js.map → styles-CAVmBLgp.js.map} +1 -1
  45. package/dist/chunks/{styles-DPQQIig4.js → styles-CPczw1Jz.js} +4 -4
  46. package/dist/chunks/{styles-DPQQIig4.js.map → styles-CPczw1Jz.js.map} +1 -1
  47. package/dist/chunks/{styles-Cm62yyQX.js → styles-boK6Ln54.js} +65 -30
  48. package/dist/chunks/styles-boK6Ln54.js.map +1 -0
  49. package/dist/chunks/{styles-yed-UMFdNqze.js → styles-yed-XeFBQ6VS.js} +8 -8
  50. package/dist/chunks/{styles-yed-UMFdNqze.js.map → styles-yed-XeFBQ6VS.js.map} +1 -1
  51. package/dist/cx.js +2 -2
  52. package/dist/cx2.js +2 -2
  53. package/dist/cys.js +1 -1
  54. package/dist/dot.js +7 -4
  55. package/dist/gexf.js +2 -2
  56. package/dist/gml.js +8 -8
  57. package/dist/gml.js.map +1 -1
  58. package/dist/graph-io.js +129 -104
  59. package/dist/graph-io.js.map +1 -1
  60. package/dist/graphml.js +2 -2
  61. package/dist/json.js +1 -1
  62. package/dist/pajek.js +1 -1
  63. package/dist/sources-cypher.js +25 -22
  64. package/dist/sources-cypher.js.map +1 -1
  65. package/dist/sources-ndex.js +2 -2
  66. package/dist/sources-rest.js +20 -4
  67. package/dist/sources-rest.js.map +1 -1
  68. package/dist/sources-sparql.js +40 -6
  69. package/dist/sources-sparql.js.map +1 -1
  70. package/dist/src/formats/dot/exporter.d.ts.map +1 -1
  71. package/dist/src/formats/dot/exporter.js +34 -2
  72. package/dist/src/formats/dot/exporter.js.map +1 -1
  73. package/dist/src/formats/dot/importer.d.ts +6 -1
  74. package/dist/src/formats/dot/importer.d.ts.map +1 -1
  75. package/dist/src/formats/dot/importer.js +65 -5
  76. package/dist/src/formats/dot/importer.js.map +1 -1
  77. package/dist/src/formats/dot/index.d.ts +3 -1
  78. package/dist/src/formats/dot/index.d.ts.map +1 -1
  79. package/dist/src/formats/dot/index.js +2 -1
  80. package/dist/src/formats/dot/index.js.map +1 -1
  81. package/dist/src/formats/dot/label-places.d.ts +7 -0
  82. package/dist/src/formats/dot/label-places.d.ts.map +1 -1
  83. package/dist/src/formats/dot/label-places.js +9 -3
  84. package/dist/src/formats/dot/label-places.js.map +1 -1
  85. package/dist/src/formats/dot/names.d.ts +13 -0
  86. package/dist/src/formats/dot/names.d.ts.map +1 -1
  87. package/dist/src/formats/dot/names.js +13 -0
  88. package/dist/src/formats/dot/names.js.map +1 -1
  89. package/dist/src/formats/dot/styles.d.ts +10 -0
  90. package/dist/src/formats/dot/styles.d.ts.map +1 -1
  91. package/dist/src/formats/dot/styles.js +49 -3
  92. package/dist/src/formats/dot/styles.js.map +1 -1
  93. package/dist/src/formats/gml/styles.js +1 -1
  94. package/dist/src/formats/gml/styles.js.map +1 -1
  95. package/dist/src/formats/graphml/styles-yed.js +3 -3
  96. package/dist/src/formats/graphml/styles-yed.js.map +1 -1
  97. package/dist/src/formats/graphml/styles-yfiles3.d.ts.map +1 -1
  98. package/dist/src/formats/graphml/styles-yfiles3.js +6 -4
  99. package/dist/src/formats/graphml/styles-yfiles3.js.map +1 -1
  100. package/dist/src/formats/json/styles.d.ts.map +1 -1
  101. package/dist/src/formats/json/styles.js +94 -6
  102. package/dist/src/formats/json/styles.js.map +1 -1
  103. package/dist/src/formats/pajek/draw.d.ts +8 -0
  104. package/dist/src/formats/pajek/draw.d.ts.map +1 -1
  105. package/dist/src/formats/pajek/draw.js +10 -0
  106. package/dist/src/formats/pajek/draw.js.map +1 -1
  107. package/dist/src/formats/pajek/styles.d.ts.map +1 -1
  108. package/dist/src/formats/pajek/styles.js +142 -25
  109. package/dist/src/formats/pajek/styles.js.map +1 -1
  110. package/dist/src/index.d.ts +3 -3
  111. package/dist/src/index.d.ts.map +1 -1
  112. package/dist/src/index.js +2 -2
  113. package/dist/src/index.js.map +1 -1
  114. package/dist/src/sources/credentials.d.ts +50 -1
  115. package/dist/src/sources/credentials.d.ts.map +1 -1
  116. package/dist/src/sources/credentials.js +69 -0
  117. package/dist/src/sources/credentials.js.map +1 -1
  118. package/dist/src/sources/cypher/index.d.ts.map +1 -1
  119. package/dist/src/sources/cypher/index.js +12 -11
  120. package/dist/src/sources/cypher/index.js.map +1 -1
  121. package/dist/src/sources/cypher/query-builder.d.ts +6 -6
  122. package/dist/src/sources/cypher/query-builder.d.ts.map +1 -1
  123. package/dist/src/sources/cypher/query-builder.js +15 -15
  124. package/dist/src/sources/cypher/query-builder.js.map +1 -1
  125. package/dist/src/sources/rest/descriptor.d.ts.map +1 -1
  126. package/dist/src/sources/rest/descriptor.js +4 -0
  127. package/dist/src/sources/rest/descriptor.js.map +1 -1
  128. package/dist/src/sources/rest/openalex.d.ts +4 -2
  129. package/dist/src/sources/rest/openalex.d.ts.map +1 -1
  130. package/dist/src/sources/rest/openalex.js +4 -2
  131. package/dist/src/sources/rest/openalex.js.map +1 -1
  132. package/dist/src/sources/rest/source.d.ts.map +1 -1
  133. package/dist/src/sources/rest/source.js +23 -0
  134. package/dist/src/sources/rest/source.js.map +1 -1
  135. package/dist/src/sources/run.d.ts +2 -0
  136. package/dist/src/sources/run.d.ts.map +1 -1
  137. package/dist/src/sources/run.js +30 -3
  138. package/dist/src/sources/run.js.map +1 -1
  139. package/dist/src/sources/sparql/index.d.ts.map +1 -1
  140. package/dist/src/sources/sparql/index.js +14 -1
  141. package/dist/src/sources/sparql/index.js.map +1 -1
  142. package/dist/src/sources/sparql/query.d.ts +2 -1
  143. package/dist/src/sources/sparql/query.d.ts.map +1 -1
  144. package/dist/src/sources/sparql/query.js +55 -4
  145. package/dist/src/sources/sparql/query.js.map +1 -1
  146. package/dist/src/sources/types.d.ts +29 -0
  147. package/dist/src/sources/types.d.ts.map +1 -1
  148. package/dist/src/styles/canon/enums.d.ts.map +1 -1
  149. package/dist/src/styles/canon/enums.js +8 -0
  150. package/dist/src/styles/canon/enums.js.map +1 -1
  151. package/dist/src/styles/cyjs/cascade.d.ts.map +1 -1
  152. package/dist/src/styles/cyjs/cascade.js +124 -0
  153. package/dist/src/styles/cyjs/cascade.js.map +1 -1
  154. package/dist/src/styles/cyjs/defaults-table.d.ts.map +1 -1
  155. package/dist/src/styles/cyjs/defaults-table.js +1 -0
  156. package/dist/src/styles/cyjs/defaults-table.js.map +1 -1
  157. package/dist/src/styles/cyjs/emit.d.ts.map +1 -1
  158. package/dist/src/styles/cyjs/emit.js +30 -1
  159. package/dist/src/styles/cyjs/emit.js.map +1 -1
  160. package/dist/src/styles/cyjs/mappers.d.ts.map +1 -1
  161. package/dist/src/styles/cyjs/mappers.js +14 -0
  162. package/dist/src/styles/cyjs/mappers.js.map +1 -1
  163. package/dist/src/styles/types.d.ts +65 -0
  164. package/dist/src/styles/types.d.ts.map +1 -1
  165. package/dist/src/styles/vocabulary.d.ts.map +1 -1
  166. package/dist/src/styles/vocabulary.js +21 -0
  167. package/dist/src/styles/vocabulary.js.map +1 -1
  168. package/dist/styles.js +6 -6
  169. package/dist/xgmml.js +3 -3
  170. package/package.json +2 -2
  171. package/src/formats/dot/exporter.ts +37 -1
  172. package/src/formats/dot/importer.ts +75 -4
  173. package/src/formats/dot/index.ts +3 -1
  174. package/src/formats/dot/label-places.ts +16 -3
  175. package/src/formats/dot/names.ts +15 -0
  176. package/src/formats/dot/styles.ts +55 -3
  177. package/src/formats/gml/styles.ts +1 -1
  178. package/src/formats/graphml/styles-yed.ts +3 -3
  179. package/src/formats/graphml/styles-yfiles3.ts +6 -4
  180. package/src/formats/json/styles.ts +102 -6
  181. package/src/formats/pajek/draw.ts +11 -0
  182. package/src/formats/pajek/styles.ts +151 -26
  183. package/src/index.ts +7 -0
  184. package/src/sources/credentials.ts +90 -1
  185. package/src/sources/cypher/index.ts +12 -11
  186. package/src/sources/cypher/query-builder.ts +15 -15
  187. package/src/sources/rest/descriptor.ts +4 -0
  188. package/src/sources/rest/openalex.ts +4 -2
  189. package/src/sources/rest/source.ts +25 -0
  190. package/src/sources/run.ts +35 -3
  191. package/src/sources/sparql/index.ts +16 -1
  192. package/src/sources/sparql/query.ts +58 -4
  193. package/src/sources/types.ts +33 -0
  194. package/src/styles/canon/enums.ts +9 -0
  195. package/src/styles/cyjs/cascade.ts +143 -0
  196. package/src/styles/cyjs/defaults-table.ts +1 -0
  197. package/src/styles/cyjs/emit.ts +35 -1
  198. package/src/styles/cyjs/mappers.ts +14 -0
  199. package/src/styles/types.ts +65 -0
  200. package/src/styles/vocabulary.ts +21 -0
  201. package/dist/chunks/block-iptrlMBb.js.map +0 -1
  202. package/dist/chunks/credentials-DXHx7nwR.js.map +0 -1
  203. package/dist/chunks/emit-BwHQkZle.js.map +0 -1
  204. package/dist/chunks/exporter-D2CETOMK.js.map +0 -1
  205. package/dist/chunks/importer-CT9mJ1nn.js.map +0 -1
  206. package/dist/chunks/importer-DaLTjbds.js.map +0 -1
  207. package/dist/chunks/importer-vRq4h3j5.js.map +0 -1
  208. package/dist/chunks/styles-Cm62yyQX.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"credentials-DXHx7nwR.js","sources":["../../src/sources/ids.ts","../../src/sources/fail.ts","../../src/sources/define.ts","../../src/sources/credentials.ts"],"sourcesContent":["/**\n * The public names of network sources: one constant per built-in source id, and the reserved\n * `_source.` attribute names. Nothing else in graph-io spells them, so a rename is one edit here.\n *\n * Experimental: the ids and the `_source.` namespace await the owner's final word (design\n * section 22, items 4 and 5).\n */\n\n/**\n * The NDEx source (www.ndexbio.org). Experimental.\n * @category Network sources\n */\nexport const NDEX_SOURCE_ID = \"ndex\";\n\n/**\n * The generic Cypher source, for any openCypher server. Experimental.\n * @category Network sources\n */\nexport const CYPHER_SOURCE_ID = \"cypher\";\n\n/**\n * The Neo4j preset of the Cypher source. Experimental.\n * @category Network sources\n */\nexport const NEO4J_SOURCE_ID = \"neo4j\";\n\n/**\n * The Amazon Neptune preset of the Cypher source. Experimental.\n * @category Network sources\n */\nexport const NEPTUNE_SOURCE_ID = \"neptune\";\n\n/**\n * The generic REST mapping source. Experimental.\n * @category Network sources\n */\nexport const REST_SOURCE_ID = \"rest\";\n\n/**\n * The OpenAlex preset of the REST mapping source. Experimental.\n * @category Network sources\n */\nexport const OPENALEX_SOURCE_ID = \"openalex\";\n\n/**\n * The SPARQL source, for any SPARQL 1.1 endpoint. Experimental.\n * @category Network sources\n */\nexport const SPARQL_SOURCE_ID = \"sparql\";\n\n/**\n * The prefix of the reserved attribute namespace sources and graphty-element write facts under.\n * @category Network sources\n */\nexport const SOURCE_ATTR_PREFIX = \"_source.\";\n\n/**\n * Node attribute: true on a stub, a node known only by its id until it is hydrated or expanded.\n * @category Network sources\n */\nexport const SOURCE_STUB_ATTR = \"_source.stub\";\n\n/**\n * Node attribute: the entity a stub node is (a REST mapping's entity name).\n * @category Network sources\n */\nexport const SOURCE_ENTITY_ATTR = \"_source.entity\";\n\n/**\n * Node attribute: the node's degree at the source, when the source returns it at no extra cost\n * (the Cypher source's degree hint).\n * @category Network sources\n */\nexport const SOURCE_DEGREE_ATTR = \"_source.degree\";\n\n/**\n * The prefix of `ImportGraphResult.format` for a load from a source: `\"source:<id>\"`.\n * @category Network sources\n */\nexport const SOURCE_FORMAT_PREFIX = \"source:\";\n","/**\n * Raising a network source issue: one place that turns a code and its params into an ImportError\n * whose `issue.params` and `details` both carry the params, so callers branch on\n * `err.issue.code` and read `err.issue.params` as with every other graph-io failure.\n */\n\nimport { ImportReportBuilder } from \"../common/report.js\";\nimport { type IssueCategory } from \"../types.js\";\nimport { type SourceIssueCode } from \"./codes.js\";\n\n/** The category each code is filed under. */\nconst CATEGORY: Readonly<Partial<Record<SourceIssueCode, IssueCategory>>> = {\n E_SOURCE_PARAM: \"validation-error\",\n E_SOURCE_INVALID: \"validation-error\",\n E_SOURCE_RESPONSE: \"parse-error\",\n E_SOURCE_NOT_A_GRAPH: \"parse-error\",\n E_SOURCE_NOT_FOUND: \"missing-value\",\n E_SOURCE_UNKNOWN: \"missing-value\",\n};\n\n/**\n * Abort a load with a source error, carrying the load's report so far plus the error.\n * @param report - the load's report\n * @param code - the code\n * @param message - a plain-ASCII message, for logs\n * @param params - the issue's values\n * @returns never; it throws the ImportError\n */\nexport function failOn(\n report: ImportReportBuilder,\n code: SourceIssueCode,\n message: string,\n params: Readonly<Record<string, unknown>>,\n): never {\n // a fork, so a failure the runner turns into a warning (a later page's 401, a cap) leaves no\n // error in the load's own report; the ImportError carries everything recorded so far\n return report.fork().failWith(CATEGORY[code] ?? \"unsupported\", code, message, undefined, params, params);\n}\n\n/**\n * Raise a source error outside a load (registration, a credential factory).\n * @param code - the code\n * @param message - a plain-ASCII message, for logs\n * @param params - the issue's values\n * @param format - the report's format name\n */\nexport function failAlone(\n code: SourceIssueCode,\n message: string,\n params: Readonly<Record<string, unknown>>,\n format = \"source\",\n): never {\n failOn(new ImportReportBuilder(format, 0), code, message, params);\n}\n\n/**\n * Record a source warning on a report.\n * @param report - the report\n * @param code - the code\n * @param message - a plain-ASCII message, for logs\n * @param params - the issue's values\n */\nexport function warnOn(\n report: ImportReportBuilder,\n code: SourceIssueCode,\n message: string,\n params: Readonly<Record<string, unknown>>,\n): void {\n report.warning(\"unsupported\", code, message, undefined, params);\n}\n","/**\n * `defineSource` and the registration checks (design section 2): the id form, exactly one read\n * method, and the declared features against the methods present. Also the parameter checks every\n * load runs against the descriptor before any request.\n */\n\nimport { type ImportReportBuilder } from \"../common/report.js\";\nimport { failAlone, failOn } from \"./fail.js\";\nimport {\n type GraphSource,\n type LazySource,\n type SourceDescriptor,\n type SourceFeature,\n type SourceParamDescriptor,\n} from \"./types.js\";\n\n/** Lowercase letters, digits and single dashes between them. */\nconst ID_FORM = /^[a-z0-9]+(-[a-z0-9]+)*$/;\n\n/** The optional methods and the feature each one is. */\nconst FEATURE_METHODS: readonly (readonly [SourceFeature, \"expand\" | \"probe\" | \"list\" | \"validate\"])[] = [\n [\"expand\", \"expand\"],\n [\"probe\", \"probe\"],\n [\"list\", \"list\"],\n [\"validate\", \"validate\"],\n];\n\n/**\n * Refuse a malformed source.\n * @param id - the source id\n * @param reason - why\n * @param message - for logs\n */\nfunction invalid(id: string, reason: string, message: string): never {\n failAlone(\"E_SOURCE_INVALID\", message, { id, reason });\n}\n\n/**\n * Check a source id.\n * @param id - the id\n */\nfunction checkSourceId(id: unknown): asserts id is string {\n if (typeof id !== \"string\" || !ID_FORM.test(id)) {\n invalid(String(id), \"id\", `source id ${JSON.stringify(id)} must be lowercase letters, digits and dashes`);\n }\n}\n\n/**\n * The features a loaded source has, from its methods.\n * @param source - the source\n * @returns the features\n */\nfunction featuresOf(source: GraphSource<never>): readonly SourceFeature[] {\n return FEATURE_METHODS.filter(([, method]) => typeof source[method] === \"function\").map(([f]) => f);\n}\n\n/**\n * Check a loaded source: its id, exactly one read method, and its declared features.\n * @param source - the source\n * @param declared - features a lazy registration declared, if any\n */\nexport function checkSource(source: GraphSource<never>, declared?: SourceDescriptor): void {\n checkSourceId((source as { id?: unknown }).id);\n const reads = ([\"records\", \"file\", \"import\"] as const).filter((m) => typeof source[m] === \"function\");\n if (reads.length !== 1) {\n invalid(source.id, \"read-methods\", `source ${source.id} must have exactly one of records, file and import`);\n }\n const features = (declared ?? source.descriptor)?.features;\n if (features !== undefined) {\n const has = new Set(featuresOf(source));\n for (const f of features) {\n if (f !== \"page\" && !has.has(f)) {\n invalid(source.id, \"features\", `source ${source.id} declares ${f} but has no ${f} method`);\n }\n }\n }\n}\n\n/**\n * Check a lazy registration before its code is loaded.\n * @param source - the lazy source\n */\nexport function checkLazySource(source: LazySource): void {\n checkSourceId(source.id);\n if (typeof source.load !== \"function\" || typeof source.descriptor !== \"object\") {\n invalid(source.id, \"lazy\", `lazy source ${source.id} needs a descriptor and a load function`);\n }\n}\n\n/**\n * Define a network source: returns it unchanged, with its parameter type inferred, after the\n * registration checks (an id of lowercase letters, digits and dashes; exactly one of `records`,\n * `file` and `import`; declared features backed by methods). A malformed source throws an\n * ImportError whose `issue.code` is E_SOURCE_INVALID. Experimental.\n * @param source - the source\n * @returns the same source\n * @example\n * ```ts\n * const people = defineSource({\n * id: \"people\",\n * async records(params: { team: string }, ctx) {\n * const rows = await ctx.fetchJson<{ id: string; name: string }[]>(`/api/people?team=${params.team}`);\n * return { nodes: rows };\n * },\n * });\n * ```\n * @category Network sources\n */\nexport function defineSource<P>(source: GraphSource<P>): GraphSource<P> {\n checkSource(source);\n return source;\n}\n\n/**\n * Why a number or integer param is wrong, if it is.\n * @param p - the param's descriptor\n * @param value - the value given\n * @returns the reason, or null when it is fine\n */\nfunction numberProblem(p: SourceParamDescriptor, value: unknown): string | null {\n if (typeof value !== \"number\" || Number.isNaN(value) || (p.type === \"integer\" && !Number.isInteger(value))) {\n return \"type\";\n }\n if ((p.min !== undefined && value < p.min) || (p.max !== undefined && value > p.max)) {\n return \"range\";\n }\n return null;\n}\n\n/**\n * Why a URL param is wrong, if it is.\n * @param value - the value given\n * @returns the reason, or null when it is fine\n */\nfunction urlProblem(value: unknown): string | null {\n let url: URL;\n try {\n url = new URL(typeof value === \"string\" ? value : \"\");\n } catch {\n return \"type\";\n }\n return url.username !== \"\" || url.password !== \"\" ? \"credentials-in-url\" : null;\n}\n\n/**\n * Why a present param value is wrong for its descriptor, if it is.\n * @param p - the param's descriptor\n * @param value - the value given (not undefined or null)\n * @returns the reason, or null when it is fine\n */\nfunction paramProblem(p: SourceParamDescriptor, value: unknown): string | null {\n switch (p.type) {\n case \"integer\":\n case \"number\":\n return numberProblem(p, value);\n case \"boolean\":\n return typeof value === \"boolean\" ? null : \"type\";\n case \"enum\":\n return p.values !== undefined && !p.values.some((v) => v.value === value) ? \"enum\" : null;\n case \"url\":\n return urlProblem(value);\n default:\n return null;\n }\n}\n\n/**\n * Check params against a descriptor before any request: required ones present, numbers and\n * integers in range, booleans, enums, URLs (never with a user name or password in them).\n * @param params - the caller's params\n * @param descriptor - the source's descriptor\n * @param report - the load's report\n */\nexport function checkParams(\n params: Readonly<Record<string, unknown>>,\n descriptor: SourceDescriptor | undefined,\n report: ImportReportBuilder,\n): void {\n if (typeof params !== \"object\" || (params as unknown) === null) {\n failOn(report, \"E_SOURCE_PARAM\", \"params must be an object\", { name: \"params\", reason: \"type\" });\n }\n for (const p of descriptor?.params ?? []) {\n const value = params[p.name];\n const missing = value === undefined || value === null;\n let reason: string | null = null;\n if (!missing) {\n reason = paramProblem(p, value);\n } else if (p.required === true && p.default === undefined) {\n reason = \"required\";\n }\n if (reason !== null) {\n failOn(report, \"E_SOURCE_PARAM\", `parameter ${p.name}: ${reason}`, { name: p.name, reason });\n }\n }\n}\n","/**\n * Credentials (design section 6): objects made by factories, holding their secret where no code\n * can read it back. graph-io applies a credential inside `ctx.fetch`, only to the origins it is\n * bound to, and keeps nothing after a load settles.\n *\n * Experimental, with the source contract.\n */\n\nimport { failAlone } from \"./fail.js\";\nimport { type AwsCredentials, type Credential, type CredentialKind } from \"./types.js\";\n\n/**\n * Where a credential may go: the load's endpoint origin by default. Experimental.\n * @category Network sources\n */\nexport interface CredentialBind {\n /** The origins (scheme, host and port) it may be sent to. */\n readonly origins?: readonly string[] | undefined;\n}\n\n/**\n * The options of `credentials.awsSigV4`. Experimental.\n * @category Network sources\n */\nexport interface AwsSigV4Options {\n /** The AWS region (\"us-east-1\"). */\n readonly region: string;\n /** The signing service: \"neptune-db\" (default) or \"neptune-graph\" for Neptune Analytics. */\n readonly service?: string | undefined;\n /** The credentials, or a function returning fresh ones per request. */\n readonly credentials: AwsCredentials | (() => Promise<AwsCredentials>);\n}\n\n/** What only graph-io's own code can read about a credential. */\ntype Secret =\n | { readonly kind: \"bearer\"; readonly token: string | (() => Promise<string>) }\n | { readonly kind: \"basic\"; readonly username: string; readonly password: string }\n | {\n readonly kind: \"api-key\";\n readonly header: string | null;\n readonly query: string | null;\n readonly value: string;\n }\n | { readonly kind: \"aws-sigv4\"; readonly options: AwsSigV4Options }\n | {\n readonly kind: \"custom\";\n readonly name: string;\n readonly apply: (request: Request) => Promise<Request> | Request;\n };\n\n/** The secrets, by credential; a WeakMap so nothing reachable from the object holds them. */\nconst SECRETS = new WeakMap<Credential, Secret>();\n\n/** The key Node's util.inspect looks up. */\nconst INSPECT = Symbol.for(\"nodejs.util.inspect.custom\");\n\n/**\n * The scheme, host and port of a URL. `URL.origin` is \"null\" for schemes such as bolt+s:, so this\n * is used everywhere instead.\n * @param url - the URL\n * @returns the origin string\n */\nexport function originOf(url: URL): string {\n return `${url.protocol}//${url.host}`;\n}\n\n/**\n * Normalize the origins a credential is bound to.\n * @param bind - the bind option\n * @returns the normalized origins\n */\nfunction bindOrigins(bind: CredentialBind | undefined): readonly string[] {\n return Object.freeze(\n (bind?.origins ?? []).map((o) => {\n let url: URL;\n try {\n url = new URL(o);\n } catch {\n return failAlone(\"E_SOURCE_PARAM\", `credential origin ${JSON.stringify(o)} is not a URL`, {\n name: \"origins\",\n reason: \"origin\",\n });\n }\n return originOf(url);\n }),\n );\n}\n\n/** The object every factory returns: kind and origins visible, the secret in SECRETS. */\nclass SourceCredential implements Credential {\n readonly kind: CredentialKind;\n readonly origins: readonly string[];\n readonly username: string | undefined;\n\n /**\n * Create one; only the factories do.\n * @param secret - the secret\n * @param bind - the origins it is bound to\n */\n constructor(secret: Secret, bind: CredentialBind | undefined) {\n this.kind = secret.kind === \"custom\" ? secret.name : secret.kind;\n this.origins = bindOrigins(bind);\n this.username = secret.kind === \"basic\" ? secret.username : undefined;\n SECRETS.set(this, secret);\n Object.freeze(this);\n }\n\n /**\n * What JSON.stringify writes: never the secret.\n * @returns kind, origins and a basic credential's user name\n */\n toJSON(): Record<string, unknown> {\n return this.username === undefined\n ? { kind: this.kind, origins: this.origins }\n : { kind: this.kind, origins: this.origins, username: this.username };\n }\n\n /**\n * What util.inspect and console.log show in Node: never the secret.\n * @returns the same as toJSON\n */\n [INSPECT](): Record<string, unknown> {\n return this.toJSON();\n }\n\n /**\n * What string conversion shows: never the secret.\n * @returns a description\n */\n toString(): string {\n return `[Credential ${this.kind}]`;\n }\n}\n\n/**\n * Base64 of a string's UTF-8 bytes.\n * @param text - the text\n * @returns base64\n */\nfunction base64(text: string): string {\n let binary = \"\";\n for (const b of new TextEncoder().encode(text)) {\n binary += String.fromCodePoint(b);\n }\n return btoa(binary);\n}\n\n/**\n * The factories that make credentials. Pass the result as the `credential` option of a load; it is\n * sent only to the load's endpoint origin, or to `bind.origins` when you give them. Experimental.\n * @example\n * ```ts\n * await loadFromSource(\"people\", { team: \"core\" }, {\n * endpoint: \"https://example.com\",\n * credential: credentials.bearer(token),\n * });\n * ```\n * @category Network sources\n */\nexport const credentials = Object.freeze({\n /**\n * An `Authorization: Bearer` token, or a function returning a fresh one per request.\n * @param token - the token or a function returning it\n * @param bind - the origins it may be sent to\n * @returns the credential\n */\n bearer(token: string | (() => Promise<string>), bind?: CredentialBind): Credential {\n return new SourceCredential({ kind: \"bearer\", token }, bind);\n },\n /**\n * HTTP basic authentication (a database user and password).\n * @param username - the user name\n * @param password - the password\n * @param bind - the origins it may be sent to\n * @returns the credential\n */\n basic(username: string, password: string, bind?: CredentialBind): Credential {\n return new SourceCredential({ kind: \"basic\", username, password }, bind);\n },\n /**\n * An API key sent in a request header or a query parameter.\n * @param where - `{ header: \"X-Api-Key\" }` or `{ query: \"api_key\" }`\n * @param value - the key\n * @param bind - the origins it may be sent to\n * @returns the credential\n */\n apiKey(\n where: { readonly header: string } | { readonly query: string },\n value: string,\n bind?: CredentialBind,\n ): Credential {\n const header = \"header\" in where ? where.header : null;\n const query = \"query\" in where ? where.query : null;\n return new SourceCredential({ kind: \"api-key\", header, query, value }, bind);\n },\n /**\n * AWS Signature Version 4 (Amazon Neptune). The signer loads on first use.\n * @param options - region, service and the credentials or a provider of them\n * @param bind - the origins it may be sent to\n * @returns the credential\n */\n awsSigV4(options: AwsSigV4Options, bind?: CredentialBind): Credential {\n return new SourceCredential({ kind: \"aws-sigv4\", options }, bind);\n },\n /**\n * Anything else: a function that returns the request with its authentication added. The\n * request's origin must not change.\n * @param apply - adds the authentication\n * @param kind - what to call it in `credential.kind`\n * @param bind - the origins it may be sent to\n * @returns the credential\n */\n custom(apply: (request: Request) => Promise<Request> | Request, kind: string, bind?: CredentialBind): Credential {\n return new SourceCredential({ kind: \"custom\", name: kind, apply }, bind);\n },\n});\n\n/**\n * The secret of a credential made by the factories, or undefined for any other object.\n * @param credential - the credential\n * @returns the secret\n */\nfunction secretOf(credential: Credential): Secret | undefined {\n return SECRETS.get(credential);\n}\n\n/**\n * Whether an object is a credential made by the `credentials` factories.\n * @param value - the value\n * @returns true for a factory-made credential\n */\nexport function isCredential(value: unknown): value is Credential {\n return typeof value === \"object\" && value !== null && secretOf(value as Credential) !== undefined;\n}\n\n/**\n * The request header a credential sets, for the browser checks; null for a query key or a custom one.\n * @param credential - the credential\n * @returns the header name, lowercase\n */\nexport function credentialHeader(credential: Credential): string | null {\n const secret = secretOf(credential);\n if (secret?.kind === \"api-key\") {\n return secret.header?.toLowerCase() ?? null;\n }\n return secret?.kind === \"bearer\" || secret?.kind === \"basic\" || secret?.kind === \"aws-sigv4\"\n ? \"authorization\"\n : null;\n}\n\n/**\n * Add a credential to a request. Internal to graph-io: only `ctx.fetch` calls it.\n * @param credential - the credential\n * @param request - the request\n * @returns the request with its authentication\n */\nexport async function applyCredential(credential: Credential, request: Request): Promise<Request> {\n const secret = secretOf(credential);\n if (secret === undefined) {\n return failAlone(\"E_SOURCE_PARAM\", \"the credential was not made by the credentials factories\", {\n name: \"credential\",\n reason: \"type\",\n });\n }\n switch (secret.kind) {\n case \"bearer\": {\n const token = typeof secret.token === \"string\" ? secret.token : await secret.token();\n const headers = new Headers(request.headers);\n headers.set(\"Authorization\", `Bearer ${token}`);\n return new Request(request, { headers });\n }\n case \"basic\": {\n const headers = new Headers(request.headers);\n const pair = `${secret.username}:${secret.password}`;\n headers.set(\"Authorization\", `Basic ${base64(pair)}`);\n return new Request(request, { headers });\n }\n case \"api-key\": {\n if (secret.header !== null) {\n const headers = new Headers(request.headers);\n headers.set(secret.header, secret.value);\n return new Request(request, { headers });\n }\n const url = new URL(request.url);\n url.searchParams.set(secret.query ?? \"api_key\", secret.value);\n return new Request(url, request);\n }\n case \"aws-sigv4\": {\n const { signRequest } = await import(\"./sigv4.js\");\n return signRequest(request, secret.options);\n }\n case \"custom\":\n return secret.apply(request);\n default:\n return request;\n }\n}\n\n/**\n * The raw secret, for a transport that must hand it to a driver (Bolt). Internal to graph-io; the\n * caller applies the origin and TLS rules itself.\n * @param credential - the credential\n * @returns the kind and the values the driver needs\n */\nexport function unwrapCredential(\n credential: Credential,\n):\n | { readonly kind: \"basic\"; readonly username: string; readonly password: string }\n | { readonly kind: \"bearer\"; readonly token: string | (() => Promise<string>) }\n | { readonly kind: CredentialKind }\n | undefined {\n const secret = secretOf(credential);\n if (secret?.kind === \"basic\") {\n return { kind: \"basic\", username: secret.username, password: secret.password };\n }\n if (secret?.kind === \"bearer\") {\n return { kind: \"bearer\", token: secret.token };\n }\n return secret === undefined ? undefined : { kind: credential.kind };\n}\n\n/**\n * Whether a credential can be remembered: its secret is a plain value, not a function. A token\n * refresher, a custom credential and an AWS provider cannot.\n * @param credential - the credential\n * @returns true for basic, a bearer string token and an API key\n */\nexport function isStorableCredential(credential: Credential): boolean {\n const secret = secretOf(credential);\n return (\n secret?.kind === \"basic\" ||\n secret?.kind === \"api-key\" ||\n (secret?.kind === \"bearer\" && typeof secret.token === \"string\")\n );\n}\n\n/**\n * The plain parts of a credential that can be remembered. Experimental.\n * @category Network sources\n */\nexport type StorableCredential =\n | {\n /** A user name and password, sent as HTTP Basic authentication. */\n readonly kind: \"basic\";\n /** The user name. */\n readonly username: string;\n /** The password. */\n readonly password: string;\n }\n | {\n /** A bearer token, sent in the Authorization header. */\n readonly kind: \"bearer\";\n /** The token. */\n readonly token: string;\n }\n | {\n /** An API key, sent in a header or a query parameter. */\n readonly kind: \"api-key\";\n /** The header that carries the key, or null when a query parameter does. */\n readonly header: string | null;\n /** The query parameter that carries the key, or null when a header does. */\n readonly query: string | null;\n /** The key. */\n readonly value: string;\n };\n\n/**\n * The parts of a credential a credential store saves (graphty-element's `CredentialStore` is the\n * one caller), or null when it cannot be saved: a token function, an AWS provider or a custom\n * credential. The result HOLDS THE SECRET: never log it, and keep it only where you would keep the\n * password itself. `fromStorableCredential` makes the credential again. Experimental.\n * @param credential - a credential made by the `credentials` factories\n * @returns the parts, or null\n * @category Network sources\n */\nexport function storableCredential(credential: Credential): StorableCredential | null {\n const secret = secretOf(credential);\n switch (secret?.kind) {\n case \"basic\":\n return { kind: \"basic\", username: secret.username, password: secret.password };\n case \"api-key\":\n return { kind: \"api-key\", header: secret.header, query: secret.query, value: secret.value };\n case \"bearer\":\n return typeof secret.token === \"string\" ? { kind: \"bearer\", token: secret.token } : null;\n default:\n return null;\n }\n}\n\n/**\n * The credential `storableCredential` took apart, bound to the origins given. Experimental.\n * @param parts - what `storableCredential` returned\n * @param bind - the origins it may be sent to\n * @returns the credential\n * @category Network sources\n */\nexport function fromStorableCredential(parts: StorableCredential, bind?: CredentialBind): Credential {\n switch (parts.kind) {\n case \"basic\":\n return credentials.basic(parts.username, parts.password, bind);\n case \"bearer\":\n return credentials.bearer(parts.token, bind);\n default:\n return new SourceCredential(\n { kind: \"api-key\", header: parts.header, query: parts.query, value: parts.value },\n bind,\n );\n }\n}\n"],"names":[],"mappings":";AAYO,MAAM,iBAAiB;AAMvB,MAAM,mBAAmB;AAMzB,MAAM,kBAAkB;AAMxB,MAAM,oBAAoB;AAM1B,MAAM,iBAAiB;AAMvB,MAAM,qBAAqB;AAM3B,MAAM,mBAAmB;AAMzB,MAAM,qBAAqB;AAM3B,MAAM,mBAAmB;AAMzB,MAAM,qBAAqB;AAO3B,MAAM,qBAAqB;AAM3B,MAAM,uBAAuB;ACpEpC,MAAM,WAAsE;AAAA,EACxE,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,sBAAsB;AAAA,EACtB,oBAAoB;AAAA,EACpB,kBAAkB;AACtB;AAU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