cedar-model-typescript-library 1.0.18 → 1.0.20

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 (105) hide show
  1. package/README.md +74 -3
  2. package/index.d.ts +12 -0
  3. package/index.d.ts.map +1 -1
  4. package/index.esm.js +1 -1
  5. package/index.esm.js.map +1 -1
  6. package/index.js +1 -1
  7. package/index.js.map +1 -1
  8. package/index.umd.js +1 -1
  9. package/index.umd.js.map +1 -1
  10. package/org/metadatacenter/io/reader/ReaderUtil.d.ts +9 -20
  11. package/org/metadatacenter/io/reader/ReaderUtil.d.ts.map +1 -1
  12. package/org/metadatacenter/io/reader/json/CedarJsonReaders.d.ts.map +1 -1
  13. package/org/metadatacenter/io/reader/json/JsonAbstractArtifactReader.d.ts.map +1 -1
  14. package/org/metadatacenter/io/reader/json/JsonTemplateElementReader.d.ts.map +1 -1
  15. package/org/metadatacenter/io/reader/json/JsonTemplateFieldReader.d.ts.map +1 -1
  16. package/org/metadatacenter/io/reader/json/JsonTemplateInstanceReader.d.ts.map +1 -1
  17. package/org/metadatacenter/io/reader/json/JsonTemplateReader.d.ts.map +1 -1
  18. package/org/metadatacenter/io/reader/yaml/YamlAbstractArtifactReader.d.ts.map +1 -1
  19. package/org/metadatacenter/io/reader/yaml/YamlContainerArtifactReader.d.ts.map +1 -1
  20. package/org/metadatacenter/io/reader/yaml/YamlSourcePolicy.d.ts +6 -0
  21. package/org/metadatacenter/io/reader/yaml/YamlSourcePolicy.d.ts.map +1 -0
  22. package/org/metadatacenter/io/reader/yaml/YamlTemplateElementReader.d.ts.map +1 -1
  23. package/org/metadatacenter/io/reader/yaml/YamlTemplateFieldReader.d.ts.map +1 -1
  24. package/org/metadatacenter/io/reader/yaml/YamlTemplateInstanceReader.d.ts.map +1 -1
  25. package/org/metadatacenter/io/reader/yaml/YamlTemplateReader.d.ts.map +1 -1
  26. package/org/metadatacenter/io/roundtrip/RoundTrip.d.ts.map +1 -1
  27. package/org/metadatacenter/io/writer/json/JsonTemplateInstanceWriter.d.ts.map +1 -1
  28. package/org/metadatacenter/io/writer/json/stringifyInstance.d.ts.map +1 -1
  29. package/org/metadatacenter/io/writer/json/stringifySchema.d.ts.map +1 -1
  30. package/org/metadatacenter/io/writer/yaml/SimpleYamlSerializer.d.ts.map +1 -1
  31. package/org/metadatacenter/io/writer/yaml/YamlAbstractContainerArtifactWriter.d.ts.map +1 -1
  32. package/org/metadatacenter/io/writer/yaml/YamlTemplateInstanceWriter.d.ts.map +1 -1
  33. package/org/metadatacenter/model/cedar/AbstractContainerArtifact.d.ts +0 -2
  34. package/org/metadatacenter/model/cedar/AbstractContainerArtifact.d.ts.map +1 -1
  35. package/org/metadatacenter/model/cedar/TemplateValueValidator.d.ts +11 -0
  36. package/org/metadatacenter/model/cedar/TemplateValueValidator.d.ts.map +1 -0
  37. package/org/metadatacenter/model/cedar/deployment/AbstractChildDeploymentInfo.d.ts +7 -7
  38. package/org/metadatacenter/model/cedar/deployment/ChildDeploymentInfoAlwaysMultiple.d.ts +3 -3
  39. package/org/metadatacenter/model/cedar/deployment/ChildDeploymentInfoAlwaysMultiple.d.ts.map +1 -1
  40. package/org/metadatacenter/model/cedar/field/dynamic/controlled-term/JsonFieldReaderControlledTerm.d.ts +8 -0
  41. package/org/metadatacenter/model/cedar/field/dynamic/controlled-term/JsonFieldReaderControlledTerm.d.ts.map +1 -1
  42. package/org/metadatacenter/model/cedar/field/dynamic/controlled-term/YamlFieldReaderControlledTerm.d.ts +8 -0
  43. package/org/metadatacenter/model/cedar/field/dynamic/controlled-term/YamlFieldReaderControlledTerm.d.ts.map +1 -1
  44. package/org/metadatacenter/model/cedar/field/dynamic/controlled-term/value-constraint/ControlledTermVersion.d.ts +7 -0
  45. package/org/metadatacenter/model/cedar/field/dynamic/controlled-term/value-constraint/ControlledTermVersion.d.ts.map +1 -1
  46. package/org/metadatacenter/model/cedar/field/dynamic/email/EmailFieldBuilderImpl.d.ts.map +1 -1
  47. package/org/metadatacenter/model/cedar/field/dynamic/numeric/NumericDefaultValueValidator.d.ts +2 -1
  48. package/org/metadatacenter/model/cedar/field/dynamic/numeric/NumericDefaultValueValidator.d.ts.map +1 -1
  49. package/org/metadatacenter/model/cedar/field/dynamic/numeric/NumericFieldBuilder.d.ts +4 -3
  50. package/org/metadatacenter/model/cedar/field/dynamic/numeric/NumericFieldBuilder.d.ts.map +1 -1
  51. package/org/metadatacenter/model/cedar/field/dynamic/numeric/NumericFieldBuilderImpl.d.ts +4 -3
  52. package/org/metadatacenter/model/cedar/field/dynamic/numeric/NumericFieldBuilderImpl.d.ts.map +1 -1
  53. package/org/metadatacenter/model/cedar/field/dynamic/numeric/ValueConstraintsNumericField.d.ts +4 -3
  54. package/org/metadatacenter/model/cedar/field/dynamic/numeric/ValueConstraintsNumericField.d.ts.map +1 -1
  55. package/org/metadatacenter/model/cedar/field/dynamic/phone-number/PhoneNumberFieldBuilderImpl.d.ts.map +1 -1
  56. package/org/metadatacenter/model/cedar/field/dynamic/temporal/TemporalDefaultValueValidator.d.ts +2 -11
  57. package/org/metadatacenter/model/cedar/field/dynamic/temporal/TemporalDefaultValueValidator.d.ts.map +1 -1
  58. package/org/metadatacenter/model/cedar/field/dynamic/temporal/TemporalFieldBuilderImpl.d.ts.map +1 -1
  59. package/org/metadatacenter/model/cedar/field/dynamic/textarea/TextAreaBuilderImpl.d.ts.map +1 -1
  60. package/org/metadatacenter/model/cedar/field/dynamic/textfield/TextFieldBuilderImpl.d.ts.map +1 -1
  61. package/org/metadatacenter/model/cedar/template-instance/AttributeValueNamePolicy.d.ts.map +1 -1
  62. package/org/metadatacenter/model/cedar/template-instance/InstanceValidator.d.ts +8 -72
  63. package/org/metadatacenter/model/cedar/template-instance/InstanceValidator.d.ts.map +1 -1
  64. package/org/metadatacenter/model/cedar/types/wrapped-types/IsoDate.d.ts +3 -3
  65. package/org/metadatacenter/model/cedar/types/wrapped-types/IsoDate.d.ts.map +1 -1
  66. package/org/metadatacenter/model/cedar/util/JavaStrings.d.ts +6 -0
  67. package/org/metadatacenter/model/cedar/util/JavaStrings.d.ts.map +1 -0
  68. package/org/metadatacenter/model/cedar/util/compare/JsonArtifactParsingResult.d.ts +6 -0
  69. package/org/metadatacenter/model/cedar/util/compare/JsonArtifactParsingResult.d.ts.map +1 -1
  70. package/org/metadatacenter/model/cedar/util/compare/JsonObjectComparator.d.ts.map +1 -1
  71. package/org/metadatacenter/model/cedar/util/path/JsonPath.d.ts +3 -0
  72. package/org/metadatacenter/model/cedar/util/path/JsonPath.d.ts.map +1 -1
  73. package/org/metadatacenter/model/cedar/util/validationFieldSchema.d.ts +5 -0
  74. package/org/metadatacenter/model/cedar/util/validationFieldSchema.d.ts.map +1 -0
  75. package/org/metadatacenter/policy/DisplayText.d.ts +13 -0
  76. package/org/metadatacenter/policy/DisplayText.d.ts.map +1 -0
  77. package/org/metadatacenter/policy/FieldValuePolicy.d.ts +35 -0
  78. package/org/metadatacenter/policy/FieldValuePolicy.d.ts.map +1 -0
  79. package/org/metadatacenter/policy/IdentifierPolicy.d.ts +30 -0
  80. package/org/metadatacenter/policy/IdentifierPolicy.d.ts.map +1 -0
  81. package/org/metadatacenter/policy/JsonSourcePolicy.d.ts +12 -0
  82. package/org/metadatacenter/policy/JsonSourcePolicy.d.ts.map +1 -0
  83. package/org/metadatacenter/policy/NumericPolicy.d.ts +26 -0
  84. package/org/metadatacenter/policy/NumericPolicy.d.ts.map +1 -0
  85. package/org/metadatacenter/policy/RegexChecks.d.ts +29 -0
  86. package/org/metadatacenter/policy/RegexChecks.d.ts.map +1 -0
  87. package/org/metadatacenter/policy/RegexPolicy.d.ts +52 -0
  88. package/org/metadatacenter/policy/RegexPolicy.d.ts.map +1 -0
  89. package/org/metadatacenter/policy/TemporalDefaultPolicy.d.ts +15 -0
  90. package/org/metadatacenter/policy/TemporalDefaultPolicy.d.ts.map +1 -0
  91. package/org/metadatacenter/policy/TextPolicy.d.ts +12 -0
  92. package/org/metadatacenter/policy/TextPolicy.d.ts.map +1 -0
  93. package/org/metadatacenter/policy/TimestampPolicy.d.ts +5 -0
  94. package/org/metadatacenter/policy/TimestampPolicy.d.ts.map +1 -0
  95. package/org/metadatacenter/policy/ValidationPolicy.d.ts +35 -0
  96. package/org/metadatacenter/policy/ValidationPolicy.d.ts.map +1 -0
  97. package/package.json +1 -1
  98. package/policy.d.ts +11 -0
  99. package/policy.d.ts.map +1 -0
  100. package/policy.esm.js +2 -0
  101. package/policy.esm.js.map +1 -0
  102. package/policy.js +2 -0
  103. package/policy.js.map +1 -0
  104. package/policy.umd.js +2 -0
  105. package/policy.umd.js.map +1 -0
