cedar-model-typescript-library 1.0.22 → 1.0.23
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.
- package/README.md +7 -1
- package/index.esm.js +1 -1
- package/index.esm.js.map +1 -1
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/index.umd.js +1 -1
- package/index.umd.js.map +1 -1
- package/org/metadatacenter/io/reader/yaml/YamlSourcePolicy.d.ts +5 -0
- package/org/metadatacenter/io/reader/yaml/YamlSourcePolicy.d.ts.map +1 -1
- package/org/metadatacenter/io/reader/yaml/YamlTemplateInstanceReader.d.ts +26 -0
- package/org/metadatacenter/io/reader/yaml/YamlTemplateInstanceReader.d.ts.map +1 -1
- package/org/metadatacenter/model/cedar/template-instance/InstanceInflater.d.ts +11 -8
- package/org/metadatacenter/model/cedar/template-instance/InstanceInflater.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { JsonNode } from '../../../model/cedar/types/basic-types/JsonNode';
|
|
2
|
+
/**
|
|
3
|
+
* The text a number or boolean in a parsed YAML mapping was written as, for a position that holds a
|
|
4
|
+
* literal rather than a number, while the mapping still holds the value read from that text.
|
|
5
|
+
*/
|
|
6
|
+
export declare function yamlSpelling(mapping: JsonNode, key: string): string | null;
|
|
2
7
|
/** YAML 1.2 core values with exact numbers, literal mapping keys and bounded, acyclic alias expansion. */
|
|
3
8
|
export declare class YamlSourcePolicy {
|
|
4
9
|
static parse(source: string): JsonNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YamlSourcePolicy.d.ts","sourceRoot":"","sources":["../../../../../../src/org/metadatacenter/io/reader/yaml/YamlSourcePolicy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;
|
|
1
|
+
{"version":3,"file":"YamlSourcePolicy.d.ts","sourceRoot":"","sources":["../../../../../../src/org/metadatacenter/io/reader/yaml/YamlSourcePolicy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAO3E;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAG1E;AAED,0GAA0G;AAC1G,qBAAa,gBAAgB;WACb,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ;CA0D9C"}
|
|
@@ -38,8 +38,34 @@ export declare class YamlTemplateInstanceReader extends YamlAbstractArtifactRead
|
|
|
38
38
|
*/
|
|
39
39
|
private static readonly RESERVED_KEYS;
|
|
40
40
|
private static readonly ELEMENT_RESERVED_KEYS;
|
|
41
|
+
/** A YAML mapping: an object that is neither a list nor a number the source policy kept exact. */
|
|
42
|
+
private static isMapping;
|
|
43
|
+
private static refuseNullOrEmpty;
|
|
44
|
+
/**
|
|
45
|
+
* Refuse null, an empty mapping and an empty list wherever the instance holds data, as Java's
|
|
46
|
+
* reader does. A value that is not known is left out rather than written as one of them. The one
|
|
47
|
+
* exception, also Java's, is a null `value` beside a label, a preferred label or a notation. At the
|
|
48
|
+
* document root this walks only the `children` block and the attribute-value fields beside it. The
|
|
49
|
+
* instance's own name, description, identifiers, provenance and annotations are read below.
|
|
50
|
+
*/
|
|
51
|
+
private static refuseNullAndEmptyValues;
|
|
41
52
|
private parseContainer;
|
|
53
|
+
/** An attribute is a mapping held to the rules of a field's value, as Java's reader holds it. */
|
|
42
54
|
private parseAttributeValue;
|
|
55
|
+
/**
|
|
56
|
+
* Hold a field's value to what Java's reader takes: an id or a value but not both, at most one
|
|
57
|
+
* datatype and that an IRI, a literal that is a string, number or boolean, and text for the label,
|
|
58
|
+
* notation, preferred label and language.
|
|
59
|
+
*/
|
|
60
|
+
private static assertFieldValue;
|
|
61
|
+
private static assertText;
|
|
62
|
+
/**
|
|
63
|
+
* A field value, read as a string. An unquoted number or boolean is read as the text it was written
|
|
64
|
+
* as, so `007` stays `007`: a field holds a literal, which a YAML 1.2 core resolver would otherwise
|
|
65
|
+
* read as the number 7. Java's reader keeps the same text. A value the source policy did not parse
|
|
66
|
+
* has no recorded text, and is read as the string form of the value it holds.
|
|
67
|
+
*/
|
|
68
|
+
private static readValue;
|
|
43
69
|
private parseNode;
|
|
44
70
|
private parseNodeWithoutNotation;
|
|
45
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YamlTemplateInstanceReader.d.ts","sourceRoot":"","sources":["../../../../../../src/org/metadatacenter/io/reader/yaml/YamlTemplateInstanceReader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"YamlTemplateInstanceReader.d.ts","sourceRoot":"","sources":["../../../../../../src/org/metadatacenter/io/reader/yaml/YamlTemplateInstanceReader.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAE3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAO1E,OAAO,EAAE,gCAAgC,EAAE,MAAM,oCAAoC,CAAC;AAuBtF;;;;;;;;;;;;;GAaG;AACH,qBAAa,0BAA2B,SAAQ,0BAA0B;IACxE,OAAO;WAIO,SAAS,IAAI,0BAA0B;IAIrD;;;;OAIG;WACW,mBAAmB,IAAI,0BAA0B;WAIjD,cAAc,CAAC,QAAQ,EAAE,kBAAkB,EAAE,SAAS,GAAE,OAAe,GAAG,0BAA0B;IAI3G,cAAc,CAAC,oBAAoB,EAAE,MAAM,GAAG,gCAAgC;IAK9E,cAAc,CAAC,oBAAoB,EAAE,QAAQ,GAAG,gCAAgC;IAsCvF;;;;;;;OAOG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAkE;IAEvG,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,qBAAqB,CAAwE;IAErH,kGAAkG;IAClG,OAAO,CAAC,MAAM,CAAC,SAAS;IAIxB,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAYhC;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,wBAAwB;IAoBvC,OAAO,CAAC,cAAc;IAuDtB,iGAAiG;IACjG,OAAO,CAAC,mBAAmB;IAS3B;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAmB/B,OAAO,CAAC,MAAM,CAAC,UAAU;IAMzB;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,SAAS;IAQxB,OAAO,CAAC,SAAS;IAcjB,OAAO,CAAC,wBAAwB;CA8BjC"}
|
|
@@ -14,7 +14,8 @@ import { Template } from '../template/Template';
|
|
|
14
14
|
* instance writer builds the `@context` from. Without them the emitted
|
|
15
15
|
* `@context` has no per-property entries and the instance is not valid JSON-LD.
|
|
16
16
|
* - **empty slots** — a child the sparse instance omitted is re-added empty, so
|
|
17
|
-
* every property the template's JSON Schema requires is present
|
|
17
|
+
* every property the template's JSON Schema requires is present, and a
|
|
18
|
+
* repeated child short of its lower bound is filled to it.
|
|
18
19
|
* - **child order** — children are placed in the template's declared order.
|
|
19
20
|
*
|
|
20
21
|
* Values the sparse instance already carries are preserved untouched. Mirrors the
|
|
@@ -25,21 +26,23 @@ export declare class InstanceInflater {
|
|
|
25
26
|
/**
|
|
26
27
|
* Complete an instance against its template.
|
|
27
28
|
*
|
|
28
|
-
* A repeated child
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* the
|
|
29
|
+
* A repeated child has the occurrences its lower bound demands, as the Java inflater gives it, so
|
|
30
|
+
* the instance satisfies its template: one the instance omits starts with that many empty ones,
|
|
31
|
+
* and one it holds fewer of keeps its own and gains empty ones after them. An editor that shows a
|
|
32
|
+
* user the instance as stored can ask for `'empty'` instead, and each repeated child then keeps
|
|
33
|
+
* exactly the occurrences the user saw, none for one the instance omits, rather than gaining
|
|
34
|
+
* occurrences the user never created.
|
|
32
35
|
*/
|
|
33
36
|
static inflate(instance: TemplateInstance, template: Template, repeatedChildren?: 'lowerBound' | 'empty'): TemplateInstance;
|
|
34
37
|
private static emptyField;
|
|
35
38
|
/**
|
|
36
|
-
* The occurrences a
|
|
39
|
+
* The empty occurrences a repeated child holding `held` of them is short of its lower bound, which
|
|
37
40
|
* is the bound both writers state in the template. Every repeated child was given an empty list,
|
|
38
41
|
* so an instance inflated here failed its own template wherever that bound was above zero, and the
|
|
39
|
-
* Java inflater filled it. An attribute-value field
|
|
42
|
+
* Java inflater filled it. An attribute-value field gains none whatever its bound, as there,
|
|
40
43
|
* since its attributes need names nobody has given.
|
|
41
44
|
*/
|
|
42
|
-
private static
|
|
45
|
+
private static missingOccurrences;
|
|
43
46
|
private static inflateContainer;
|
|
44
47
|
}
|
|
45
48
|
//# sourceMappingURL=InstanceInflater.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InstanceInflater.d.ts","sourceRoot":"","sources":["../../../../../../src/org/metadatacenter/model/cedar/template-instance/InstanceInflater.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAOtD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAMhD
|
|
1
|
+
{"version":3,"file":"InstanceInflater.d.ts","sourceRoot":"","sources":["../../../../../../src/org/metadatacenter/model/cedar/template-instance/InstanceInflater.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAOtD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAMhD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,gBAAgB;IAC3B,OAAO;IAEP;;;;;;;;;OASG;WACW,OAAO,CACnB,QAAQ,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,GAAE,YAAY,GAAG,OAAsB,GACtD,gBAAgB;IAKnB,OAAO,CAAC,MAAM,CAAC,UAAU;IAqBzB;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAajC,OAAO,CAAC,MAAM,CAAC,gBAAgB;CAsEhC"}
|
package/package.json
CHANGED