@clementine-solutions/jane-io 1.0.0 → 1.0.2

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 (408) hide show
  1. package/README.md +132 -1
  2. package/dist/core/analysis/diff.d.ts +35 -0
  3. package/dist/core/analysis/diff.js +88 -0
  4. package/dist/core/analysis/explain.d.ts +35 -0
  5. package/dist/core/analysis/explain.js +117 -0
  6. package/dist/core/analysis/index.d.ts +14 -0
  7. package/dist/core/analysis/index.js +26 -0
  8. package/dist/core/analysis/replay.d.ts +34 -0
  9. package/dist/core/analysis/replay.js +68 -0
  10. package/dist/core/analysis/telemetry.d.ts +28 -0
  11. package/dist/core/analysis/telemetry.js +123 -0
  12. package/dist/core/boundary-rules/at-most-one.d.ts +17 -0
  13. package/dist/core/boundary-rules/at-most-one.js +38 -0
  14. package/dist/core/boundary-rules/conditionally-required.d.ts +18 -0
  15. package/dist/core/boundary-rules/conditionally-required.js +44 -0
  16. package/dist/core/boundary-rules/date-range.d.ts +17 -0
  17. package/dist/core/boundary-rules/date-range.js +39 -0
  18. package/dist/core/boundary-rules/index.d.ts +18 -0
  19. package/dist/core/boundary-rules/index.js +21 -0
  20. package/dist/core/boundary-rules/mutually-exclusive.d.ts +16 -0
  21. package/dist/core/boundary-rules/mutually-exclusive.js +38 -0
  22. package/dist/core/boundary-rules/no-unknown-fields.d.ts +17 -0
  23. package/dist/core/boundary-rules/no-unknown-fields.js +39 -0
  24. package/dist/core/boundary-rules/require-all.d.ts +16 -0
  25. package/dist/core/boundary-rules/require-all.js +39 -0
  26. package/dist/core/boundary-rules/require-one.d.ts +17 -0
  27. package/dist/core/boundary-rules/require-one.js +41 -0
  28. package/dist/core/common/events.d.ts +37 -0
  29. package/dist/core/common/events.js +82 -0
  30. package/dist/core/common/fluent.d.ts +151 -0
  31. package/dist/core/common/fluent.js +429 -0
  32. package/dist/core/common/index.d.ts +16 -0
  33. package/dist/core/common/index.js +31 -0
  34. package/dist/core/common/policy.d.ts +170 -0
  35. package/dist/core/common/policy.js +550 -0
  36. package/dist/core/common/utilities.d.ts +59 -0
  37. package/dist/core/common/utilities.js +177 -0
  38. package/dist/core/common/wildcard.d.ts +27 -0
  39. package/dist/core/common/wildcard.js +63 -0
  40. package/dist/core/field-path/construct.d.ts +77 -0
  41. package/dist/core/field-path/construct.js +189 -0
  42. package/dist/core/field-path/format.d.ts +41 -0
  43. package/dist/core/field-path/format.js +154 -0
  44. package/dist/core/field-path/index.d.ts +14 -0
  45. package/dist/core/field-path/index.js +26 -0
  46. package/dist/core/field-path/utilities.d.ts +85 -0
  47. package/dist/core/field-path/utilities.js +138 -0
  48. package/dist/core/field-path/walk.d.ts +36 -0
  49. package/dist/core/field-path/walk.js +80 -0
  50. package/dist/core/fluent-registry.d.ts +138 -0
  51. package/dist/core/fluent-registry.js +151 -0
  52. package/dist/core/normalizers/array/compact-sparse-array.d.ts +22 -0
  53. package/dist/core/normalizers/array/compact-sparse-array.js +40 -0
  54. package/dist/core/normalizers/array/flatten-one-level.d.ts +17 -0
  55. package/dist/core/normalizers/array/flatten-one-level.js +45 -0
  56. package/dist/core/normalizers/array/remove-empty-string-items.d.ts +6 -0
  57. package/dist/core/normalizers/array/remove-empty-string-items.js +34 -0
  58. package/dist/core/normalizers/array/remove-null-items.d.ts +16 -0
  59. package/dist/core/normalizers/array/remove-null-items.js +34 -0
  60. package/dist/core/normalizers/array/remove-undefined-items.d.ts +16 -0
  61. package/dist/core/normalizers/array/remove-undefined-items.js +34 -0
  62. package/dist/core/normalizers/date/invalid-date-to-undefined.d.ts +17 -0
  63. package/dist/core/normalizers/date/invalid-date-to-undefined.js +35 -0
  64. package/dist/core/normalizers/index.d.ts +28 -0
  65. package/dist/core/normalizers/index.js +46 -0
  66. package/dist/core/normalizers/normalizer-register.d.ts +17 -0
  67. package/dist/core/normalizers/normalizer-register.js +41 -0
  68. package/dist/core/normalizers/number/infinity-to-undefined.d.ts +18 -0
  69. package/dist/core/normalizers/number/infinity-to-undefined.js +35 -0
  70. package/dist/core/normalizers/number/nan-to-undefined.d.ts +17 -0
  71. package/dist/core/normalizers/number/nan-to-undefined.js +34 -0
  72. package/dist/core/normalizers/number/normalize-negative-zero.d.ts +16 -0
  73. package/dist/core/normalizers/number/normalize-negative-zero.js +33 -0
  74. package/dist/core/normalizers/object/remove-empty-array-keys.d.ts +17 -0
  75. package/dist/core/normalizers/object/remove-empty-array-keys.js +38 -0
  76. package/dist/core/normalizers/object/remove-empty-object-keys.d.ts +16 -0
  77. package/dist/core/normalizers/object/remove-empty-object-keys.js +42 -0
  78. package/dist/core/normalizers/object/remove-empty-string-keys.d.ts +16 -0
  79. package/dist/core/normalizers/object/remove-empty-string-keys.js +37 -0
  80. package/dist/core/normalizers/object/remove-null-keys.d.ts +16 -0
  81. package/dist/core/normalizers/object/remove-null-keys.js +37 -0
  82. package/dist/core/normalizers/object/remove-undefined-keys.d.ts +16 -0
  83. package/dist/core/normalizers/object/remove-undefined-keys.js +37 -0
  84. package/dist/core/normalizers/string/collapse-whitespace.d.ts +17 -0
  85. package/dist/core/normalizers/string/collapse-whitespace.js +35 -0
  86. package/dist/core/normalizers/string/empty-to-undefined.d.ts +16 -0
  87. package/dist/core/normalizers/string/empty-to-undefined.js +33 -0
  88. package/dist/core/normalizers/string/trim.d.ts +16 -0
  89. package/dist/core/normalizers/string/trim.js +34 -0
  90. package/dist/core/parsers/index.d.ts +22 -0
  91. package/dist/core/parsers/index.js +43 -0
  92. package/dist/core/parsers/parse-array-string.d.ts +16 -0
  93. package/dist/core/parsers/parse-array-string.js +36 -0
  94. package/dist/core/parsers/parse-bigint-string.d.ts +16 -0
  95. package/dist/core/parsers/parse-bigint-string.js +33 -0
  96. package/dist/core/parsers/parse-binary-string.d.ts +16 -0
  97. package/dist/core/parsers/parse-binary-string.js +33 -0
  98. package/dist/core/parsers/parse-boolean-string.d.ts +16 -0
  99. package/dist/core/parsers/parse-boolean-string.js +27 -0
  100. package/dist/core/parsers/parse-date-string.d.ts +16 -0
  101. package/dist/core/parsers/parse-date-string.js +30 -0
  102. package/dist/core/parsers/parse-duration-string.d.ts +16 -0
  103. package/dist/core/parsers/parse-duration-string.js +37 -0
  104. package/dist/core/parsers/parse-hex-string.d.ts +16 -0
  105. package/dist/core/parsers/parse-hex-string.js +29 -0
  106. package/dist/core/parsers/parse-integer-string.d.ts +16 -0
  107. package/dist/core/parsers/parse-integer-string.js +30 -0
  108. package/dist/core/parsers/parse-json-string.d.ts +17 -0
  109. package/dist/core/parsers/parse-json-string.js +35 -0
  110. package/dist/core/parsers/parse-numeric-string.d.ts +16 -0
  111. package/dist/core/parsers/parse-numeric-string.js +29 -0
  112. package/dist/core/parsers/parse-object-string.d.ts +16 -0
  113. package/dist/core/parsers/parse-object-string.js +36 -0
  114. package/dist/core/parsers/parse-octal-string.d.ts +16 -0
  115. package/dist/core/parsers/parse-octal-string.js +33 -0
  116. package/dist/core/parsers/parse-scientific-notation-string.d.ts +16 -0
  117. package/dist/core/parsers/parse-scientific-notation-string.js +30 -0
  118. package/dist/core/parsers/parse-url-string.d.ts +16 -0
  119. package/dist/core/parsers/parse-url-string.js +36 -0
  120. package/dist/core/pipeline/boundary.d.ts +36 -0
  121. package/dist/core/pipeline/boundary.js +256 -0
  122. package/dist/core/pipeline/contain.d.ts +122 -0
  123. package/dist/core/pipeline/contain.js +339 -0
  124. package/dist/core/pipeline/index.d.ts +16 -0
  125. package/dist/core/pipeline/index.js +37 -0
  126. package/dist/core/pipeline/normalize.d.ts +34 -0
  127. package/dist/core/pipeline/normalize.js +76 -0
  128. package/dist/core/pipeline/parse.d.ts +40 -0
  129. package/dist/core/pipeline/parse.js +91 -0
  130. package/dist/core/pipeline/pipeline.d.ts +23 -0
  131. package/dist/core/pipeline/pipeline.js +418 -0
  132. package/dist/core/pipeline/scan.d.ts +46 -0
  133. package/dist/core/pipeline/scan.js +115 -0
  134. package/dist/core/pipeline/validate.d.ts +40 -0
  135. package/dist/core/pipeline/validate.js +74 -0
  136. package/dist/core/scanners/any/scan-for-sentinels.d.ts +19 -0
  137. package/dist/core/scanners/any/scan-for-sentinels.js +35 -0
  138. package/dist/core/scanners/array/array-is-deep.d.ts +19 -0
  139. package/dist/core/scanners/array/array-is-deep.js +38 -0
  140. package/dist/core/scanners/array/array-is-heterogenous.d.ts +18 -0
  141. package/dist/core/scanners/array/array-is-heterogenous.js +39 -0
  142. package/dist/core/scanners/array/array-is-large.d.ts +19 -0
  143. package/dist/core/scanners/array/array-is-large.js +32 -0
  144. package/dist/core/scanners/bigint/bigint-is-large.d.ts +20 -0
  145. package/dist/core/scanners/bigint/bigint-is-large.js +34 -0
  146. package/dist/core/scanners/bigint/bigint-not-safe.d.ts +20 -0
  147. package/dist/core/scanners/bigint/bigint-not-safe.js +34 -0
  148. package/dist/core/scanners/date/date-is-before-epoch.d.ts +19 -0
  149. package/dist/core/scanners/date/date-is-before-epoch.js +32 -0
  150. package/dist/core/scanners/date/date-is-far-future.d.ts +19 -0
  151. package/dist/core/scanners/date/date-is-far-future.js +32 -0
  152. package/dist/core/scanners/date/date-is-invalid.d.ts +19 -0
  153. package/dist/core/scanners/date/date-is-invalid.js +31 -0
  154. package/dist/core/scanners/index.d.ts +31 -0
  155. package/dist/core/scanners/index.js +58 -0
  156. package/dist/core/scanners/number/number-is-infinite.d.ts +19 -0
  157. package/dist/core/scanners/number/number-is-infinite.js +31 -0
  158. package/dist/core/scanners/number/number-is-nan.d.ts +19 -0
  159. package/dist/core/scanners/number/number-is-nan.js +31 -0
  160. package/dist/core/scanners/number/number-is-too-large.d.ts +20 -0
  161. package/dist/core/scanners/number/number-is-too-large.js +33 -0
  162. package/dist/core/scanners/number/number-is-unsafe-integer.d.ts +19 -0
  163. package/dist/core/scanners/number/number-is-unsafe-integer.js +31 -0
  164. package/dist/core/scanners/object/object-has-circular-references.d.ts +20 -0
  165. package/dist/core/scanners/object/object-has-circular-references.js +43 -0
  166. package/dist/core/scanners/object/object-has-many-keys.d.ts +19 -0
  167. package/dist/core/scanners/object/object-has-many-keys.js +33 -0
  168. package/dist/core/scanners/object/object-is-deep.d.ts +20 -0
  169. package/dist/core/scanners/object/object-is-deep.js +38 -0
  170. package/dist/core/scanners/scanner-registry.d.ts +19 -0
  171. package/dist/core/scanners/scanner-registry.js +36 -0
  172. package/dist/core/scanners/string/string-has-unsafe-unicode.d.ts +19 -0
  173. package/dist/core/scanners/string/string-has-unsafe-unicode.js +32 -0
  174. package/dist/core/scanners/string/string-has-whitespace-edges.d.ts +19 -0
  175. package/dist/core/scanners/string/string-has-whitespace-edges.js +31 -0
  176. package/dist/core/scanners/string/string-is-long.d.ts +19 -0
  177. package/dist/core/scanners/string/string-is-long.js +32 -0
  178. package/dist/core/scanners/unknown/unknown-not-scannable.d.ts +21 -0
  179. package/dist/core/scanners/unknown/unknown-not-scannable.js +34 -0
  180. package/dist/core/shapes/analysis.d.ts +239 -0
  181. package/dist/core/shapes/analysis.js +11 -0
  182. package/dist/core/shapes/boundary.d.ts +126 -0
  183. package/dist/core/shapes/boundary.js +11 -0
  184. package/dist/core/shapes/events.d.ts +83 -0
  185. package/dist/core/shapes/events.js +10 -0
  186. package/dist/core/shapes/field-path.d.ts +51 -0
  187. package/dist/core/shapes/field-path.js +10 -0
  188. package/dist/core/shapes/index.d.ts +21 -0
  189. package/dist/core/shapes/index.js +11 -0
  190. package/dist/core/shapes/normalize.d.ts +59 -0
  191. package/dist/core/shapes/normalize.js +11 -0
  192. package/dist/core/shapes/parse.d.ts +75 -0
  193. package/dist/core/shapes/parse.js +11 -0
  194. package/dist/core/shapes/pipeline.d.ts +149 -0
  195. package/dist/core/shapes/pipeline.js +11 -0
  196. package/dist/core/shapes/policy.d.ts +158 -0
  197. package/dist/core/shapes/policy.js +11 -0
  198. package/dist/core/shapes/public.d.ts +92 -0
  199. package/dist/core/shapes/public.js +10 -0
  200. package/dist/core/shapes/scan.d.ts +126 -0
  201. package/dist/core/shapes/scan.js +11 -0
  202. package/dist/core/shapes/validate.d.ts +65 -0
  203. package/dist/core/shapes/validate.js +11 -0
  204. package/dist/core/validators/array/array-max-items.d.ts +25 -0
  205. package/dist/core/validators/array/array-max-items.js +42 -0
  206. package/dist/core/validators/array/array-min-items.d.ts +25 -0
  207. package/dist/core/validators/array/array-min-items.js +42 -0
  208. package/dist/core/validators/array/array.d.ts +22 -0
  209. package/dist/core/validators/array/array.js +34 -0
  210. package/dist/core/validators/array/excludes.d.ts +25 -0
  211. package/dist/core/validators/array/excludes.js +47 -0
  212. package/dist/core/validators/array/has-unique-items.d.ts +24 -0
  213. package/dist/core/validators/array/has-unique-items.js +46 -0
  214. package/dist/core/validators/array/includes.d.ts +24 -0
  215. package/dist/core/validators/array/includes.js +46 -0
  216. package/dist/core/validators/array/items-equal.d.ts +25 -0
  217. package/dist/core/validators/array/items-equal.js +42 -0
  218. package/dist/core/validators/array/no-empty-string-items.d.ts +24 -0
  219. package/dist/core/validators/array/no-empty-string-items.js +46 -0
  220. package/dist/core/validators/array/no-null-items.d.ts +24 -0
  221. package/dist/core/validators/array/no-null-items.js +46 -0
  222. package/dist/core/validators/array/no-undefined-items.d.ts +24 -0
  223. package/dist/core/validators/array/no-undefined-items.js +45 -0
  224. package/dist/core/validators/array/non-empty-array.d.ts +24 -0
  225. package/dist/core/validators/array/non-empty-array.js +45 -0
  226. package/dist/core/validators/array/not-sparse.d.ts +25 -0
  227. package/dist/core/validators/array/not-sparse.js +44 -0
  228. package/dist/core/validators/bigint/bigint-equals.d.ts +24 -0
  229. package/dist/core/validators/bigint/bigint-equals.js +57 -0
  230. package/dist/core/validators/bigint/bigint-max.d.ts +25 -0
  231. package/dist/core/validators/bigint/bigint-max.js +63 -0
  232. package/dist/core/validators/bigint/bigint-min.d.ts +25 -0
  233. package/dist/core/validators/bigint/bigint-min.js +87 -0
  234. package/dist/core/validators/bigint/bigint-negative.d.ts +23 -0
  235. package/dist/core/validators/bigint/bigint-negative.js +73 -0
  236. package/dist/core/validators/bigint/bigint-non-negative.d.ts +24 -0
  237. package/dist/core/validators/bigint/bigint-non-negative.js +72 -0
  238. package/dist/core/validators/bigint/bigint-non-positive.d.ts +24 -0
  239. package/dist/core/validators/bigint/bigint-non-positive.js +72 -0
  240. package/dist/core/validators/bigint/bigint-positive.d.ts +24 -0
  241. package/dist/core/validators/bigint/bigint-positive.js +72 -0
  242. package/dist/core/validators/bigint/bigint-safe.d.ts +25 -0
  243. package/dist/core/validators/bigint/bigint-safe.js +75 -0
  244. package/dist/core/validators/bigint/bigint.d.ts +20 -0
  245. package/dist/core/validators/bigint/bigint.js +38 -0
  246. package/dist/core/validators/boolean/boolean.d.ts +21 -0
  247. package/dist/core/validators/boolean/boolean.js +39 -0
  248. package/dist/core/validators/boolean/is-false.d.ts +22 -0
  249. package/dist/core/validators/boolean/is-false.js +48 -0
  250. package/dist/core/validators/boolean/is-true.d.ts +22 -0
  251. package/dist/core/validators/boolean/is-true.js +48 -0
  252. package/dist/core/validators/common/is-country-code.d.ts +17 -0
  253. package/dist/core/validators/common/is-country-code.js +36 -0
  254. package/dist/core/validators/common/is-currency-code.d.ts +17 -0
  255. package/dist/core/validators/common/is-currency-code.js +36 -0
  256. package/dist/core/validators/common/is-email-strict.d.ts +17 -0
  257. package/dist/core/validators/common/is-email-strict.js +36 -0
  258. package/dist/core/validators/common/is-email.d.ts +17 -0
  259. package/dist/core/validators/common/is-email.js +36 -0
  260. package/dist/core/validators/common/is-ip.d.ts +17 -0
  261. package/dist/core/validators/common/is-ip.js +37 -0
  262. package/dist/core/validators/common/is-phone-strict.d.ts +17 -0
  263. package/dist/core/validators/common/is-phone-strict.js +36 -0
  264. package/dist/core/validators/common/is-phone.d.ts +17 -0
  265. package/dist/core/validators/common/is-phone.js +36 -0
  266. package/dist/core/validators/common/is-port.d.ts +17 -0
  267. package/dist/core/validators/common/is-port.js +35 -0
  268. package/dist/core/validators/common/is-postal-code.d.ts +17 -0
  269. package/dist/core/validators/common/is-postal-code.js +36 -0
  270. package/dist/core/validators/common/is-url.d.ts +17 -0
  271. package/dist/core/validators/common/is-url.js +38 -0
  272. package/dist/core/validators/common/is-uuid.d.ts +17 -0
  273. package/dist/core/validators/common/is-uuid.js +36 -0
  274. package/dist/core/validators/date/before-epoch.d.ts +28 -0
  275. package/dist/core/validators/date/before-epoch.js +56 -0
  276. package/dist/core/validators/date/date-now-required.d.ts +22 -0
  277. package/dist/core/validators/date/date-now-required.js +48 -0
  278. package/dist/core/validators/date/is-date.d.ts +21 -0
  279. package/dist/core/validators/date/is-date.js +47 -0
  280. package/dist/core/validators/date/is-far-future.d.ts +23 -0
  281. package/dist/core/validators/date/is-far-future.js +46 -0
  282. package/dist/core/validators/date/is-future.d.ts +24 -0
  283. package/dist/core/validators/date/is-future.js +59 -0
  284. package/dist/core/validators/date/is-past.d.ts +24 -0
  285. package/dist/core/validators/date/is-past.js +59 -0
  286. package/dist/core/validators/date/not-after.d.ts +25 -0
  287. package/dist/core/validators/date/not-after.js +66 -0
  288. package/dist/core/validators/date/not-before.d.ts +25 -0
  289. package/dist/core/validators/date/not-before.js +66 -0
  290. package/dist/core/validators/date/same-day.d.ts +25 -0
  291. package/dist/core/validators/date/same-day.js +60 -0
  292. package/dist/core/validators/date/same-month.d.ts +25 -0
  293. package/dist/core/validators/date/same-month.js +59 -0
  294. package/dist/core/validators/date/same-year.d.ts +24 -0
  295. package/dist/core/validators/date/same-year.js +56 -0
  296. package/dist/core/validators/date/too-early.d.ts +25 -0
  297. package/dist/core/validators/date/too-early.js +57 -0
  298. package/dist/core/validators/date/too-late.d.ts +25 -0
  299. package/dist/core/validators/date/too-late.js +57 -0
  300. package/dist/core/validators/date/weekday.d.ts +32 -0
  301. package/dist/core/validators/date/weekday.js +65 -0
  302. package/dist/core/validators/date/weekend.d.ts +27 -0
  303. package/dist/core/validators/date/weekend.js +56 -0
  304. package/dist/core/validators/index.d.ts +112 -0
  305. package/dist/core/validators/index.js +139 -0
  306. package/dist/core/validators/nullish/is-null-or-undefined.d.ts +22 -0
  307. package/dist/core/validators/nullish/is-null-or-undefined.js +40 -0
  308. package/dist/core/validators/nullish/is-null.d.ts +21 -0
  309. package/dist/core/validators/nullish/is-null.js +39 -0
  310. package/dist/core/validators/nullish/is-undefined.d.ts +21 -0
  311. package/dist/core/validators/nullish/is-undefined.js +39 -0
  312. package/dist/core/validators/number/finite.d.ts +22 -0
  313. package/dist/core/validators/number/finite.js +40 -0
  314. package/dist/core/validators/number/integer.d.ts +22 -0
  315. package/dist/core/validators/number/integer.js +40 -0
  316. package/dist/core/validators/number/less-than.d.ts +21 -0
  317. package/dist/core/validators/number/less-than.js +39 -0
  318. package/dist/core/validators/number/max.d.ts +21 -0
  319. package/dist/core/validators/number/max.js +39 -0
  320. package/dist/core/validators/number/min.d.ts +21 -0
  321. package/dist/core/validators/number/min.js +39 -0
  322. package/dist/core/validators/number/more-than.d.ts +21 -0
  323. package/dist/core/validators/number/more-than.js +39 -0
  324. package/dist/core/validators/number/negative.d.ts +20 -0
  325. package/dist/core/validators/number/negative.js +38 -0
  326. package/dist/core/validators/number/non-negative.d.ts +19 -0
  327. package/dist/core/validators/number/non-negative.js +37 -0
  328. package/dist/core/validators/number/non-positive.d.ts +19 -0
  329. package/dist/core/validators/number/non-positive.js +37 -0
  330. package/dist/core/validators/number/number.d.ts +19 -0
  331. package/dist/core/validators/number/number.js +31 -0
  332. package/dist/core/validators/number/positive.d.ts +20 -0
  333. package/dist/core/validators/number/positive.js +38 -0
  334. package/dist/core/validators/number/safe-integer.d.ts +19 -0
  335. package/dist/core/validators/number/safe-integer.js +42 -0
  336. package/dist/core/validators/object/deep-equals.d.ts +24 -0
  337. package/dist/core/validators/object/deep-equals.js +47 -0
  338. package/dist/core/validators/object/has-key.d.ts +23 -0
  339. package/dist/core/validators/object/has-key.js +42 -0
  340. package/dist/core/validators/object/has-value.d.ts +27 -0
  341. package/dist/core/validators/object/has-value.js +59 -0
  342. package/dist/core/validators/object/keys-equal.d.ts +26 -0
  343. package/dist/core/validators/object/keys-equal.js +47 -0
  344. package/dist/core/validators/object/max-keys.d.ts +24 -0
  345. package/dist/core/validators/object/max-keys.js +43 -0
  346. package/dist/core/validators/object/min-keys.d.ts +24 -0
  347. package/dist/core/validators/object/min-keys.js +43 -0
  348. package/dist/core/validators/object/missing-key.d.ts +23 -0
  349. package/dist/core/validators/object/missing-key.js +42 -0
  350. package/dist/core/validators/object/no-empty-array-values.d.ts +23 -0
  351. package/dist/core/validators/object/no-empty-array-values.js +44 -0
  352. package/dist/core/validators/object/no-empty-object-values.d.ts +23 -0
  353. package/dist/core/validators/object/no-empty-object-values.js +44 -0
  354. package/dist/core/validators/object/no-null-values.d.ts +23 -0
  355. package/dist/core/validators/object/no-null-values.js +44 -0
  356. package/dist/core/validators/object/no-undefined-values.d.ts +23 -0
  357. package/dist/core/validators/object/no-undefined-values.js +44 -0
  358. package/dist/core/validators/object/non-empty-object.d.ts +21 -0
  359. package/dist/core/validators/object/non-empty-object.js +40 -0
  360. package/dist/core/validators/object/only-keys.d.ts +23 -0
  361. package/dist/core/validators/object/only-keys.js +43 -0
  362. package/dist/core/validators/object/plain-object.d.ts +22 -0
  363. package/dist/core/validators/object/plain-object.js +35 -0
  364. package/dist/core/validators/string/alpha-num.d.ts +23 -0
  365. package/dist/core/validators/string/alpha-num.js +50 -0
  366. package/dist/core/validators/string/alpha.d.ts +24 -0
  367. package/dist/core/validators/string/alpha.js +51 -0
  368. package/dist/core/validators/string/chars-equal.d.ts +23 -0
  369. package/dist/core/validators/string/chars-equal.js +49 -0
  370. package/dist/core/validators/string/ends-with.d.ts +23 -0
  371. package/dist/core/validators/string/ends-with.js +50 -0
  372. package/dist/core/validators/string/is-ascii.d.ts +24 -0
  373. package/dist/core/validators/string/is-ascii.js +53 -0
  374. package/dist/core/validators/string/is-printable.d.ts +25 -0
  375. package/dist/core/validators/string/is-printable.js +53 -0
  376. package/dist/core/validators/string/matches.d.ts +23 -0
  377. package/dist/core/validators/string/matches.js +50 -0
  378. package/dist/core/validators/string/max-length.d.ts +24 -0
  379. package/dist/core/validators/string/max-length.js +50 -0
  380. package/dist/core/validators/string/min-length.d.ts +24 -0
  381. package/dist/core/validators/string/min-length.js +50 -0
  382. package/dist/core/validators/string/no-lead-space.d.ts +23 -0
  383. package/dist/core/validators/string/no-lead-space.js +50 -0
  384. package/dist/core/validators/string/no-repeat-space.d.ts +25 -0
  385. package/dist/core/validators/string/no-repeat-space.js +52 -0
  386. package/dist/core/validators/string/no-space.d.ts +24 -0
  387. package/dist/core/validators/string/no-space.js +51 -0
  388. package/dist/core/validators/string/no-trail-space.d.ts +23 -0
  389. package/dist/core/validators/string/no-trail-space.js +50 -0
  390. package/dist/core/validators/string/non-empty.d.ts +22 -0
  391. package/dist/core/validators/string/non-empty.js +48 -0
  392. package/dist/core/validators/string/not-one-of.d.ts +24 -0
  393. package/dist/core/validators/string/not-one-of.js +51 -0
  394. package/dist/core/validators/string/num-string.d.ts +23 -0
  395. package/dist/core/validators/string/num-string.js +50 -0
  396. package/dist/core/validators/string/one-of.d.ts +23 -0
  397. package/dist/core/validators/string/one-of.js +50 -0
  398. package/dist/core/validators/string/starts-with.d.ts +23 -0
  399. package/dist/core/validators/string/starts-with.js +50 -0
  400. package/dist/core/validators/string/string.d.ts +21 -0
  401. package/dist/core/validators/string/string.js +39 -0
  402. package/dist/core/validators/string/trimmed.d.ts +24 -0
  403. package/dist/core/validators/string/trimmed.js +51 -0
  404. package/dist/index.d.ts +83 -0
  405. package/dist/index.js +26 -0
  406. package/dist/test.d.ts +1 -0
  407. package/dist/test.js +12 -0
  408. package/package.json +2 -2
