yarramate 1.25.0 → 1.25.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.
- package/dist/adapters/visual/layout-sidecar.d.ts +28 -0
- package/dist/adapters/visual/layout-sidecar.js +61 -0
- package/dist/adapters/visual/session-server.js +20 -39
- package/dist/adapters/visual/view-identity.d.ts +13 -0
- package/dist/adapters/visual/view-identity.js +29 -11
- package/dist/schema-validation.d.ts +1 -0
- package/dist/schema-validation.js +1 -0
- package/dist/schema-validators.generated.d.ts +6 -0
- package/dist/schema-validators.generated.js +592 -1
- package/dist/visual-app/assets/{elk.bundled-CLux5E_P.js → elk.bundled-ZYNFKdcv.js} +1 -1
- package/dist/visual-app/assets/{index-DGkU2CSB.js → index-CMqEmjU2.js} +2 -2
- package/dist/visual-app/index.html +1 -1
- package/dist/visual-app-lib/editor.js +23866 -23223
- package/dist/visual-app-lib/types/adapters/visual/layout-sidecar.d.ts +28 -0
- package/dist/visual-app-lib/types/adapters/visual/view-identity.d.ts +13 -0
- package/dist/visual-app-lib/types/schema-validation.d.ts +1 -0
- package/dist/visual-app-lib/types/schema-validators.generated.d.ts +6 -0
- package/docs/CONSUMING-YARRAMATE.md +7 -0
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// file and not a runtime one; the two pure helpers imported below are
|
|
10
10
|
// all the runtime still takes from ajv.
|
|
11
11
|
//
|
|
12
|
-
// schema/ sha256:
|
|
12
|
+
// schema/ sha256: 00cb6c9fd71eaa7353b5463dfc7206df81c621e98e0edf47cb6cc0dba539b3b1
|
|
13
13
|
import ajvRuntime0Module from 'ajv/dist/runtime/ucs2length.js';
|
|
14
14
|
const ajvRuntime0 = ajvRuntime0Module.default ?? ajvRuntime0Module;
|
|
15
15
|
import ajvRuntime1Module from 'ajv/dist/runtime/equal.js';
|
|
@@ -11864,3 +11864,594 @@ else {
|
|
|
11864
11864
|
errors++;
|
|
11865
11865
|
} validate74.errors = vErrors; return errors === 0; }
|
|
11866
11866
|
validate74.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|
|
11867
|
+
export const validateVisualLayout = validate82;
|
|
11868
|
+
const schema187 = { "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://yarramate.org/schema/visual-layout/v1", "title": "YarraMate visual layout", "description": "Adapter-owned drag-position sidecar for one saved projection's canvas (ADR 0023). Never validated by Core, never routed through apply.", "type": "object", "additionalProperties": false, "required": ["format", "projectionId", "positions"], "properties": { "format": { "const": "yarramate/visual-layout/v1" }, "projectionId": { "$ref": "https://yarramate.org/schema/projection/v1#/$defs/id" }, "positions": { "$ref": "#/$defs/positions" }, "folded": { "description": "The instances this view draws folded (#473). Written WITH the positions in the same document and always in full, never as a patch: a reader that half-applies a fold state draws a box whose contents are somewhere else on the canvas. Absent means the view's own `presentation.fold` decides.", "$ref": "#/$defs/subjectIds" }, "unfolded": { "description": "The instances this view draws OPEN even though `presentation.fold` says to fold them (#473). Two lists rather than one, because a reader who opened a box must not have it close again the moment the view's default is read back.", "$ref": "#/$defs/subjectIds" }, "routes": { "description": "The routes the canvas was drawing when the positions were saved (ADR 0147), keyed by relationship id, in absolute canvas coordinates from the source end. A route is applied only while both of its ends still sit where `positions` says; an edge whose end has moved draws straight. Absent means the layout recomputes every route.", "$ref": "#/$defs/routes" } }, "$defs": { "subjectIds": { "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 } }, "positions": { "type": "object", "propertyNames": { "type": "string", "minLength": 1 }, "additionalProperties": { "$ref": "#/$defs/position" } }, "position": { "type": "object", "additionalProperties": false, "required": ["x", "y"], "properties": { "x": { "type": "number" }, "y": { "type": "number" } } }, "routes": { "type": "object", "propertyNames": { "type": "string", "minLength": 1 }, "additionalProperties": { "$ref": "#/$defs/route" } }, "route": { "type": "object", "additionalProperties": false, "required": ["points", "labelAt"], "properties": { "points": { "description": "Source end first, both endpoints included, so a route is never fewer than two points.", "type": "array", "minItems": 2, "items": { "$ref": "#/$defs/position" } }, "labelAt": { "description": "How far along the route, in px from the source end, the label's centre sits; null for a route with no label.", "type": ["number", "null"] } } } } };
|
|
11869
|
+
const schema191 = { "type": "array", "uniqueItems": true, "items": { "type": "string", "minLength": 1 } };
|
|
11870
|
+
const schema189 = { "type": "object", "propertyNames": { "type": "string", "minLength": 1 }, "additionalProperties": { "$ref": "#/$defs/position" } };
|
|
11871
|
+
const schema190 = { "type": "object", "additionalProperties": false, "required": ["x", "y"], "properties": { "x": { "type": "number" }, "y": { "type": "number" } } };
|
|
11872
|
+
function validate83(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { let vErrors = null; let errors = 0; const evaluated0 = validate83.evaluated; if (evaluated0.dynamicProps) {
|
|
11873
|
+
evaluated0.props = undefined;
|
|
11874
|
+
} if (evaluated0.dynamicItems) {
|
|
11875
|
+
evaluated0.items = undefined;
|
|
11876
|
+
} if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
11877
|
+
for (const key0 in data) {
|
|
11878
|
+
const _errs1 = errors;
|
|
11879
|
+
if (typeof key0 === "string") {
|
|
11880
|
+
if (func2(key0) < 1) {
|
|
11881
|
+
const err0 = { instancePath, schemaPath: "#/propertyNames/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters", propertyName: key0 };
|
|
11882
|
+
if (vErrors === null) {
|
|
11883
|
+
vErrors = [err0];
|
|
11884
|
+
}
|
|
11885
|
+
else {
|
|
11886
|
+
vErrors.push(err0);
|
|
11887
|
+
}
|
|
11888
|
+
errors++;
|
|
11889
|
+
}
|
|
11890
|
+
}
|
|
11891
|
+
else {
|
|
11892
|
+
const err1 = { instancePath, schemaPath: "#/propertyNames/type", keyword: "type", params: { type: "string" }, message: "must be string", propertyName: key0 };
|
|
11893
|
+
if (vErrors === null) {
|
|
11894
|
+
vErrors = [err1];
|
|
11895
|
+
}
|
|
11896
|
+
else {
|
|
11897
|
+
vErrors.push(err1);
|
|
11898
|
+
}
|
|
11899
|
+
errors++;
|
|
11900
|
+
}
|
|
11901
|
+
var valid0 = _errs1 === errors;
|
|
11902
|
+
if (!valid0) {
|
|
11903
|
+
const err2 = { instancePath, schemaPath: "#/propertyNames", keyword: "propertyNames", params: { propertyName: key0 }, message: "property name must be valid" };
|
|
11904
|
+
if (vErrors === null) {
|
|
11905
|
+
vErrors = [err2];
|
|
11906
|
+
}
|
|
11907
|
+
else {
|
|
11908
|
+
vErrors.push(err2);
|
|
11909
|
+
}
|
|
11910
|
+
errors++;
|
|
11911
|
+
}
|
|
11912
|
+
}
|
|
11913
|
+
for (const key1 in data) {
|
|
11914
|
+
let data0 = data[key1];
|
|
11915
|
+
if (data0 && typeof data0 == "object" && !Array.isArray(data0)) {
|
|
11916
|
+
if (data0.x === undefined) {
|
|
11917
|
+
const err3 = { instancePath: instancePath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/$defs/position/required", keyword: "required", params: { missingProperty: "x" }, message: "must have required property '" + "x" + "'" };
|
|
11918
|
+
if (vErrors === null) {
|
|
11919
|
+
vErrors = [err3];
|
|
11920
|
+
}
|
|
11921
|
+
else {
|
|
11922
|
+
vErrors.push(err3);
|
|
11923
|
+
}
|
|
11924
|
+
errors++;
|
|
11925
|
+
}
|
|
11926
|
+
if (data0.y === undefined) {
|
|
11927
|
+
const err4 = { instancePath: instancePath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/$defs/position/required", keyword: "required", params: { missingProperty: "y" }, message: "must have required property '" + "y" + "'" };
|
|
11928
|
+
if (vErrors === null) {
|
|
11929
|
+
vErrors = [err4];
|
|
11930
|
+
}
|
|
11931
|
+
else {
|
|
11932
|
+
vErrors.push(err4);
|
|
11933
|
+
}
|
|
11934
|
+
errors++;
|
|
11935
|
+
}
|
|
11936
|
+
for (const key2 in data0) {
|
|
11937
|
+
if (!((key2 === "x") || (key2 === "y"))) {
|
|
11938
|
+
const err5 = { instancePath: instancePath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/$defs/position/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key2 }, message: "must NOT have additional properties" };
|
|
11939
|
+
if (vErrors === null) {
|
|
11940
|
+
vErrors = [err5];
|
|
11941
|
+
}
|
|
11942
|
+
else {
|
|
11943
|
+
vErrors.push(err5);
|
|
11944
|
+
}
|
|
11945
|
+
errors++;
|
|
11946
|
+
}
|
|
11947
|
+
}
|
|
11948
|
+
if (data0.x !== undefined) {
|
|
11949
|
+
let data1 = data0.x;
|
|
11950
|
+
if (!((typeof data1 == "number") && (isFinite(data1)))) {
|
|
11951
|
+
const err6 = { instancePath: instancePath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1") + "/x", schemaPath: "#/$defs/position/properties/x/type", keyword: "type", params: { type: "number" }, message: "must be number" };
|
|
11952
|
+
if (vErrors === null) {
|
|
11953
|
+
vErrors = [err6];
|
|
11954
|
+
}
|
|
11955
|
+
else {
|
|
11956
|
+
vErrors.push(err6);
|
|
11957
|
+
}
|
|
11958
|
+
errors++;
|
|
11959
|
+
}
|
|
11960
|
+
}
|
|
11961
|
+
if (data0.y !== undefined) {
|
|
11962
|
+
let data2 = data0.y;
|
|
11963
|
+
if (!((typeof data2 == "number") && (isFinite(data2)))) {
|
|
11964
|
+
const err7 = { instancePath: instancePath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1") + "/y", schemaPath: "#/$defs/position/properties/y/type", keyword: "type", params: { type: "number" }, message: "must be number" };
|
|
11965
|
+
if (vErrors === null) {
|
|
11966
|
+
vErrors = [err7];
|
|
11967
|
+
}
|
|
11968
|
+
else {
|
|
11969
|
+
vErrors.push(err7);
|
|
11970
|
+
}
|
|
11971
|
+
errors++;
|
|
11972
|
+
}
|
|
11973
|
+
}
|
|
11974
|
+
}
|
|
11975
|
+
else {
|
|
11976
|
+
const err8 = { instancePath: instancePath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"), schemaPath: "#/$defs/position/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
11977
|
+
if (vErrors === null) {
|
|
11978
|
+
vErrors = [err8];
|
|
11979
|
+
}
|
|
11980
|
+
else {
|
|
11981
|
+
vErrors.push(err8);
|
|
11982
|
+
}
|
|
11983
|
+
errors++;
|
|
11984
|
+
}
|
|
11985
|
+
}
|
|
11986
|
+
}
|
|
11987
|
+
else {
|
|
11988
|
+
const err9 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
11989
|
+
if (vErrors === null) {
|
|
11990
|
+
vErrors = [err9];
|
|
11991
|
+
}
|
|
11992
|
+
else {
|
|
11993
|
+
vErrors.push(err9);
|
|
11994
|
+
}
|
|
11995
|
+
errors++;
|
|
11996
|
+
} validate83.errors = vErrors; return errors === 0; }
|
|
11997
|
+
validate83.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|
|
11998
|
+
const schema193 = { "type": "object", "propertyNames": { "type": "string", "minLength": 1 }, "additionalProperties": { "$ref": "#/$defs/route" } };
|
|
11999
|
+
const schema194 = { "type": "object", "additionalProperties": false, "required": ["points", "labelAt"], "properties": { "points": { "description": "Source end first, both endpoints included, so a route is never fewer than two points.", "type": "array", "minItems": 2, "items": { "$ref": "#/$defs/position" } }, "labelAt": { "description": "How far along the route, in px from the source end, the label's centre sits; null for a route with no label.", "type": ["number", "null"] } } };
|
|
12000
|
+
function validate86(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { let vErrors = null; let errors = 0; const evaluated0 = validate86.evaluated; if (evaluated0.dynamicProps) {
|
|
12001
|
+
evaluated0.props = undefined;
|
|
12002
|
+
} if (evaluated0.dynamicItems) {
|
|
12003
|
+
evaluated0.items = undefined;
|
|
12004
|
+
} if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
12005
|
+
if (data.points === undefined) {
|
|
12006
|
+
const err0 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "points" }, message: "must have required property '" + "points" + "'" };
|
|
12007
|
+
if (vErrors === null) {
|
|
12008
|
+
vErrors = [err0];
|
|
12009
|
+
}
|
|
12010
|
+
else {
|
|
12011
|
+
vErrors.push(err0);
|
|
12012
|
+
}
|
|
12013
|
+
errors++;
|
|
12014
|
+
}
|
|
12015
|
+
if (data.labelAt === undefined) {
|
|
12016
|
+
const err1 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "labelAt" }, message: "must have required property '" + "labelAt" + "'" };
|
|
12017
|
+
if (vErrors === null) {
|
|
12018
|
+
vErrors = [err1];
|
|
12019
|
+
}
|
|
12020
|
+
else {
|
|
12021
|
+
vErrors.push(err1);
|
|
12022
|
+
}
|
|
12023
|
+
errors++;
|
|
12024
|
+
}
|
|
12025
|
+
for (const key0 in data) {
|
|
12026
|
+
if (!((key0 === "points") || (key0 === "labelAt"))) {
|
|
12027
|
+
const err2 = { instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
|
|
12028
|
+
if (vErrors === null) {
|
|
12029
|
+
vErrors = [err2];
|
|
12030
|
+
}
|
|
12031
|
+
else {
|
|
12032
|
+
vErrors.push(err2);
|
|
12033
|
+
}
|
|
12034
|
+
errors++;
|
|
12035
|
+
}
|
|
12036
|
+
}
|
|
12037
|
+
if (data.points !== undefined) {
|
|
12038
|
+
let data0 = data.points;
|
|
12039
|
+
if (Array.isArray(data0)) {
|
|
12040
|
+
if (data0.length < 2) {
|
|
12041
|
+
const err3 = { instancePath: instancePath + "/points", schemaPath: "#/properties/points/minItems", keyword: "minItems", params: { limit: 2 }, message: "must NOT have fewer than 2 items" };
|
|
12042
|
+
if (vErrors === null) {
|
|
12043
|
+
vErrors = [err3];
|
|
12044
|
+
}
|
|
12045
|
+
else {
|
|
12046
|
+
vErrors.push(err3);
|
|
12047
|
+
}
|
|
12048
|
+
errors++;
|
|
12049
|
+
}
|
|
12050
|
+
const len0 = data0.length;
|
|
12051
|
+
for (let i0 = 0; i0 < len0; i0++) {
|
|
12052
|
+
let data1 = data0[i0];
|
|
12053
|
+
if (data1 && typeof data1 == "object" && !Array.isArray(data1)) {
|
|
12054
|
+
if (data1.x === undefined) {
|
|
12055
|
+
const err4 = { instancePath: instancePath + "/points/" + i0, schemaPath: "#/$defs/position/required", keyword: "required", params: { missingProperty: "x" }, message: "must have required property '" + "x" + "'" };
|
|
12056
|
+
if (vErrors === null) {
|
|
12057
|
+
vErrors = [err4];
|
|
12058
|
+
}
|
|
12059
|
+
else {
|
|
12060
|
+
vErrors.push(err4);
|
|
12061
|
+
}
|
|
12062
|
+
errors++;
|
|
12063
|
+
}
|
|
12064
|
+
if (data1.y === undefined) {
|
|
12065
|
+
const err5 = { instancePath: instancePath + "/points/" + i0, schemaPath: "#/$defs/position/required", keyword: "required", params: { missingProperty: "y" }, message: "must have required property '" + "y" + "'" };
|
|
12066
|
+
if (vErrors === null) {
|
|
12067
|
+
vErrors = [err5];
|
|
12068
|
+
}
|
|
12069
|
+
else {
|
|
12070
|
+
vErrors.push(err5);
|
|
12071
|
+
}
|
|
12072
|
+
errors++;
|
|
12073
|
+
}
|
|
12074
|
+
for (const key1 in data1) {
|
|
12075
|
+
if (!((key1 === "x") || (key1 === "y"))) {
|
|
12076
|
+
const err6 = { instancePath: instancePath + "/points/" + i0, schemaPath: "#/$defs/position/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" };
|
|
12077
|
+
if (vErrors === null) {
|
|
12078
|
+
vErrors = [err6];
|
|
12079
|
+
}
|
|
12080
|
+
else {
|
|
12081
|
+
vErrors.push(err6);
|
|
12082
|
+
}
|
|
12083
|
+
errors++;
|
|
12084
|
+
}
|
|
12085
|
+
}
|
|
12086
|
+
if (data1.x !== undefined) {
|
|
12087
|
+
let data2 = data1.x;
|
|
12088
|
+
if (!((typeof data2 == "number") && (isFinite(data2)))) {
|
|
12089
|
+
const err7 = { instancePath: instancePath + "/points/" + i0 + "/x", schemaPath: "#/$defs/position/properties/x/type", keyword: "type", params: { type: "number" }, message: "must be number" };
|
|
12090
|
+
if (vErrors === null) {
|
|
12091
|
+
vErrors = [err7];
|
|
12092
|
+
}
|
|
12093
|
+
else {
|
|
12094
|
+
vErrors.push(err7);
|
|
12095
|
+
}
|
|
12096
|
+
errors++;
|
|
12097
|
+
}
|
|
12098
|
+
}
|
|
12099
|
+
if (data1.y !== undefined) {
|
|
12100
|
+
let data3 = data1.y;
|
|
12101
|
+
if (!((typeof data3 == "number") && (isFinite(data3)))) {
|
|
12102
|
+
const err8 = { instancePath: instancePath + "/points/" + i0 + "/y", schemaPath: "#/$defs/position/properties/y/type", keyword: "type", params: { type: "number" }, message: "must be number" };
|
|
12103
|
+
if (vErrors === null) {
|
|
12104
|
+
vErrors = [err8];
|
|
12105
|
+
}
|
|
12106
|
+
else {
|
|
12107
|
+
vErrors.push(err8);
|
|
12108
|
+
}
|
|
12109
|
+
errors++;
|
|
12110
|
+
}
|
|
12111
|
+
}
|
|
12112
|
+
}
|
|
12113
|
+
else {
|
|
12114
|
+
const err9 = { instancePath: instancePath + "/points/" + i0, schemaPath: "#/$defs/position/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
12115
|
+
if (vErrors === null) {
|
|
12116
|
+
vErrors = [err9];
|
|
12117
|
+
}
|
|
12118
|
+
else {
|
|
12119
|
+
vErrors.push(err9);
|
|
12120
|
+
}
|
|
12121
|
+
errors++;
|
|
12122
|
+
}
|
|
12123
|
+
}
|
|
12124
|
+
}
|
|
12125
|
+
else {
|
|
12126
|
+
const err10 = { instancePath: instancePath + "/points", schemaPath: "#/properties/points/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
12127
|
+
if (vErrors === null) {
|
|
12128
|
+
vErrors = [err10];
|
|
12129
|
+
}
|
|
12130
|
+
else {
|
|
12131
|
+
vErrors.push(err10);
|
|
12132
|
+
}
|
|
12133
|
+
errors++;
|
|
12134
|
+
}
|
|
12135
|
+
}
|
|
12136
|
+
if (data.labelAt !== undefined) {
|
|
12137
|
+
let data4 = data.labelAt;
|
|
12138
|
+
if ((!((typeof data4 == "number") && (isFinite(data4)))) && (data4 !== null)) {
|
|
12139
|
+
const err11 = { instancePath: instancePath + "/labelAt", schemaPath: "#/properties/labelAt/type", keyword: "type", params: { type: schema194.properties.labelAt.type }, message: "must be number,null" };
|
|
12140
|
+
if (vErrors === null) {
|
|
12141
|
+
vErrors = [err11];
|
|
12142
|
+
}
|
|
12143
|
+
else {
|
|
12144
|
+
vErrors.push(err11);
|
|
12145
|
+
}
|
|
12146
|
+
errors++;
|
|
12147
|
+
}
|
|
12148
|
+
}
|
|
12149
|
+
}
|
|
12150
|
+
else {
|
|
12151
|
+
const err12 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
12152
|
+
if (vErrors === null) {
|
|
12153
|
+
vErrors = [err12];
|
|
12154
|
+
}
|
|
12155
|
+
else {
|
|
12156
|
+
vErrors.push(err12);
|
|
12157
|
+
}
|
|
12158
|
+
errors++;
|
|
12159
|
+
} validate86.errors = vErrors; return errors === 0; }
|
|
12160
|
+
validate86.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|
|
12161
|
+
function validate85(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { let vErrors = null; let errors = 0; const evaluated0 = validate85.evaluated; if (evaluated0.dynamicProps) {
|
|
12162
|
+
evaluated0.props = undefined;
|
|
12163
|
+
} if (evaluated0.dynamicItems) {
|
|
12164
|
+
evaluated0.items = undefined;
|
|
12165
|
+
} if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
12166
|
+
for (const key0 in data) {
|
|
12167
|
+
const _errs1 = errors;
|
|
12168
|
+
if (typeof key0 === "string") {
|
|
12169
|
+
if (func2(key0) < 1) {
|
|
12170
|
+
const err0 = { instancePath, schemaPath: "#/propertyNames/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters", propertyName: key0 };
|
|
12171
|
+
if (vErrors === null) {
|
|
12172
|
+
vErrors = [err0];
|
|
12173
|
+
}
|
|
12174
|
+
else {
|
|
12175
|
+
vErrors.push(err0);
|
|
12176
|
+
}
|
|
12177
|
+
errors++;
|
|
12178
|
+
}
|
|
12179
|
+
}
|
|
12180
|
+
else {
|
|
12181
|
+
const err1 = { instancePath, schemaPath: "#/propertyNames/type", keyword: "type", params: { type: "string" }, message: "must be string", propertyName: key0 };
|
|
12182
|
+
if (vErrors === null) {
|
|
12183
|
+
vErrors = [err1];
|
|
12184
|
+
}
|
|
12185
|
+
else {
|
|
12186
|
+
vErrors.push(err1);
|
|
12187
|
+
}
|
|
12188
|
+
errors++;
|
|
12189
|
+
}
|
|
12190
|
+
var valid0 = _errs1 === errors;
|
|
12191
|
+
if (!valid0) {
|
|
12192
|
+
const err2 = { instancePath, schemaPath: "#/propertyNames", keyword: "propertyNames", params: { propertyName: key0 }, message: "property name must be valid" };
|
|
12193
|
+
if (vErrors === null) {
|
|
12194
|
+
vErrors = [err2];
|
|
12195
|
+
}
|
|
12196
|
+
else {
|
|
12197
|
+
vErrors.push(err2);
|
|
12198
|
+
}
|
|
12199
|
+
errors++;
|
|
12200
|
+
}
|
|
12201
|
+
}
|
|
12202
|
+
for (const key1 in data) {
|
|
12203
|
+
if (!(validate86(data[key1], { instancePath: instancePath + "/" + key1.replace(/~/g, "~0").replace(/\//g, "~1"), parentData: data, parentDataProperty: key1, rootData, dynamicAnchors }))) {
|
|
12204
|
+
vErrors = vErrors === null ? validate86.errors : vErrors.concat(validate86.errors);
|
|
12205
|
+
errors = vErrors.length;
|
|
12206
|
+
}
|
|
12207
|
+
}
|
|
12208
|
+
}
|
|
12209
|
+
else {
|
|
12210
|
+
const err3 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
12211
|
+
if (vErrors === null) {
|
|
12212
|
+
vErrors = [err3];
|
|
12213
|
+
}
|
|
12214
|
+
else {
|
|
12215
|
+
vErrors.push(err3);
|
|
12216
|
+
}
|
|
12217
|
+
errors++;
|
|
12218
|
+
} validate85.errors = vErrors; return errors === 0; }
|
|
12219
|
+
validate85.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|
|
12220
|
+
function validate82(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) { /*# sourceURL="https://yarramate.org/schema/visual-layout/v1" */ ; let vErrors = null; let errors = 0; const evaluated0 = validate82.evaluated; if (evaluated0.dynamicProps) {
|
|
12221
|
+
evaluated0.props = undefined;
|
|
12222
|
+
} if (evaluated0.dynamicItems) {
|
|
12223
|
+
evaluated0.items = undefined;
|
|
12224
|
+
} if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
12225
|
+
if (data.format === undefined) {
|
|
12226
|
+
const err0 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "format" }, message: "must have required property '" + "format" + "'" };
|
|
12227
|
+
if (vErrors === null) {
|
|
12228
|
+
vErrors = [err0];
|
|
12229
|
+
}
|
|
12230
|
+
else {
|
|
12231
|
+
vErrors.push(err0);
|
|
12232
|
+
}
|
|
12233
|
+
errors++;
|
|
12234
|
+
}
|
|
12235
|
+
if (data.projectionId === undefined) {
|
|
12236
|
+
const err1 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "projectionId" }, message: "must have required property '" + "projectionId" + "'" };
|
|
12237
|
+
if (vErrors === null) {
|
|
12238
|
+
vErrors = [err1];
|
|
12239
|
+
}
|
|
12240
|
+
else {
|
|
12241
|
+
vErrors.push(err1);
|
|
12242
|
+
}
|
|
12243
|
+
errors++;
|
|
12244
|
+
}
|
|
12245
|
+
if (data.positions === undefined) {
|
|
12246
|
+
const err2 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "positions" }, message: "must have required property '" + "positions" + "'" };
|
|
12247
|
+
if (vErrors === null) {
|
|
12248
|
+
vErrors = [err2];
|
|
12249
|
+
}
|
|
12250
|
+
else {
|
|
12251
|
+
vErrors.push(err2);
|
|
12252
|
+
}
|
|
12253
|
+
errors++;
|
|
12254
|
+
}
|
|
12255
|
+
for (const key0 in data) {
|
|
12256
|
+
if (!((((((key0 === "format") || (key0 === "projectionId")) || (key0 === "positions")) || (key0 === "folded")) || (key0 === "unfolded")) || (key0 === "routes"))) {
|
|
12257
|
+
const err3 = { instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
|
|
12258
|
+
if (vErrors === null) {
|
|
12259
|
+
vErrors = [err3];
|
|
12260
|
+
}
|
|
12261
|
+
else {
|
|
12262
|
+
vErrors.push(err3);
|
|
12263
|
+
}
|
|
12264
|
+
errors++;
|
|
12265
|
+
}
|
|
12266
|
+
}
|
|
12267
|
+
if (data.format !== undefined) {
|
|
12268
|
+
if ("yarramate/visual-layout/v1" !== data.format) {
|
|
12269
|
+
const err4 = { instancePath: instancePath + "/format", schemaPath: "#/properties/format/const", keyword: "const", params: { allowedValue: "yarramate/visual-layout/v1" }, message: "must be equal to constant" };
|
|
12270
|
+
if (vErrors === null) {
|
|
12271
|
+
vErrors = [err4];
|
|
12272
|
+
}
|
|
12273
|
+
else {
|
|
12274
|
+
vErrors.push(err4);
|
|
12275
|
+
}
|
|
12276
|
+
errors++;
|
|
12277
|
+
}
|
|
12278
|
+
}
|
|
12279
|
+
if (data.projectionId !== undefined) {
|
|
12280
|
+
let data1 = data.projectionId;
|
|
12281
|
+
if (typeof data1 === "string") {
|
|
12282
|
+
if (!pattern4.test(data1)) {
|
|
12283
|
+
const err5 = { instancePath: instancePath + "/projectionId", schemaPath: "https://yarramate.org/schema/projection/v1#/$defs/id/pattern", keyword: "pattern", params: { pattern: "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$" }, message: "must match pattern \"" + "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$" + "\"" };
|
|
12284
|
+
if (vErrors === null) {
|
|
12285
|
+
vErrors = [err5];
|
|
12286
|
+
}
|
|
12287
|
+
else {
|
|
12288
|
+
vErrors.push(err5);
|
|
12289
|
+
}
|
|
12290
|
+
errors++;
|
|
12291
|
+
}
|
|
12292
|
+
}
|
|
12293
|
+
else {
|
|
12294
|
+
const err6 = { instancePath: instancePath + "/projectionId", schemaPath: "https://yarramate.org/schema/projection/v1#/$defs/id/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
12295
|
+
if (vErrors === null) {
|
|
12296
|
+
vErrors = [err6];
|
|
12297
|
+
}
|
|
12298
|
+
else {
|
|
12299
|
+
vErrors.push(err6);
|
|
12300
|
+
}
|
|
12301
|
+
errors++;
|
|
12302
|
+
}
|
|
12303
|
+
}
|
|
12304
|
+
if (data.positions !== undefined) {
|
|
12305
|
+
if (!(validate83(data.positions, { instancePath: instancePath + "/positions", parentData: data, parentDataProperty: "positions", rootData, dynamicAnchors }))) {
|
|
12306
|
+
vErrors = vErrors === null ? validate83.errors : vErrors.concat(validate83.errors);
|
|
12307
|
+
errors = vErrors.length;
|
|
12308
|
+
}
|
|
12309
|
+
}
|
|
12310
|
+
if (data.folded !== undefined) {
|
|
12311
|
+
let data3 = data.folded;
|
|
12312
|
+
if (Array.isArray(data3)) {
|
|
12313
|
+
const len0 = data3.length;
|
|
12314
|
+
for (let i0 = 0; i0 < len0; i0++) {
|
|
12315
|
+
let data4 = data3[i0];
|
|
12316
|
+
if (typeof data4 === "string") {
|
|
12317
|
+
if (func2(data4) < 1) {
|
|
12318
|
+
const err7 = { instancePath: instancePath + "/folded/" + i0, schemaPath: "#/$defs/subjectIds/items/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
|
|
12319
|
+
if (vErrors === null) {
|
|
12320
|
+
vErrors = [err7];
|
|
12321
|
+
}
|
|
12322
|
+
else {
|
|
12323
|
+
vErrors.push(err7);
|
|
12324
|
+
}
|
|
12325
|
+
errors++;
|
|
12326
|
+
}
|
|
12327
|
+
}
|
|
12328
|
+
else {
|
|
12329
|
+
const err8 = { instancePath: instancePath + "/folded/" + i0, schemaPath: "#/$defs/subjectIds/items/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
12330
|
+
if (vErrors === null) {
|
|
12331
|
+
vErrors = [err8];
|
|
12332
|
+
}
|
|
12333
|
+
else {
|
|
12334
|
+
vErrors.push(err8);
|
|
12335
|
+
}
|
|
12336
|
+
errors++;
|
|
12337
|
+
}
|
|
12338
|
+
}
|
|
12339
|
+
let i1 = data3.length;
|
|
12340
|
+
let j0;
|
|
12341
|
+
if (i1 > 1) {
|
|
12342
|
+
const indices0 = {};
|
|
12343
|
+
for (; i1--;) {
|
|
12344
|
+
let item0 = data3[i1];
|
|
12345
|
+
if (typeof item0 !== "string") {
|
|
12346
|
+
continue;
|
|
12347
|
+
}
|
|
12348
|
+
if (typeof indices0[item0] == "number") {
|
|
12349
|
+
j0 = indices0[item0];
|
|
12350
|
+
const err9 = { instancePath: instancePath + "/folded", schemaPath: "#/$defs/subjectIds/uniqueItems", keyword: "uniqueItems", params: { i: i1, j: j0 }, message: "must NOT have duplicate items (items ## " + j0 + " and " + i1 + " are identical)" };
|
|
12351
|
+
if (vErrors === null) {
|
|
12352
|
+
vErrors = [err9];
|
|
12353
|
+
}
|
|
12354
|
+
else {
|
|
12355
|
+
vErrors.push(err9);
|
|
12356
|
+
}
|
|
12357
|
+
errors++;
|
|
12358
|
+
break;
|
|
12359
|
+
}
|
|
12360
|
+
indices0[item0] = i1;
|
|
12361
|
+
}
|
|
12362
|
+
}
|
|
12363
|
+
}
|
|
12364
|
+
else {
|
|
12365
|
+
const err10 = { instancePath: instancePath + "/folded", schemaPath: "#/$defs/subjectIds/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
12366
|
+
if (vErrors === null) {
|
|
12367
|
+
vErrors = [err10];
|
|
12368
|
+
}
|
|
12369
|
+
else {
|
|
12370
|
+
vErrors.push(err10);
|
|
12371
|
+
}
|
|
12372
|
+
errors++;
|
|
12373
|
+
}
|
|
12374
|
+
}
|
|
12375
|
+
if (data.unfolded !== undefined) {
|
|
12376
|
+
let data5 = data.unfolded;
|
|
12377
|
+
if (Array.isArray(data5)) {
|
|
12378
|
+
const len1 = data5.length;
|
|
12379
|
+
for (let i2 = 0; i2 < len1; i2++) {
|
|
12380
|
+
let data6 = data5[i2];
|
|
12381
|
+
if (typeof data6 === "string") {
|
|
12382
|
+
if (func2(data6) < 1) {
|
|
12383
|
+
const err11 = { instancePath: instancePath + "/unfolded/" + i2, schemaPath: "#/$defs/subjectIds/items/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
|
|
12384
|
+
if (vErrors === null) {
|
|
12385
|
+
vErrors = [err11];
|
|
12386
|
+
}
|
|
12387
|
+
else {
|
|
12388
|
+
vErrors.push(err11);
|
|
12389
|
+
}
|
|
12390
|
+
errors++;
|
|
12391
|
+
}
|
|
12392
|
+
}
|
|
12393
|
+
else {
|
|
12394
|
+
const err12 = { instancePath: instancePath + "/unfolded/" + i2, schemaPath: "#/$defs/subjectIds/items/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
12395
|
+
if (vErrors === null) {
|
|
12396
|
+
vErrors = [err12];
|
|
12397
|
+
}
|
|
12398
|
+
else {
|
|
12399
|
+
vErrors.push(err12);
|
|
12400
|
+
}
|
|
12401
|
+
errors++;
|
|
12402
|
+
}
|
|
12403
|
+
}
|
|
12404
|
+
let i3 = data5.length;
|
|
12405
|
+
let j1;
|
|
12406
|
+
if (i3 > 1) {
|
|
12407
|
+
const indices1 = {};
|
|
12408
|
+
for (; i3--;) {
|
|
12409
|
+
let item1 = data5[i3];
|
|
12410
|
+
if (typeof item1 !== "string") {
|
|
12411
|
+
continue;
|
|
12412
|
+
}
|
|
12413
|
+
if (typeof indices1[item1] == "number") {
|
|
12414
|
+
j1 = indices1[item1];
|
|
12415
|
+
const err13 = { instancePath: instancePath + "/unfolded", schemaPath: "#/$defs/subjectIds/uniqueItems", keyword: "uniqueItems", params: { i: i3, j: j1 }, message: "must NOT have duplicate items (items ## " + j1 + " and " + i3 + " are identical)" };
|
|
12416
|
+
if (vErrors === null) {
|
|
12417
|
+
vErrors = [err13];
|
|
12418
|
+
}
|
|
12419
|
+
else {
|
|
12420
|
+
vErrors.push(err13);
|
|
12421
|
+
}
|
|
12422
|
+
errors++;
|
|
12423
|
+
break;
|
|
12424
|
+
}
|
|
12425
|
+
indices1[item1] = i3;
|
|
12426
|
+
}
|
|
12427
|
+
}
|
|
12428
|
+
}
|
|
12429
|
+
else {
|
|
12430
|
+
const err14 = { instancePath: instancePath + "/unfolded", schemaPath: "#/$defs/subjectIds/type", keyword: "type", params: { type: "array" }, message: "must be array" };
|
|
12431
|
+
if (vErrors === null) {
|
|
12432
|
+
vErrors = [err14];
|
|
12433
|
+
}
|
|
12434
|
+
else {
|
|
12435
|
+
vErrors.push(err14);
|
|
12436
|
+
}
|
|
12437
|
+
errors++;
|
|
12438
|
+
}
|
|
12439
|
+
}
|
|
12440
|
+
if (data.routes !== undefined) {
|
|
12441
|
+
if (!(validate85(data.routes, { instancePath: instancePath + "/routes", parentData: data, parentDataProperty: "routes", rootData, dynamicAnchors }))) {
|
|
12442
|
+
vErrors = vErrors === null ? validate85.errors : vErrors.concat(validate85.errors);
|
|
12443
|
+
errors = vErrors.length;
|
|
12444
|
+
}
|
|
12445
|
+
}
|
|
12446
|
+
}
|
|
12447
|
+
else {
|
|
12448
|
+
const err15 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
12449
|
+
if (vErrors === null) {
|
|
12450
|
+
vErrors = [err15];
|
|
12451
|
+
}
|
|
12452
|
+
else {
|
|
12453
|
+
vErrors.push(err15);
|
|
12454
|
+
}
|
|
12455
|
+
errors++;
|
|
12456
|
+
} validate82.errors = vErrors; return errors === 0; }
|
|
12457
|
+
validate82.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
|