@uncefact/untp-utils 0.1.0 → 0.3.0

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 (389) hide show
  1. package/README.md +52 -2
  2. package/artefacts/context/untp/0.6.0/dcc.json +1241 -0
  3. package/artefacts/context/untp/0.6.0/dfr.json +619 -0
  4. package/artefacts/context/untp/0.6.0/dia.json +162 -0
  5. package/artefacts/context/untp/0.6.0/dpp.json +1078 -0
  6. package/artefacts/context/untp/0.6.0/dte.json +1285 -0
  7. package/artefacts/context/untp/0.6.1/dcc.json +1388 -0
  8. package/artefacts/context/untp/0.6.1/dfr.json +690 -0
  9. package/artefacts/context/untp/0.6.1/dia.json +196 -0
  10. package/artefacts/context/untp/0.6.1/dpp.json +1164 -0
  11. package/artefacts/context/untp/0.6.1/dte.json +1340 -0
  12. package/artefacts/context/untp/0.7.0/untp.json +3493 -0
  13. package/artefacts/context/vcdm/2/credentials.json +301 -0
  14. package/artefacts/manifest.json +214 -0
  15. package/artefacts/schema/untp/0.6.0/dcc.json +1131 -0
  16. package/artefacts/schema/untp/0.6.0/dfr.json +1028 -0
  17. package/artefacts/schema/untp/0.6.0/dia.json +236 -0
  18. package/artefacts/schema/untp/0.6.0/dpp.json +1219 -0
  19. package/artefacts/schema/untp/0.6.0/dte.json +845 -0
  20. package/artefacts/schema/untp/0.6.1/dcc.json +1196 -0
  21. package/artefacts/schema/untp/0.6.1/dfr.json +1037 -0
  22. package/artefacts/schema/untp/0.6.1/dia.json +236 -0
  23. package/artefacts/schema/untp/0.6.1/dpp.json +1229 -0
  24. package/artefacts/schema/untp/0.6.1/dte.json +845 -0
  25. package/artefacts/schema/untp/0.7.0/cvc.json +701 -0
  26. package/artefacts/schema/untp/0.7.0/dcc.json +1133 -0
  27. package/artefacts/schema/untp/0.7.0/dfr.json +1245 -0
  28. package/artefacts/schema/untp/0.7.0/dia.json +443 -0
  29. package/artefacts/schema/untp/0.7.0/dpp.json +1300 -0
  30. package/artefacts/schema/untp/0.7.0/dte.json +1226 -0
  31. package/artefacts/schema/untp/0.7.0/linkset.json +119 -0
  32. package/artefacts/schema/vcdm/2/verifiable-credential.json +318 -0
  33. package/build/artefacts/detect-version-from-context.d.ts +46 -0
  34. package/build/artefacts/detect-version-from-context.js +77 -0
  35. package/build/artefacts/detect-version-from-context.js.map +1 -0
  36. package/build/artefacts/detect-version-from-context.test.d.ts +1 -0
  37. package/build/artefacts/detect-version-from-context.test.js +69 -0
  38. package/build/artefacts/detect-version-from-context.test.js.map +1 -0
  39. package/build/artefacts/index.d.ts +3 -0
  40. package/build/artefacts/index.js +4 -0
  41. package/build/artefacts/index.js.map +1 -0
  42. package/build/artefacts/urls.d.ts +85 -0
  43. package/build/artefacts/urls.js +141 -0
  44. package/build/artefacts/urls.js.map +1 -0
  45. package/build/artefacts/urls.test.d.ts +1 -0
  46. package/build/artefacts/urls.test.js +99 -0
  47. package/build/artefacts/urls.test.js.map +1 -0
  48. package/build/artefacts/version.d.ts +9 -0
  49. package/build/artefacts/version.js +17 -0
  50. package/build/artefacts/version.js.map +1 -0
  51. package/build/artefacts/version.test.d.ts +1 -0
  52. package/build/artefacts/version.test.js +16 -0
  53. package/build/artefacts/version.test.js.map +1 -0
  54. package/build/bundle/artefacts/context/untp/0.6.0/dcc.d.ts +2 -0
  55. package/build/bundle/artefacts/context/untp/0.6.0/dcc.js +1244 -0
  56. package/build/bundle/artefacts/context/untp/0.6.0/dcc.js.map +1 -0
  57. package/build/bundle/artefacts/context/untp/0.6.0/dfr.d.ts +2 -0
  58. package/build/bundle/artefacts/context/untp/0.6.0/dfr.js +622 -0
  59. package/build/bundle/artefacts/context/untp/0.6.0/dfr.js.map +1 -0
  60. package/build/bundle/artefacts/context/untp/0.6.0/dia.d.ts +2 -0
  61. package/build/bundle/artefacts/context/untp/0.6.0/dia.js +165 -0
  62. package/build/bundle/artefacts/context/untp/0.6.0/dia.js.map +1 -0
  63. package/build/bundle/artefacts/context/untp/0.6.0/dpp.d.ts +2 -0
  64. package/build/bundle/artefacts/context/untp/0.6.0/dpp.js +1081 -0
  65. package/build/bundle/artefacts/context/untp/0.6.0/dpp.js.map +1 -0
  66. package/build/bundle/artefacts/context/untp/0.6.0/dte.d.ts +2 -0
  67. package/build/bundle/artefacts/context/untp/0.6.0/dte.js +1288 -0
  68. package/build/bundle/artefacts/context/untp/0.6.0/dte.js.map +1 -0
  69. package/build/bundle/artefacts/context/untp/0.6.1/dcc.d.ts +2 -0
  70. package/build/bundle/artefacts/context/untp/0.6.1/dcc.js +1391 -0
  71. package/build/bundle/artefacts/context/untp/0.6.1/dcc.js.map +1 -0
  72. package/build/bundle/artefacts/context/untp/0.6.1/dfr.d.ts +2 -0
  73. package/build/bundle/artefacts/context/untp/0.6.1/dfr.js +693 -0
  74. package/build/bundle/artefacts/context/untp/0.6.1/dfr.js.map +1 -0
  75. package/build/bundle/artefacts/context/untp/0.6.1/dia.d.ts +2 -0
  76. package/build/bundle/artefacts/context/untp/0.6.1/dia.js +199 -0
  77. package/build/bundle/artefacts/context/untp/0.6.1/dia.js.map +1 -0
  78. package/build/bundle/artefacts/context/untp/0.6.1/dpp.d.ts +2 -0
  79. package/build/bundle/artefacts/context/untp/0.6.1/dpp.js +1167 -0
  80. package/build/bundle/artefacts/context/untp/0.6.1/dpp.js.map +1 -0
  81. package/build/bundle/artefacts/context/untp/0.6.1/dte.d.ts +2 -0
  82. package/build/bundle/artefacts/context/untp/0.6.1/dte.js +1343 -0
  83. package/build/bundle/artefacts/context/untp/0.6.1/dte.js.map +1 -0
  84. package/build/bundle/artefacts/context/untp/0.7.0/untp.d.ts +2 -0
  85. package/build/bundle/artefacts/context/untp/0.7.0/untp.js +3496 -0
  86. package/build/bundle/artefacts/context/untp/0.7.0/untp.js.map +1 -0
  87. package/build/bundle/artefacts/context/vcdm/2/credentials.d.ts +2 -0
  88. package/build/bundle/artefacts/context/vcdm/2/credentials.js +304 -0
  89. package/build/bundle/artefacts/context/vcdm/2/credentials.js.map +1 -0
  90. package/build/bundle/artefacts/schema/untp/0.6.0/dcc.d.ts +2 -0
  91. package/build/bundle/artefacts/schema/untp/0.6.0/dcc.js +1134 -0
  92. package/build/bundle/artefacts/schema/untp/0.6.0/dcc.js.map +1 -0
  93. package/build/bundle/artefacts/schema/untp/0.6.0/dfr.d.ts +2 -0
  94. package/build/bundle/artefacts/schema/untp/0.6.0/dfr.js +1031 -0
  95. package/build/bundle/artefacts/schema/untp/0.6.0/dfr.js.map +1 -0
  96. package/build/bundle/artefacts/schema/untp/0.6.0/dia.d.ts +2 -0
  97. package/build/bundle/artefacts/schema/untp/0.6.0/dia.js +239 -0
  98. package/build/bundle/artefacts/schema/untp/0.6.0/dia.js.map +1 -0
  99. package/build/bundle/artefacts/schema/untp/0.6.0/dpp.d.ts +2 -0
  100. package/build/bundle/artefacts/schema/untp/0.6.0/dpp.js +1222 -0
  101. package/build/bundle/artefacts/schema/untp/0.6.0/dpp.js.map +1 -0
  102. package/build/bundle/artefacts/schema/untp/0.6.0/dte.d.ts +2 -0
  103. package/build/bundle/artefacts/schema/untp/0.6.0/dte.js +848 -0
  104. package/build/bundle/artefacts/schema/untp/0.6.0/dte.js.map +1 -0
  105. package/build/bundle/artefacts/schema/untp/0.6.1/dcc.d.ts +2 -0
  106. package/build/bundle/artefacts/schema/untp/0.6.1/dcc.js +1199 -0
  107. package/build/bundle/artefacts/schema/untp/0.6.1/dcc.js.map +1 -0
  108. package/build/bundle/artefacts/schema/untp/0.6.1/dfr.d.ts +2 -0
  109. package/build/bundle/artefacts/schema/untp/0.6.1/dfr.js +1040 -0
  110. package/build/bundle/artefacts/schema/untp/0.6.1/dfr.js.map +1 -0
  111. package/build/bundle/artefacts/schema/untp/0.6.1/dia.d.ts +2 -0
  112. package/build/bundle/artefacts/schema/untp/0.6.1/dia.js +239 -0
  113. package/build/bundle/artefacts/schema/untp/0.6.1/dia.js.map +1 -0
  114. package/build/bundle/artefacts/schema/untp/0.6.1/dpp.d.ts +2 -0
  115. package/build/bundle/artefacts/schema/untp/0.6.1/dpp.js +1232 -0
  116. package/build/bundle/artefacts/schema/untp/0.6.1/dpp.js.map +1 -0
  117. package/build/bundle/artefacts/schema/untp/0.6.1/dte.d.ts +2 -0
  118. package/build/bundle/artefacts/schema/untp/0.6.1/dte.js +848 -0
  119. package/build/bundle/artefacts/schema/untp/0.6.1/dte.js.map +1 -0
  120. package/build/bundle/artefacts/schema/untp/0.7.0/cvc.d.ts +2 -0
  121. package/build/bundle/artefacts/schema/untp/0.7.0/cvc.js +704 -0
  122. package/build/bundle/artefacts/schema/untp/0.7.0/cvc.js.map +1 -0
  123. package/build/bundle/artefacts/schema/untp/0.7.0/dcc.d.ts +2 -0
  124. package/build/bundle/artefacts/schema/untp/0.7.0/dcc.js +1136 -0
  125. package/build/bundle/artefacts/schema/untp/0.7.0/dcc.js.map +1 -0
  126. package/build/bundle/artefacts/schema/untp/0.7.0/dfr.d.ts +2 -0
  127. package/build/bundle/artefacts/schema/untp/0.7.0/dfr.js +1248 -0
  128. package/build/bundle/artefacts/schema/untp/0.7.0/dfr.js.map +1 -0
  129. package/build/bundle/artefacts/schema/untp/0.7.0/dia.d.ts +2 -0
  130. package/build/bundle/artefacts/schema/untp/0.7.0/dia.js +446 -0
  131. package/build/bundle/artefacts/schema/untp/0.7.0/dia.js.map +1 -0
  132. package/build/bundle/artefacts/schema/untp/0.7.0/dpp.d.ts +2 -0
  133. package/build/bundle/artefacts/schema/untp/0.7.0/dpp.js +1303 -0
  134. package/build/bundle/artefacts/schema/untp/0.7.0/dpp.js.map +1 -0
  135. package/build/bundle/artefacts/schema/untp/0.7.0/dte.d.ts +2 -0
  136. package/build/bundle/artefacts/schema/untp/0.7.0/dte.js +1229 -0
  137. package/build/bundle/artefacts/schema/untp/0.7.0/dte.js.map +1 -0
  138. package/build/bundle/artefacts/schema/untp/0.7.0/linkset.d.ts +2 -0
  139. package/build/bundle/artefacts/schema/untp/0.7.0/linkset.js +122 -0
  140. package/build/bundle/artefacts/schema/untp/0.7.0/linkset.js.map +1 -0
  141. package/build/bundle/artefacts/schema/vcdm/2/verifiable-credential.d.ts +2 -0
  142. package/build/bundle/artefacts/schema/vcdm/2/verifiable-credential.js +321 -0
  143. package/build/bundle/artefacts/schema/vcdm/2/verifiable-credential.js.map +1 -0
  144. package/build/bundle/fallback.d.ts +41 -0
  145. package/build/bundle/fallback.js +62 -0
  146. package/build/bundle/fallback.js.map +1 -0
  147. package/build/bundle/fallback.test.d.ts +1 -0
  148. package/build/bundle/fallback.test.js +124 -0
  149. package/build/bundle/fallback.test.js.map +1 -0
  150. package/build/bundle/index.d.ts +4 -0
  151. package/build/bundle/index.js +77 -0
  152. package/build/bundle/index.js.map +1 -0
  153. package/build/bundle/lookup.d.ts +14 -0
  154. package/build/bundle/lookup.js +40 -0
  155. package/build/bundle/lookup.js.map +1 -0
  156. package/build/bundle/lookup.test.d.ts +1 -0
  157. package/build/bundle/lookup.test.js +70 -0
  158. package/build/bundle/lookup.test.js.map +1 -0
  159. package/build/bundle/public.d.ts +25 -0
  160. package/build/bundle/public.js +56 -0
  161. package/build/bundle/public.js.map +1 -0
  162. package/build/bundle/public.test.d.ts +1 -0
  163. package/build/bundle/public.test.js +35 -0
  164. package/build/bundle/public.test.js.map +1 -0
  165. package/build/bundle/refresh-classify.test.d.ts +1 -0
  166. package/build/bundle/refresh-classify.test.js +20 -0
  167. package/build/bundle/refresh-classify.test.js.map +1 -0
  168. package/build/bundle/refresh-main.test.d.ts +1 -0
  169. package/build/bundle/refresh-main.test.js +98 -0
  170. package/build/bundle/refresh-main.test.js.map +1 -0
  171. package/build/cache/in-memory-ttl-cache.d.ts +2 -0
  172. package/build/cache/in-memory-ttl-cache.js +76 -0
  173. package/build/cache/in-memory-ttl-cache.js.map +1 -0
  174. package/build/cache/in-memory-ttl-cache.test.d.ts +1 -0
  175. package/build/cache/in-memory-ttl-cache.test.js +236 -0
  176. package/build/cache/in-memory-ttl-cache.test.js.map +1 -0
  177. package/build/cache/index.d.ts +2 -0
  178. package/build/cache/index.js +2 -0
  179. package/build/cache/index.js.map +1 -0
  180. package/build/cache/ttl-cache.d.ts +22 -0
  181. package/build/cache/ttl-cache.js +2 -0
  182. package/build/cache/ttl-cache.js.map +1 -0
  183. package/build/common/as-date-time.d.ts +13 -0
  184. package/build/common/as-date-time.js +44 -0
  185. package/build/common/as-date-time.js.map +1 -0
  186. package/build/common/as-date-time.test.d.ts +1 -0
  187. package/build/common/as-date-time.test.js +42 -0
  188. package/build/common/as-date-time.test.js.map +1 -0
  189. package/build/common/as-non-empty-string.d.ts +14 -0
  190. package/build/common/as-non-empty-string.js +20 -0
  191. package/build/common/as-non-empty-string.js.map +1 -0
  192. package/build/common/as-non-empty-string.test.d.ts +1 -0
  193. package/build/common/as-non-empty-string.test.js +30 -0
  194. package/build/common/as-non-empty-string.test.js.map +1 -0
  195. package/build/common/index.d.ts +4 -0
  196. package/build/common/index.js +5 -0
  197. package/build/common/index.js.map +1 -0
  198. package/build/common/require-string.d.ts +12 -0
  199. package/build/common/require-string.js +27 -0
  200. package/build/common/require-string.js.map +1 -0
  201. package/build/common/require-string.test.d.ts +1 -0
  202. package/build/common/require-string.test.js +53 -0
  203. package/build/common/require-string.test.js.map +1 -0
  204. package/build/common/validity-window.d.ts +45 -0
  205. package/build/common/validity-window.js +68 -0
  206. package/build/common/validity-window.js.map +1 -0
  207. package/build/common/validity-window.test.d.ts +1 -0
  208. package/build/common/validity-window.test.js +67 -0
  209. package/build/common/validity-window.test.js.map +1 -0
  210. package/build/conformity-vocabulary/codes.d.ts +10 -0
  211. package/build/conformity-vocabulary/codes.js +10 -0
  212. package/build/conformity-vocabulary/codes.js.map +1 -0
  213. package/build/conformity-vocabulary/errors.d.ts +44 -0
  214. package/build/conformity-vocabulary/errors.js +68 -0
  215. package/build/conformity-vocabulary/errors.js.map +1 -0
  216. package/build/conformity-vocabulary/index.d.ts +6 -0
  217. package/build/conformity-vocabulary/index.js +7 -0
  218. package/build/conformity-vocabulary/index.js.map +1 -0
  219. package/build/conformity-vocabulary/parse-conformity-catalogue.d.ts +26 -0
  220. package/build/conformity-vocabulary/parse-conformity-catalogue.js +106 -0
  221. package/build/conformity-vocabulary/parse-conformity-catalogue.js.map +1 -0
  222. package/build/conformity-vocabulary/parse-conformity-catalogue.test.d.ts +1 -0
  223. package/build/conformity-vocabulary/parse-conformity-catalogue.test.js +327 -0
  224. package/build/conformity-vocabulary/parse-conformity-catalogue.test.js.map +1 -0
  225. package/build/conformity-vocabulary/parse-conformity-scheme.d.ts +28 -0
  226. package/build/conformity-vocabulary/parse-conformity-scheme.js +47 -0
  227. package/build/conformity-vocabulary/parse-conformity-scheme.js.map +1 -0
  228. package/build/conformity-vocabulary/parse-conformity-scheme.test.d.ts +1 -0
  229. package/build/conformity-vocabulary/parse-conformity-scheme.test.js +284 -0
  230. package/build/conformity-vocabulary/parse-conformity-scheme.test.js.map +1 -0
  231. package/build/conformity-vocabulary/parsers/v0-7-0.parser.d.ts +19 -0
  232. package/build/conformity-vocabulary/parsers/v0-7-0.parser.js +219 -0
  233. package/build/conformity-vocabulary/parsers/v0-7-0.parser.js.map +1 -0
  234. package/build/conformity-vocabulary/types.d.ts +180 -0
  235. package/build/conformity-vocabulary/types.js +2 -0
  236. package/build/conformity-vocabulary/types.js.map +1 -0
  237. package/build/conformity-vocabulary/validate-conformity-claim.d.ts +26 -0
  238. package/build/conformity-vocabulary/validate-conformity-claim.js +165 -0
  239. package/build/conformity-vocabulary/validate-conformity-claim.js.map +1 -0
  240. package/build/conformity-vocabulary/validate-conformity-claim.test.d.ts +1 -0
  241. package/build/conformity-vocabulary/validate-conformity-claim.test.js +478 -0
  242. package/build/conformity-vocabulary/validate-conformity-claim.test.js.map +1 -0
  243. package/build/http-headers/index.d.ts +5 -0
  244. package/build/http-headers/index.js +6 -0
  245. package/build/http-headers/index.js.map +1 -0
  246. package/build/http-headers/is-safe-header-value.d.ts +10 -0
  247. package/build/http-headers/is-safe-header-value.js +15 -0
  248. package/build/http-headers/is-safe-header-value.js.map +1 -0
  249. package/build/http-headers/is-safe-header-value.test.d.ts +1 -0
  250. package/build/http-headers/is-safe-header-value.test.js +37 -0
  251. package/build/http-headers/is-safe-header-value.test.js.map +1 -0
  252. package/build/http-headers/parse-entity-tag.d.ts +9 -0
  253. package/build/http-headers/parse-entity-tag.js +18 -0
  254. package/build/http-headers/parse-entity-tag.js.map +1 -0
  255. package/build/http-headers/parse-entity-tag.test.d.ts +1 -0
  256. package/build/http-headers/parse-entity-tag.test.js +41 -0
  257. package/build/http-headers/parse-entity-tag.test.js.map +1 -0
  258. package/build/http-headers/parse-imf-date.d.ts +13 -0
  259. package/build/http-headers/parse-imf-date.js +23 -0
  260. package/build/http-headers/parse-imf-date.js.map +1 -0
  261. package/build/http-headers/parse-imf-date.test.d.ts +1 -0
  262. package/build/http-headers/parse-imf-date.test.js +31 -0
  263. package/build/http-headers/parse-imf-date.test.js.map +1 -0
  264. package/build/http-headers/parse-media-type.d.ts +8 -0
  265. package/build/http-headers/parse-media-type.js +21 -0
  266. package/build/http-headers/parse-media-type.js.map +1 -0
  267. package/build/http-headers/parse-media-type.test.d.ts +1 -0
  268. package/build/http-headers/parse-media-type.test.js +39 -0
  269. package/build/http-headers/parse-media-type.test.js.map +1 -0
  270. package/build/http-headers/user-agent.d.ts +35 -0
  271. package/build/http-headers/user-agent.js +45 -0
  272. package/build/http-headers/user-agent.js.map +1 -0
  273. package/build/http-headers/user-agent.test.d.ts +1 -0
  274. package/build/http-headers/user-agent.test.js +27 -0
  275. package/build/http-headers/user-agent.test.js.map +1 -0
  276. package/build/index.d.ts +1 -1
  277. package/build/index.js +1 -1
  278. package/build/index.js.map +1 -1
  279. package/build/loaders/errors.d.ts +21 -0
  280. package/build/loaders/errors.js +45 -0
  281. package/build/loaders/errors.js.map +1 -0
  282. package/build/loaders/index.d.ts +5 -0
  283. package/build/loaders/index.js +5 -0
  284. package/build/loaders/index.js.map +1 -0
  285. package/build/loaders/jsonld-document-loader.d.ts +48 -0
  286. package/build/loaders/jsonld-document-loader.js +43 -0
  287. package/build/loaders/jsonld-document-loader.js.map +1 -0
  288. package/build/loaders/jsonld-document-loader.test.d.ts +1 -0
  289. package/build/loaders/jsonld-document-loader.test.js +111 -0
  290. package/build/loaders/jsonld-document-loader.test.js.map +1 -0
  291. package/build/loaders/schema-loader.d.ts +31 -0
  292. package/build/loaders/schema-loader.js +83 -0
  293. package/build/loaders/schema-loader.js.map +1 -0
  294. package/build/loaders/schema-loader.ssrf.test.d.ts +1 -0
  295. package/build/loaders/schema-loader.ssrf.test.js +55 -0
  296. package/build/loaders/schema-loader.ssrf.test.js.map +1 -0
  297. package/build/loaders/schema-loader.test.d.ts +1 -0
  298. package/build/loaders/schema-loader.test.js +217 -0
  299. package/build/loaders/schema-loader.test.js.map +1 -0
  300. package/build/multibase-digest/multibase-digest.d.ts +23 -0
  301. package/build/multibase-digest/multibase-digest.js +40 -0
  302. package/build/multibase-digest/multibase-digest.js.map +1 -1
  303. package/build/multibase-digest/multibase-digest.test.js +46 -0
  304. package/build/multibase-digest/multibase-digest.test.js.map +1 -1
  305. package/build/node/errors.d.ts +47 -0
  306. package/build/node/errors.js +86 -0
  307. package/build/node/errors.js.map +1 -0
  308. package/build/node/index.d.ts +3 -0
  309. package/build/node/index.js +4 -0
  310. package/build/node/index.js.map +1 -0
  311. package/build/node/is-private-ip.d.ts +45 -0
  312. package/build/node/is-private-ip.fail-closed.test.d.ts +1 -0
  313. package/build/node/is-private-ip.fail-closed.test.js +36 -0
  314. package/build/node/is-private-ip.fail-closed.test.js.map +1 -0
  315. package/build/node/is-private-ip.js +203 -0
  316. package/build/node/is-private-ip.js.map +1 -0
  317. package/build/node/is-private-ip.test.d.ts +1 -0
  318. package/build/node/is-private-ip.test.js +124 -0
  319. package/build/node/is-private-ip.test.js.map +1 -0
  320. package/build/node/validate-public-url.d.ts +81 -0
  321. package/build/node/validate-public-url.js +128 -0
  322. package/build/node/validate-public-url.js.map +1 -0
  323. package/build/node/validate-public-url.test.d.ts +1 -0
  324. package/build/node/validate-public-url.test.js +324 -0
  325. package/build/node/validate-public-url.test.js.map +1 -0
  326. package/build/resolvers/errors.d.ts +73 -0
  327. package/build/resolvers/errors.js +133 -0
  328. package/build/resolvers/errors.js.map +1 -0
  329. package/build/resolvers/index.d.ts +5 -0
  330. package/build/resolvers/index.js +6 -0
  331. package/build/resolvers/index.js.map +1 -0
  332. package/build/resolvers/resolve-document-if-changed.d.ts +48 -0
  333. package/build/resolvers/resolve-document-if-changed.js +42 -0
  334. package/build/resolvers/resolve-document-if-changed.js.map +1 -0
  335. package/build/resolvers/resolve-document-if-changed.test.d.ts +1 -0
  336. package/build/resolvers/resolve-document-if-changed.test.js +116 -0
  337. package/build/resolvers/resolve-document-if-changed.test.js.map +1 -0
  338. package/build/resolvers/resolve-document.d.ts +106 -0
  339. package/build/resolvers/resolve-document.integration.test.d.ts +1 -0
  340. package/build/resolvers/resolve-document.integration.test.js +108 -0
  341. package/build/resolvers/resolve-document.integration.test.js.map +1 -0
  342. package/build/resolvers/resolve-document.js +319 -0
  343. package/build/resolvers/resolve-document.js.map +1 -0
  344. package/build/resolvers/resolve-document.test.d.ts +1 -0
  345. package/build/resolvers/resolve-document.test.js +749 -0
  346. package/build/resolvers/resolve-document.test.js.map +1 -0
  347. package/build/resolvers/resolve-json-document.d.ts +43 -0
  348. package/build/resolvers/resolve-json-document.js +43 -0
  349. package/build/resolvers/resolve-json-document.js.map +1 -0
  350. package/build/resolvers/resolve-json-document.test.d.ts +1 -0
  351. package/build/resolvers/resolve-json-document.test.js +78 -0
  352. package/build/resolvers/resolve-json-document.test.js.map +1 -0
  353. package/build/structured-error.d.ts +49 -0
  354. package/build/structured-error.js +17 -0
  355. package/build/structured-error.js.map +1 -0
  356. package/build/structured-error.test.d.ts +1 -0
  357. package/build/structured-error.test.js +112 -0
  358. package/build/structured-error.test.js.map +1 -0
  359. package/build/validation/describe-jsonld-failure.d.ts +90 -0
  360. package/build/validation/describe-jsonld-failure.js +171 -0
  361. package/build/validation/describe-jsonld-failure.js.map +1 -0
  362. package/build/validation/describe-jsonld-failure.test.d.ts +1 -0
  363. package/build/validation/describe-jsonld-failure.test.js +226 -0
  364. package/build/validation/describe-jsonld-failure.test.js.map +1 -0
  365. package/build/validation/errors.d.ts +40 -0
  366. package/build/validation/errors.js +75 -0
  367. package/build/validation/errors.js.map +1 -0
  368. package/build/validation/index.d.ts +5 -0
  369. package/build/validation/index.js +5 -0
  370. package/build/validation/index.js.map +1 -0
  371. package/build/validation/validate-against-schemas.d.ts +22 -0
  372. package/build/validation/validate-against-schemas.js +65 -0
  373. package/build/validation/validate-against-schemas.js.map +1 -0
  374. package/build/validation/validate-against-schemas.test.d.ts +1 -0
  375. package/build/validation/validate-against-schemas.test.js +169 -0
  376. package/build/validation/validate-against-schemas.test.js.map +1 -0
  377. package/build/validation/validate-jsonld.context-cache.test.d.ts +1 -0
  378. package/build/validation/validate-jsonld.context-cache.test.js +32 -0
  379. package/build/validation/validate-jsonld.context-cache.test.js.map +1 -0
  380. package/build/validation/validate-jsonld.d.ts +59 -0
  381. package/build/validation/validate-jsonld.js +126 -0
  382. package/build/validation/validate-jsonld.js.map +1 -0
  383. package/build/validation/validate-jsonld.ssrf.test.d.ts +1 -0
  384. package/build/validation/validate-jsonld.ssrf.test.js +108 -0
  385. package/build/validation/validate-jsonld.ssrf.test.js.map +1 -0
  386. package/build/validation/validate-jsonld.test.d.ts +1 -0
  387. package/build/validation/validate-jsonld.test.js +257 -0
  388. package/build/validation/validate-jsonld.test.js.map +1 -0
  389. package/package.json +86 -5
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Construction of UNTP artefact URLs (JSON Schema and JSON-LD context) for a
3
+ * given credential / artefact type and spec version.
4
+ *
5
+ * UNTP v0.7.0 relocated the artefacts. Schemas moved from the legacy
6
+ * per-credential-type layout on `test.uncefact.org` to the unece.org
7
+ * artefacts origin, and the JSON-LD context was unified into a single
8
+ * per-version context on `vocabulary.uncefact.org` (the same context URL for
9
+ * every type, including the Conformity Vocabulary Catalogue `ConformityScheme`
10
+ * artefact, which was introduced in v0.7.0). Earlier versions (v0.6.x)
11
+ * continue to be served from the legacy layout. This is the forward
12
+ * counterpart to {@link detectVersionFromContext}, which derives the version
13
+ * from a context URL.
14
+ *
15
+ * @see https://untp.unece.org/artefacts/schema/v0.7.0/dpp/DigitalProductPassport.json
16
+ * @see https://vocabulary.uncefact.org/untp/0.7.0/context/
17
+ */
18
+ /** Short artefact codes used in UNTP artefact paths, keyed by credential / artefact type. */
19
+ export declare const UNTP_SHORT_CREDENTIAL_TYPES: Record<string, string>;
20
+ /**
21
+ * v0.7.0+ core schema file names keyed by credential / artefact type. Most
22
+ * match the type verbatim; `DigitalConformityCredential` is published as
23
+ * `ConformityCredential`.
24
+ */
25
+ export declare const UNTP_CORE_SCHEMA_FILENAMES: Record<string, string>;
26
+ /**
27
+ * UNTP specification page slugs keyed by credential / artefact type. Slugs are
28
+ * version-independent. Several differ from the credential type name:
29
+ * `DigitalConformityCredential` is documented at `ConformityCredential`,
30
+ * `DigitalTraceabilityEvent` at the plural `DigitalTraceabilityEvents`, and
31
+ * `ConformityScheme` at `ConformityVocabularyCatalog`.
32
+ */
33
+ export declare const UNTP_SPECIFICATION_PAGE_SLUGS: Record<string, string>;
34
+ /**
35
+ * The UNTP docs version currently served at the unversioned ("current") docs
36
+ * path. This version is linked at `/docs/specification/<slug>`; older versions
37
+ * are linked at `/docs/<version>/specification/<slug>`.
38
+ *
39
+ * Maintenance point: update this when UNTP promotes a newer docs version to
40
+ * current. The previously-current version then gains its own
41
+ * `/docs/<version>/` path, so this constant moving keeps existing links
42
+ * pointing at the right version.
43
+ */
44
+ export declare const CURRENT_UNTP_DOCS_VERSION = "0.7.0";
45
+ /**
46
+ * Builds the human-readable UNTP specification page URL for a credential /
47
+ * artefact type at a given version.
48
+ *
49
+ * The current docs version ({@link CURRENT_UNTP_DOCS_VERSION}) is served at
50
+ * the unversioned `/docs/specification/<slug>` path; older versions resolve to
51
+ * `/docs/<version>/specification/<slug>`. Versions without their own docs fall
52
+ * back to the nearest published docs version (see `DOCS_VERSION_FALLBACKS`).
53
+ *
54
+ * @param type - UNTP credential / artefact type (e.g. `DigitalProductPassport`).
55
+ * @param version - Semantic version of the artefact (e.g. `0.7.0`).
56
+ * @returns The specification page URL.
57
+ * @throws {Error} When `type` is not a recognised UNTP artefact type.
58
+ */
59
+ export declare function buildSpecificationPageUrl(type: string, version: string): string;
60
+ /** The schema and context URLs for a UNTP artefact. */
61
+ export interface UntpArtefactUrls {
62
+ /** URL of the JSON Schema the document validates against. */
63
+ schemaUrl: string;
64
+ /** URL of the JSON-LD context the document references in `@context`. */
65
+ contextUrl: string;
66
+ }
67
+ /**
68
+ * Builds the JSON Schema and JSON-LD context URLs for a UNTP artefact.
69
+ *
70
+ * `ConformityScheme` was introduced in v0.7.0 and has no legacy layout; only
71
+ * call it with a v0.7.0+ version.
72
+ *
73
+ * @param type - UNTP credential / artefact type (e.g. `DigitalProductPassport`,
74
+ * `ConformityScheme`). Must be a recognised type.
75
+ * @param version - Semantic version of the artefact (e.g. `0.7.0`).
76
+ * @returns The {@link UntpArtefactUrls} appropriate for the version.
77
+ * @throws {Error} When `type` is not a recognised UNTP artefact type.
78
+ */
79
+ export declare function buildUntpArtefactUrls(type: string, version: string): UntpArtefactUrls;
80
+ /**
81
+ * The published Identity Resolver link set schema URL for a UNTP version. The schema exists from
82
+ * 0.7.0 under the artefacts layout only (`/idr/LinksetSchema.json`); no legacy per-type form ever
83
+ * existed, so this is a single layout rather than a version switch.
84
+ */
85
+ export declare function buildLinkSetSchemaUrl(version: string): string;
@@ -0,0 +1,141 @@
1
+ /**
2
+ * Construction of UNTP artefact URLs (JSON Schema and JSON-LD context) for a
3
+ * given credential / artefact type and spec version.
4
+ *
5
+ * UNTP v0.7.0 relocated the artefacts. Schemas moved from the legacy
6
+ * per-credential-type layout on `test.uncefact.org` to the unece.org
7
+ * artefacts origin, and the JSON-LD context was unified into a single
8
+ * per-version context on `vocabulary.uncefact.org` (the same context URL for
9
+ * every type, including the Conformity Vocabulary Catalogue `ConformityScheme`
10
+ * artefact, which was introduced in v0.7.0). Earlier versions (v0.6.x)
11
+ * continue to be served from the legacy layout. This is the forward
12
+ * counterpart to {@link detectVersionFromContext}, which derives the version
13
+ * from a context URL.
14
+ *
15
+ * @see https://untp.unece.org/artefacts/schema/v0.7.0/dpp/DigitalProductPassport.json
16
+ * @see https://vocabulary.uncefact.org/untp/0.7.0/context/
17
+ */
18
+ import { isV070OrAbove } from './version.js';
19
+ const LEGACY_BASE = 'https://test.uncefact.org/vocabulary/untp';
20
+ const ARTEFACTS_SCHEMA_BASE = 'https://untp.unece.org/artefacts/schema';
21
+ const UNIFIED_CONTEXT_BASE = 'https://vocabulary.uncefact.org/untp';
22
+ /** Short artefact codes used in UNTP artefact paths, keyed by credential / artefact type. */
23
+ export const UNTP_SHORT_CREDENTIAL_TYPES = {
24
+ DigitalProductPassport: 'dpp',
25
+ DigitalConformityCredential: 'dcc',
26
+ DigitalTraceabilityEvent: 'dte',
27
+ DigitalFacilityRecord: 'dfr',
28
+ DigitalIdentityAnchor: 'dia',
29
+ ConformityScheme: 'cvc',
30
+ };
31
+ /**
32
+ * v0.7.0+ core schema file names keyed by credential / artefact type. Most
33
+ * match the type verbatim; `DigitalConformityCredential` is published as
34
+ * `ConformityCredential`.
35
+ */
36
+ export const UNTP_CORE_SCHEMA_FILENAMES = {
37
+ DigitalProductPassport: 'DigitalProductPassport',
38
+ DigitalConformityCredential: 'ConformityCredential',
39
+ DigitalTraceabilityEvent: 'DigitalTraceabilityEvent',
40
+ DigitalFacilityRecord: 'DigitalFacilityRecord',
41
+ DigitalIdentityAnchor: 'DigitalIdentityAnchor',
42
+ ConformityScheme: 'ConformityScheme',
43
+ };
44
+ const DOCS_BASE = 'https://untp.unece.org/docs';
45
+ /**
46
+ * UNTP specification page slugs keyed by credential / artefact type. Slugs are
47
+ * version-independent. Several differ from the credential type name:
48
+ * `DigitalConformityCredential` is documented at `ConformityCredential`,
49
+ * `DigitalTraceabilityEvent` at the plural `DigitalTraceabilityEvents`, and
50
+ * `ConformityScheme` at `ConformityVocabularyCatalog`.
51
+ */
52
+ export const UNTP_SPECIFICATION_PAGE_SLUGS = {
53
+ DigitalProductPassport: 'DigitalProductPassport',
54
+ DigitalConformityCredential: 'ConformityCredential',
55
+ DigitalTraceabilityEvent: 'DigitalTraceabilityEvents',
56
+ DigitalFacilityRecord: 'DigitalFacilityRecord',
57
+ DigitalIdentityAnchor: 'DigitalIdentityAnchor',
58
+ ConformityScheme: 'ConformityVocabularyCatalog',
59
+ };
60
+ /**
61
+ * The UNTP docs version currently served at the unversioned ("current") docs
62
+ * path. This version is linked at `/docs/specification/<slug>`; older versions
63
+ * are linked at `/docs/<version>/specification/<slug>`.
64
+ *
65
+ * Maintenance point: update this when UNTP promotes a newer docs version to
66
+ * current. The previously-current version then gains its own
67
+ * `/docs/<version>/` path, so this constant moving keeps existing links
68
+ * pointing at the right version.
69
+ */
70
+ export const CURRENT_UNTP_DOCS_VERSION = '0.7.0';
71
+ /**
72
+ * Versions that ship no docs of their own, mapped to the published docs
73
+ * version that covers them. UNTP released 0.6.1 schemas without separate
74
+ * 0.6.1 docs; the 0.6.0 docs document the whole 0.6.x line.
75
+ */
76
+ const DOCS_VERSION_FALLBACKS = {
77
+ '0.6.1': '0.6.0',
78
+ };
79
+ /**
80
+ * Builds the human-readable UNTP specification page URL for a credential /
81
+ * artefact type at a given version.
82
+ *
83
+ * The current docs version ({@link CURRENT_UNTP_DOCS_VERSION}) is served at
84
+ * the unversioned `/docs/specification/<slug>` path; older versions resolve to
85
+ * `/docs/<version>/specification/<slug>`. Versions without their own docs fall
86
+ * back to the nearest published docs version (see `DOCS_VERSION_FALLBACKS`).
87
+ *
88
+ * @param type - UNTP credential / artefact type (e.g. `DigitalProductPassport`).
89
+ * @param version - Semantic version of the artefact (e.g. `0.7.0`).
90
+ * @returns The specification page URL.
91
+ * @throws {Error} When `type` is not a recognised UNTP artefact type.
92
+ */
93
+ export function buildSpecificationPageUrl(type, version) {
94
+ const slug = UNTP_SPECIFICATION_PAGE_SLUGS[type];
95
+ if (!slug) {
96
+ throw new Error(`Unknown UNTP artefact type "${type}". Expected one of: ${Object.keys(UNTP_SPECIFICATION_PAGE_SLUGS).join(', ')}.`);
97
+ }
98
+ const docsVersion = DOCS_VERSION_FALLBACKS[version] ?? version;
99
+ if (docsVersion === CURRENT_UNTP_DOCS_VERSION) {
100
+ return `${DOCS_BASE}/specification/${slug}`;
101
+ }
102
+ return `${DOCS_BASE}/${docsVersion}/specification/${slug}`;
103
+ }
104
+ /**
105
+ * Builds the JSON Schema and JSON-LD context URLs for a UNTP artefact.
106
+ *
107
+ * `ConformityScheme` was introduced in v0.7.0 and has no legacy layout; only
108
+ * call it with a v0.7.0+ version.
109
+ *
110
+ * @param type - UNTP credential / artefact type (e.g. `DigitalProductPassport`,
111
+ * `ConformityScheme`). Must be a recognised type.
112
+ * @param version - Semantic version of the artefact (e.g. `0.7.0`).
113
+ * @returns The {@link UntpArtefactUrls} appropriate for the version.
114
+ * @throws {Error} When `type` is not a recognised UNTP artefact type.
115
+ */
116
+ export function buildUntpArtefactUrls(type, version) {
117
+ const shortCode = UNTP_SHORT_CREDENTIAL_TYPES[type];
118
+ if (!shortCode) {
119
+ throw new Error(`Unknown UNTP artefact type "${type}". Expected one of: ${Object.keys(UNTP_SHORT_CREDENTIAL_TYPES).join(', ')}.`);
120
+ }
121
+ if (isV070OrAbove(version)) {
122
+ const fileName = UNTP_CORE_SCHEMA_FILENAMES[type];
123
+ return {
124
+ schemaUrl: `${ARTEFACTS_SCHEMA_BASE}/v${version}/${shortCode}/${fileName}.json`,
125
+ contextUrl: `${UNIFIED_CONTEXT_BASE}/${version}/context/`,
126
+ };
127
+ }
128
+ return {
129
+ schemaUrl: `${LEGACY_BASE}/${shortCode}/untp-${shortCode}-schema-${version}.json`,
130
+ contextUrl: `${LEGACY_BASE}/${shortCode}/${version}/context/`,
131
+ };
132
+ }
133
+ /**
134
+ * The published Identity Resolver link set schema URL for a UNTP version. The schema exists from
135
+ * 0.7.0 under the artefacts layout only (`/idr/LinksetSchema.json`); no legacy per-type form ever
136
+ * existed, so this is a single layout rather than a version switch.
137
+ */
138
+ export function buildLinkSetSchemaUrl(version) {
139
+ return `${ARTEFACTS_SCHEMA_BASE}/v${version}/idr/LinksetSchema.json`;
140
+ }
141
+ //# sourceMappingURL=urls.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"urls.js","sourceRoot":"","sources":["../../src/artefacts/urls.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,WAAW,GAAG,2CAA2C,CAAC;AAChE,MAAM,qBAAqB,GAAG,yCAAyC,CAAC;AACxE,MAAM,oBAAoB,GAAG,sCAAsC,CAAC;AAEpE,6FAA6F;AAC7F,MAAM,CAAC,MAAM,2BAA2B,GAA2B;IACjE,sBAAsB,EAAE,KAAK;IAC7B,2BAA2B,EAAE,KAAK;IAClC,wBAAwB,EAAE,KAAK;IAC/B,qBAAqB,EAAE,KAAK;IAC5B,qBAAqB,EAAE,KAAK;IAC5B,gBAAgB,EAAE,KAAK;CACxB,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAA2B;IAChE,sBAAsB,EAAE,wBAAwB;IAChD,2BAA2B,EAAE,sBAAsB;IACnD,wBAAwB,EAAE,0BAA0B;IACpD,qBAAqB,EAAE,uBAAuB;IAC9C,qBAAqB,EAAE,uBAAuB;IAC9C,gBAAgB,EAAE,kBAAkB;CACrC,CAAC;AAEF,MAAM,SAAS,GAAG,6BAA6B,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAA2B;IACnE,sBAAsB,EAAE,wBAAwB;IAChD,2BAA2B,EAAE,sBAAsB;IACnD,wBAAwB,EAAE,2BA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CAAC,CAAC;QAClD,OAAO;YACL,SAAS,EAAE,GAAG,qBAAqB,KAAK,OAAO,IAAI,SAAS,IAAI,QAAQ,OAAO;YAC/E,UAAU,EAAE,GAAG,oBAAoB,IAAI,OAAO,WAAW;SAC1D,CAAC;IACJ,CAAC;IAED,OAAO;QACL,SAAS,EAAE,GAAG,WAAW,IAAI,SAAS,SAAS,SAAS,WAAW,OAAO,OAAO;QACjF,UAAU,EAAE,GAAG,WAAW,IAAI,SAAS,IAAI,OAAO,WAAW;KAC9D,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAAe;IACnD,OAAO,GAAG,qBAAqB,KAAK,OAAO,yBAAyB,CAAC;AACvE,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,99 @@
1
+ import { buildUntpArtefactUrls, buildSpecificationPageUrl, UNTP_SHORT_CREDENTIAL_TYPES, UNTP_CORE_SCHEMA_FILENAMES, UNTP_SPECIFICATION_PAGE_SLUGS, buildLinkSetSchemaUrl, } from './urls';
2
+ describe('buildUntpArtefactUrls', () => {
3
+ describe('v0.6.x (legacy layout)', () => {
4
+ it('builds the legacy per-credential-type schema and context URLs', () => {
5
+ expect(buildUntpArtefactUrls('DigitalProductPassport', '0.6.1')).toEqual({
6
+ schemaUrl: 'https://test.uncefact.org/vocabulary/untp/dpp/untp-dpp-schema-0.6.1.json',
7
+ contextUrl: 'https://test.uncefact.org/vocabulary/untp/dpp/0.6.1/context/',
8
+ });
9
+ });
10
+ it('uses the legacy layout for v0.6.0', () => {
11
+ expect(buildUntpArtefactUrls('DigitalConformityCredential', '0.6.0')).toEqual({
12
+ schemaUrl: 'https://test.uncefact.org/vocabulary/untp/dcc/untp-dcc-schema-0.6.0.json',
13
+ contextUrl: 'https://test.uncefact.org/vocabulary/untp/dcc/0.6.0/context/',
14
+ });
15
+ });
16
+ });
17
+ describe('v0.7.0+ (artefacts layout)', () => {
18
+ it('builds the artefacts schema URL and unified context URL for DPP', () => {
19
+ expect(buildUntpArtefactUrls('DigitalProductPassport', '0.7.0')).toEqual({
20
+ schemaUrl: 'https://untp.unece.org/artefacts/schema/v0.7.0/dpp/DigitalProductPassport.json',
21
+ contextUrl: 'https://vocabulary.uncefact.org/untp/0.7.0/context/',
22
+ });
23
+ });
24
+ it('maps DigitalConformityCredential to the ConformityCredential schema file name', () => {
25
+ expect(buildUntpArtefactUrls('DigitalConformityCredential', '0.7.0').schemaUrl).toBe('https://untp.unece.org/artefacts/schema/v0.7.0/dcc/ConformityCredential.json');
26
+ });
27
+ it.each([
28
+ ['DigitalFacilityRecord', 'dfr', 'DigitalFacilityRecord'],
29
+ ['DigitalIdentityAnchor', 'dia', 'DigitalIdentityAnchor'],
30
+ ['DigitalTraceabilityEvent', 'dte', 'DigitalTraceabilityEvent'],
31
+ ])('builds the artefacts schema URL for %s', (type, shortCode, fileName) => {
32
+ expect(buildUntpArtefactUrls(type, '0.7.0').schemaUrl).toBe(`https://untp.unece.org/artefacts/schema/v0.7.0/${shortCode}/${fileName}.json`);
33
+ });
34
+ it('builds the artefacts schema and unified context URLs for ConformityScheme (introduced in v0.7.0)', () => {
35
+ expect(buildUntpArtefactUrls('ConformityScheme', '0.7.0')).toEqual({
36
+ schemaUrl: 'https://untp.unece.org/artefacts/schema/v0.7.0/cvc/ConformityScheme.json',
37
+ contextUrl: 'https://vocabulary.uncefact.org/untp/0.7.0/context/',
38
+ });
39
+ });
40
+ it('shares one unified context URL across credentials and the conformity scheme', () => {
41
+ const dpp = buildUntpArtefactUrls('DigitalProductPassport', '0.7.0').contextUrl;
42
+ const dte = buildUntpArtefactUrls('DigitalTraceabilityEvent', '0.7.0').contextUrl;
43
+ const cvc = buildUntpArtefactUrls('ConformityScheme', '0.7.0').contextUrl;
44
+ expect(new Set([dpp, dte, cvc]).size).toBe(1);
45
+ expect(dpp).toBe('https://vocabulary.uncefact.org/untp/0.7.0/context/');
46
+ });
47
+ it('treats a future minor (0.8.0) as the artefacts layout', () => {
48
+ expect(buildUntpArtefactUrls('DigitalProductPassport', '0.8.0').schemaUrl).toBe('https://untp.unece.org/artefacts/schema/v0.8.0/dpp/DigitalProductPassport.json');
49
+ });
50
+ it('treats a future major (1.0.0) as the artefacts layout', () => {
51
+ expect(buildUntpArtefactUrls('DigitalProductPassport', '1.0.0').contextUrl).toBe('https://vocabulary.uncefact.org/untp/1.0.0/context/');
52
+ });
53
+ });
54
+ describe('unknown artefact type', () => {
55
+ it('throws with a helpful message listing the supported types', () => {
56
+ expect(() => buildUntpArtefactUrls('DigitalLivestockPassport', '0.7.0')).toThrow(/Unknown UNTP artefact type/);
57
+ });
58
+ });
59
+ describe('exported maps', () => {
60
+ it('the short-code and schema-filename maps agree on the set of supported types', () => {
61
+ expect(Object.keys(UNTP_SHORT_CREDENTIAL_TYPES).sort()).toEqual(Object.keys(UNTP_CORE_SCHEMA_FILENAMES).sort());
62
+ });
63
+ });
64
+ });
65
+ describe('buildSpecificationPageUrl', () => {
66
+ it('links the current docs version (0.7.0) at the unversioned path', () => {
67
+ expect(buildSpecificationPageUrl('DigitalProductPassport', '0.7.0')).toBe('https://untp.unece.org/docs/specification/DigitalProductPassport');
68
+ });
69
+ it('links an older version (0.6.0) at the versioned path', () => {
70
+ expect(buildSpecificationPageUrl('DigitalProductPassport', '0.6.0')).toBe('https://untp.unece.org/docs/0.6.0/specification/DigitalProductPassport');
71
+ });
72
+ it('falls back to the 0.6.0 docs for 0.6.1 (which has no docs of its own)', () => {
73
+ expect(buildSpecificationPageUrl('DigitalProductPassport', '0.6.1')).toBe('https://untp.unece.org/docs/0.6.0/specification/DigitalProductPassport');
74
+ });
75
+ it('uses the ConformityCredential slug for DigitalConformityCredential', () => {
76
+ expect(buildSpecificationPageUrl('DigitalConformityCredential', '0.7.0')).toBe('https://untp.unece.org/docs/specification/ConformityCredential');
77
+ });
78
+ it('uses the plural DigitalTraceabilityEvents slug for DigitalTraceabilityEvent', () => {
79
+ expect(buildSpecificationPageUrl('DigitalTraceabilityEvent', '0.6.0')).toBe('https://untp.unece.org/docs/0.6.0/specification/DigitalTraceabilityEvents');
80
+ });
81
+ it('uses the ConformityVocabularyCatalog slug for ConformityScheme', () => {
82
+ expect(buildSpecificationPageUrl('ConformityScheme', '0.7.0')).toBe('https://untp.unece.org/docs/specification/ConformityVocabularyCatalog');
83
+ });
84
+ it('throws for an unknown artefact type', () => {
85
+ expect(() => buildSpecificationPageUrl('DigitalLivestockPassport', '0.7.0')).toThrow(/Unknown UNTP artefact type/);
86
+ });
87
+ it('keeps the slug set aligned with the short-code map', () => {
88
+ expect(Object.keys(UNTP_SPECIFICATION_PAGE_SLUGS).sort()).toEqual(Object.keys(UNTP_SHORT_CREDENTIAL_TYPES).sort());
89
+ });
90
+ });
91
+ describe('buildLinkSetSchemaUrl', () => {
92
+ it('builds the artefacts-layout idr schema URL the manifest pins for v0.7.0', () => {
93
+ expect(buildLinkSetSchemaUrl('0.7.0')).toBe('https://untp.unece.org/artefacts/schema/v0.7.0/idr/LinksetSchema.json');
94
+ });
95
+ it('uses the same layout for a later version', () => {
96
+ expect(buildLinkSetSchemaUrl('0.8.0')).toBe('https://untp.unece.org/artefacts/schema/v0.8.0/idr/LinksetSchema.json');
97
+ });
98
+ });
99
+ //# sourceMappingURL=urls.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"urls.test.js","sourceRoot":"","sources":["../../src/artefacts/urls.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,2BAA2B,EAC3B,0BAA0B,EAC1B,6BAA6B,EAC7B,qBAAqB,GACtB,MAAM,QAAQ,CAAC;AAEhB,QAAQ,CAAC,uBAAuB,EAAE,GAAG,EAAE;IACrC,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;QACtC,EAAE,CAAC,+DAA+D,EAAE,GAAG,EAAE;YACvE,MAAM,CAAC,qBAAqB,CAAC,wBAAwB,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,C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+ * UNTP spec version predicates.
3
+ *
4
+ * The v0.7.0 boundary is significant because v0.7.0 relocated the published
5
+ * artefacts (see `./urls.ts`): schema origin, context unification, and the
6
+ * introduction of the Conformity Vocabulary Catalogue.
7
+ */
8
+ /** Returns true when the given UNTP version string is v0.7.0 or newer. */
9
+ export declare function isV070OrAbove(version: string): boolean;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * UNTP spec version predicates.
3
+ *
4
+ * The v0.7.0 boundary is significant because v0.7.0 relocated the published
5
+ * artefacts (see `./urls.ts`): schema origin, context unification, and the
6
+ * introduction of the Conformity Vocabulary Catalogue.
7
+ */
8
+ /** Returns true when the given UNTP version string is v0.7.0 or newer. */
9
+ export function isV070OrAbove(version) {
10
+ const match = version.match(/^(\d+)\.(\d+)/);
11
+ if (!match)
12
+ return false;
13
+ const major = Number(match[1]);
14
+ const minor = Number(match[2]);
15
+ return major > 0 || (major === 0 && minor >= 7);
16
+ }
17
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/artefacts/version.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,0EAA0E;AAC1E,MAAM,UAAU,aAAa,CAAC,OAAe;IAC3C,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;IAC7C,IAAI,CAAC,KAAK;QAAE,OAAO,KAAK,CAAC;IACzB,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/B,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/B,OAAO,KAAK,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC;AAClD,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,16 @@
1
+ import { isV070OrAbove } from './version';
2
+ describe('isV070OrAbove', () => {
3
+ it.each([
4
+ ['0.7.0', true],
5
+ ['0.7.1', true],
6
+ ['0.8.0', true],
7
+ ['1.0.0', true],
8
+ ['0.6.1', false],
9
+ ['0.6.0', false],
10
+ ['0.5.0', false],
11
+ ['not-a-version', false],
12
+ ])('returns %s -> %s', (version, expected) => {
13
+ expect(isV070OrAbove(version)).toBe(expected);
14
+ });
15
+ });
16
+ //# sourceMappingURL=version.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.test.js","sourceRoot":"","sources":["../../src/artefacts/version.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,EAAE,CAAC,IAAI,CAAC;QACN,CAAC,OAAO,EAAE,IAAI,CAAC;QACf,CAAC,OAAO,EAAE,IAAI,CAAC;QACf,CAAC,OAAO,EAAE,IAAI,CAAC;QACf,CAAC,OAAO,EAAE,IAAI,CAAC;QACf,CAAC,OAAO,EAAE,KAAK,CAAC;QAChB,CAAC,OAAO,EAAE,KAAK,CAAC;QAChB,CAAC,OAAO,EAAE,KAAK,CAAC;QAChB,CAAC,eAAe,EAAE,KAAK,CAAC;KACzB,CAAC,CAAC,kBAAkB,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE;QAC3C,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ declare const artefact: Record<string, unknown>;
2
+ export default artefact;