@@ -1,51 +1,13 @@
1
1
  import { TemplateInstance } from './TemplateInstance';
2
2
  import { Template } from '../template/Template';
3
3
  import { JsonArtifactParsingResult } from '../util/compare/JsonArtifactParsingResult';
4
+ import { ValidationSummary } from '../../../policy/ValidationPolicy';
4
5
  /**
5
- * Check a parsed instance against the template that defines it.
6
- *
7
- * Reading an instance answers no question about whether it is *correct*. The
8
- * reader takes a JSON document at face value — it is handed no template, so a
9
- * field that has lost its `@type`, an element short of its `minItems`, or a
10
- * property the template requires and the document omits all parse cleanly. The
11
- * verdict on those needs the template, which is what this takes.
12
- *
13
- * It is deliberately the counterpart of `InstanceInflater`: the same walk over
14
- * the same pairing of container and template, but reporting what is wrong
15
- * instead of repairing it. Where the inflater re-adds a missing slot, this
16
- * records that it was missing.
17
- *
18
- * ## What is checked
19
- *
20
- * - **presence** — every child the template lists in its JSON Schema
21
- * `required` has a slot. Static fields and attribute-value fields are
22
- * excluded, exactly as `getChildrenNamesForRequiredInProperties` excludes
23
- * them from `required` itself.
24
- * - **cardinality** — a multi child holds an array and a single child does
25
- * not, and the array's length sits within `minItems`/`maxItems`.
26
- * - **value type** — a temporal or numeric value carries the `@type` its
27
- * field declares. These are the two field kinds whose instance
28
- * representation is a typed atom, so they are the two where a missing or
29
- * wrong `@type` is unambiguous rather than a matter of interpretation.
30
- * - **elements** — recursively, on the same terms.
31
- *
32
- * ## What is deliberately not checked
33
- *
34
- * An empty slot is valid. A property must be *present*, but `null` is a legal
35
- * value for one — that is how CEDAR represents "not filled in", and the
36
- * template's own schema permits it. So emptiness is never an error here; only
37
- * absence is.
38
- *
39
- * Emptiness has a legal spelling, though, and `{"@id": null}` is not it. A
40
- * literal's `@value` may be null; an `@id` may not, and an unfilled link is
41
- * written `{}`. That asymmetry is checked — see `validateIri`.
42
- *
43
- * Nor does this police the atom kind of every field. Only temporal and numeric
44
- * fields have a declared datatype to check against. Inferring the rest from
45
- * `uiInputType` would mean asserting things the model does not actually
46
- * constrain, and a validator that reports errors which are not errors is worse
47
- * than one that stays quiet: consumers stop believing it. Widening the check is
48
- * a matter of adding cases here as the model gains constraints worth enforcing.
6
+ * Compare a parsed instance with its template without repairing it. Missing slots,
7
+ * wrong atom/container shapes and malformed typed values are structural errors.
8
+ * Well-formed answers outside field constraints and incomplete answers are quality
9
+ * findings. validateReport exposes saveability separately from full validity.
10
+ * Remote terminology and authority verification is explicitly not checked here.
49
11
  */
