@clementine-solutions/jane-io 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. package/README.md +132 -1
  2. package/dist/core/analysis/diff.d.ts +35 -0
  3. package/dist/core/analysis/explain.d.ts +35 -0
  4. package/dist/core/analysis/index.d.ts +14 -0
  5. package/dist/core/analysis/replay.d.ts +34 -0
  6. package/dist/core/analysis/telemetry.d.ts +28 -0
  7. package/dist/core/boundary-rules/at-most-one.d.ts +17 -0
  8. package/dist/core/boundary-rules/conditionally-required.d.ts +18 -0
  9. package/dist/core/boundary-rules/date-range.d.ts +17 -0
  10. package/dist/core/boundary-rules/index.d.ts +18 -0
  11. package/dist/core/boundary-rules/mutually-exclusive.d.ts +16 -0
  12. package/dist/core/boundary-rules/no-unknown-fields.d.ts +17 -0
  13. package/dist/core/boundary-rules/require-all.d.ts +16 -0
  14. package/dist/core/boundary-rules/require-one.d.ts +17 -0
  15. package/dist/core/common/events.d.ts +37 -0
  16. package/dist/core/common/fluent.d.ts +151 -0
  17. package/dist/core/common/index.d.ts +16 -0
  18. package/dist/core/common/policy.d.ts +170 -0
  19. package/dist/core/common/utilities.d.ts +59 -0
  20. package/dist/core/common/wildcard.d.ts +27 -0
  21. package/dist/core/field-path/construct.d.ts +77 -0
  22. package/dist/core/field-path/format.d.ts +41 -0
  23. package/dist/core/field-path/index.d.ts +14 -0
  24. package/dist/core/field-path/utilities.d.ts +85 -0
  25. package/dist/core/field-path/walk.d.ts +36 -0
  26. package/dist/core/fluent-registry.d.ts +138 -0
  27. package/dist/core/normalizers/array/compact-sparse-array.d.ts +22 -0
  28. package/dist/core/normalizers/array/flatten-one-level.d.ts +17 -0
  29. package/dist/core/normalizers/array/remove-empty-string-items.d.ts +6 -0
  30. package/dist/core/normalizers/array/remove-null-items.d.ts +16 -0
  31. package/dist/core/normalizers/array/remove-undefined-items.d.ts +16 -0
  32. package/dist/core/normalizers/date/invalid-date-to-undefined.d.ts +17 -0
  33. package/dist/core/normalizers/index.d.ts +28 -0
  34. package/dist/core/normalizers/normalizer-register.d.ts +17 -0
  35. package/dist/core/normalizers/number/infinity-to-undefined.d.ts +18 -0
  36. package/dist/core/normalizers/number/nan-to-undefined.d.ts +17 -0
  37. package/dist/core/normalizers/number/normalize-negative-zero.d.ts +16 -0
  38. package/dist/core/normalizers/object/remove-empty-array-keys.d.ts +17 -0
  39. package/dist/core/normalizers/object/remove-empty-object-keys.d.ts +16 -0
  40. package/dist/core/normalizers/object/remove-empty-string-keys.d.ts +16 -0
  41. package/dist/core/normalizers/object/remove-null-keys.d.ts +16 -0
  42. package/dist/core/normalizers/object/remove-undefined-keys.d.ts +16 -0
  43. package/dist/core/normalizers/string/collapse-whitespace.d.ts +17 -0
  44. package/dist/core/normalizers/string/empty-to-undefined.d.ts +16 -0
  45. package/dist/core/normalizers/string/trim.d.ts +16 -0
  46. package/dist/core/parsers/index.d.ts +22 -0
  47. package/dist/core/parsers/parse-array-string.d.ts +16 -0
  48. package/dist/core/parsers/parse-bigint-string.d.ts +16 -0
  49. package/dist/core/parsers/parse-binary-string.d.ts +16 -0
  50. package/dist/core/parsers/parse-boolean-string.d.ts +16 -0
  51. package/dist/core/parsers/parse-date-string.d.ts +16 -0
  52. package/dist/core/parsers/parse-duration-string.d.ts +16 -0
  53. package/dist/core/parsers/parse-hex-string.d.ts +16 -0
  54. package/dist/core/parsers/parse-integer-string.d.ts +16 -0
  55. package/dist/core/parsers/parse-json-string.d.ts +17 -0
  56. package/dist/core/parsers/parse-numeric-string.d.ts +16 -0
  57. package/dist/core/parsers/parse-object-string.d.ts +16 -0
  58. package/dist/core/parsers/parse-octal-string.d.ts +16 -0
  59. package/dist/core/parsers/parse-scientific-notation-string.d.ts +16 -0
  60. package/dist/core/parsers/parse-url-string.d.ts +16 -0
  61. package/dist/core/pipeline/boundary.d.ts +36 -0
  62. package/dist/core/pipeline/contain.d.ts +122 -0
  63. package/dist/core/pipeline/index.d.ts +16 -0
  64. package/dist/core/pipeline/normalize.d.ts +34 -0
  65. package/dist/core/pipeline/parse.d.ts +40 -0
  66. package/dist/core/pipeline/pipeline.d.ts +23 -0
  67. package/dist/core/pipeline/scan.d.ts +46 -0
  68. package/dist/core/pipeline/validate.d.ts +40 -0
  69. package/dist/core/scanners/any/scan-for-sentinels.d.ts +19 -0
  70. package/dist/core/scanners/array/array-is-deep.d.ts +19 -0
  71. package/dist/core/scanners/array/array-is-heterogenous.d.ts +18 -0
  72. package/dist/core/scanners/array/array-is-large.d.ts +19 -0
  73. package/dist/core/scanners/bigint/bigint-is-large.d.ts +20 -0
  74. package/dist/core/scanners/bigint/bigint-not-safe.d.ts +20 -0
  75. package/dist/core/scanners/date/date-is-before-epoch.d.ts +19 -0
  76. package/dist/core/scanners/date/date-is-far-future.d.ts +19 -0
  77. package/dist/core/scanners/date/date-is-invalid.d.ts +19 -0
  78. package/dist/core/scanners/index.d.ts +31 -0
  79. package/dist/core/scanners/number/number-is-infinite.d.ts +19 -0
  80. package/dist/core/scanners/number/number-is-nan.d.ts +19 -0
  81. package/dist/core/scanners/number/number-is-too-large.d.ts +20 -0
  82. package/dist/core/scanners/number/number-is-unsafe-integer.d.ts +19 -0
  83. package/dist/core/scanners/object/object-has-circular-references.d.ts +20 -0
  84. package/dist/core/scanners/object/object-has-many-keys.d.ts +19 -0
  85. package/dist/core/scanners/object/object-is-deep.d.ts +20 -0
  86. package/dist/core/scanners/scanner-registry.d.ts +19 -0
  87. package/dist/core/scanners/string/string-has-unsafe-unicode.d.ts +19 -0
  88. package/dist/core/scanners/string/string-has-whitespace-edges.d.ts +19 -0
  89. package/dist/core/scanners/string/string-is-long.d.ts +19 -0
  90. package/dist/core/scanners/unknown/unknown-not-scannable.d.ts +21 -0
  91. package/dist/core/shapes/analysis.d.ts +239 -0
  92. package/dist/core/shapes/boundary.d.ts +126 -0
  93. package/dist/core/shapes/events.d.ts +83 -0
  94. package/dist/core/shapes/field-path.d.ts +51 -0
  95. package/dist/core/shapes/index.d.ts +21 -0
  96. package/dist/core/shapes/normalize.d.ts +59 -0
  97. package/dist/core/shapes/parse.d.ts +75 -0
  98. package/dist/core/shapes/pipeline.d.ts +149 -0
  99. package/dist/core/shapes/policy.d.ts +158 -0
  100. package/dist/core/shapes/public.d.ts +92 -0
  101. package/dist/core/shapes/scan.d.ts +126 -0
  102. package/dist/core/shapes/validate.d.ts +65 -0
  103. package/dist/core/validators/array/array-max-items.d.ts +25 -0
  104. package/dist/core/validators/array/array-min-items.d.ts +25 -0
  105. package/dist/core/validators/array/array.d.ts +22 -0
  106. package/dist/core/validators/array/excludes.d.ts +25 -0
  107. package/dist/core/validators/array/has-unique-items.d.ts +24 -0
  108. package/dist/core/validators/array/includes.d.ts +24 -0
  109. package/dist/core/validators/array/items-equal.d.ts +25 -0
  110. package/dist/core/validators/array/no-empty-string-items.d.ts +24 -0
  111. package/dist/core/validators/array/no-null-items.d.ts +24 -0
  112. package/dist/core/validators/array/no-undefined-items.d.ts +24 -0
  113. package/dist/core/validators/array/non-empty-array.d.ts +24 -0
  114. package/dist/core/validators/array/not-sparse.d.ts +25 -0
  115. package/dist/core/validators/bigint/bigint-equals.d.ts +24 -0
  116. package/dist/core/validators/bigint/bigint-max.d.ts +25 -0
  117. package/dist/core/validators/bigint/bigint-min.d.ts +25 -0
  118. package/dist/core/validators/bigint/bigint-negative.d.ts +23 -0
  119. package/dist/core/validators/bigint/bigint-non-negative.d.ts +24 -0
  120. package/dist/core/validators/bigint/bigint-non-positive.d.ts +24 -0
  121. package/dist/core/validators/bigint/bigint-positive.d.ts +24 -0
  122. package/dist/core/validators/bigint/bigint-safe.d.ts +25 -0
  123. package/dist/core/validators/bigint/bigint.d.ts +20 -0
  124. package/dist/core/validators/boolean/boolean.d.ts +21 -0
  125. package/dist/core/validators/boolean/is-false.d.ts +22 -0
  126. package/dist/core/validators/boolean/is-true.d.ts +22 -0
  127. package/dist/core/validators/common/is-country-code.d.ts +17 -0
  128. package/dist/core/validators/common/is-currency-code.d.ts +17 -0
  129. package/dist/core/validators/common/is-email-strict.d.ts +17 -0
  130. package/dist/core/validators/common/is-email.d.ts +17 -0
  131. package/dist/core/validators/common/is-ip.d.ts +17 -0
  132. package/dist/core/validators/common/is-phone-strict.d.ts +17 -0
  133. package/dist/core/validators/common/is-phone.d.ts +17 -0
  134. package/dist/core/validators/common/is-port.d.ts +17 -0
  135. package/dist/core/validators/common/is-postal-code.d.ts +17 -0
  136. package/dist/core/validators/common/is-url.d.ts +17 -0
  137. package/dist/core/validators/common/is-uuid.d.ts +17 -0
  138. package/dist/core/validators/date/before-epoch.d.ts +28 -0
  139. package/dist/core/validators/date/date-now-required.d.ts +22 -0
  140. package/dist/core/validators/date/is-date.d.ts +21 -0
  141. package/dist/core/validators/date/is-far-future.d.ts +23 -0
  142. package/dist/core/validators/date/is-future.d.ts +24 -0
  143. package/dist/core/validators/date/is-past.d.ts +24 -0
  144. package/dist/core/validators/date/not-after.d.ts +25 -0
  145. package/dist/core/validators/date/not-before.d.ts +25 -0
  146. package/dist/core/validators/date/same-day.d.ts +25 -0
  147. package/dist/core/validators/date/same-month.d.ts +25 -0
  148. package/dist/core/validators/date/same-year.d.ts +24 -0
  149. package/dist/core/validators/date/too-early.d.ts +25 -0
  150. package/dist/core/validators/date/too-late.d.ts +25 -0
  151. package/dist/core/validators/date/weekday.d.ts +32 -0
  152. package/dist/core/validators/date/weekend.d.ts +27 -0
  153. package/dist/core/validators/index.d.ts +112 -0
  154. package/dist/core/validators/nullish/is-null-or-undefined.d.ts +22 -0
  155. package/dist/core/validators/nullish/is-null.d.ts +21 -0
  156. package/dist/core/validators/nullish/is-undefined.d.ts +21 -0
  157. package/dist/core/validators/number/finite.d.ts +22 -0
  158. package/dist/core/validators/number/integer.d.ts +22 -0
  159. package/dist/core/validators/number/less-than.d.ts +21 -0
  160. package/dist/core/validators/number/max.d.ts +21 -0
  161. package/dist/core/validators/number/min.d.ts +21 -0
  162. package/dist/core/validators/number/more-than.d.ts +21 -0
  163. package/dist/core/validators/number/negative.d.ts +20 -0
  164. package/dist/core/validators/number/non-negative.d.ts +19 -0
  165. package/dist/core/validators/number/non-positive.d.ts +19 -0
  166. package/dist/core/validators/number/number.d.ts +19 -0
  167. package/dist/core/validators/number/positive.d.ts +20 -0
  168. package/dist/core/validators/number/safe-integer.d.ts +19 -0
  169. package/dist/core/validators/object/deep-equals.d.ts +24 -0
  170. package/dist/core/validators/object/has-key.d.ts +23 -0
  171. package/dist/core/validators/object/has-value.d.ts +27 -0
  172. package/dist/core/validators/object/keys-equal.d.ts +26 -0
  173. package/dist/core/validators/object/max-keys.d.ts +24 -0
  174. package/dist/core/validators/object/min-keys.d.ts +24 -0
  175. package/dist/core/validators/object/missing-key.d.ts +23 -0
  176. package/dist/core/validators/object/no-empty-array-values.d.ts +23 -0
  177. package/dist/core/validators/object/no-empty-object-values.d.ts +23 -0
  178. package/dist/core/validators/object/no-null-values.d.ts +23 -0
  179. package/dist/core/validators/object/no-undefined-values.d.ts +23 -0
  180. package/dist/core/validators/object/non-empty-object.d.ts +21 -0
  181. package/dist/core/validators/object/only-keys.d.ts +23 -0
  182. package/dist/core/validators/object/plain-object.d.ts +22 -0
  183. package/dist/core/validators/string/alpha-num.d.ts +23 -0
  184. package/dist/core/validators/string/alpha.d.ts +24 -0
  185. package/dist/core/validators/string/chars-equal.d.ts +23 -0
  186. package/dist/core/validators/string/ends-with.d.ts +23 -0
  187. package/dist/core/validators/string/is-ascii.d.ts +24 -0
  188. package/dist/core/validators/string/is-printable.d.ts +25 -0
  189. package/dist/core/validators/string/matches.d.ts +23 -0
  190. package/dist/core/validators/string/max-length.d.ts +24 -0
  191. package/dist/core/validators/string/min-length.d.ts +24 -0
  192. package/dist/core/validators/string/no-lead-space.d.ts +23 -0
  193. package/dist/core/validators/string/no-repeat-space.d.ts +25 -0
  194. package/dist/core/validators/string/no-space.d.ts +24 -0
  195. package/dist/core/validators/string/no-trail-space.d.ts +23 -0
  196. package/dist/core/validators/string/non-empty.d.ts +22 -0
  197. package/dist/core/validators/string/not-one-of.d.ts +24 -0
  198. package/dist/core/validators/string/num-string.d.ts +23 -0
  199. package/dist/core/validators/string/one-of.d.ts +23 -0
  200. package/dist/core/validators/string/starts-with.d.ts +23 -0
  201. package/dist/core/validators/string/string.d.ts +21 -0
  202. package/dist/core/validators/string/trimmed.d.ts +24 -0
  203. package/dist/index.d.ts +83 -0
  204. package/dist/test.d.ts +1 -0
  205. package/package.json +2 -2