@@ -0,0 +1,32 @@
1
+ /**
2
+ * ----------------------------------------------------------------------------
3
+ * Scanners | String Is Long
4
+ * ----------------------------------------------------------------------------
5
+ * @package @clementine-solutions/jane
6
+ * @description Warns when text exceeds a conservative length threshold,
7
+ * highlighting oversized or potentially adversarial input.
8
+ * @see https://jane-io.com
9
+ * ----------------------------------------------------------------------------
10
+ */
11
+ import { scanEvent } from '../../pipeline';
12
+ /* ——— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ——— *\
13
+ |* Implementation *|
14
+ \* ——— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ——— */
15
+ /**
16
+ * Warns when a string exceeds a conservative maximum length.
17
+ *
18
+ * Extremely long text can signal malformed payloads, denial‑of‑service
19
+ * attempts, or unbounded user input. This rule surfaces oversized strings
20
+ * early so containment and validation layers can respond safely.
21
+ */
22
+ export const stringIsLong = (raw, path) => {
23
+ if (typeof raw !== 'string')
24
+ return [];
25
+ const max = 10_000;
26
+ if (raw.length > max) {
27
+ return [
28
+ scanEvent('warn', 'string.is.long', path, `String length ${raw.length} exceeds safe threshold ${max}.`, 'This text is very long.', { length: raw.length, max }),
29
+ ];
30
+ }
31
+ return [];
32
+ };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * ----------------------------------------------------------------------------
3
+ * Scanners | Unknown Not Scannable
4
+ * ----------------------------------------------------------------------------
5
+ * @package @clementine-solutions/jane
6
+ * @description Flags values whose structural type cannot be determined,
7
+ * surfacing opaque or unpredictable inputs that cannot be
8
+ * scanned safely.
9
+ * @see https://jane-io.com
10
+ * ----------------------------------------------------------------------------
11
+ */
12
+ import type { ScanRule } from '../../shapes';
13
+ /**
14
+ * Flags values whose structural type cannot be determined.
15
+ *
16
+ * Unknown values have no predictable shape, traversal semantics, or guarantees
17
+ * about behavior. They may be callable, throw on access, or vary across realms.
18
+ * This rule surfaces opaque inputs early so containment, validation, and policy
19
+ * layers can decide how to handle them safely.
20
+ */
21
+ export declare const unknownNotScannable: ScanRule;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * ----------------------------------------------------------------------------
3
+ * Scanners | Unknown Not Scannable
4
+ * ----------------------------------------------------------------------------
5
+ * @package @clementine-solutions/jane
6
+ * @description Flags values whose structural type cannot be determined,
7
+ * surfacing opaque or unpredictable inputs that cannot be
8
+ * scanned safely.
9
+ * @see https://jane-io.com
10
+ * ----------------------------------------------------------------------------
11
+ */
12
+ /* ——— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ——— *\
13
+ |* Internal Modules *|
14
+ \* ——— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ——— */
15
+ import { detectStructuralType } from '../../../core/pipeline';
16
+ import { scanEvent } from '../../pipeline';
17
+ /* ——— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ——— *\
18
+ |* Implementation *|
19
+ \* ——— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ————— * ——— */
20
+ /**
21
+ * Flags values whose structural type cannot be determined.
22
+ *
23
+ * Unknown values have no predictable shape, traversal semantics, or guarantees
24
+ * about behavior. They may be callable, throw on access, or vary across realms.
25
+ * This rule surfaces opaque inputs early so containment, validation, and policy
26
+ * layers can decide how to handle them safely.
27
+ */
28
+ export const unknownNotScannable = (raw, path) => {
29
+ if (detectStructuralType(raw) !== 'unknown')
30
+ return [];
31
+ return [
32
+ scanEvent('warn', 'unknown.not.scannable', path, 'Value has an unknown structural type and cannot be scanned safely.', 'This value cannot be scanned safely.', { value: raw }),
33
+ ];
34
+ };
@@ -0,0 +1,239 @@
1
+ /**
2
+ * ----------------------------------------------------------------------------
3
+ * Shapes | Analysis
4
+ * ----------------------------------------------------------------------------
5
+ * @package @clementine-solutions/jane
6
+ * @description Shapes that define the structures used for diff, explain,
7
+ * replay, and telemetry analysis.
8
+ * @see https://jane-io.com
9
+ * ----------------------------------------------------------------------------
10
+ */
11
+ import type { FieldPath, JaneEvent, PipelineResult } from '.';
12
+ /**
13
+ * Represents a single structural difference between two values.
14
+ *
15
+ * Captures the field path, the nature of the change, and the before/after
16
+ * snapshots used for diff, explain, and replay analysis.
17
+ */
18
+ export interface DiffEntry {
19
+ readonly path: FieldPath;
20
+ readonly kind: 'added' | 'removed' | 'changed';
21
+ readonly before?: unknown;
22
+ readonly after?: unknown;
23
+ }
24
+ /**
25
+ * Computes the structural differences between two values.
26
+ *
27
+ * Produces a diff result describing all added, removed, and changed
28
+ * paths for downstream analysis.
29
+ */
30
+ export type DiffFunction = (before: unknown, after: unknown) => DiffResult;
31
+ /**
32
+ * The complete set of structural differences between two values.
33
+ *
34
+ * Contains the ordered list of diff entries used by explain and replay
35
+ * to interpret or reconstruct changes.
36
+ */
37
+ export interface DiffResult {
38
+ readonly entries: readonly DiffEntry[];
39
+ }
40
+ /**
41
+ * Produces a narrative explanation of pipeline behavior.
42
+ *
43
+ * Consumes events from each stage and an optional diff to generate a
44
+ * step‑wise account of hazards, changes, and errors.
45
+ */
46
+ export type ExplainFunction = (input: {
47
+ scanEvents: readonly JaneEvent[];
48
+ normalizationEvents: readonly JaneEvent[];
49
+ parseEvents: readonly JaneEvent[];
50
+ validationEvents: readonly JaneEvent[];
51
+ diff?: DiffResult;
52
+ }) => ExplainResult;
53
+ /**
54
+ * A structured narrative describing how the pipeline processed a value.
55
+ *
56
+ * Contains the ordered explanation steps that summarize hazards,
57
+ * changes, and errors across all stages.
58
+ */
59
+ export interface ExplainResult {
60
+ readonly steps: readonly ExplainStep[];
61
+ }
62
+ /**
63
+ * A single explanatory step in the pipeline narrative.
64
+ *
65
+ * Identifies the stage, kind, and code involved, with optional path and
66
+ * message to clarify the meaning of the event.
67
+ */
68
+ export interface ExplainStep {
69
+ readonly path?: FieldPath;
70
+ readonly stage: 'scan' | 'normalize' | 'parse' | 'validate' | 'decide';
71
+ readonly kind: 'hazard' | 'change' | 'error';
72
+ readonly code: string;
73
+ readonly message?: string;
74
+ }
75
+ /**
76
+ * Reconstructs intermediate states by replaying diff entries.
77
+ *
78
+ * Applies each diff step in order to show how the value evolved from
79
+ * its original form to the final normalized or parsed state.
80
+ */
81
+ export type ReplayFunction = (input: {
82
+ before: unknown;
83
+ diff: readonly DiffEntry[];
84
+ }) => ReplayResult;
85
+ /**
86
+ * The full sequence of replayed states derived from a diff.
87
+ *
88
+ * Contains each intermediate step, allowing contributors to inspect how
89
+ * structural changes accumulated over time.
90
+ */
91
+ export interface ReplayResult {
92
+ readonly steps: readonly ReplayStep[];
93
+ }
94
+ /**
95
+ * A single step in the replay sequence.
96
+ *
97
+ * Records the diff entry applied and the resulting state after that
98
+ * change, enabling step‑wise reconstruction of value evolution.
99
+ */
100
+ export interface ReplayStep {
101
+ readonly index: number;
102
+ readonly entry: DiffEntry;
103
+ readonly state: unknown;
104
+ }
105
+ /**
106
+ * Receives the emitted telemetry records for a pipeline run.
107
+ *
108
+ * Allows callers to collect, store, or forward stage‑level telemetry
109
+ * without coupling the pipeline to any specific transport or backend.
110
+ */
111
+ export type TelemetrySink = (records: readonly TelemetryRecord[]) => void;
112
+ /**
113
+ * Enumerates all pipeline stages that can emit telemetry.
114
+ *
115
+ * Used to tag records with their originating phase for analysis,
116
+ * auditing, and observability.
117
+ */
118
+ export type TelemetryStage = 'scan' | 'normalize' | 'validate' | 'parse' | 'diff' | 'explain' | 'replay' | 'decide';
119
+ /**
120
+ * Common metadata shared by all telemetry records.
121
+ *
122
+ * Identifies the boundary, pipeline, timestamp, and originating stage,
123
+ * forming the structural foundation for all telemetry entries.
124
+ */
125
+ export interface TelemetryRecordBase {
126
+ readonly boundary: string;
127
+ readonly pipeline: string;
128
+ readonly timestamp: string;
129
+ readonly stage: TelemetryStage;
130
+ }
131
+ /**
132
+ * Telemetry emitted from the scan stage.
133
+ *
134
+ * Captures all scan events, including hazards, errors, and structural
135
+ * findings discovered before normalization or parsing.
136
+ */
137
+ export interface TelemetryScanRecord extends TelemetryRecordBase {
138
+ readonly stage: 'scan';
139
+ readonly events: readonly JaneEvent[];
140
+ }
141
+ /**
142
+ * Telemetry emitted from the normalization stage.
143
+ *
144
+ * Records all normalization events that shaped the safe or adjusted
145
+ * value prior to parsing or validation.
146
+ */
147
+ export interface TelemetryNormalizeRecord extends TelemetryRecordBase {
148
+ readonly stage: 'normalize';
149
+ readonly events: readonly JaneEvent[];
150
+ }
151
+ /**
152
+ * Telemetry emitted from the parse stage.
153
+ *
154
+ * Captures parser‑driven transformations and any associated events
155
+ * produced while interpreting the normalized value.
156
+ */
157
+ export interface TelemetryParseRecord extends TelemetryRecordBase {
158
+ readonly stage: 'parse';
159
+ readonly events: readonly JaneEvent[];
160
+ }
161
+ /**
162
+ * Telemetry emitted from the validation stage.
163
+ *
164
+ * Records all validation events, including rule outcomes and any
165
+ * issues that contribute to the final decision.
166
+ */
167
+ export interface TelemetryValidateRecord extends TelemetryRecordBase {
168
+ readonly stage: 'validate';
169
+ readonly events: readonly JaneEvent[];
170
+ }
171
+ /**
172
+ * Telemetry emitted from the diff stage.
173
+ *
174
+ * Contains the structural differences between the safe and normalized
175
+ * values, supporting explain and replay analysis.
176
+ */
177
+ export interface TelemetryDiffRecord extends TelemetryRecordBase {
178
+ readonly stage: 'diff';
179
+ readonly diff: DiffResult;
180
+ }
181
+ /**
182
+ * Telemetry emitted from the explain stage.
183
+ *
184
+ * Provides the narrative explanation of how the pipeline processed the
185
+ * value across all stages.
186
+ */
187
+ export interface TelemetryExplainRecord extends TelemetryRecordBase {
188
+ readonly stage: 'explain';
189
+ readonly explain: ExplainResult;
190
+ }
191
+ /**
192
+ * Telemetry emitted from the replay stage.
193
+ *
194
+ * Contains the reconstructed intermediate states derived from applying
195
+ * diff entries step‑by‑step.
196
+ */
197
+ export interface TelemetryReplayRecord extends TelemetryRecordBase {
198
+ readonly stage: 'replay';
199
+ readonly replay: ReplayResult;
200
+ }
201
+ /**
202
+ * Telemetry emitted from the decision stage.
203
+ *
204
+ * Records the final decision code, policy mode, and total event count,
205
+ * providing a compact summary of the pipeline outcome.
206
+ */
207
+ export interface TelemetryDecideRecord extends TelemetryRecordBase {
208
+ readonly stage: 'decide';
209
+ readonly decision: string;
210
+ readonly mode: string;
211
+ readonly eventCount: number;
212
+ }
213
+ /**
214
+ * Union of all telemetry record types.
215
+ *
216
+ * Represents any stage‑specific telemetry entry emitted during a
217
+ * pipeline run.
218
+ */
219
+ export type TelemetryRecord = TelemetryScanRecord | TelemetryNormalizeRecord | TelemetryParseRecord | TelemetryValidateRecord | TelemetryDiffRecord | TelemetryExplainRecord | TelemetryReplayRecord | TelemetryDecideRecord;
220
+ /**
221
+ * Container for all telemetry emitted during a pipeline run.
222
+ *
223
+ * Provides the complete ordered sequence of stage‑level records for
224
+ * analysis, debugging, or external reporting.
225
+ */
226
+ export interface TelemetryResult {
227
+ readonly records: readonly TelemetryRecord[];
228
+ }
229
+ /**
230
+ * Context passed to the telemetry generator.
231
+ *
232
+ * Supplies the boundary and pipeline names along with the full pipeline
233
+ * result, enabling stage‑aware telemetry construction.
234
+ */
235
+ export interface TelemetryContext<T> {
236
+ readonly boundaryName: string;
237
+ readonly pipelineName: string;
238
+ readonly result: PipelineResult<T>;
239
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * ----------------------------------------------------------------------------
3
+ * Shapes | Analysis
4
+ * ----------------------------------------------------------------------------
5
+ * @package @clementine-solutions/jane
6
+ * @description Shapes that define the structures used for diff, explain,
7
+ * replay, and telemetry analysis.
8
+ * @see https://jane-io.com
9
+ * ----------------------------------------------------------------------------
10
+ */
11
+ export {};
@@ -0,0 +1,126 @@
1
+ /**
2
+ * ----------------------------------------------------------------------------
3
+ * Shapes | Boundary
4
+ * ----------------------------------------------------------------------------
5
+ * @package @clementine-solutions/jane
6
+ * @description Shapes that define the structure, policy surface, and
7
+ * results of boundary evaluation.
8
+ * @see https://jane-io.com
9
+ * ----------------------------------------------------------------------------
10
+ */
11
+ import type { EventCode, FieldMetadata, JaneEvent, PipelineResult, Policy } from '.';
12
+ /**
13
+ * Context passed to boundary rules and reducers.
14
+ * Provides the evaluated fields, aggregated events and issues, resolved
15
+ * values, and the active policy for making boundary‑level decisions.
16
+ */
17
+ export interface BoundaryContext {
18
+ readonly policy: Policy;
19
+ readonly fields: Record<string, PipelineResult<unknown>>;
20
+ readonly issues: readonly JaneEvent[];
21
+ readonly events: readonly JaneEvent[];
22
+ readonly values: Record<string, unknown>;
23
+ }
24
+ /**
25
+ * Configuration surface for boundary‑level decision logic.
26
+ * Defines reject and review patterns, severity transforms, visibility
27
+ * filters, acceptance modes, value and metadata shaping, and optional
28
+ * rule and reducer hooks.
29
+ */
30
+ export interface BoundaryDecideConfig {
31
+ readonly reject?: readonly string[];
32
+ readonly review?: readonly string[];
33
+ readonly override?: Readonly<Partial<Record<EventCode, number>>>;
34
+ readonly escalate?: Readonly<Partial<Record<EventCode, number>>>;
35
+ readonly ignore?: readonly string[];
36
+ readonly hideEvents?: readonly string[];
37
+ readonly hideIssues?: readonly string[];
38
+ readonly accept?: 'all' | 'any' | 'strict' | 'partial';
39
+ readonly values?: {
40
+ readonly includeRejected?: boolean;
41
+ readonly includeUndefined?: boolean;
42
+ readonly transform?: (values: Record<string, unknown>) => Record<string, unknown>;
43
+ };
44
+ readonly metadata?: {
45
+ readonly includeFields?: boolean;
46
+ readonly includeTimestamps?: boolean;
47
+ readonly includeRunId?: boolean;
48
+ };
49
+ rules?: BoundaryRule[];
50
+ readonly reducer?: BoundaryReducer;
51
+ }
52
+ /**
53
+ * A reducer hook that can refine or override the boundary decision.
54
+ * Receives the full boundary context and may return a complete or
55
+ * partial decision, or perform side effects without returning a value.
56
+ */
57
+ export type BoundaryReducer = (ctx: BoundaryContext) => BoundaryDecision | Partial<BoundaryDecision> | void;
58
+ /**
59
+ * The final decision produced by boundary evaluation.
60
+ * Indicates acceptance and may override values, metadata, issues, or
61
+ * events before the result is returned to the caller.
62
+ */
63
+ export interface BoundaryDecision {
64
+ readonly ok: boolean;
65
+ readonly values?: Record<string, unknown>;
66
+ readonly metadata?: BoundaryMetadata;
67
+ readonly issues?: readonly JaneEvent[];
68
+ readonly events?: readonly JaneEvent[];
69
+ }
70
+ /**
71
+ * Input to a boundary evaluation.
72
+ * Supplies the evaluated field results and an optional policy to guide
73
+ * decision logic and shaping.
74
+ */
75
+ export interface BoundaryInput {
76
+ readonly policy?: Policy;
77
+ readonly fields: Record<string, PipelineResult<unknown>>;
78
+ }
79
+ /**
80
+ * Execution‑level metadata for a boundary evaluation.
81
+ * Records timing, identifiers, field metadata, naming, and enabled
82
+ * analysis features for auditing and reporting.
83
+ */
84
+ export interface BoundaryMetadata {
85
+ readonly runId?: string;
86
+ readonly startedAt?: string;
87
+ readonly finishedAt?: string;
88
+ readonly durationMs?: number;
89
+ readonly fields: Record<string, FieldMetadata>;
90
+ readonly boundaryName?: string;
91
+ readonly pipelineName?: string;
92
+ readonly analysis?: {
93
+ readonly diff?: boolean;
94
+ readonly explain?: boolean;
95
+ readonly replay?: boolean;
96
+ readonly telemetry?: boolean;
97
+ };
98
+ }
99
+ /**
100
+ * A boundary‑level rule that can emit additional events or issues.
101
+ * Operates on the full boundary context and may refine the decision
102
+ * indirectly through its outputs.
103
+ */
104
+ export type BoundaryRule = (ctx: BoundaryContext) => BoundaryRuleResult | Promise<BoundaryRuleResult>;
105
+ /**
106
+ * Output produced by a boundary rule.
107
+ * Allows rules to contribute events or issues that participate in the
108
+ * final boundary decision.
109
+ */
110
+ export interface BoundaryRuleResult {
111
+ events?: JaneEvent[];
112
+ issues?: JaneEvent[];
113
+ }
114
+ /**
115
+ * The complete result of boundary evaluation.
116
+ * Contains the final acceptance state, shaped values, aggregated field
117
+ * results, emitted events and issues, and execution metadata.
118
+ */
119
+ export interface BoundaryResult {
120
+ ok: boolean;
121
+ issues?: readonly JaneEvent[];
122
+ events?: readonly JaneEvent[];
123
+ values?: Record<string, unknown>;
124
+ fields: Record<string, PipelineResult<unknown>>;
125
+ metadata: BoundaryMetadata;
126
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * ----------------------------------------------------------------------------
3
+ * Shapes | Boundary
4
+ * ----------------------------------------------------------------------------
5
+ * @package @clementine-solutions/jane
6
+ * @description Shapes that define the structure, policy surface, and
7
+ * results of boundary evaluation.
8
+ * @see https://jane-io.com
9
+ * ----------------------------------------------------------------------------
10
+ */
11
+ export {};
@@ -0,0 +1,83 @@
1
+ /**
2
+ * ----------------------------------------------------------------------------
3
+ * Shapes | Event
4
+ * ----------------------------------------------------------------------------
5
+ * @package @clementine-solutions/jane
6
+ * @description Structured observations emitted by each pipeline phase.
7
+ * @see https://jane-io.com
8
+ * ----------------------------------------------------------------------------
9
+ */
10
+ import type { FieldPath, PipelinePhase } from '../shapes';
11
+ /**
12
+ * Canonical list of all event codes emitted anywhere in the pipeline.
13
+ *
14
+ * Each literal represents a stable, public identifier used by scan, parse,
15
+ * normalize, validate, boundary, and policy stages. Codes are intentionally
16
+ * explicit and human‑readable so contributors can reason about behavior,
17
+ * write policies, and interpret explain/diff/replay output without guessing.
18
+ *
19
+ * This union is closed: adding or removing codes is a versioned change.
20
+ * Downstream tools rely on these strings for matching, grouping, and
21
+ * telemetry, so edits should be deliberate and documented.
22
+ */
23
+ export type EventCode = 'array.has.empty-strings' | 'array.has.invalid-length' | 'array.has.invalid-value' | 'array.has.null-items' | 'array.has.undefined-items' | 'array.is.deep' | 'array.is.empty' | 'array.is.heterogeneous' | 'array.is.large' | 'array.is.missing-value' | 'array.is.sparse' | 'array.not.array' | 'array.not.unique' | 'array.now.compacted' | 'array.now.flattened' | 'array.too.short' | 'array.too.long' | 'array.without.empty-strings' | 'array.without.null-items' | 'array.without.undefined-items' | 'bigint.is.large' | 'bigint.not.bigint' | 'bigint.not.equal' | 'bigint.not.in-range' | 'bigint.not.negative' | 'bigint.not.positive' | 'bigint.not.non-negative' | 'bigint.not.non-positive' | 'bigint.not.safe' | 'bigint.not.string' | 'bigint.too.large' | 'bigint.too.small' | 'boolean.not.boolean' | 'boolean.not.false' | 'boolean.not.true' | 'boundary.cannot.allow-unknown' | 'boundary.does.at-most-one' | 'boundary.does.mutual-exclusion' | 'boundary.does.require-all' | 'boundary.does.require-date-range' | 'boundary.does.require-field' | 'boundary.does.require-one' | 'boundary.fatal.error' | 'date.in.future' | 'date.in.past' | 'date.is.before-epoch' | 'date.is.far-future' | 'date.is.invalid' | 'date.not.after' | 'date.not.before' | 'date.not.date' | 'date.not.in-range' | 'date.not.same-day' | 'date.not.same-month' | 'date.not.same-year' | 'date.not.weekday' | 'date.not.weekend' | 'date.now.undefined' | 'date.too.early' | 'date.too.late' | 'error.while.normalizing' | 'error.while.parsing' | 'error.while.scanning' | 'error.while.validating' | 'map.has.circular-ref' | 'map.has.non-string-key' | 'map.is.empty' | 'map.is.large' | 'map.not.map' | 'map.too.large' | 'map.too.small' | 'number.is.too-large' | 'number.not.number' | 'number.not.zero' | 'number.not.finite' | 'number.not.integer' | 'number.not.float' | 'number.not.negative' | 'number.not.positive' | 'number.not.in-range' | 'number.not.in-port-range' | 'number.not.multiple-of' | 'number.not.non-negative' | 'number.not.non-positive' | 'number.not.safe-integer' | 'number.now.positive-zero' | 'number.now.undefined' | 'number.too.high' | 'number.too.low' | 'object.has.circular-references' | 'object.has.empty-array' | 'object.has.empty-object' | 'object.has.empty-string' | 'object.has.extra-key' | 'object.has.invalid-key' | 'object.has.invalid-key-length' | 'object.has.key' | 'object.has.many-keys' | 'object.has.missing-key' | 'object.has.missing-value' | 'object.has.null-value' | 'object.has.undefined-value' | 'object.is.deep' | 'object.is.empty' | 'object.not.deeply-equal' | 'object.not.object' | 'object.not.plain-object' | 'object.now.plain' | 'object.too.few-keys' | 'object.too.many-keys' | 'object.without.empty-arrays' | 'object.without.empty-objects' | 'object.without.empty-strings' | 'object.without.null-keys' | 'object.without.undefined-keys' | 'policy.is.moderate' | 'policy.is.strict' | 'scan.is.disabled' | 'scan.rule.checked' | 'set.has.circular-refs' | 'set.is.empty' | 'set.is.large' | 'set.not.set' | 'set.too.large' | 'set.too.small' | 'string.has.invalid-length' | 'string.has.leading-whitespace' | 'string.has.repeating-whitespace' | 'string.has.trailing-whitespace' | 'string.has.unsafe-unicode' | 'string.has.whitespace' | 'string.has.whitespace-edges' | 'string.is.disallowed' | 'string.is.empty' | 'string.is.long' | 'string.is.not-match' | 'string.too.long' | 'string.too.short' | 'string.must.end-with' | 'string.must.start-with' | 'string.not.allowed' | 'string.not.alpha' | 'string.not.alphanumeric' | 'string.not.ascii' | 'string.not.country-code' | 'string.not.currency-code' | 'string.not.email' | 'string.not.ip' | 'string.not.in-range' | 'string.not.numeric' | 'string.not.phone' | 'string.not.postal-code' | 'string.not.printable' | 'string.not.strict-email' | 'string.not.strict-phone' | 'string.not.string' | 'string.not.trimmed' | 'string.not.url' | 'string.not.uuid' | 'string.now.array' | 'string.now.bigint' | 'string.now.binary' | 'string.now.boolean' | 'string.now.collapsed' | 'string.now.date' | 'string.now.duration' | 'string.now.enum' | 'string.now.hex' | 'string.now.integer' | 'string.now.json' | 'string.now.number' | 'string.now.object' | 'string.now.octal' | 'string.now.parsed' | 'string.now.scientific' | 'string.now.trimmed' | 'string.now.undefined' | 'string.now.url' | 'type.not.valid' | 'unknown.not.scannable' | 'value.not.found' | 'value.not.null' | 'value.not.null-or-undefined' | 'value.not.undefined' | 'value.was.contained';
24
+ /**
25
+ * Severity level attached to an event as it moves through the pipeline.
26
+ *
27
+ * Kinds describe how the event should be interpreted, not whether the
28
+ * pipeline accepts or rejects a value. Policy makes those decisions.
29
+ *
30
+ * These literals are stable and intentionally minimal so contributors can
31
+ * classify events consistently across scan, parse, normalize, validate,
32
+ * boundary, and policy stages.
33
+ */
34
+ export type EventKind = 'info' | 'warn' | 'error' | 'fatal';
35
+ /**
36
+ * User‑supplied pattern used to match event codes in policy configuration.
37
+ *
38
+ * Patterns are plain strings. They may include wildcards or other matching
39
+ * syntax defined by the policy layer, but the type remains open so policy
40
+ * authors are not constrained by the EventCode union.
41
+ *
42
+ * This alias exists to distinguish user patterns from canonical event codes
43
+ * and to make intent clear at call sites.
44
+ */
45
+ export type EventPattern = string;
46
+ /**
47
+ * Structural filter used by policies to match specific events.
48
+ *
49
+ * A rule narrows the set of events a policy entry applies to. Each field is
50
+ * optional, and matching is exact: a rule only matches events whose path,
51
+ * code, kind, and phase equal the values provided here.
52
+ *
53
+ * Rules are intentionally minimal. They do not support patterns, wildcards,
54
+ * or partial matching. More complex behavior is composed by listing multiple
55
+ * rules rather than expanding this shape.
56
+ */
57
+ export interface EventRule {
58
+ readonly path?: FieldPath;
59
+ readonly code?: EventCode;
60
+ readonly kind?: EventKind;
61
+ readonly phase?: PipelinePhase;
62
+ }
63
+ /**
64
+ * Immutable fact emitted by any stage of the pipeline.
65
+ *
66
+ * A JaneEvent records what happened at a specific path: which phase produced
67
+ * it, how severe it is, and the stable code describing the condition. Events
68
+ * never encode decisions or control flow; they are observations only.
69
+ *
70
+ * Optional fields carry developer‑facing context (`message`), end‑user
71
+ * context (`userMessage`), the originating input name, and any structured
72
+ * metadata needed by tooling. All fields are stable and contributor‑visible.
73
+ */
74
+ export interface JaneEvent {
75
+ readonly phase: PipelinePhase;
76
+ readonly kind: EventKind;
77
+ readonly code: EventCode;
78
+ readonly message?: string;
79
+ readonly inputName?: string;
80
+ readonly userMessage?: string;
81
+ readonly path?: FieldPath;
82
+ readonly metadata?: Record<string, unknown>;
83
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * ----------------------------------------------------------------------------
3
+ * Shapes | Event
4
+ * ----------------------------------------------------------------------------
5
+ * @package @clementine-solutions/jane
6
+ * @description Structured observations emitted by each pipeline phase.
7
+ * @see https://jane-io.com
8
+ * ----------------------------------------------------------------------------
9
+ */
10
+ export {};
@@ -0,0 +1,51 @@
1
+ /**
2
+ * ----------------------------------------------------------------------------
3
+ * Shapes | Field Path
4
+ * ----------------------------------------------------------------------------
5
+ * @package @clementine-solutions/jane
6
+ * @description Structural paths that locate positions inside JSON‑like data.
7
+ * @see https://jane-io.com
8
+ * ----------------------------------------------------------------------------
9
+ */
10
+ /**
11
+ * A structured, lossless representation of a location inside a value.
12
+ *
13
+ * A FieldPath is an ordered list of segments, each describing a single step
14
+ * into an object or array. This avoids string parsing, keeps traversal
15
+ * deterministic, and provides a stable reference for validation, scanning,
16
+ * formatting, and boundary evaluation.
17
+ */
18
+ export interface FieldPath {
19
+ segments: FieldPathSegment[];
20
+ toString(): string;
21
+ inputName?: string;
22
+ }
23
+ /**
24
+ * A single step in a FieldPath.
25
+ *
26
+ * Segments are either object keys or array indexes. They never infer meaning
27
+ * and never encode both at once, ensuring paths remain literal and unambiguous
28
+ * across all pipeline stages.
29
+ */
30
+ export type FieldPathSegment = SegmentIndex | SegmentKey;
31
+ /**
32
+ * A segment that refers to an array index.
33
+ *
34
+ * Represents a concrete numeric position inside a list. Index segments keep
35
+ * array traversal stable and predictable for scanning, diff, and explain.
36
+ */
37
+ export interface SegmentIndex {
38
+ kind: 'index';
39
+ index: number;
40
+ }
41
+ /**
42
+ * A segment that refers to an object key.
43
+ *
44
+ * Stores the key exactly as encountered. No normalization or inference is
45
+ * applied, preserving the original structure for formatting, parsing, and
46
+ * boundary evaluation.
47
+ */
48
+ export interface SegmentKey {
49
+ kind: 'key';
50
+ key: string;
51
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * ----------------------------------------------------------------------------
3
+ * Shapes | Field Path
4
+ * ----------------------------------------------------------------------------
5
+ * @package @clementine-solutions/jane
6
+ * @description Structural paths that locate positions inside JSON‑like data.
7
+ * @see https://jane-io.com
8
+ * ----------------------------------------------------------------------------
9
+ */
10
+ export {};
@@ -0,0 +1,21 @@
1
+ /**
2
+ * ----------------------------------------------------------------------------
3
+ * Shapes | Barrel File
4
+ * ----------------------------------------------------------------------------
5
+ * @package @clementine-solutions/jane
6
+ * @description Central export surface for all shape families in this
7
+ * module.
8
+ * @see https://jane-io.com
9
+ * ----------------------------------------------------------------------------
10
+ */
11
+ export type { DiffEntry, DiffFunction, DiffResult, ExplainFunction, ExplainResult, ExplainStep, ReplayFunction, ReplayResult, ReplayStep, TelemetryContext, TelemetryDiffRecord, TelemetryNormalizeRecord, TelemetryDecideRecord, TelemetryExplainRecord, TelemetryParseRecord, TelemetryReplayRecord, TelemetryRecord, TelemetryRecordBase, TelemetryResult, TelemetryScanRecord, TelemetrySink, TelemetryStage, TelemetryValidateRecord, } from './analysis';
12
+ export type { BoundaryContext, BoundaryDecideConfig, BoundaryDecision, BoundaryInput, BoundaryMetadata, BoundaryResult, BoundaryRule, BoundaryRuleResult, } from './boundary';
13
+ export type { EventCode, EventKind, EventRule, JaneEvent } from './events';
14
+ export type { FieldPath, FieldPathSegment, SegmentIndex, SegmentKey } from './field-path';
15
+ export type { NormalizationMode, NormalizationResult, NormalizationRule, NormalizationStageContext, NormalizationStageOutput, } from './normalize';
16
+ export type { ParserFactory, ParserFactoryRule, ParseResult, ParseRule, ParseStageContext, ParseStageOutput, ParserFluentRule, ParserName, } from './parse';
17
+ export type { FieldMetadata, PipelineBuilder, PipelineBuilderBase, PipelineInput, PipelineMetadata, PipelinePhase, PipelineResult, } from './pipeline';
18
+ export type { Policy, PolicyAnalysisConfig, PolicyContext, PolicyDecideConfig, PolicyDecision, PolicyDecisionCode, PolicyExceptionConfig, PolicyInput, PolicyOverrides, PolicyResult, } from './policy';
19
+ export type { JaneBoundaryResult, JaneResult, PublicPipeline } from './public';
20
+ export type { ContainmentContext, ContainmentOptions, InternalJsonArray, InternalJsonObject, InternalJsonValue, JsonValue, ScanRule, ScanRuleSet, ScanRunner, ScanStageContext, ScanStageOutput, StructuralType, } from './scan';
21
+ export type { ValidatorFactory, ValidatorFactoryRule, ValidatorFluentRule, ValidatorName, ValidationRule, ValidationStageContext, ValidationStageOutput, } from './validate';