50
12
  export declare class InstanceValidator {
51
13
  private constructor();
@@ -57,39 +19,13 @@ export declare class InstanceValidator {
57
19
  * result can read this the same way.
58
20
  */
59
21
  static validate(instance: TemplateInstance, template: Template): JsonArtifactParsingResult;
22
+ /** Saveability and quality are different answers; semantic checks remain explicitly not checked. */
23
+ static validateReport(instance: TemplateInstance, template: Template): ValidationSummary;
60
24
  private static validateContainer;
61
25
  private static attributeValueGroups;
62
26
  private static validateChild;
63
27
  private static validateCardinality;
64
28
  private static validateItem;
65
- /**
66
- * `{"@id": null}` is not an empty value. It is a malformed one.
67
- *
68
- * `@value` and `@id` are not symmetrical here, and the difference is easy to
69
- * miss. A literal's `@value` may be null — JSON-LD allows it and CEDAR
70
- * declares the property `["string", "null"]`, which is how an unfilled
71
- * literal is written. An `@id` may not: JSON-LD requires an IRI, and CEDAR
72
- * declares it `{"type": "string", "format": "uri"}` with no null branch. An
73
- * unfilled link or controlled-term field is written `{}` instead, which the
74
- * reader returns as an empty node.
75
- *
76
- * So a link atom carrying a null id came from a document that should not
77
- * exist, and nothing else notices: the reader accepts it and the writer emits
78
- * it back unchanged. None of the 120 instances in the shared corpus contains
79
- * one.
80
- *
81
- * This is a structural rule rather than a datatype one, so it applies to any
82
- * field. The instance's own top-level `@id` is a different matter — an unsaved
83
- * instance legitimately has none — and is not reached here, which walks only
84
- * the children the template declares.
85
- */
86
- private static validateIri;
87
- /**
88
- * The `@type` a filled value of this field must carry, or null where the
89
- * field kind declares none.
90
- */
91
- private static declaredValueType;
92
- private static validateTypedValue;
93
29
  /** An unfilled slot, in any of the shapes the reader produces for one. */
94
30
  private static isEmpty;
95
31
  }
@@ -1 +1 @@
1
- {"version":3,"file":"InstanceValidator.d.ts","sourceRoot":"","sources":["../../../../../../src/org/metadatacenter/model/cedar/template-instance/InstanceValidator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAatD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGhD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAatF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,qBAAa,iBAAiB;IAC5B,OAAO;IAEP;;;;;;OAMG;WACW,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,GAAG,yBAAyB;IAMjG,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAqEhC,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAkBnC,OAAO,CAAC,MAAM,CAAC,aAAa;IAqC5B,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAsBlC,OAAO,CAAC,MAAM,CAAC,YAAY;IA8B3B;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,OAAO,CAAC,MAAM,CAAC,WAAW;IAS1B;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAUhC,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAsCjC,0EAA0E;IAC1E,OAAO,CAAC,MAAM,CAAC,OAAO;CASvB"}
1
+ {"version":3,"file":"InstanceValidator.d.ts","sourceRoot":"","sources":["../../../../../../src/org/metadatacenter/model/cedar/template-instance/InstanceValidator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAWtD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAC;AAYtF,OAAO,EAAoB,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAKvF;;;;;;GAMG;AACH,qBAAa,iBAAiB;IAC5B,OAAO;IAEP;;;;;;OAMG;WACW,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,GAAG,yBAAyB;IAMjG,oGAAoG;WACtF,cAAc,CAAC,QAAQ,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,GAAG,iBAAiB;IAI/F,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAiFhC,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAkBnC,OAAO,CAAC,MAAM,CAAC,aAAa;IAqC5B,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAkBlC,OAAO,CAAC,MAAM,CAAC,YAAY;IAuE3B,0EAA0E;IAC1E,OAAO,CAAC,MAAM,CAAC,OAAO;CASvB"}
@@ -1,10 +1,10 @@
1
+ /** A lossless provenance timestamp, independent of JavaScript Date's millisecond rounding. */
1
2
  export declare class IsoDate {
2
- private readonly date;
3
- private readonly timezoneOffset;
3
+ private readonly value;
4
4
  private constructor();
5
5
  static NULL: IsoDate;
6
6
  getValue(): string | null;
7
- static forValue(isoDateString: string | null): IsoDate;
7
+ static forValue(value: string | null): IsoDate;
8
8
  static now(): IsoDate;
9
9
  static getCurrentGMTOffset(): string;
10
10
  }
@@ -1 +1 @@
1
- {"version":3,"file":"IsoDate.d.ts","sourceRoot":"","sources":["../../../../../../../src/org/metadatacenter/model/cedar/types/wrapped-types/IsoDate.ts"],"names":[],"mappings":"AAAA,qBAAa,OAAO;IAClB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAc;IACnC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAgB;IAE/C,OAAO;IAKP,OAAc,IAAI,UAA2B;IAGtC,QAAQ,IAAI,MAAM,GAAG,IAAI;WAkClB,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO;WAY/C,GAAG,IAAI,OAAO;WAMd,mBAAmB,IAAI,MAAM;CAc5C"}
1
+ {"version":3,"file":"IsoDate.d.ts","sourceRoot":"","sources":["../../../../../../../src/org/metadatacenter/model/cedar/types/wrapped-types/IsoDate.ts"],"names":[],"mappings":"AAEA,8FAA8F;AAC9F,qBAAa,OAAO;IACE,OAAO,CAAC,QAAQ,CAAC,KAAK;IAA1C,OAAO;IACP,OAAc,IAAI,UAAqB;IAEhC,QAAQ,IAAI,MAAM,GAAG,IAAI;WAIlB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO;WAIvC,GAAG,IAAI,OAAO;WAMd,mBAAmB,IAAI,MAAM;CAc5C"}
@@ -0,0 +1,6 @@
1
+ /** Compatibility API; the pinned text contract lives in the lightweight policy package. */
2
+ export declare abstract class JavaStrings {
3
+ static isBlank(value: string): boolean;
4
+ static isWhitespace(character: string): boolean;
5
+ }
6
+ //# sourceMappingURL=JavaStrings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JavaStrings.d.ts","sourceRoot":"","sources":["../../../../../../src/org/metadatacenter/model/cedar/util/JavaStrings.ts"],"names":[],"mappings":"AAEA,2FAA2F;AAC3F,8BAAsB,WAAW;WACjB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;WAG/B,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;CAGvD"}
@@ -1,7 +1,13 @@
1
1
  import { ComparisonError } from './ComparisonError';
2
+ import { ValidationContext, ValidationFinding, ValidationSummary } from '../../../../policy/ValidationPolicy';
2
3
  export declare class JsonArtifactParsingResult {
3
4
  private blueprintComparisonErrors;
4
5
  private blueprintComparisonWarnings;
6
+ private validationFindings;
7
+ /** Structured validation facts, separate from the legacy parser-comparison diagnostics. */
8
+ getValidationFindings(): ValidationFinding[];
9
+ addValidationFinding(finding: ValidationFinding, context?: ValidationContext, legacyDiagnostic?: ComparisonError): void;
10
+ getValidationReport(context?: ValidationContext): ValidationSummary;
5
11
  addBlueprintComparisonError(error: ComparisonError): void;
6
12
  getBlueprintComparisonErrors(): Array<ComparisonError>;
7
13
  getBlueprintComparisonErrorCount(): number;
@@ -1 +1 @@
1
- {"version":3,"file":"JsonArtifactParsingResult.d.ts","sourceRoot":"","sources":["../../../../../../../src/org/metadatacenter/model/cedar/util/compare/JsonArtifactParsingResult.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,qBAAa,yBAAyB;IACpC,OAAO,CAAC,yBAAyB,CAA8B;IAC/D,OAAO,CAAC,2BAA2B,CAA8B;IAE1D,2BAA2B,CAAC,KAAK,EAAE,eAAe;IAIlD,4BAA4B,IAAI,KAAK,CAAC,eAAe,CAAC;IAI7D,gCAAgC;IAIzB,6BAA6B,CAAC,OAAO,EAAE,eAAe;IAItD,8BAA8B,IAAI,KAAK,CAAC,eAAe,CAAC;IAI/D,kCAAkC;IAIlC;;;;;;OAMG;IACI,aAAa,IAAI,OAAO;IAI/B;;;;;;;;;;;;;OAaG;IACI,kBAAkB,IAAI,OAAO;IAIpC,KAAK,CAAC,WAAW,EAAE,yBAAyB;CAI7C"}
1
+ {"version":3,"file":"JsonArtifactParsingResult.d.ts","sourceRoot":"","sources":["../../../../../../../src/org/metadatacenter/model/cedar/util/compare/JsonArtifactParsingResult.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAoB,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAEhI,qBAAa,yBAAyB;IACpC,OAAO,CAAC,yBAAyB,CAA8B;IAC/D,OAAO,CAAC,2BAA2B,CAA8B;IACjE,OAAO,CAAC,kBAAkB,CAA2B;IAErD,2FAA2F;IACpF,qBAAqB,IAAI,iBAAiB,EAAE;IAI5C,oBAAoB,CACzB,OAAO,EAAE,iBAAiB,EAC1B,OAAO,GAAE,iBAA8B,EACvC,gBAAgB,CAAC,EAAE,eAAe,GACjC,IAAI;IAWA,mBAAmB,CAAC,OAAO,GAAE,iBAA8B,GAAG,iBAAiB;IAU/E,2BAA2B,CAAC,KAAK,EAAE,eAAe;IAIlD,4BAA4B,IAAI,KAAK,CAAC,eAAe,CAAC;IAI7D,gCAAgC;IAIzB,6BAA6B,CAAC,OAAO,EAAE,eAAe;IAItD,8BAA8B,IAAI,KAAK,CAAC,eAAe,CAAC;IAI/D,kCAAkC;IAIlC;;;;;;OAMG;IACI,aAAa,IAAI,OAAO;IAI/B;;;;;;;;;;;;;OAaG;IACI,kBAAkB,IAAI,OAAO;IAIpC,KAAK,CAAC,WAAW,EAAE,yBAAyB;CAK7C"}
@@ -1 +1 @@
1
- {"version":3,"file":"JsonObjectComparator.d.ts","sourceRoot":"","sources":["../../../../../../../src/org/metadatacenter/model/cedar/util/compare/JsonObjectComparator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAK5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,qBAAa,oBAAoB;IAC/B,MAAM,CAAC,eAAe,CACpB,gBAAgB,EAAE,yBAAyB,EAC3C,eAAe,EAAE,gBAAgB,EACjC,UAAU,EAAE,gBAAgB,EAC5B,IAAI,EAAE,QAAQ,EACd,QAAQ,EAAE,oBAAoB,EAC9B,cAAc,GAAE,MAAM,EAAO,GAC5B,IAAI;IAkHP;;;;;;;;;;;;;;;;;;;;;;;OAuBG;WACW,0BAA0B,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO;IAcjE;;;;;;;;;OASG;IACH,OAAO,CAAC,MAAM,CAAC,YAAY;IAQ3B,MAAM,CAAC,aAAa,CAClB,gBAAgB,EAAE,yBAAyB,EAC3C,eAAe,EAAE,gBAAgB,EACjC,UAAU,EAAE,gBAAgB,EAC5B,IAAI,EAAE,QAAQ,EACd,QAAQ,EAAE,oBAAoB,GAC7B,IAAI;IAmEP,MAAM,CAAC,gBAAgB,CACrB,gBAAgB,EAAE,yBAAyB,EAC3C,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,QAAQ,GACb,yBAAyB;CAM7B"}
1
+ {"version":3,"file":"JsonObjectComparator.d.ts","sourceRoot":"","sources":["../../../../../../../src/org/metadatacenter/model/cedar/util/compare/JsonObjectComparator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAK5C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAWtD,qBAAa,oBAAoB;IAC/B,MAAM,CAAC,eAAe,CACpB,gBAAgB,EAAE,yBAAyB,EAC3C,eAAe,EAAE,gBAAgB,EACjC,UAAU,EAAE,gBAAgB,EAC5B,IAAI,EAAE,QAAQ,EACd,QAAQ,EAAE,oBAAoB,EAC9B,cAAc,GAAE,MAAM,EAAO,GAC5B,IAAI;IAkHP;;;;;;;;;;;;;;;;;;;;;;;OAuBG;WACW,0BAA0B,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO;IAcjE;;;;;;;;;OASG;IACH,OAAO,CAAC,MAAM,CAAC,YAAY;IAQ3B,MAAM,CAAC,aAAa,CAClB,gBAAgB,EAAE,yBAAyB,EAC3C,eAAe,EAAE,gBAAgB,EACjC,UAAU,EAAE,gBAAgB,EAC5B,IAAI,EAAE,QAAQ,EACd,QAAQ,EAAE,oBAAoB,GAC7B,IAAI;IAmEP,MAAM,CAAC,gBAAgB,CACrB,gBAAgB,EAAE,yBAAyB,EAC3C,IAAI,EAAE,SAAS,EACf,MAAM,EAAE,SAAS,EACjB,IAAI,EAAE,QAAQ,GACb,yBAAyB;CAM7B"}
@@ -6,6 +6,9 @@ export declare class JsonPath {
6
6
  add(...pathComponents: Array<string | number>): JsonPath;
7
7
  join(another: JsonPath): JsonPath;
8
8
  toString(): string;
9
+ /** Standard JSON Pointer for validation APIs; the legacy display spelling is unchanged. */
10
+ toPointer(): string;
11
+ static fromPointer(pointer: string): JsonPath;
9
12
  toJSON(): string;
10
13
  getLastComponent(): string | number | null;
11
14
  endsIn(...pathComponents: Array<string | number>): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"JsonPath.d.ts","sourceRoot":"","sources":["../../../../../../../src/org/metadatacenter/model/cedar/util/path/JsonPath.ts"],"names":[],"mappings":"AAAA,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAyB;IAE9C,OAAc,GAAG,EAAE,MAAM,CAAO;gBAEpB,GAAG,cAAc,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;IAIrD,KAAK,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO;IAKjC,GAAG,CAAC,GAAG,cAAc,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,QAAQ;IAIxD,IAAI,CAAC,OAAO,EAAE,QAAQ,GAAG,QAAQ;IAIjC,QAAQ,IAAI,MAAM;IAalB,MAAM;IAIN,gBAAgB,IAAI,MAAM,GAAG,MAAM,GAAG,IAAI;IAO1C,MAAM,CAAC,GAAG,cAAc,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,OAAO;IAkB1D,kBAAkB,CAAC,CAAC,EAAE,MAAM,GAAG,QAAQ;CAQxC"}
1
+ {"version":3,"file":"JsonPath.d.ts","sourceRoot":"","sources":["../../../../../../../src/org/metadatacenter/model/cedar/util/path/JsonPath.ts"],"names":[],"mappings":"AAAA,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAyB;IAE9C,OAAc,GAAG,EAAE,MAAM,CAAO;gBAEpB,GAAG,cAAc,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;IAIrD,KAAK,CAAC,OAAO,EAAE,QAAQ,GAAG,OAAO;IAKjC,GAAG,CAAC,GAAG,cAAc,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,QAAQ;IAIxD,IAAI,CAAC,OAAO,EAAE,QAAQ,GAAG,QAAQ;IAIjC,QAAQ,IAAI,MAAM;IAYlB,2FAA2F;IAC3F,SAAS,IAAI,MAAM;IAInB,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ;IAY7C,MAAM;IAIN,gBAAgB,IAAI,MAAM,GAAG,MAAM,GAAG,IAAI;IAO1C,MAAM,CAAC,GAAG,cAAc,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,OAAO;IAkB1D,kBAAkB,CAAC,CAAC,EAAE,MAAM,GAAG,QAAQ;CAQxC"}
@@ -0,0 +1,5 @@
1
+ import { ValidationField } from '../../../policy/FieldValuePolicy';
2
+ import { TemplateField } from '../field/TemplateField';
3
+ /** Inspect invalid imported constraints without passing them through save-time writer assertions. */
4
+ export declare function validationFieldSchema(child: TemplateField, includeDefault?: boolean): ValidationField;
5
+ //# sourceMappingURL=validationFieldSchema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validationFieldSchema.d.ts","sourceRoot":"","sources":["../../../../../../src/org/metadatacenter/model/cedar/util/validationFieldSchema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAIvD,qGAAqG;AACrG,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,aAAa,EAAE,cAAc,UAAQ,GAAG,eAAe,CAsBnG"}
@@ -0,0 +1,13 @@
1
+ /** Derived search/display text only. Never use these operations to rewrite an identifier or object key. */
2
+ export declare class DisplayText {
3
+ private static readonly segmenter;
4
+ /** Prefix/suffix abbreviation for legacy consumers, without cutting a displayed character. */
5
+ static take(value: string, length: number, fromEnd?: boolean): string;
6
+ /** Locale-independent matching; canonical equivalents match without changing stored spelling. */
7
+ static searchKey(value: string): string;
8
+ /** Map a folded match back to the original graphemes, including expanding case mappings such as İ. */
9
+ static splitMatch(value: string, query: string): readonly [string, string, string];
10
+ /** Middle elision counts graphemes; it never splits a surrogate pair, accent or joined emoji. */
11
+ static elide(value: string, max?: number, tail?: number): string;
12
+ }
13
+ //# sourceMappingURL=DisplayText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DisplayText.d.ts","sourceRoot":"","sources":["../../../../src/org/metadatacenter/policy/DisplayText.ts"],"names":[],"mappings":"AAAA,2GAA2G;AAC3G,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAA0D;IAE3F,8FAA8F;WAChF,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,UAAQ,GAAG,MAAM;IAO1E,iGAAiG;WACnF,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAI9C,sGAAsG;WACxF,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;IAiBzF,iGAAiG;WACnF,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,SAAK,EAAE,IAAI,SAAK,GAAG,MAAM;CAUhE"}
@@ -0,0 +1,35 @@
1
+ import { ValidationContext, ValidationFinding } from './ValidationPolicy';
2
+ /** Raw field metadata keeps every versioned terminology constraint intact. */
3
+ export interface ValidationField {
4
+ _ui?: {
5
+ inputType?: string;
6
+ temporalGranularity?: string | null;
7
+ timezoneEnabled?: boolean;
8
+ [key: string]: unknown;
9
+ };
10
+ _valueConstraints?: {
11
+ [key: string]: any;
12
+ };
13
+ properties?: {
14
+ [key: string]: any;
15
+ };
16
+ required?: string[];
17
+ }
18
+ /** Local facts shared by model callers and editors. Remote checks are explicit, separate facts. */
19
+ export declare class FieldValuePolicy {
20
+ static readonly authorityTypes: Set<string>;
21
+ private static readonly integerRanges;
22
+ static isControlled(field: ValidationField): boolean;
23
+ static isIri(field: ValidationField): boolean;
24
+ static validateConfiguration(field: ValidationField, path?: string): ValidationFinding[];
25
+ static validate(field: ValidationField, value: unknown, path?: string, context?: ValidationContext): ValidationFinding[];
26
+ /** Empty slots are distinct from malformed typed atoms and missing structural properties. */
27
+ static validateNode(field: ValidationField, node: unknown, path?: string): ValidationFinding[];
28
+ static validateDefault(field: ValidationField, path?: string): ValidationFinding[];
29
+ /** Synchronous construction checks. Async regex/semantic coverage remains explicit in reports. */
30
+ static assertConsistent(field: ValidationField): void;
31
+ private static regex;
32
+ private static numeric;
33
+ private static temporal;
34
+ }
35
+ //# sourceMappingURL=FieldValuePolicy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FieldValuePolicy.d.ts","sourceRoot":"","sources":["../../../../src/org/metadatacenter/policy/FieldValuePolicy.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAoB,MAAM,oBAAoB,CAAC;AAE5F,8EAA8E;AAC9E,MAAM,WAAW,eAAe;IAC9B,GAAG,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,mBAAmB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,eAAe,CAAC,EAAE,OAAO,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAGrH,iBAAiB,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAE3C,UAAU,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IACpC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,mGAAmG;AACnG,qBAAa,gBAAgB;IAC3B,MAAM,CAAC,QAAQ,CAAC,cAAc,cAA0G;IACxI,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAKnC;IACF,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO;IAOpD,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO;IAK7C,MAAM,CAAC,qBAAqB,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,SAAK,GAAG,iBAAiB,EAAE;IA8CpF,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,SAAK,EAAE,OAAO,GAAE,iBAA8B,GAAG,iBAAiB,EAAE;IA0ChI,6FAA6F;IAC7F,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,SAAK,GAAG,iBAAiB,EAAE;IAuE1F,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,eAAe,EAAE,IAAI,SAAK,GAAG,iBAAiB,EAAE;IAqB9E,kGAAkG;IAClG,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI;IAWrD,OAAO,CAAC,MAAM,CAAC,KAAK;IAepB,OAAO,CAAC,MAAM,CAAC,OAAO;IAoDtB,OAAO,CAAC,MAAM,CAAC,QAAQ;CA0DxB"}
@@ -0,0 +1,30 @@
1
+ /** Pure identifier checks shared by model readers and UI; no URL normalization. */
2
+ export declare abstract class IdentifierPolicy {
3
+ /** Match Java URI's whitespace, fragment and scheme checks; never rewrite identifiers. */
4
+ static assertIdentifierCharacters(raw: string | null, key: string): void;
5
+ /** RFC 3987 field identifiers: validate characters without normalizing RDF identity. */
6
+ static assertFieldIri(raw: string | null, key: string): void;
7
+ /**
8
+ * An IRI anywhere but a field's value, as the Java readers judge one: RFC 3987 characters, and
9
+ * none of the space separators a java.net.URI cannot hold as spelled. A field's value keeps its
10
+ * spelling and so takes those, through `assertFieldIri` alone. Whether an empty string means
11
+ * absence differs by position, so each position decides that itself.
12
+ */
13
+ static assertIri(raw: string | null, key: string): void;
14
+ /**
15
+ * An identifier, as the Java readers judge one: an IRI `assertIri` takes that is also absolute.
16
+ * Every IRI outside a field's value is one, except a nested child's temporary `@id`, which the
17
+ * server replaces on a write, and an action's `sourceUri`, where the legacy editor writes
18
+ * `template`. Null is absence; the empty string is a relative reference and is refused.
19
+ */
20
+ static assertIdentifier(raw: string | null, key: string): void;
21
+ static isValid(value: string): boolean;
22
+ /** Field values retain the RFC 3987 spelling, including Unicode spaces. */
23
+ static isValidFieldValue(value: string): boolean;
24
+ /**
25
+ * The existing editor contract also requires an HTTP(S) address to have a host.
26
+ * URL is used only for that check: its normalized serialization is never stored.
27
+ */
28
+ static isValidAuthoringIri(value: string, fieldValue?: boolean): boolean;
29
+ }
30
+ //# sourceMappingURL=IdentifierPolicy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IdentifierPolicy.d.ts","sourceRoot":"","sources":["../../../../src/org/metadatacenter/policy/IdentifierPolicy.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,8BAAsB,gBAAgB;IACpC,0FAA0F;WAC5E,0BAA0B,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAsB/E,wFAAwF;WAC1E,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAsCnE;;;;;OAKG;WACW,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;IAO9D;;;;;OAKG;WACW,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI;WAYvD,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAU7C,2EAA2E;WAC7D,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAUvD;;;OAGG;WACW,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,UAAQ,GAAG,OAAO;CAW9E"}
@@ -0,0 +1,12 @@
1
+ import { NumericValue } from './NumericPolicy';
2
+ import { JsonNode } from '../model/cedar/types/basic-types/JsonNode';
3
+ /** Raw JSON boundary. Duplicate decoded keys and rounded or nonfinite source numbers are never accepted silently. */
4
+ export declare class JsonSourcePolicy {
5
+ static sourceNumber(text: string): NumericValue;
6
+ static parse(source: string): JsonNode;
7
+ /** Own a JSON tree while preserving exact numeric atoms across independent bundles. */
8
+ static clone<T>(source: T): T;
9
+ /** Exact numeric tokens on every supported browser, without depending on JSON.rawJSON. */
10
+ static stringify(value: unknown, indent?: number): string;
11
+ }
12
+ //# sourceMappingURL=JsonSourcePolicy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsonSourcePolicy.d.ts","sourceRoot":"","sources":["../../../../src/org/metadatacenter/policy/JsonSourcePolicy.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE5E,OAAO,EAAE,QAAQ,EAAE,MAAM,2CAA2C,CAAC;AAErE,qHAAqH;AACrH,qBAAa,gBAAgB;WACb,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY;WAKxC,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ;IAuE7C,uFAAuF;WACzE,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC;IAoBpC,0FAA0F;WAC5E,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,SAAI,GAAG,MAAM;CAkC5D"}
@@ -0,0 +1,26 @@
1
+ export type NumericValue = number | ExactDecimal;
2
+ export type NumericInput = NumericValue | string;
3
+ /** An exact decimal when a JavaScript number cannot carry the source value. */
4
+ export declare class ExactDecimal {
5
+ private readonly text;
6
+ readonly cedarExactDecimal = true;
7
+ /** CED and CEE may bundle independent copies of this package. */
8
+ static isExact(value: unknown): value is ExactDecimal;
9
+ private constructor();
10
+ static forValue(value: string): ExactDecimal;
11
+ toString(): string;
12
+ valueOf(): never;
13
+ /** Modern native JSON serialization is exact; older engines must use JsonSourcePolicy.stringify. */
14
+ toJSON(): unknown;
15
+ }
16
+ /** Locale-independent ASCII decimal grammar and comparisons without binary floating-point conversion. */
17
+ export declare class NumericPolicy {
18
+ private static parts;
19
+ static canonical(value: NumericInput): string;
20
+ static compare(left: NumericInput, right: NumericInput): -1 | 0 | 1;
21
+ static isInteger(value: NumericInput): boolean;
22
+ static fractionalDigits(value: NumericInput): number;
23
+ /** Existing number callers remain supported; raw text retains all digits when a double cannot. */
24
+ static value(value: NumericInput): NumericValue;
25
+ }
26
+ //# sourceMappingURL=NumericPolicy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NumericPolicy.d.ts","sourceRoot":"","sources":["../../../../src/org/metadatacenter/policy/NumericPolicy.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,YAAY,CAAC;AACjD,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,MAAM,CAAC;AAQjD,+EAA+E;AAC/E,qBAAa,YAAY;IAaH,OAAO,CAAC,QAAQ,CAAC,IAAI;IAZzC,SAAgB,iBAAiB,QAAQ;IAEzC,iEAAiE;WACnD,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY;IAS5D,OAAO;WAIO,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;IAI5C,QAAQ,IAAI,MAAM;IAIlB,OAAO,IAAI,KAAK;IAIvB,oGAAoG;IAC7F,MAAM,IAAI,OAAO;CAKzB;AAED,yGAAyG;AACzG,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAC,KAAK;WAmBN,SAAS,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM;WAiBtC,OAAO,CAAC,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;WAkB5D,SAAS,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO;WAIvC,gBAAgB,CAAC,KAAK,EAAE,YAAY,GAAG,MAAM;IAI3D,kGAAkG;WACpF,KAAK,CAAC,KAAK,EAAE,YAAY,GAAG,YAAY;CAavD"}
@@ -0,0 +1,29 @@
1
+ import { RegexPolicy, RegexVerdict } from './RegexPolicy';
2
+ /**
3
+ * A document's current checks. A synchronous report can say "pending" while the
4
+ * worker runs; its owner gets a callback when the current batch has settled.
5
+ * Each run retains only the checks it used, cancelling obsolete values and
6
+ * freeing old answers. Owners must never advertise pending checks as valid.
7
+ */
8
+ export declare class RegexChecks {
9
+ private readonly changed;
10
+ private readonly policy;
11
+ private readonly entries;
12
+ private used;
13
+ private size;
14
+ private disposed;
15
+ private capacityLimited;
16
+ private static active;
17
+ constructor(changed?: () => void, policy?: RegexPolicy);
18
+ /** Scope is synchronous and restored even if a validator throws. Never pass an async callback. */
19
+ run<T>(validate: () => T): T;
20
+ /** Outside a report scope the verdict is explicitly pending, never a successful validation. */
21
+ static inspect(pattern: string, value?: string | null): RegexVerdict | 'pending';
22
+ private check;
23
+ get pending(): boolean;
24
+ settled(): Promise<void>;
25
+ /** Useful at an asynchronous validation boundary, including headless consumers. */
26
+ static validate<T>(validate: () => T, policy?: RegexPolicy): Promise<T>;
27
+ dispose(): void;
28
+ }
29
+ //# sourceMappingURL=RegexChecks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RegexChecks.d.ts","sourceRoot":"","sources":["../../../../src/org/metadatacenter/policy/RegexChecks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAQ1D;;;;;GAKG;AACH,qBAAa,WAAW;IASpB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM;IATzB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA4B;IACpD,OAAO,CAAC,IAAI,CAA4B;IACxC,OAAO,CAAC,IAAI,CAAK;IACjB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,MAAM,CAAC,MAAM,CAA4B;gBAG9B,OAAO,GAAE,MAAM,IAAe,EAC9B,MAAM,cAAoB;IAG7C,kGAAkG;IAC3F,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC;IA2BnC,+FAA+F;WACjF,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,GAAE,MAAM,GAAG,IAAW,GAAG,YAAY,GAAG,SAAS;IAI7F,OAAO,CAAC,KAAK;IAwBb,IAAW,OAAO,IAAI,OAAO,CAE5B;IAEY,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAIrC,mFAAmF;WAC/D,QAAQ,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC;IAc7E,OAAO,IAAI,IAAI;CAOvB"}
@@ -0,0 +1,52 @@
1
+ /** A work limit or unavailable worker must never be interpreted as a successful validation. */
2
+ export type RegexVerdict = 'valid' | 'match' | 'mismatch' | 'invalid' | 'timeout' | 'unavailable' | 'limit' | 'cancelled';
3
+ /** Minimal worker interface, also implemented by the Node conformance-test adapter. */
4
+ export interface RegexWorker {
5
+ onmessage: ((event: {
6
+ data: unknown;
7
+ }) => void) | null;
8
+ onerror: (() => void) | null;
9
+ postMessage(value: unknown): void;
10
+ terminate(): void;
11
+ }
12
+ export declare const REGEX_WORKER_SOURCE = "\n onmessage = ({data}) => {\n let result;\n try {\n const expression = new RegExp('^(?:' + data.pattern + ')$');\n result = data.value === null ? 'valid' : expression.test(data.value) ? 'match' : 'mismatch';\n } catch (_) { result = 'invalid'; }\n postMessage({id: data.id, result});\n };\n postMessage({ready: true});\n";
13
+ /** Structural AbortSignal subset; the policy declarations do not require DOM or Node types. */
14
+ export interface RegexCancellation {
15
+ readonly aborted: boolean;
16
+ addEventListener(type: 'abort', listener: () => void, options?: {
17
+ once?: boolean;
18
+ }): void;
19
+ removeEventListener(type: 'abort', listener: () => void): void;
20
+ }
21
+ export interface RegexPolicyOptions {
22
+ /** A host may supply its own same-origin worker where CSP forbids blob workers. */
23
+ workerFactory?: () => RegexWorker;
24
+ workTimeoutMs?: number;
25
+ startupTimeoutMs?: number;
26
+ queueLimit?: number;
27
+ }
28
+ /**
29
+ * Serial, bounded evaluation in a disposable worker. Compilation is isolated too.
30
+ * A timed-out worker is terminated, then the next request gets a fresh worker.
31
+ * No synchronous fallback is permitted, including when a host's CSP blocks workers.
32
+ */
33
+ export declare class RegexPolicy {
34
+ private worker;
35
+ private ready;
36
+ private releaseSource;
37
+ private current;
38
+ private queue;
39
+ private serial;
40
+ private timer;
41
+ private idleTimer;
42
+ private closed;
43
+ private readonly options;
44
+ constructor(options?: RegexPolicyOptions);
45
+ evaluate(pattern: string, value?: string | null, signal?: RegexCancellation): Promise<RegexVerdict>;
46
+ private stopWorker;
47
+ private fail;
48
+ private next;
49
+ private send;
50
+ dispose(): void;
51
+ }
52
+ //# sourceMappingURL=RegexPolicy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RegexPolicy.d.ts","sourceRoot":"","sources":["../../../../src/org/metadatacenter/policy/RegexPolicy.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,aAAa,GAAG,OAAO,GAAG,WAAW,CAAC;AAE1H,uFAAuF;AACvF,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,CAAC,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC;IACvD,OAAO,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC;IAC7B,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IAClC,SAAS,IAAI,IAAI,CAAC;CACnB;AAGD,eAAO,MAAM,mBAAmB,+VAU/B,CAAC;AAEF,+FAA+F;AAC/F,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,EAAE,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IAC1F,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;CAChE;AAED,MAAM,WAAW,kBAAkB;IACjC,mFAAmF;IACnF,aAAa,CAAC,EAAE,MAAM,WAAW,CAAC;IAClC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AASD;;;;GAIG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,aAAa,CAA6B;IAClD,OAAO,CAAC,OAAO,CAAoB;IACnC,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,MAAM,CAAK;IACnB,OAAO,CAAC,KAAK,CAA4C;IACzD,OAAO,CAAC,SAAS,CAA4C;IAC7D,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAA+B;gBAEpC,OAAO,GAAE,kBAAuB;IAwB5C,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,GAAE,MAAM,GAAG,IAAW,EAAE,MAAM,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC;IA4BhH,OAAO,CAAC,UAAU;IAclB,OAAO,CAAC,IAAI;IASZ,OAAO,CAAC,IAAI;IAqCZ,OAAO,CAAC,IAAI;IAUL,OAAO,IAAI,IAAI;CAOvB"}
@@ -0,0 +1,15 @@
1
+ /** Shared partial temporal default grammar; instance atoms retain complete XSD spellings. */
2
+ export declare class TemporalDefaultPolicy {
3
+ private static readonly zone;
4
+ private static readonly hour;
5
+ private static readonly minute;
6
+ private static readonly second;
7
+ static assertValid(temporalType: string | null, granularity: string | null, defaultValue: string | null): void;
8
+ private static isCompatibleGranularity;
9
+ private static datePattern;
10
+ private static timePattern;
11
+ private static dateTimePattern;
12
+ private static timePatternSource;
13
+ private static hasValidCalendarDate;
14
+ }
15
+ //# sourceMappingURL=TemporalDefaultPolicy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TemporalDefaultPolicy.d.ts","sourceRoot":"","sources":["../../../../src/org/metadatacenter/policy/TemporalDefaultPolicy.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,qBAAa,qBAAqB;IAChC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAmD;IAC/E,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAwB;IACpD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAc;IAC5C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAc;WAE9B,WAAW,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IA+BrH,OAAO,CAAC,MAAM,CAAC,uBAAuB;IAatC,OAAO,CAAC,MAAM,CAAC,WAAW;IAa1B,OAAO,CAAC,MAAM,CAAC,WAAW;IAoB1B,OAAO,CAAC,MAAM,CAAC,eAAe;IAc9B,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAIhC,OAAO,CAAC,MAAM,CAAC,oBAAoB;CAYpC"}
@@ -0,0 +1,12 @@
1
+ /** Stable CEDAR text rules. Validation never trims or normalizes stored spelling. */
2
+ export declare class TextPolicy {
3
+ private constructor();
4
+ /** Pinned Java 17 blankness; deliberately differs from JavaScript trim and Unicode White_Space. */
5
+ static isBlank(value: string): boolean;
6
+ static isBlankCodePoint(cp: number): boolean;
7
+ /** JSON Schema length, distinct from UTF-16 layout offsets and displayed graphemes. */
8
+ static codePointLength(value: string): number;
9
+ /** Explicit authoring affordance only, never a reader/writer or identity normalization. */
10
+ static trimInputPadding(value: string): string;
11
+ }
12
+ //# sourceMappingURL=TextPolicy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextPolicy.d.ts","sourceRoot":"","sources":["../../../../src/org/metadatacenter/policy/TextPolicy.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,qBAAa,UAAU;IACrB,OAAO;IAEP,mGAAmG;WACrF,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;WAK/B,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAcnD,uFAAuF;WACzE,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAIpD,2FAA2F;WAC7E,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;CAGtD"}
@@ -0,0 +1,5 @@
1
+ /** Provenance timestamps. Partial temporal field values have a separate contract. */
2
+ export declare class TimestampPolicy {
3
+ static canonical(value: string): string;
4
+ }
5
+ //# sourceMappingURL=TimestampPolicy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TimestampPolicy.d.ts","sourceRoot":"","sources":["../../../../src/org/metadatacenter/policy/TimestampPolicy.ts"],"names":[],"mappings":"AAAA,qFAAqF;AACrF,qBAAa,eAAe;WACZ,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;CAuC/C"}
@@ -0,0 +1,35 @@
1
+ /** Facts are independent of the context in which an artifact is saved. */
2
+ export type ValidationCategory = 'structural' | 'constraint' | 'completeness' | 'verification';
3
+ export type ValidationContext = 'instance' | 'template';
4
+ export type VerificationStatus = 'passed' | 'failed' | 'notChecked' | 'unavailable';
5
+ export interface ValidationFinding {
6
+ code: string;
7
+ category: ValidationCategory;
8
+ /** RFC 6901 JSON Pointer, including array indexes and the offending property. */
9
+ path: string;
10
+ message: string;
11
+ verificationStatus?: VerificationStatus;
12
+ }
13
+ export interface ValidationSummary {
14
+ findings: ValidationFinding[];
15
+ structurallyValid: boolean;
16
+ canSave: boolean;
17
+ /** False also when an applicable check was omitted or could not complete. */
18
+ isValid: boolean;
19
+ }
20
+ /** Shared save policy. Unknown codes fail closed as structural defects. */
21
+ export declare class ValidationPolicy {
22
+ private static readonly constraints;
23
+ private static readonly completeness;
24
+ private static readonly verification;
25
+ /** A semantic service response is evidence only for its documented check and outcome. */
26
+ static acceptsSemanticResult(controlled: boolean, status: unknown, code: unknown): boolean;
27
+ static category(code: string): ValidationCategory;
28
+ static blocksSave(code: string | ValidationFinding, context?: ValidationContext): boolean;
29
+ static severity(code: string, context?: ValidationContext): 'error' | 'warning';
30
+ static finding(code: string, path: string, message: string, verificationStatus?: VerificationStatus): ValidationFinding;
31
+ static summarize(findings: readonly ValidationFinding[], context?: ValidationContext): ValidationSummary;
32
+ static pointer(path: readonly (string | number)[]): string;
33
+ static child(path: string, property: string | number): string;
34
+ }
35
+ //# sourceMappingURL=ValidationPolicy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ValidationPolicy.d.ts","sourceRoot":"","sources":["../../../../src/org/metadatacenter/policy/ValidationPolicy.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,MAAM,MAAM,kBAAkB,GAAG,YAAY,GAAG,YAAY,GAAG,cAAc,GAAG,cAAc,CAAC;AAC/F,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,UAAU,CAAC;AACxD,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,QAAQ,GAAG,YAAY,GAAG,aAAa,CAAC;AAEpF,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,6EAA6E;IAC7E,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,2EAA2E;AAC3E,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAkBhC;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAqC;IACzE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAQjC;IAEH,yFAAyF;IACzF,MAAM,CAAC,qBAAqB,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO;IAe1F,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB;IAOjD,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,EAAE,OAAO,GAAE,iBAA8B,GAAG,OAAO;IASrG,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,iBAA8B,GAAG,OAAO,GAAG,SAAS;IAI3F,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,kBAAkB,GAAG,iBAAiB;IAMvH,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,SAAS,iBAAiB,EAAE,EAAE,OAAO,GAAE,iBAA8B,GAAG,iBAAiB;IAUpH,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,SAAS,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,MAAM;IAI1D,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM;CAG9D"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cedar-model-typescript-library",
3
- "version": "1.0.18",
3
+ "version": "1.0.20",
4
4
  "description": "TypeScript models, builders, readers, writers, and validators for CEDAR metadata artifacts",
5
5
  "main": "index.js",
6
6
  "module": "index.esm.js",
package/policy.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ /** Dependency-free validation entry point for editors and other lightweight consumers. */
2
+ export { TextPolicy } from './org/metadatacenter/policy/TextPolicy';
3
+ export { IdentifierPolicy } from './org/metadatacenter/policy/IdentifierPolicy';
4
+ export { DisplayText } from './org/metadatacenter/policy/DisplayText';
5
+ export { TimestampPolicy } from './org/metadatacenter/policy/TimestampPolicy';
6
+ export { NumericPolicy, ExactDecimal, NumericValue, NumericInput } from './org/metadatacenter/policy/NumericPolicy';
7
+ export { JsonSourcePolicy } from './org/metadatacenter/policy/JsonSourcePolicy';
8
+ export { RegexPolicy, RegexVerdict, RegexWorker, RegexPolicyOptions, REGEX_WORKER_SOURCE } from './org/metadatacenter/policy/RegexPolicy';
9
+ export { RegexChecks } from './org/metadatacenter/policy/RegexChecks';
10
+ export { ValidationPolicy, ValidationFinding, ValidationCategory, ValidationContext, VerificationStatus, ValidationSummary, } from './org/metadatacenter/policy/ValidationPolicy';
11
+ //# sourceMappingURL=policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../src/policy.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAE9E,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAEpH,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAEhF,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,yCAAyC,CAAC;AAE1I,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAEtE,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,8CAA8C,CAAC"}