@cosyte/synth 0.1.4 → 0.1.5

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.
@@ -34,11 +34,42 @@ function sfc32Next(s) {
34
34
  }
35
35
 
36
36
  // src/codes.ts
37
- var SYNTH_FATAL_CODES = {
37
+ var SYNTH_FATAL_CODES = Object.freeze({
38
+ /**
39
+ * A format was requested that this build cannot generate through a real parser builder/serializer.
40
+ * Fatal, never a hand-written byte fallback.
41
+ *
42
+ * **No code path in this build raises it.** All six formats generate, so it is reserved for a
43
+ * future format that does not, and is kept because removing a published code is a breaking change.
44
+ * An unsupported *kind* within a format that does generate is `SYNTH_UNSUPPORTED_KIND`.
45
+ */
46
+ SYNTH_UNSUPPORTED_FORMAT: "SYNTH_UNSUPPORTED_FORMAT",
47
+ /**
48
+ * A vendor quirk was requested that the target format's profile system does not support. Fatal,
49
+ * never a silent no-op and never a fabricated quirk.
50
+ */
51
+ SYNTH_UNSUPPORTED_QUIRK: "SYNTH_UNSUPPORTED_QUIRK",
52
+ /**
53
+ * A quirk transform found no structural anchor to mutate, so the fixture would not carry the
54
+ * deviation it is labelled with. Fatal: a golden file that lies about its parser verdict is worse
55
+ * than no golden file.
56
+ */
57
+ SYNTH_QUIRK_ANCHOR_ABSENT: "SYNTH_QUIRK_ANCHOR_ABSENT",
58
+ /**
59
+ * A bare parse of a freshly-generated quirk artifact did not produce exactly the declared intended
60
+ * warning code(s). Fatal, never emit a mislabeled fixture.
61
+ */
62
+ SYNTH_INTENDED_WARNING_MISMATCH: "SYNTH_INTENDED_WARNING_MISMATCH",
63
+ /** A concept's code-system URI has no OID mapping in the C-CDA example-code table. Fatal. */
64
+ SYNTH_UNMAPPED_CODE_SYSTEM: "SYNTH_UNMAPPED_CODE_SYSTEM",
65
+ /** A money value could not be read as an X12 decimal. Fatal: a generator never rounds to a float. */
66
+ SYNTH_INVALID_DECIMAL: "SYNTH_INVALID_DECIMAL",
38
67
  /** An integer range was requested with its maximum below its minimum. Fatal. */
39
68
  SYNTH_INVALID_RANGE: "SYNTH_INVALID_RANGE",
40
69
  /** A value was drawn from an empty pool. Fatal, never a fabricated substitute. */
41
70
  SYNTH_EMPTY_POOL: "SYNTH_EMPTY_POOL",
71
+ /** A `defineSynthProfile` spec was not usable (a missing or blank `name`). Fatal. */
72
+ SYNTH_INVALID_PROFILE: "SYNTH_INVALID_PROFILE",
42
73
  /**
43
74
  * A caller-supplied selector (a message kind, a document type, a corpus mix entry, a claim
44
75
  * variant, a Bundle type, a resource profile) is not in the closed set that governs it. Fatal:
@@ -55,7 +86,7 @@ var SYNTH_FATAL_CODES = {
55
86
  * mislabelled artifact is worse than no artifact.
56
87
  */
57
88
  SYNTH_PROFILE_NOT_GENERATED: "SYNTH_PROFILE_NOT_GENERATED"
58
- };
89
+ });
59
90
  var SYNTH_FATAL_MESSAGES = Object.freeze({
60
91
  SYNTH_UNSUPPORTED_FORMAT: "The requested format is not generable by this build. A generator has no byte fallback: it builds through a parser's own serializer or it refuses.",
61
92
  SYNTH_UNSUPPORTED_QUIRK: "The requested vendor quirk is not in the target format's quirk registry. Compare the request against that format's exported registry (HL7_QUIRKS, CCDA_QUIRKS, ASTM_QUIRKS).",