@@ -0,0 +1,23 @@
1
+ /**
2
+ * ----------------------------------------------------------------------------
3
+ * Validators | One Of
4
+ * ----------------------------------------------------------------------------
5
+ * @package @clementine-solutions/jane
6
+ * @description Validates that the value is a string included in the
7
+ * provided `allowed` list.
8
+ * @see https://jane-io.com
9
+ * ----------------------------------------------------------------------------
10
+ */
11
+ import type { ValidationRule } from '../../shapes';
12
+ /**
13
+ * Validates that the value is a string included in the provided `allowed` list.
14
+ *
15
+ * - Non‑string values emit `type.not.valid`.
16
+ * - Strings not present in the allowed list emit `string.not.allowed`.
17
+ * - Returns an empty array when the value is valid.
18
+ *
19
+ * This rule is pure, total, async‑compatible, and returns a readonly array of
20
+ * JaneEvent objects. It preserves the provided path and supports userMessage
21
+ * overrides applied at the pipeline level.
22
+ */
23
+ export declare const oneOf: (allowed: readonly string[]) => ValidationRule;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * ----------------------------------------------------------------------------
3
+ * Validators | Starts With
4
+ * ----------------------------------------------------------------------------
5
+ * @package @clementine-solutions/jane
6
+ * @description Validates that the value is a string beginning with the
7
+ * provided `prefix`.
8
+ * @see https://jane-io.com
9
+ * ----------------------------------------------------------------------------
10
+ */
11
+ import type { ValidationRule } from '../../shapes';
12
+ /**
13
+ * Validates that the value is a string beginning with the provided `prefix`.
14
+ *
15
+ * - Non‑string values emit `string.not.string`.
16
+ * - Strings that do not begin with `prefix` emit `string.must.start-with`.
17
+ * - Returns an empty array when the value is valid.
18
+ *
19
+ * This rule is pure, total, async‑compatible, and returns a readonly array of
20
+ * JaneEvent objects. It preserves the provided path and supports userMessage
21
+ * overrides applied at the pipeline level.
22
+ */
23
+ export declare const startsWith: (prefix: string) => ValidationRule;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * ----------------------------------------------------------------------------
3
+ * Validators | String
4
+ * ----------------------------------------------------------------------------
5
+ * @package @clementine-solutions/jane
6
+ * @description Validates that the value is a string.
7
+ * @see https://jane-io.com
8
+ * ----------------------------------------------------------------------------
9
+ */
10
+ import type { ValidationRule } from '../../shapes';
11
+ /**
12
+ * Validates that the value is a string.
13
+ *
14
+ * - Non‑string values emit `string.not.string`.
15
+ * - Returns an empty array when the value is a valid string.
16
+ *
17
+ * This rule is pure, total, async‑compatible, and returns a readonly array of
18
+ * JaneEvent objects. It preserves the provided path and supports userMessage
19
+ * overrides applied at the pipeline level.
20
+ */
21
+ export declare const string: ValidationRule;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * ----------------------------------------------------------------------------
3
+ * Validators | Trimmed (No Leading Or Trailing Whitespace)
4
+ * ----------------------------------------------------------------------------
5
+ * @package @clementine-solutions/jane
6
+ * @description Validates that the value is a string with no leading or
7
+ * trailing whitespace.
8
+ * @see https://jane-io.com
9
+ * ----------------------------------------------------------------------------
10
+ */
11
+ import type { ValidationRule } from '../../shapes';
12
+ /**
13
+ * Validates that the value is a string with no leading or trailing whitespace.
14
+ *
15
+ * - Non‑string values emit `type.not.valid`.
16
+ * - Strings whose trimmed form differs from the original emit
17
+ * `string.not.trimmed`.
18
+ * - Returns an empty array when the value is valid.
19
+ *
20
+ * This rule is pure, total, async‑compatible, and returns a readonly array of
21
+ * JaneEvent objects. It preserves the provided path and supports userMessage
22
+ * overrides applied at the pipeline level.
23
+ */
24
+ export declare const trimmed: ValidationRule;
@@ -0,0 +1,83 @@
1
+ /**
2
+ * ----------------------------------------------------------------------------
3
+ * Public | Jane
4
+ * ----------------------------------------------------------------------------
5
+ * @package @clementine-solutions/jane
6
+ * @description The public entry point for creating and running Jane
7
+ * boundaries.
8
+ * @see https://jane-io.com
9
+ * ----------------------------------------------------------------------------
10
+ */
11
+ /**
12
+ * The default Jane instance configured with the library’s built‑in policy.
13
+ *
14
+ * Exposes the full public API—value(), boundary(), and withPolicy()—and
15
+ * serves as the primary entry point for consumers who do not need custom
16
+ * policy configuration.
17
+ */
18
+ export declare const jane: {
19
+ value(raw: unknown, path?: import("./core/shapes").FieldPath, options?: {
20
+ inputName?: string;
21
+ }): import("./core/shapes").PublicPipeline;
22
+ boundary<TShape extends Record<string, import("./core/shapes").PublicPipeline>>(shape: TShape): Promise<{
23
+ policy: import("./core/shapes").Policy;
24
+ ok: boolean;
25
+ issues?: readonly import("./core/shapes").JaneEvent[];
26
+ events?: readonly import("./core/shapes").JaneEvent[];
27
+ values?: Record<string, unknown> | undefined;
28
+ fields: Record<string, import("./core/shapes").JaneResult<unknown>>;
29
+ metadata: {
30
+ runId?: string;
31
+ startedAt?: string;
32
+ finishedAt?: string;
33
+ durationMs?: number;
34
+ fields: Record<string, import("./core/shapes").FieldMetadata>;
35
+ };
36
+ }>;
37
+ withPolicy(input: import("./core/shapes").PolicyInput): /*elided*/ any;
38
+ strictBoundary<TShape extends Record<string, import("./core/shapes").PublicPipeline>>(shape: TShape): Promise<{
39
+ policy: import("./core/shapes").Policy;
40
+ ok: boolean;
41
+ issues?: readonly import("./core/shapes").JaneEvent[];
42
+ events?: readonly import("./core/shapes").JaneEvent[];
43
+ values?: Record<string, unknown> | undefined;
44
+ fields: Record<string, import("./core/shapes").JaneResult<unknown>>;
45
+ metadata: {
46
+ runId?: string;
47
+ startedAt?: string;
48
+ finishedAt?: string;
49
+ durationMs?: number;
50
+ fields: Record<string, import("./core/shapes").FieldMetadata>;
51
+ };
52
+ }>;
53
+ laxBoundary<TShape extends Record<string, import("./core/shapes").PublicPipeline>>(shape: TShape): Promise<{
54
+ policy: import("./core/shapes").Policy;
55
+ ok: boolean;
56
+ issues?: readonly import("./core/shapes").JaneEvent[];
57
+ events?: readonly import("./core/shapes").JaneEvent[];
58
+ values?: Record<string, unknown> | undefined;
59
+ fields: Record<string, import("./core/shapes").JaneResult<unknown>>;
60
+ metadata: {
61
+ runId?: string;
62
+ startedAt?: string;
63
+ finishedAt?: string;
64
+ durationMs?: number;
65
+ fields: Record<string, import("./core/shapes").FieldMetadata>;
66
+ };
67
+ }>;
68
+ defaultBoundary<TShape extends Record<string, import("./core/shapes").PublicPipeline>>(shape: TShape): Promise<{
69
+ policy: import("./core/shapes").Policy;
70
+ ok: boolean;
71
+ issues?: readonly import("./core/shapes").JaneEvent[];
72
+ events?: readonly import("./core/shapes").JaneEvent[];
73
+ values?: Record<string, unknown> | undefined;
74
+ fields: Record<string, import("./core/shapes").JaneResult<unknown>>;
75
+ metadata: {
76
+ runId?: string;
77
+ startedAt?: string;
78
+ finishedAt?: string;
79
+ durationMs?: number;
80
+ fields: Record<string, import("./core/shapes").FieldMetadata>;
81
+ };
82
+ }>;
83
+ };
package/dist/test.d.ts ADDED
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@clementine-solutions/jane-io",
3
3
  "type": "module",
4
- "main": "index.js",
4
+ "main": "dist/index.js",
5
5
  "description": "A clarity-first boundary system for shaping, validating, and transforming data with full introspection and policy control.",
6
6
  "license": "Apache-2.0",
7
7
  "author": "Clementine Solutions <develop.clementine@outlook.com>",
@@ -83,5 +83,5 @@
83
83
  "access": "public",
84
84
  "registry": "https://registry.npmjs.org/"
85
85
  },
86
- "version": "1.0.0"
86
+ "version": "1.0.1"
87
87
  }