efiencrypt 1.0.0 → 1.1.0
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 +5 -1
- package/{build-laCVTTyp.js → build-BfNzd1Cv.js} +677 -208
- package/efiencrypt +3 -3
- package/{extract-BW1V8DVW.js → extract-BvhlZgSs.js} +1 -1
- package/handlers.d.ts +4 -0
- package/index.js +1 -1
- package/package.json +1 -1
- package/schema.json +1 -1
- package/type.d.ts +16 -1
|
@@ -167,25 +167,25 @@ const parseUUID = (uuid) => {
|
|
|
167
167
|
const fail = (msg) => {
|
|
168
168
|
throw new Error(msg);
|
|
169
169
|
};
|
|
170
|
+
const readBufferBinaryData = (binaryData) => binaryData.type === "buffer" ? binaryData.buffer : Buffer.from(binaryData.buffer, binaryData.type);
|
|
171
|
+
const readFileBinaryData = (binaryData) => {
|
|
172
|
+
const start = binaryData.offset ?? 0;
|
|
173
|
+
return createReadStream(binaryData.file, {
|
|
174
|
+
start,
|
|
175
|
+
end: binaryData.size != null ? start + binaryData.size - 1 : Infinity
|
|
176
|
+
});
|
|
177
|
+
};
|
|
178
|
+
const binaryDataVar = (codeBuilder, binaryData) => codeBuilder.createBinaryVar(binaryData.type === "file" ? readFileBinaryData(binaryData) : readBufferBinaryData(binaryData));
|
|
170
179
|
const hashData = async (hash, binaryData) => {
|
|
171
180
|
if (binaryData.type === "missing") {
|
|
172
181
|
return binaryData.size ?? 1;
|
|
173
182
|
}
|
|
174
183
|
if (binaryData.type === "file") {
|
|
175
184
|
const count = new CountTransform();
|
|
176
|
-
|
|
177
|
-
await pipeline(
|
|
178
|
-
createReadStream(binaryData.file, {
|
|
179
|
-
start,
|
|
180
|
-
end: binaryData.size != null ? start + binaryData.size - 1 : Infinity
|
|
181
|
-
}),
|
|
182
|
-
count,
|
|
183
|
-
hash,
|
|
184
|
-
{ end: false }
|
|
185
|
-
);
|
|
185
|
+
await pipeline(readFileBinaryData(binaryData), count, hash, { end: false });
|
|
186
186
|
return count.length;
|
|
187
187
|
}
|
|
188
|
-
const buffer =
|
|
188
|
+
const buffer = readBufferBinaryData(binaryData);
|
|
189
189
|
hash.update(buffer);
|
|
190
190
|
return buffer.length;
|
|
191
191
|
};
|
|
@@ -202,6 +202,13 @@ const codeBlockProtocolGuid = (codeBuilder, protocolName) => {
|
|
|
202
202
|
`, "guidVars");
|
|
203
203
|
});
|
|
204
204
|
};
|
|
205
|
+
const codeBlockGuid = (codeBuilder, guidString) => codeBuilder.insertOnce(`GUID-${guidString}`, (data) => {
|
|
206
|
+
data.varName = codeBuilder.createBinaryVar(parseUUID(guidString));
|
|
207
|
+
});
|
|
208
|
+
const nullStringTermination = Buffer.from([0, 0]);
|
|
209
|
+
const codeBlockUTF16String = (codeBuilder, value) => codeBuilder.insertOnce(`string-${value}`, (data) => {
|
|
210
|
+
data.varName = codeBuilder.createBinaryVar(Buffer.concat([Buffer.from(value, "utf16le"), nullStringTermination]));
|
|
211
|
+
});
|
|
205
212
|
const codeBlockLoadedImage = (codeBuilder) => {
|
|
206
213
|
codeBuilder.insertOnce("loadedImage", () => {
|
|
207
214
|
codeBlockProtocolGuid(codeBuilder, "LOADED_IMAGE");
|
|
@@ -380,6 +387,19 @@ const handlers = {
|
|
|
380
387
|
hash.update(secret);
|
|
381
388
|
const secretVar = codeBuilder.createBinaryVar(secret);
|
|
382
389
|
codeBuilder.write(`sha256_update(hash, ${secretVar}, ${secretVar}_len);
|
|
390
|
+
`);
|
|
391
|
+
},
|
|
392
|
+
async efivar({ hash, codeBuilder, hashComponent }) {
|
|
393
|
+
await hashData(hash, hashComponent.value);
|
|
394
|
+
const { varName: varNameVar } = codeBlockUTF16String(codeBuilder, hashComponent.name);
|
|
395
|
+
const { varName: guidVar } = codeBlockGuid(codeBuilder, hashComponent.guid);
|
|
396
|
+
const valueVar = codeBuilder.newVar();
|
|
397
|
+
codeBuilder.write(`UINTN ${valueVar}_len = 0;
|
|
398
|
+
uint8_t *${valueVar} = LibGetVariableAndSize((void*) ${varNameVar}, (void*) ${guidVar}, &${valueVar}_len);
|
|
399
|
+
if (${valueVar}) {
|
|
400
|
+
sha256_update(hash, ${valueVar}, ${valueVar}_len);
|
|
401
|
+
FREE_POOL(${valueVar});
|
|
402
|
+
}
|
|
383
403
|
`);
|
|
384
404
|
},
|
|
385
405
|
smbios({ hash, codeBuilder, hashComponent, smbios }) {
|
|
@@ -498,6 +518,46 @@ const handlers = {
|
|
|
498
518
|
`);
|
|
499
519
|
}
|
|
500
520
|
};
|
|
521
|
+
const enrollSecureBoot = async ({ codeBuilder, config: { enrollSecureBoot: enrollSecureBoot2 } }) => {
|
|
522
|
+
if (enrollSecureBoot2) {
|
|
523
|
+
const efiGlobalVarGuid = codeBlockGuid(codeBuilder, "8be4df61-93ca-11d2-aa0d-00e098032b8c").varName;
|
|
524
|
+
const setupModeVariable = codeBlockUTF16String(codeBuilder, "SetupMode").varName;
|
|
525
|
+
const varsToSet = [
|
|
526
|
+
{
|
|
527
|
+
name: codeBlockUTF16String(codeBuilder, "KEK").varName,
|
|
528
|
+
guid: efiGlobalVarGuid,
|
|
529
|
+
value: binaryDataVar(codeBuilder, enrollSecureBoot2.kek)
|
|
530
|
+
},
|
|
531
|
+
{
|
|
532
|
+
name: codeBlockUTF16String(codeBuilder, "db").varName,
|
|
533
|
+
guid: codeBlockGuid(codeBuilder, "d719b2cb-3d3a-4596-a3bc-dad00e67656f").varName,
|
|
534
|
+
value: binaryDataVar(codeBuilder, enrollSecureBoot2.db)
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
name: codeBlockUTF16String(codeBuilder, "PK").varName,
|
|
538
|
+
guid: efiGlobalVarGuid,
|
|
539
|
+
value: binaryDataVar(codeBuilder, enrollSecureBoot2.pk)
|
|
540
|
+
}
|
|
541
|
+
];
|
|
542
|
+
codeBuilder.write(`
|
|
543
|
+
UINT8 byteVarContent = 0;
|
|
544
|
+
UINTN byteVarSize = sizeof(byteVarContent);
|
|
545
|
+
status = uefi_call_wrapper(RT->GetVariable, 5, ${setupModeVariable}, &${efiGlobalVarGuid}, NULL, &byteVarSize, &byteVarContent);
|
|
546
|
+
if (status == EFI_SUCCESS && byteVarSize == 1 && byteVarContent) {
|
|
547
|
+
`);
|
|
548
|
+
for (const { name, guid, value } of varsToSet) {
|
|
549
|
+
codeBuilder.write(`
|
|
550
|
+
status = uefi_call_wrapper(RT->SetVariable, 5, ${name}, &${guid}, EFI_VARIABLE_NON_VOLATILE
|
|
551
|
+
| EFI_VARIABLE_RUNTIME_ACCESS
|
|
552
|
+
| EFI_VARIABLE_BOOTSERVICE_ACCESS
|
|
553
|
+
| EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS, ${value}_len, ${value});
|
|
554
|
+
CHECK_ERROR(0);
|
|
555
|
+
`);
|
|
556
|
+
}
|
|
557
|
+
codeBuilder.write(`}
|
|
558
|
+
`);
|
|
559
|
+
}
|
|
560
|
+
};
|
|
501
561
|
const genCode = async (config) => {
|
|
502
562
|
const codeBuilder = new CodeBuilder("/*\n * DO NOT EDIT! This file was generated automatically!\n */\n");
|
|
503
563
|
codeBuilder.addHeader('"gen-code.h"');
|
|
@@ -508,8 +568,11 @@ EFI_STATUS status = 0;
|
|
|
508
568
|
);
|
|
509
569
|
codeBuilder.writeNewBlock("gen_compute_hash_vars");
|
|
510
570
|
codeBuilder.writeNewBlock("gen_compute_hash_prep");
|
|
571
|
+
codeBuilder.writeNewBlock("enroll_secure_boot");
|
|
511
572
|
codeBuilder.writeNewBlock("gen_compute_hash");
|
|
512
573
|
codeBuilder.write("return status;\n}\n");
|
|
574
|
+
codeBuilder.curBlock = "enroll_secure_boot";
|
|
575
|
+
await enrollSecureBoot({ codeBuilder, config });
|
|
513
576
|
codeBuilder.curBlock = "gen_compute_hash";
|
|
514
577
|
const hash = createHash("sha256");
|
|
515
578
|
const smbios = config.smbios ? parseSmbios(await readFile(config.smbios)) : void 0;
|
|
@@ -524,12 +587,390 @@ EFI_STATUS status = 0;
|
|
|
524
587
|
await pipeline(codeBuilder.toReadable(), createWriteStream(join(config.buildFolder, "gen-code.c")));
|
|
525
588
|
};
|
|
526
589
|
const validate = validate10;
|
|
527
|
-
const schema11 = { "properties": { "$schema": { "type": "string" }, "inputFile": { "description": "Path to the input efi file to embed.", "type": "string" }, "outputFile": { "description": "Path to the output efi file to write.", "type": "string" }, "skipGenCode": { "description": "Whether to skip generating code", "type": "boolean" }, "skipExtract": { "description": "Whether to skip extracting source code\n(can be useful if the extraction was already done)", "type": "boolean" }, "skipMake": { "description": "Whether to skip calling make\n(can be useful to change the code before calling make)", "type": "boolean" }, "buildFolder": { "description": "Folder where to build the code.\nDefaults to a temporary folder that is removed when the build is finished.", "type": "string" }, "hashComponents": { "description": "Data to include in the hash for encryption.", "type": "array", "items": { "$ref": "#/definitions/HashComponent" } }, "smbios": { "description": "Path to the input smbios dump file.\nCan be produced by: dmidecode --dump-bin <filePath>", "type": "string" } } };
|
|
590
|
+
const schema11 = { "properties": { "$schema": { "type": "string" }, "inputFile": { "description": "Path to the input efi file to embed.", "type": "string" }, "outputFile": { "description": "Path to the output efi file to write.", "type": "string" }, "skipGenCode": { "description": "Whether to skip generating code", "type": "boolean" }, "skipExtract": { "description": "Whether to skip extracting source code\n(can be useful if the extraction was already done)", "type": "boolean" }, "skipMake": { "description": "Whether to skip calling make\n(can be useful to change the code before calling make)", "type": "boolean" }, "buildFolder": { "description": "Folder where to build the code.\nDefaults to a temporary folder that is removed when the build is finished.", "type": "string" }, "hashComponents": { "description": "Data to include in the hash for encryption.", "type": "array", "items": { "$ref": "#/definitions/HashComponent" } }, "smbios": { "description": "Path to the input smbios dump file.\nCan be produced by: dmidecode --dump-bin <filePath>", "type": "string" }, "enrollSecureBoot": { "description": "Secure boot keys to enroll automatically if the system is in setup mode.", "$ref": "#/definitions/SecureBootEnrollConfig" } } };
|
|
528
591
|
const func2 = Object.prototype.hasOwnProperty;
|
|
529
|
-
const
|
|
530
|
-
const
|
|
531
|
-
|
|
592
|
+
const schema36 = { "properties": { "type": { "enum": ["boot-file", "boot-hd-device", "boot-partition-device"] } } };
|
|
593
|
+
const schema18 = { "enum": ["ascii", "base64", "base64url", "binary", "hex", "latin1", "ucs-2", "ucs2", "utf-16le", "utf-8", "utf16le", "utf8"] };
|
|
594
|
+
function validate14(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
595
|
+
let vErrors = null;
|
|
596
|
+
let errors = 0;
|
|
597
|
+
{
|
|
598
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
599
|
+
let missing0;
|
|
600
|
+
if (data.buffer === void 0 && (missing0 = "buffer") || data.type === void 0 && (missing0 = "type")) {
|
|
601
|
+
validate14.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
|
602
|
+
return false;
|
|
603
|
+
} else {
|
|
604
|
+
for (const key0 in data) {
|
|
605
|
+
if (!(key0 === "type" || key0 === "buffer")) {
|
|
606
|
+
validate14.errors = [{ instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
|
|
607
|
+
return false;
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
{
|
|
611
|
+
if (data.type !== void 0) {
|
|
612
|
+
let data0 = data.type;
|
|
613
|
+
const _errs2 = errors;
|
|
614
|
+
if (typeof data0 !== "string") {
|
|
615
|
+
validate14.errors = [{ instancePath: instancePath + "/type", schemaPath: "#/definitions/global.BufferEncoding/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
616
|
+
return false;
|
|
617
|
+
}
|
|
618
|
+
if (!(data0 === "ascii" || data0 === "base64" || data0 === "base64url" || data0 === "binary" || data0 === "hex" || data0 === "latin1" || data0 === "ucs-2" || data0 === "ucs2" || data0 === "utf-16le" || data0 === "utf-8" || data0 === "utf16le" || data0 === "utf8")) {
|
|
619
|
+
validate14.errors = [{ instancePath: instancePath + "/type", schemaPath: "#/definitions/global.BufferEncoding/enum", keyword: "enum", params: { allowedValues: schema18.enum }, message: "must be equal to one of the allowed values" }];
|
|
620
|
+
return false;
|
|
621
|
+
}
|
|
622
|
+
var valid0 = _errs2 === errors;
|
|
623
|
+
} else {
|
|
624
|
+
var valid0 = true;
|
|
625
|
+
}
|
|
626
|
+
if (valid0) {
|
|
627
|
+
if (data.buffer !== void 0) {
|
|
628
|
+
const _errs5 = errors;
|
|
629
|
+
if (typeof data.buffer !== "string") {
|
|
630
|
+
validate14.errors = [{ instancePath: instancePath + "/buffer", schemaPath: "#/properties/buffer/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
631
|
+
return false;
|
|
632
|
+
}
|
|
633
|
+
var valid0 = _errs5 === errors;
|
|
634
|
+
} else {
|
|
635
|
+
var valid0 = true;
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
} else {
|
|
641
|
+
validate14.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
642
|
+
return false;
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
validate14.errors = vErrors;
|
|
646
|
+
return errors === 0;
|
|
647
|
+
}
|
|
532
648
|
function validate13(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
649
|
+
let vErrors = null;
|
|
650
|
+
let errors = 0;
|
|
651
|
+
const _errs0 = errors;
|
|
652
|
+
let valid0 = false;
|
|
653
|
+
const _errs1 = errors;
|
|
654
|
+
const _errs2 = errors;
|
|
655
|
+
if (errors === _errs2) {
|
|
656
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
657
|
+
let missing0;
|
|
658
|
+
if (data.file === void 0 && (missing0 = "file") || data.type === void 0 && (missing0 = "type")) {
|
|
659
|
+
const err0 = { instancePath, schemaPath: "#/definitions/BinaryDataFromFile/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" };
|
|
660
|
+
if (vErrors === null) {
|
|
661
|
+
vErrors = [err0];
|
|
662
|
+
} else {
|
|
663
|
+
vErrors.push(err0);
|
|
664
|
+
}
|
|
665
|
+
errors++;
|
|
666
|
+
} else {
|
|
667
|
+
const _errs4 = errors;
|
|
668
|
+
for (const key0 in data) {
|
|
669
|
+
if (!(key0 === "type" || key0 === "file" || key0 === "offset" || key0 === "size")) {
|
|
670
|
+
const err1 = { instancePath, schemaPath: "#/definitions/BinaryDataFromFile/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
|
|
671
|
+
if (vErrors === null) {
|
|
672
|
+
vErrors = [err1];
|
|
673
|
+
} else {
|
|
674
|
+
vErrors.push(err1);
|
|
675
|
+
}
|
|
676
|
+
errors++;
|
|
677
|
+
break;
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
if (_errs4 === errors) {
|
|
681
|
+
if (data.type !== void 0) {
|
|
682
|
+
let data0 = data.type;
|
|
683
|
+
const _errs5 = errors;
|
|
684
|
+
if (typeof data0 !== "string") {
|
|
685
|
+
const err2 = { instancePath: instancePath + "/type", schemaPath: "#/definitions/BinaryDataFromFile/properties/type/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
686
|
+
if (vErrors === null) {
|
|
687
|
+
vErrors = [err2];
|
|
688
|
+
} else {
|
|
689
|
+
vErrors.push(err2);
|
|
690
|
+
}
|
|
691
|
+
errors++;
|
|
692
|
+
}
|
|
693
|
+
if ("file" !== data0) {
|
|
694
|
+
const err3 = { instancePath: instancePath + "/type", schemaPath: "#/definitions/BinaryDataFromFile/properties/type/const", keyword: "const", params: { allowedValue: "file" }, message: "must be equal to constant" };
|
|
695
|
+
if (vErrors === null) {
|
|
696
|
+
vErrors = [err3];
|
|
697
|
+
} else {
|
|
698
|
+
vErrors.push(err3);
|
|
699
|
+
}
|
|
700
|
+
errors++;
|
|
701
|
+
}
|
|
702
|
+
var valid2 = _errs5 === errors;
|
|
703
|
+
} else {
|
|
704
|
+
var valid2 = true;
|
|
705
|
+
}
|
|
706
|
+
if (valid2) {
|
|
707
|
+
if (data.file !== void 0) {
|
|
708
|
+
const _errs7 = errors;
|
|
709
|
+
if (typeof data.file !== "string") {
|
|
710
|
+
const err4 = { instancePath: instancePath + "/file", schemaPath: "#/definitions/BinaryDataFromFile/properties/file/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
711
|
+
if (vErrors === null) {
|
|
712
|
+
vErrors = [err4];
|
|
713
|
+
} else {
|
|
714
|
+
vErrors.push(err4);
|
|
715
|
+
}
|
|
716
|
+
errors++;
|
|
717
|
+
}
|
|
718
|
+
var valid2 = _errs7 === errors;
|
|
719
|
+
} else {
|
|
720
|
+
var valid2 = true;
|
|
721
|
+
}
|
|
722
|
+
if (valid2) {
|
|
723
|
+
if (data.offset !== void 0) {
|
|
724
|
+
let data2 = data.offset;
|
|
725
|
+
const _errs9 = errors;
|
|
726
|
+
if (!(typeof data2 == "number" && isFinite(data2))) {
|
|
727
|
+
const err5 = { instancePath: instancePath + "/offset", schemaPath: "#/definitions/BinaryDataFromFile/properties/offset/type", keyword: "type", params: { type: "number" }, message: "must be number" };
|
|
728
|
+
if (vErrors === null) {
|
|
729
|
+
vErrors = [err5];
|
|
730
|
+
} else {
|
|
731
|
+
vErrors.push(err5);
|
|
732
|
+
}
|
|
733
|
+
errors++;
|
|
734
|
+
}
|
|
735
|
+
var valid2 = _errs9 === errors;
|
|
736
|
+
} else {
|
|
737
|
+
var valid2 = true;
|
|
738
|
+
}
|
|
739
|
+
if (valid2) {
|
|
740
|
+
if (data.size !== void 0) {
|
|
741
|
+
let data3 = data.size;
|
|
742
|
+
const _errs11 = errors;
|
|
743
|
+
if (!(typeof data3 == "number" && isFinite(data3))) {
|
|
744
|
+
const err6 = { instancePath: instancePath + "/size", schemaPath: "#/definitions/BinaryDataFromFile/properties/size/type", keyword: "type", params: { type: "number" }, message: "must be number" };
|
|
745
|
+
if (vErrors === null) {
|
|
746
|
+
vErrors = [err6];
|
|
747
|
+
} else {
|
|
748
|
+
vErrors.push(err6);
|
|
749
|
+
}
|
|
750
|
+
errors++;
|
|
751
|
+
}
|
|
752
|
+
var valid2 = _errs11 === errors;
|
|
753
|
+
} else {
|
|
754
|
+
var valid2 = true;
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
} else {
|
|
762
|
+
const err7 = { instancePath, schemaPath: "#/definitions/BinaryDataFromFile/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
763
|
+
if (vErrors === null) {
|
|
764
|
+
vErrors = [err7];
|
|
765
|
+
} else {
|
|
766
|
+
vErrors.push(err7);
|
|
767
|
+
}
|
|
768
|
+
errors++;
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
var _valid0 = _errs1 === errors;
|
|
772
|
+
valid0 = valid0 || _valid0;
|
|
773
|
+
if (!valid0) {
|
|
774
|
+
const _errs13 = errors;
|
|
775
|
+
if (!validate14(data, { instancePath, parentData, parentDataProperty, rootData })) {
|
|
776
|
+
vErrors = vErrors === null ? validate14.errors : vErrors.concat(validate14.errors);
|
|
777
|
+
errors = vErrors.length;
|
|
778
|
+
}
|
|
779
|
+
var _valid0 = _errs13 === errors;
|
|
780
|
+
valid0 = valid0 || _valid0;
|
|
781
|
+
if (!valid0) {
|
|
782
|
+
const _errs14 = errors;
|
|
783
|
+
const _errs15 = errors;
|
|
784
|
+
if (errors === _errs15) {
|
|
785
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
786
|
+
let missing1;
|
|
787
|
+
if (data.buffer === void 0 && (missing1 = "buffer") || data.type === void 0 && (missing1 = "type")) {
|
|
788
|
+
const err8 = { instancePath, schemaPath: "#/definitions/BinaryDataFromBuffer/required", keyword: "required", params: { missingProperty: missing1 }, message: "must have required property '" + missing1 + "'" };
|
|
789
|
+
if (vErrors === null) {
|
|
790
|
+
vErrors = [err8];
|
|
791
|
+
} else {
|
|
792
|
+
vErrors.push(err8);
|
|
793
|
+
}
|
|
794
|
+
errors++;
|
|
795
|
+
} else {
|
|
796
|
+
const _errs17 = errors;
|
|
797
|
+
for (const key1 in data) {
|
|
798
|
+
if (!(key1 === "type" || key1 === "buffer")) {
|
|
799
|
+
const err9 = { instancePath, schemaPath: "#/definitions/BinaryDataFromBuffer/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" };
|
|
800
|
+
if (vErrors === null) {
|
|
801
|
+
vErrors = [err9];
|
|
802
|
+
} else {
|
|
803
|
+
vErrors.push(err9);
|
|
804
|
+
}
|
|
805
|
+
errors++;
|
|
806
|
+
break;
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
if (_errs17 === errors) {
|
|
810
|
+
if (data.type !== void 0) {
|
|
811
|
+
let data4 = data.type;
|
|
812
|
+
const _errs18 = errors;
|
|
813
|
+
if (typeof data4 !== "string") {
|
|
814
|
+
const err10 = { instancePath: instancePath + "/type", schemaPath: "#/definitions/BinaryDataFromBuffer/properties/type/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
815
|
+
if (vErrors === null) {
|
|
816
|
+
vErrors = [err10];
|
|
817
|
+
} else {
|
|
818
|
+
vErrors.push(err10);
|
|
819
|
+
}
|
|
820
|
+
errors++;
|
|
821
|
+
}
|
|
822
|
+
if ("buffer" !== data4) {
|
|
823
|
+
const err11 = { instancePath: instancePath + "/type", schemaPath: "#/definitions/BinaryDataFromBuffer/properties/type/const", keyword: "const", params: { allowedValue: "buffer" }, message: "must be equal to constant" };
|
|
824
|
+
if (vErrors === null) {
|
|
825
|
+
vErrors = [err11];
|
|
826
|
+
} else {
|
|
827
|
+
vErrors.push(err11);
|
|
828
|
+
}
|
|
829
|
+
errors++;
|
|
830
|
+
}
|
|
831
|
+
var valid4 = _errs18 === errors;
|
|
832
|
+
} else {
|
|
833
|
+
var valid4 = true;
|
|
834
|
+
}
|
|
835
|
+
if (valid4) {
|
|
836
|
+
if (data.buffer !== void 0) {
|
|
837
|
+
let data5 = data.buffer;
|
|
838
|
+
const _errs20 = errors;
|
|
839
|
+
if (!(data5 && typeof data5 == "object" && !Array.isArray(data5))) {
|
|
840
|
+
const err12 = { instancePath: instancePath + "/buffer", schemaPath: "#/definitions/BinaryDataFromBuffer/properties/buffer/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
841
|
+
if (vErrors === null) {
|
|
842
|
+
vErrors = [err12];
|
|
843
|
+
} else {
|
|
844
|
+
vErrors.push(err12);
|
|
845
|
+
}
|
|
846
|
+
errors++;
|
|
847
|
+
}
|
|
848
|
+
var valid4 = _errs20 === errors;
|
|
849
|
+
} else {
|
|
850
|
+
var valid4 = true;
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
} else {
|
|
856
|
+
const err13 = { instancePath, schemaPath: "#/definitions/BinaryDataFromBuffer/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
857
|
+
if (vErrors === null) {
|
|
858
|
+
vErrors = [err13];
|
|
859
|
+
} else {
|
|
860
|
+
vErrors.push(err13);
|
|
861
|
+
}
|
|
862
|
+
errors++;
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
var _valid0 = _errs14 === errors;
|
|
866
|
+
valid0 = valid0 || _valid0;
|
|
867
|
+
}
|
|
868
|
+
}
|
|
869
|
+
if (!valid0) {
|
|
870
|
+
const err14 = { instancePath, schemaPath: "#/anyOf", keyword: "anyOf", params: {}, message: "must match a schema in anyOf" };
|
|
871
|
+
if (vErrors === null) {
|
|
872
|
+
vErrors = [err14];
|
|
873
|
+
} else {
|
|
874
|
+
vErrors.push(err14);
|
|
875
|
+
}
|
|
876
|
+
errors++;
|
|
877
|
+
validate13.errors = vErrors;
|
|
878
|
+
return false;
|
|
879
|
+
} else {
|
|
880
|
+
errors = _errs0;
|
|
881
|
+
if (vErrors !== null) {
|
|
882
|
+
if (_errs0) {
|
|
883
|
+
vErrors.length = _errs0;
|
|
884
|
+
} else {
|
|
885
|
+
vErrors = null;
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
validate13.errors = vErrors;
|
|
890
|
+
return errors === 0;
|
|
891
|
+
}
|
|
892
|
+
function validate12(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
893
|
+
let vErrors = null;
|
|
894
|
+
let errors = 0;
|
|
895
|
+
if (errors === 0) {
|
|
896
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
897
|
+
let missing0;
|
|
898
|
+
if (data.guid === void 0 && (missing0 = "guid") || data.name === void 0 && (missing0 = "name") || data.type === void 0 && (missing0 = "type") || data.value === void 0 && (missing0 = "value")) {
|
|
899
|
+
validate12.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
|
900
|
+
return false;
|
|
901
|
+
} else {
|
|
902
|
+
const _errs1 = errors;
|
|
903
|
+
for (const key0 in data) {
|
|
904
|
+
if (!(key0 === "type" || key0 === "guid" || key0 === "name" || key0 === "value")) {
|
|
905
|
+
validate12.errors = [{ instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
|
|
906
|
+
return false;
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
if (_errs1 === errors) {
|
|
910
|
+
if (data.type !== void 0) {
|
|
911
|
+
let data0 = data.type;
|
|
912
|
+
const _errs2 = errors;
|
|
913
|
+
if (typeof data0 !== "string") {
|
|
914
|
+
validate12.errors = [{ instancePath: instancePath + "/type", schemaPath: "#/properties/type/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
915
|
+
return false;
|
|
916
|
+
}
|
|
917
|
+
if ("efivar" !== data0) {
|
|
918
|
+
validate12.errors = [{ instancePath: instancePath + "/type", schemaPath: "#/properties/type/const", keyword: "const", params: { allowedValue: "efivar" }, message: "must be equal to constant" }];
|
|
919
|
+
return false;
|
|
920
|
+
}
|
|
921
|
+
var valid0 = _errs2 === errors;
|
|
922
|
+
} else {
|
|
923
|
+
var valid0 = true;
|
|
924
|
+
}
|
|
925
|
+
if (valid0) {
|
|
926
|
+
if (data.guid !== void 0) {
|
|
927
|
+
const _errs4 = errors;
|
|
928
|
+
if (typeof data.guid !== "string") {
|
|
929
|
+
validate12.errors = [{ instancePath: instancePath + "/guid", schemaPath: "#/properties/guid/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
930
|
+
return false;
|
|
931
|
+
}
|
|
932
|
+
var valid0 = _errs4 === errors;
|
|
933
|
+
} else {
|
|
934
|
+
var valid0 = true;
|
|
935
|
+
}
|
|
936
|
+
if (valid0) {
|
|
937
|
+
if (data.name !== void 0) {
|
|
938
|
+
const _errs6 = errors;
|
|
939
|
+
if (typeof data.name !== "string") {
|
|
940
|
+
validate12.errors = [{ instancePath: instancePath + "/name", schemaPath: "#/properties/name/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
941
|
+
return false;
|
|
942
|
+
}
|
|
943
|
+
var valid0 = _errs6 === errors;
|
|
944
|
+
} else {
|
|
945
|
+
var valid0 = true;
|
|
946
|
+
}
|
|
947
|
+
if (valid0) {
|
|
948
|
+
if (data.value !== void 0) {
|
|
949
|
+
const _errs8 = errors;
|
|
950
|
+
if (!validate13(data.value, { instancePath: instancePath + "/value", parentData: data, parentDataProperty: "value", rootData })) {
|
|
951
|
+
vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);
|
|
952
|
+
errors = vErrors.length;
|
|
953
|
+
}
|
|
954
|
+
var valid0 = _errs8 === errors;
|
|
955
|
+
} else {
|
|
956
|
+
var valid0 = true;
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
} else {
|
|
964
|
+
validate12.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
965
|
+
return false;
|
|
966
|
+
}
|
|
967
|
+
}
|
|
968
|
+
validate12.errors = vErrors;
|
|
969
|
+
return errors === 0;
|
|
970
|
+
}
|
|
971
|
+
const schema21 = { "anyOf": [{ "type": "object", "properties": { "table": { "$ref": "#/definitions/SmbiosTableRef" }, "offset": { "type": "number" }, "type": { "enum": ["byte", "dword", "qword", "string", "uuid", "word"], "type": "string" } }, "additionalProperties": false, "required": ["offset", "table", "type"] }, { "enum": ["baseboard-asset-tag", "baseboard-manufacturer", "baseboard-product-name", "baseboard-serial-number", "baseboard-version", "bios-release-date", "bios-revision", "bios-vendor", "bios-version", "chassis-asset-tag", "chassis-manufacturer", "chassis-serial-number", "chassis-version", "processor-manufacturer", "processor-version", "system-family", "system-manufacturer", "system-product-name", "system-serial-number", "system-sku-number", "system-uuid", "system-version"], "type": "string" }] };
|
|
972
|
+
const schema22 = { "anyOf": [{ "type": "object", "properties": { "handle": { "type": "number" } }, "additionalProperties": false, "required": ["handle"] }, { "type": "object", "properties": { "type": { "type": "number" }, "index": { "type": "number" } }, "additionalProperties": false, "required": ["type"] }, { "enum": ["32-bit Memory Error", "64-bit Memory Error", "Additional Information", "Baseboard", "Boot Integrity Services", "Built-in Pointing Device", "Cache", "Chassis", "Cooling Device", "Electrical Current Probe", "Firmware Inventory", "Firmware Language", "Group Associations", "Hardware Security", "IPMI Device", "Management Controller Host Interface", "Management Device", "Management Device Component", "Management Device Threshold Data", "Memory Array Mapped Address", "Memory Channel", "Memory Controller", "Memory Device", "Memory Device Mapped Address", "Memory Module", "OEM Strings", "Onboard Devices", "Onboard Devices Extended Information", "Out-of-band Remote Access", "Physical Memory Array", "Platform Firmware", "Port Connector", "Portable Battery", "Power Supply", "Processor", "Processor Additional Information", "String Property", "System", "System Boot", "System Configuration Options", "System Event Log", "System Power Controls", "System Reset", "System Slots", "TPM Device", "Temperature Probe", "Voltage Probe"], "type": "string" }, { "type": "number" }] };
|
|
973
|
+
function validate19(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
533
974
|
let vErrors = null;
|
|
534
975
|
let errors = 0;
|
|
535
976
|
const _errs0 = errors;
|
|
@@ -707,7 +1148,7 @@ function validate13(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
707
1148
|
errors++;
|
|
708
1149
|
}
|
|
709
1150
|
if (!(data0 === "32-bit Memory Error" || data0 === "64-bit Memory Error" || data0 === "Additional Information" || data0 === "Baseboard" || data0 === "Boot Integrity Services" || data0 === "Built-in Pointing Device" || data0 === "Cache" || data0 === "Chassis" || data0 === "Cooling Device" || data0 === "Electrical Current Probe" || data0 === "Firmware Inventory" || data0 === "Firmware Language" || data0 === "Group Associations" || data0 === "Hardware Security" || data0 === "IPMI Device" || data0 === "Management Controller Host Interface" || data0 === "Management Device" || data0 === "Management Device Component" || data0 === "Management Device Threshold Data" || data0 === "Memory Array Mapped Address" || data0 === "Memory Channel" || data0 === "Memory Controller" || data0 === "Memory Device" || data0 === "Memory Device Mapped Address" || data0 === "Memory Module" || data0 === "OEM Strings" || data0 === "Onboard Devices" || data0 === "Onboard Devices Extended Information" || data0 === "Out-of-band Remote Access" || data0 === "Physical Memory Array" || data0 === "Platform Firmware" || data0 === "Port Connector" || data0 === "Portable Battery" || data0 === "Power Supply" || data0 === "Processor" || data0 === "Processor Additional Information" || data0 === "String Property" || data0 === "System" || data0 === "System Boot" || data0 === "System Configuration Options" || data0 === "System Event Log" || data0 === "System Power Controls" || data0 === "System Reset" || data0 === "System Slots" || data0 === "TPM Device" || data0 === "Temperature Probe" || data0 === "Voltage Probe")) {
|
|
710
|
-
const err12 = { instancePath: instancePath + "/table", schemaPath: "#/definitions/SmbiosTableRef/anyOf/2/enum", keyword: "enum", params: { allowedValues:
|
|
1151
|
+
const err12 = { instancePath: instancePath + "/table", schemaPath: "#/definitions/SmbiosTableRef/anyOf/2/enum", keyword: "enum", params: { allowedValues: schema22.anyOf[2].enum }, message: "must be equal to one of the allowed values" };
|
|
711
1152
|
if (vErrors === null) {
|
|
712
1153
|
vErrors = [err12];
|
|
713
1154
|
} else {
|
|
@@ -786,7 +1227,7 @@ function validate13(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
786
1227
|
errors++;
|
|
787
1228
|
}
|
|
788
1229
|
if (!(data5 === "byte" || data5 === "dword" || data5 === "qword" || data5 === "string" || data5 === "uuid" || data5 === "word")) {
|
|
789
|
-
const err17 = { instancePath: instancePath + "/type", schemaPath: "#/anyOf/0/properties/type/enum", keyword: "enum", params: { allowedValues:
|
|
1230
|
+
const err17 = { instancePath: instancePath + "/type", schemaPath: "#/anyOf/0/properties/type/enum", keyword: "enum", params: { allowedValues: schema21.anyOf[0].properties.type.enum }, message: "must be equal to one of the allowed values" };
|
|
790
1231
|
if (vErrors === null) {
|
|
791
1232
|
vErrors = [err17];
|
|
792
1233
|
} else {
|
|
@@ -826,7 +1267,7 @@ function validate13(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
826
1267
|
errors++;
|
|
827
1268
|
}
|
|
828
1269
|
if (!(data === "baseboard-asset-tag" || data === "baseboard-manufacturer" || data === "baseboard-product-name" || data === "baseboard-serial-number" || data === "baseboard-version" || data === "bios-release-date" || data === "bios-revision" || data === "bios-vendor" || data === "bios-version" || data === "chassis-asset-tag" || data === "chassis-manufacturer" || data === "chassis-serial-number" || data === "chassis-version" || data === "processor-manufacturer" || data === "processor-version" || data === "system-family" || data === "system-manufacturer" || data === "system-product-name" || data === "system-serial-number" || data === "system-sku-number" || data === "system-uuid" || data === "system-version")) {
|
|
829
|
-
const err20 = { instancePath, schemaPath: "#/anyOf/1/enum", keyword: "enum", params: { allowedValues:
|
|
1270
|
+
const err20 = { instancePath, schemaPath: "#/anyOf/1/enum", keyword: "enum", params: { allowedValues: schema21.anyOf[1].enum }, message: "must be equal to one of the allowed values" };
|
|
830
1271
|
if (vErrors === null) {
|
|
831
1272
|
vErrors = [err20];
|
|
832
1273
|
} else {
|
|
@@ -845,7 +1286,7 @@ function validate13(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
845
1286
|
vErrors.push(err21);
|
|
846
1287
|
}
|
|
847
1288
|
errors++;
|
|
848
|
-
|
|
1289
|
+
validate19.errors = vErrors;
|
|
849
1290
|
return false;
|
|
850
1291
|
} else {
|
|
851
1292
|
errors = _errs0;
|
|
@@ -857,23 +1298,23 @@ function validate13(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
857
1298
|
}
|
|
858
1299
|
}
|
|
859
1300
|
}
|
|
860
|
-
|
|
1301
|
+
validate19.errors = vErrors;
|
|
861
1302
|
return errors === 0;
|
|
862
1303
|
}
|
|
863
|
-
function
|
|
1304
|
+
function validate18(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
864
1305
|
let vErrors = null;
|
|
865
1306
|
let errors = 0;
|
|
866
1307
|
if (errors === 0) {
|
|
867
1308
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
868
1309
|
let missing0;
|
|
869
1310
|
if (data.ref === void 0 && (missing0 = "ref") || data.type === void 0 && (missing0 = "type")) {
|
|
870
|
-
|
|
1311
|
+
validate18.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
|
871
1312
|
return false;
|
|
872
1313
|
} else {
|
|
873
1314
|
const _errs1 = errors;
|
|
874
1315
|
for (const key0 in data) {
|
|
875
1316
|
if (!(key0 === "type" || key0 === "ref" || key0 === "value")) {
|
|
876
|
-
|
|
1317
|
+
validate18.errors = [{ instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
|
|
877
1318
|
return false;
|
|
878
1319
|
}
|
|
879
1320
|
}
|
|
@@ -882,11 +1323,11 @@ function validate12(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
882
1323
|
let data0 = data.type;
|
|
883
1324
|
const _errs2 = errors;
|
|
884
1325
|
if (typeof data0 !== "string") {
|
|
885
|
-
|
|
1326
|
+
validate18.errors = [{ instancePath: instancePath + "/type", schemaPath: "#/properties/type/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
886
1327
|
return false;
|
|
887
1328
|
}
|
|
888
1329
|
if ("smbios" !== data0) {
|
|
889
|
-
|
|
1330
|
+
validate18.errors = [{ instancePath: instancePath + "/type", schemaPath: "#/properties/type/const", keyword: "const", params: { allowedValue: "smbios" }, message: "must be equal to constant" }];
|
|
890
1331
|
return false;
|
|
891
1332
|
}
|
|
892
1333
|
var valid0 = _errs2 === errors;
|
|
@@ -896,8 +1337,8 @@ function validate12(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
896
1337
|
if (valid0) {
|
|
897
1338
|
if (data.ref !== void 0) {
|
|
898
1339
|
const _errs4 = errors;
|
|
899
|
-
if (!
|
|
900
|
-
vErrors = vErrors === null ?
|
|
1340
|
+
if (!validate19(data.ref, { instancePath: instancePath + "/ref", parentData: data, parentDataProperty: "ref", rootData })) {
|
|
1341
|
+
vErrors = vErrors === null ? validate19.errors : vErrors.concat(validate19.errors);
|
|
901
1342
|
errors = vErrors.length;
|
|
902
1343
|
}
|
|
903
1344
|
var valid0 = _errs4 === errors;
|
|
@@ -908,7 +1349,7 @@ function validate12(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
908
1349
|
if (data.value !== void 0) {
|
|
909
1350
|
const _errs5 = errors;
|
|
910
1351
|
if (typeof data.value !== "string") {
|
|
911
|
-
|
|
1352
|
+
validate18.errors = [{ instancePath: instancePath + "/value", schemaPath: "#/properties/value/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
912
1353
|
return false;
|
|
913
1354
|
}
|
|
914
1355
|
var valid0 = _errs5 === errors;
|
|
@@ -920,84 +1361,29 @@ function validate12(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
920
1361
|
}
|
|
921
1362
|
}
|
|
922
1363
|
} else {
|
|
923
|
-
|
|
924
|
-
return false;
|
|
925
|
-
}
|
|
926
|
-
}
|
|
927
|
-
validate12.errors = vErrors;
|
|
928
|
-
return errors === 0;
|
|
929
|
-
}
|
|
930
|
-
const schema17 = { "properties": { "offsetRef": { "enum": ["end", "start"] } } };
|
|
931
|
-
const schema18 = { "type": ["string", "number"] };
|
|
932
|
-
const schema21 = { "enum": ["ascii", "base64", "base64url", "binary", "hex", "latin1", "ucs-2", "ucs2", "utf-16le", "utf-8", "utf16le", "utf8"] };
|
|
933
|
-
function validate17(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
934
|
-
let vErrors = null;
|
|
935
|
-
let errors = 0;
|
|
936
|
-
{
|
|
937
|
-
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
938
|
-
let missing0;
|
|
939
|
-
if (data.buffer === void 0 && (missing0 = "buffer") || data.type === void 0 && (missing0 = "type")) {
|
|
940
|
-
validate17.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
|
941
|
-
return false;
|
|
942
|
-
} else {
|
|
943
|
-
for (const key0 in data) {
|
|
944
|
-
if (!(key0 === "type" || key0 === "buffer")) {
|
|
945
|
-
validate17.errors = [{ instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
|
|
946
|
-
return false;
|
|
947
|
-
}
|
|
948
|
-
}
|
|
949
|
-
{
|
|
950
|
-
if (data.type !== void 0) {
|
|
951
|
-
let data0 = data.type;
|
|
952
|
-
const _errs2 = errors;
|
|
953
|
-
if (typeof data0 !== "string") {
|
|
954
|
-
validate17.errors = [{ instancePath: instancePath + "/type", schemaPath: "#/definitions/global.BufferEncoding/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
955
|
-
return false;
|
|
956
|
-
}
|
|
957
|
-
if (!(data0 === "ascii" || data0 === "base64" || data0 === "base64url" || data0 === "binary" || data0 === "hex" || data0 === "latin1" || data0 === "ucs-2" || data0 === "ucs2" || data0 === "utf-16le" || data0 === "utf-8" || data0 === "utf16le" || data0 === "utf8")) {
|
|
958
|
-
validate17.errors = [{ instancePath: instancePath + "/type", schemaPath: "#/definitions/global.BufferEncoding/enum", keyword: "enum", params: { allowedValues: schema21.enum }, message: "must be equal to one of the allowed values" }];
|
|
959
|
-
return false;
|
|
960
|
-
}
|
|
961
|
-
var valid0 = _errs2 === errors;
|
|
962
|
-
} else {
|
|
963
|
-
var valid0 = true;
|
|
964
|
-
}
|
|
965
|
-
if (valid0) {
|
|
966
|
-
if (data.buffer !== void 0) {
|
|
967
|
-
const _errs5 = errors;
|
|
968
|
-
if (typeof data.buffer !== "string") {
|
|
969
|
-
validate17.errors = [{ instancePath: instancePath + "/buffer", schemaPath: "#/properties/buffer/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
970
|
-
return false;
|
|
971
|
-
}
|
|
972
|
-
var valid0 = _errs5 === errors;
|
|
973
|
-
} else {
|
|
974
|
-
var valid0 = true;
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
}
|
|
979
|
-
} else {
|
|
980
|
-
validate17.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
1364
|
+
validate18.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
981
1365
|
return false;
|
|
982
1366
|
}
|
|
983
1367
|
}
|
|
984
|
-
|
|
1368
|
+
validate18.errors = vErrors;
|
|
985
1369
|
return errors === 0;
|
|
986
1370
|
}
|
|
987
|
-
|
|
1371
|
+
const schema23 = { "properties": { "offsetRef": { "enum": ["end", "start"] } } };
|
|
1372
|
+
const schema24 = { "type": ["string", "number"] };
|
|
1373
|
+
function validate22(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
988
1374
|
let vErrors = null;
|
|
989
1375
|
let errors = 0;
|
|
990
1376
|
if (errors === 0) {
|
|
991
1377
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
992
1378
|
let missing0;
|
|
993
1379
|
if (data.offset === void 0 && (missing0 = "offset") || data.offsetRef === void 0 && (missing0 = "offsetRef") || data.type === void 0 && (missing0 = "type") || data.value === void 0 && (missing0 = "value")) {
|
|
994
|
-
|
|
1380
|
+
validate22.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
|
995
1381
|
return false;
|
|
996
1382
|
} else {
|
|
997
1383
|
const _errs1 = errors;
|
|
998
1384
|
for (const key0 in data) {
|
|
999
1385
|
if (!(key0 === "type" || key0 === "device" || key0 === "offsetRef" || key0 === "offset" || key0 === "value")) {
|
|
1000
|
-
|
|
1386
|
+
validate22.errors = [{ instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
|
|
1001
1387
|
return false;
|
|
1002
1388
|
}
|
|
1003
1389
|
}
|
|
@@ -1006,11 +1392,11 @@ function validate16(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1006
1392
|
let data0 = data.type;
|
|
1007
1393
|
const _errs2 = errors;
|
|
1008
1394
|
if (typeof data0 !== "string") {
|
|
1009
|
-
|
|
1395
|
+
validate22.errors = [{ instancePath: instancePath + "/type", schemaPath: "#/properties/type/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1010
1396
|
return false;
|
|
1011
1397
|
}
|
|
1012
1398
|
if ("hd-data" !== data0) {
|
|
1013
|
-
|
|
1399
|
+
validate22.errors = [{ instancePath: instancePath + "/type", schemaPath: "#/properties/type/const", keyword: "const", params: { allowedValue: "hd-data" }, message: "must be equal to constant" }];
|
|
1014
1400
|
return false;
|
|
1015
1401
|
}
|
|
1016
1402
|
var valid0 = _errs2 === errors;
|
|
@@ -1021,7 +1407,7 @@ function validate16(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1021
1407
|
if (data.device !== void 0) {
|
|
1022
1408
|
const _errs4 = errors;
|
|
1023
1409
|
if (typeof data.device !== "string") {
|
|
1024
|
-
|
|
1410
|
+
validate22.errors = [{ instancePath: instancePath + "/device", schemaPath: "#/properties/device/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1025
1411
|
return false;
|
|
1026
1412
|
}
|
|
1027
1413
|
var valid0 = _errs4 === errors;
|
|
@@ -1033,11 +1419,11 @@ function validate16(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1033
1419
|
let data2 = data.offsetRef;
|
|
1034
1420
|
const _errs6 = errors;
|
|
1035
1421
|
if (typeof data2 !== "string") {
|
|
1036
|
-
|
|
1422
|
+
validate22.errors = [{ instancePath: instancePath + "/offsetRef", schemaPath: "#/properties/offsetRef/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1037
1423
|
return false;
|
|
1038
1424
|
}
|
|
1039
1425
|
if (!(data2 === "end" || data2 === "start")) {
|
|
1040
|
-
|
|
1426
|
+
validate22.errors = [{ instancePath: instancePath + "/offsetRef", schemaPath: "#/properties/offsetRef/enum", keyword: "enum", params: { allowedValues: schema23.properties.offsetRef.enum }, message: "must be equal to one of the allowed values" }];
|
|
1041
1427
|
return false;
|
|
1042
1428
|
}
|
|
1043
1429
|
var valid0 = _errs6 === errors;
|
|
@@ -1049,7 +1435,7 @@ function validate16(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1049
1435
|
let data3 = data.offset;
|
|
1050
1436
|
const _errs8 = errors;
|
|
1051
1437
|
if (typeof data3 !== "string" && !(typeof data3 == "number" && isFinite(data3))) {
|
|
1052
|
-
|
|
1438
|
+
validate22.errors = [{ instancePath: instancePath + "/offset", schemaPath: "#/definitions/BigNumber/type", keyword: "type", params: { type: schema24.type }, message: "must be string,number" }];
|
|
1053
1439
|
return false;
|
|
1054
1440
|
}
|
|
1055
1441
|
var valid0 = _errs8 === errors;
|
|
@@ -1184,8 +1570,8 @@ function validate16(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1184
1570
|
valid2 = valid2 || _valid0;
|
|
1185
1571
|
if (!valid2) {
|
|
1186
1572
|
const _errs25 = errors;
|
|
1187
|
-
if (!
|
|
1188
|
-
vErrors = vErrors === null ?
|
|
1573
|
+
if (!validate14(data4, { instancePath: instancePath + "/value", parentData: data, parentDataProperty: "value", rootData })) {
|
|
1574
|
+
vErrors = vErrors === null ? validate14.errors : vErrors.concat(validate14.errors);
|
|
1189
1575
|
errors = vErrors.length;
|
|
1190
1576
|
}
|
|
1191
1577
|
var _valid0 = _errs25 === errors;
|
|
@@ -1373,7 +1759,7 @@ function validate16(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1373
1759
|
vErrors.push(err20);
|
|
1374
1760
|
}
|
|
1375
1761
|
errors++;
|
|
1376
|
-
|
|
1762
|
+
validate22.errors = vErrors;
|
|
1377
1763
|
return false;
|
|
1378
1764
|
} else {
|
|
1379
1765
|
errors = _errs12;
|
|
@@ -1396,26 +1782,26 @@ function validate16(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1396
1782
|
}
|
|
1397
1783
|
}
|
|
1398
1784
|
} else {
|
|
1399
|
-
|
|
1785
|
+
validate22.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
1400
1786
|
return false;
|
|
1401
1787
|
}
|
|
1402
1788
|
}
|
|
1403
|
-
|
|
1789
|
+
validate22.errors = vErrors;
|
|
1404
1790
|
return errors === 0;
|
|
1405
1791
|
}
|
|
1406
|
-
function
|
|
1792
|
+
function validate25(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
1407
1793
|
let vErrors = null;
|
|
1408
1794
|
let errors = 0;
|
|
1409
1795
|
{
|
|
1410
1796
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
1411
1797
|
let missing0;
|
|
1412
1798
|
if (data.type === void 0 && (missing0 = "type") || data.value === void 0 && (missing0 = "value")) {
|
|
1413
|
-
|
|
1799
|
+
validate25.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
|
1414
1800
|
return false;
|
|
1415
1801
|
} else {
|
|
1416
1802
|
for (const key0 in data) {
|
|
1417
1803
|
if (!(key0 === "type" || key0 === "device" || key0 === "value")) {
|
|
1418
|
-
|
|
1804
|
+
validate25.errors = [{ instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
|
|
1419
1805
|
return false;
|
|
1420
1806
|
}
|
|
1421
1807
|
}
|
|
@@ -1424,11 +1810,11 @@ function validate20(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1424
1810
|
let data0 = data.type;
|
|
1425
1811
|
const _errs2 = errors;
|
|
1426
1812
|
if (typeof data0 !== "string") {
|
|
1427
|
-
|
|
1813
|
+
validate25.errors = [{ instancePath: instancePath + "/type", schemaPath: "#/properties/type/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1428
1814
|
return false;
|
|
1429
1815
|
}
|
|
1430
1816
|
if ("hd-size" !== data0) {
|
|
1431
|
-
|
|
1817
|
+
validate25.errors = [{ instancePath: instancePath + "/type", schemaPath: "#/properties/type/const", keyword: "const", params: { allowedValue: "hd-size" }, message: "must be equal to constant" }];
|
|
1432
1818
|
return false;
|
|
1433
1819
|
}
|
|
1434
1820
|
var valid0 = _errs2 === errors;
|
|
@@ -1439,7 +1825,7 @@ function validate20(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1439
1825
|
if (data.device !== void 0) {
|
|
1440
1826
|
const _errs4 = errors;
|
|
1441
1827
|
if (typeof data.device !== "string") {
|
|
1442
|
-
|
|
1828
|
+
validate25.errors = [{ instancePath: instancePath + "/device", schemaPath: "#/properties/device/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1443
1829
|
return false;
|
|
1444
1830
|
}
|
|
1445
1831
|
var valid0 = _errs4 === errors;
|
|
@@ -1451,7 +1837,7 @@ function validate20(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1451
1837
|
let data2 = data.value;
|
|
1452
1838
|
const _errs6 = errors;
|
|
1453
1839
|
if (typeof data2 !== "string" && !(typeof data2 == "number" && isFinite(data2))) {
|
|
1454
|
-
|
|
1840
|
+
validate25.errors = [{ instancePath: instancePath + "/value", schemaPath: "#/definitions/BigNumber/type", keyword: "type", params: { type: schema24.type }, message: "must be string,number" }];
|
|
1455
1841
|
return false;
|
|
1456
1842
|
}
|
|
1457
1843
|
var valid0 = _errs6 === errors;
|
|
@@ -1463,28 +1849,28 @@ function validate20(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1463
1849
|
}
|
|
1464
1850
|
}
|
|
1465
1851
|
} else {
|
|
1466
|
-
|
|
1852
|
+
validate25.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
1467
1853
|
return false;
|
|
1468
1854
|
}
|
|
1469
1855
|
}
|
|
1470
|
-
|
|
1856
|
+
validate25.errors = vErrors;
|
|
1471
1857
|
return errors === 0;
|
|
1472
1858
|
}
|
|
1473
|
-
const
|
|
1474
|
-
function
|
|
1859
|
+
const schema30 = { "properties": { "offsetRef": { "enum": ["end", "full", "start"] }, "offset": { "type": ["string", "number"] } } };
|
|
1860
|
+
function validate27(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
1475
1861
|
let vErrors = null;
|
|
1476
1862
|
let errors = 0;
|
|
1477
1863
|
if (errors === 0) {
|
|
1478
1864
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
1479
1865
|
let missing0;
|
|
1480
1866
|
if (data.file === void 0 && (missing0 = "file") || data.type === void 0 && (missing0 = "type") || data.value === void 0 && (missing0 = "value")) {
|
|
1481
|
-
|
|
1867
|
+
validate27.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
|
1482
1868
|
return false;
|
|
1483
1869
|
} else {
|
|
1484
1870
|
const _errs1 = errors;
|
|
1485
1871
|
for (const key0 in data) {
|
|
1486
1872
|
if (!(key0 === "type" || key0 === "device" || key0 === "file" || key0 === "offsetRef" || key0 === "offset" || key0 === "value")) {
|
|
1487
|
-
|
|
1873
|
+
validate27.errors = [{ instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
|
|
1488
1874
|
return false;
|
|
1489
1875
|
}
|
|
1490
1876
|
}
|
|
@@ -1493,11 +1879,11 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1493
1879
|
let data0 = data.type;
|
|
1494
1880
|
const _errs2 = errors;
|
|
1495
1881
|
if (typeof data0 !== "string") {
|
|
1496
|
-
|
|
1882
|
+
validate27.errors = [{ instancePath: instancePath + "/type", schemaPath: "#/properties/type/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1497
1883
|
return false;
|
|
1498
1884
|
}
|
|
1499
1885
|
if ("file-data" !== data0) {
|
|
1500
|
-
|
|
1886
|
+
validate27.errors = [{ instancePath: instancePath + "/type", schemaPath: "#/properties/type/const", keyword: "const", params: { allowedValue: "file-data" }, message: "must be equal to constant" }];
|
|
1501
1887
|
return false;
|
|
1502
1888
|
}
|
|
1503
1889
|
var valid0 = _errs2 === errors;
|
|
@@ -1508,7 +1894,7 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1508
1894
|
if (data.device !== void 0) {
|
|
1509
1895
|
const _errs4 = errors;
|
|
1510
1896
|
if (typeof data.device !== "string") {
|
|
1511
|
-
|
|
1897
|
+
validate27.errors = [{ instancePath: instancePath + "/device", schemaPath: "#/properties/device/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1512
1898
|
return false;
|
|
1513
1899
|
}
|
|
1514
1900
|
var valid0 = _errs4 === errors;
|
|
@@ -1519,7 +1905,7 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1519
1905
|
if (data.file !== void 0) {
|
|
1520
1906
|
const _errs6 = errors;
|
|
1521
1907
|
if (typeof data.file !== "string") {
|
|
1522
|
-
|
|
1908
|
+
validate27.errors = [{ instancePath: instancePath + "/file", schemaPath: "#/properties/file/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1523
1909
|
return false;
|
|
1524
1910
|
}
|
|
1525
1911
|
var valid0 = _errs6 === errors;
|
|
@@ -1531,11 +1917,11 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1531
1917
|
let data3 = data.offsetRef;
|
|
1532
1918
|
const _errs8 = errors;
|
|
1533
1919
|
if (typeof data3 !== "string") {
|
|
1534
|
-
|
|
1920
|
+
validate27.errors = [{ instancePath: instancePath + "/offsetRef", schemaPath: "#/properties/offsetRef/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1535
1921
|
return false;
|
|
1536
1922
|
}
|
|
1537
1923
|
if (!(data3 === "end" || data3 === "full" || data3 === "start")) {
|
|
1538
|
-
|
|
1924
|
+
validate27.errors = [{ instancePath: instancePath + "/offsetRef", schemaPath: "#/properties/offsetRef/enum", keyword: "enum", params: { allowedValues: schema30.properties.offsetRef.enum }, message: "must be equal to one of the allowed values" }];
|
|
1539
1925
|
return false;
|
|
1540
1926
|
}
|
|
1541
1927
|
var valid0 = _errs8 === errors;
|
|
@@ -1547,7 +1933,7 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1547
1933
|
let data4 = data.offset;
|
|
1548
1934
|
const _errs10 = errors;
|
|
1549
1935
|
if (typeof data4 !== "string" && !(typeof data4 == "number" && isFinite(data4))) {
|
|
1550
|
-
|
|
1936
|
+
validate27.errors = [{ instancePath: instancePath + "/offset", schemaPath: "#/properties/offset/type", keyword: "type", params: { type: schema30.properties.offset.type }, message: "must be string,number" }];
|
|
1551
1937
|
return false;
|
|
1552
1938
|
}
|
|
1553
1939
|
var valid0 = _errs10 === errors;
|
|
@@ -1682,8 +2068,8 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1682
2068
|
valid1 = valid1 || _valid0;
|
|
1683
2069
|
if (!valid1) {
|
|
1684
2070
|
const _errs26 = errors;
|
|
1685
|
-
if (!
|
|
1686
|
-
vErrors = vErrors === null ?
|
|
2071
|
+
if (!validate14(data5, { instancePath: instancePath + "/value", parentData: data, parentDataProperty: "value", rootData })) {
|
|
2072
|
+
vErrors = vErrors === null ? validate14.errors : vErrors.concat(validate14.errors);
|
|
1687
2073
|
errors = vErrors.length;
|
|
1688
2074
|
}
|
|
1689
2075
|
var _valid0 = _errs26 === errors;
|
|
@@ -1871,7 +2257,7 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1871
2257
|
vErrors.push(err20);
|
|
1872
2258
|
}
|
|
1873
2259
|
errors++;
|
|
1874
|
-
|
|
2260
|
+
validate27.errors = vErrors;
|
|
1875
2261
|
return false;
|
|
1876
2262
|
} else {
|
|
1877
2263
|
errors = _errs13;
|
|
@@ -1895,26 +2281,26 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1895
2281
|
}
|
|
1896
2282
|
}
|
|
1897
2283
|
} else {
|
|
1898
|
-
|
|
2284
|
+
validate27.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
1899
2285
|
return false;
|
|
1900
2286
|
}
|
|
1901
2287
|
}
|
|
1902
|
-
|
|
2288
|
+
validate27.errors = vErrors;
|
|
1903
2289
|
return errors === 0;
|
|
1904
2290
|
}
|
|
1905
|
-
function
|
|
2291
|
+
function validate30(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
1906
2292
|
let vErrors = null;
|
|
1907
2293
|
let errors = 0;
|
|
1908
2294
|
{
|
|
1909
2295
|
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
1910
2296
|
let missing0;
|
|
1911
2297
|
if (data.file === void 0 && (missing0 = "file") || data.type === void 0 && (missing0 = "type") || data.value === void 0 && (missing0 = "value")) {
|
|
1912
|
-
|
|
2298
|
+
validate30.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
|
1913
2299
|
return false;
|
|
1914
2300
|
} else {
|
|
1915
2301
|
for (const key0 in data) {
|
|
1916
2302
|
if (!(key0 === "type" || key0 === "device" || key0 === "file" || key0 === "value")) {
|
|
1917
|
-
|
|
2303
|
+
validate30.errors = [{ instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
|
|
1918
2304
|
return false;
|
|
1919
2305
|
}
|
|
1920
2306
|
}
|
|
@@ -1923,11 +2309,11 @@ function validate25(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1923
2309
|
let data0 = data.type;
|
|
1924
2310
|
const _errs2 = errors;
|
|
1925
2311
|
if (typeof data0 !== "string") {
|
|
1926
|
-
|
|
2312
|
+
validate30.errors = [{ instancePath: instancePath + "/type", schemaPath: "#/properties/type/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1927
2313
|
return false;
|
|
1928
2314
|
}
|
|
1929
2315
|
if ("file-size" !== data0) {
|
|
1930
|
-
|
|
2316
|
+
validate30.errors = [{ instancePath: instancePath + "/type", schemaPath: "#/properties/type/const", keyword: "const", params: { allowedValue: "file-size" }, message: "must be equal to constant" }];
|
|
1931
2317
|
return false;
|
|
1932
2318
|
}
|
|
1933
2319
|
var valid0 = _errs2 === errors;
|
|
@@ -1938,7 +2324,7 @@ function validate25(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1938
2324
|
if (data.device !== void 0) {
|
|
1939
2325
|
const _errs4 = errors;
|
|
1940
2326
|
if (typeof data.device !== "string") {
|
|
1941
|
-
|
|
2327
|
+
validate30.errors = [{ instancePath: instancePath + "/device", schemaPath: "#/properties/device/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1942
2328
|
return false;
|
|
1943
2329
|
}
|
|
1944
2330
|
var valid0 = _errs4 === errors;
|
|
@@ -1949,7 +2335,7 @@ function validate25(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1949
2335
|
if (data.file !== void 0) {
|
|
1950
2336
|
const _errs6 = errors;
|
|
1951
2337
|
if (typeof data.file !== "string") {
|
|
1952
|
-
|
|
2338
|
+
validate30.errors = [{ instancePath: instancePath + "/file", schemaPath: "#/properties/file/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
|
|
1953
2339
|
return false;
|
|
1954
2340
|
}
|
|
1955
2341
|
var valid0 = _errs6 === errors;
|
|
@@ -1961,7 +2347,7 @@ function validate25(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1961
2347
|
let data3 = data.value;
|
|
1962
2348
|
const _errs8 = errors;
|
|
1963
2349
|
if (typeof data3 !== "string" && !(typeof data3 == "number" && isFinite(data3))) {
|
|
1964
|
-
|
|
2350
|
+
validate30.errors = [{ instancePath: instancePath + "/value", schemaPath: "#/definitions/BigNumber/type", keyword: "type", params: { type: schema24.type }, message: "must be string,number" }];
|
|
1965
2351
|
return false;
|
|
1966
2352
|
}
|
|
1967
2353
|
var valid0 = _errs8 === errors;
|
|
@@ -1974,11 +2360,11 @@ function validate25(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
1974
2360
|
}
|
|
1975
2361
|
}
|
|
1976
2362
|
} else {
|
|
1977
|
-
|
|
2363
|
+
validate30.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
1978
2364
|
return false;
|
|
1979
2365
|
}
|
|
1980
2366
|
}
|
|
1981
|
-
|
|
2367
|
+
validate30.errors = vErrors;
|
|
1982
2368
|
return errors === 0;
|
|
1983
2369
|
}
|
|
1984
2370
|
function validate11(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
@@ -2081,121 +2467,130 @@ function validate11(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
2081
2467
|
valid0 = valid0 || _valid0;
|
|
2082
2468
|
if (!valid0) {
|
|
2083
2469
|
const _errs10 = errors;
|
|
2084
|
-
if (!
|
|
2085
|
-
vErrors = vErrors === null ?
|
|
2470
|
+
if (!validate18(data, { instancePath, parentData, parentDataProperty, rootData })) {
|
|
2471
|
+
vErrors = vErrors === null ? validate18.errors : vErrors.concat(validate18.errors);
|
|
2086
2472
|
errors = vErrors.length;
|
|
2087
2473
|
}
|
|
2088
2474
|
var _valid0 = _errs10 === errors;
|
|
2089
2475
|
valid0 = valid0 || _valid0;
|
|
2090
2476
|
if (!valid0) {
|
|
2091
2477
|
const _errs11 = errors;
|
|
2092
|
-
if (!
|
|
2093
|
-
vErrors = vErrors === null ?
|
|
2478
|
+
if (!validate22(data, { instancePath, parentData, parentDataProperty, rootData })) {
|
|
2479
|
+
vErrors = vErrors === null ? validate22.errors : vErrors.concat(validate22.errors);
|
|
2094
2480
|
errors = vErrors.length;
|
|
2095
2481
|
}
|
|
2096
2482
|
var _valid0 = _errs11 === errors;
|
|
2097
2483
|
valid0 = valid0 || _valid0;
|
|
2098
2484
|
if (!valid0) {
|
|
2099
2485
|
const _errs12 = errors;
|
|
2100
|
-
if (!
|
|
2101
|
-
vErrors = vErrors === null ?
|
|
2486
|
+
if (!validate25(data, { instancePath, parentData, parentDataProperty, rootData })) {
|
|
2487
|
+
vErrors = vErrors === null ? validate25.errors : vErrors.concat(validate25.errors);
|
|
2102
2488
|
errors = vErrors.length;
|
|
2103
2489
|
}
|
|
2104
2490
|
var _valid0 = _errs12 === errors;
|
|
2105
2491
|
valid0 = valid0 || _valid0;
|
|
2106
2492
|
if (!valid0) {
|
|
2107
2493
|
const _errs13 = errors;
|
|
2108
|
-
if (!
|
|
2109
|
-
vErrors = vErrors === null ?
|
|
2494
|
+
if (!validate27(data, { instancePath, parentData, parentDataProperty, rootData })) {
|
|
2495
|
+
vErrors = vErrors === null ? validate27.errors : vErrors.concat(validate27.errors);
|
|
2110
2496
|
errors = vErrors.length;
|
|
2111
2497
|
}
|
|
2112
2498
|
var _valid0 = _errs13 === errors;
|
|
2113
2499
|
valid0 = valid0 || _valid0;
|
|
2114
2500
|
if (!valid0) {
|
|
2115
2501
|
const _errs14 = errors;
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
vErrors = [err7];
|
|
2135
|
-
} else {
|
|
2136
|
-
vErrors.push(err7);
|
|
2137
|
-
}
|
|
2138
|
-
errors++;
|
|
2139
|
-
break;
|
|
2502
|
+
if (!validate30(data, { instancePath, parentData, parentDataProperty, rootData })) {
|
|
2503
|
+
vErrors = vErrors === null ? validate30.errors : vErrors.concat(validate30.errors);
|
|
2504
|
+
errors = vErrors.length;
|
|
2505
|
+
}
|
|
2506
|
+
var _valid0 = _errs14 === errors;
|
|
2507
|
+
valid0 = valid0 || _valid0;
|
|
2508
|
+
if (!valid0) {
|
|
2509
|
+
const _errs15 = errors;
|
|
2510
|
+
const _errs16 = errors;
|
|
2511
|
+
if (errors === _errs16) {
|
|
2512
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
2513
|
+
let missing1;
|
|
2514
|
+
if (data.type === void 0 && (missing1 = "type") || data.value === void 0 && (missing1 = "value")) {
|
|
2515
|
+
const err6 = { instancePath, schemaPath: "#/definitions/HashComponentMiscStringData/required", keyword: "required", params: { missingProperty: missing1 }, message: "must have required property '" + missing1 + "'" };
|
|
2516
|
+
if (vErrors === null) {
|
|
2517
|
+
vErrors = [err6];
|
|
2518
|
+
} else {
|
|
2519
|
+
vErrors.push(err6);
|
|
2140
2520
|
}
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
const err8 = { instancePath: instancePath + "/type", schemaPath: "#/definitions/HashComponentMiscStringData/properties/type/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
2148
|
-
if (vErrors === null) {
|
|
2149
|
-
vErrors = [err8];
|
|
2150
|
-
} else {
|
|
2151
|
-
vErrors.push(err8);
|
|
2152
|
-
}
|
|
2153
|
-
errors++;
|
|
2154
|
-
}
|
|
2155
|
-
if (!(data2 === "boot-file" || data2 === "boot-hd-device" || data2 === "boot-partition-device")) {
|
|
2156
|
-
const err9 = { instancePath: instancePath + "/type", schemaPath: "#/definitions/HashComponentMiscStringData/properties/type/enum", keyword: "enum", params: { allowedValues: schema32.properties.type.enum }, message: "must be equal to one of the allowed values" };
|
|
2521
|
+
errors++;
|
|
2522
|
+
} else {
|
|
2523
|
+
const _errs18 = errors;
|
|
2524
|
+
for (const key1 in data) {
|
|
2525
|
+
if (!(key1 === "type" || key1 === "value")) {
|
|
2526
|
+
const err7 = { instancePath, schemaPath: "#/definitions/HashComponentMiscStringData/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" };
|
|
2157
2527
|
if (vErrors === null) {
|
|
2158
|
-
vErrors = [
|
|
2528
|
+
vErrors = [err7];
|
|
2159
2529
|
} else {
|
|
2160
|
-
vErrors.push(
|
|
2530
|
+
vErrors.push(err7);
|
|
2161
2531
|
}
|
|
2162
2532
|
errors++;
|
|
2533
|
+
break;
|
|
2163
2534
|
}
|
|
2164
|
-
var valid4 = _errs18 === errors;
|
|
2165
|
-
} else {
|
|
2166
|
-
var valid4 = true;
|
|
2167
2535
|
}
|
|
2168
|
-
if (
|
|
2169
|
-
if (data.
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2536
|
+
if (_errs18 === errors) {
|
|
2537
|
+
if (data.type !== void 0) {
|
|
2538
|
+
let data2 = data.type;
|
|
2539
|
+
const _errs19 = errors;
|
|
2540
|
+
if (typeof data2 !== "string") {
|
|
2541
|
+
const err8 = { instancePath: instancePath + "/type", schemaPath: "#/definitions/HashComponentMiscStringData/properties/type/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
2173
2542
|
if (vErrors === null) {
|
|
2174
|
-
vErrors = [
|
|
2543
|
+
vErrors = [err8];
|
|
2175
2544
|
} else {
|
|
2176
|
-
vErrors.push(
|
|
2545
|
+
vErrors.push(err8);
|
|
2177
2546
|
}
|
|
2178
2547
|
errors++;
|
|
2179
2548
|
}
|
|
2180
|
-
|
|
2549
|
+
if (!(data2 === "boot-file" || data2 === "boot-hd-device" || data2 === "boot-partition-device")) {
|
|
2550
|
+
const err9 = { instancePath: instancePath + "/type", schemaPath: "#/definitions/HashComponentMiscStringData/properties/type/enum", keyword: "enum", params: { allowedValues: schema36.properties.type.enum }, message: "must be equal to one of the allowed values" };
|
|
2551
|
+
if (vErrors === null) {
|
|
2552
|
+
vErrors = [err9];
|
|
2553
|
+
} else {
|
|
2554
|
+
vErrors.push(err9);
|
|
2555
|
+
}
|
|
2556
|
+
errors++;
|
|
2557
|
+
}
|
|
2558
|
+
var valid4 = _errs19 === errors;
|
|
2181
2559
|
} else {
|
|
2182
2560
|
var valid4 = true;
|
|
2183
2561
|
}
|
|
2562
|
+
if (valid4) {
|
|
2563
|
+
if (data.value !== void 0) {
|
|
2564
|
+
const _errs21 = errors;
|
|
2565
|
+
if (typeof data.value !== "string") {
|
|
2566
|
+
const err10 = { instancePath: instancePath + "/value", schemaPath: "#/definitions/HashComponentMiscStringData/properties/value/type", keyword: "type", params: { type: "string" }, message: "must be string" };
|
|
2567
|
+
if (vErrors === null) {
|
|
2568
|
+
vErrors = [err10];
|
|
2569
|
+
} else {
|
|
2570
|
+
vErrors.push(err10);
|
|
2571
|
+
}
|
|
2572
|
+
errors++;
|
|
2573
|
+
}
|
|
2574
|
+
var valid4 = _errs21 === errors;
|
|
2575
|
+
} else {
|
|
2576
|
+
var valid4 = true;
|
|
2577
|
+
}
|
|
2578
|
+
}
|
|
2184
2579
|
}
|
|
2185
2580
|
}
|
|
2186
|
-
}
|
|
2187
|
-
} else {
|
|
2188
|
-
const err11 = { instancePath, schemaPath: "#/definitions/HashComponentMiscStringData/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
2189
|
-
if (vErrors === null) {
|
|
2190
|
-
vErrors = [err11];
|
|
2191
2581
|
} else {
|
|
2192
|
-
|
|
2582
|
+
const err11 = { instancePath, schemaPath: "#/definitions/HashComponentMiscStringData/type", keyword: "type", params: { type: "object" }, message: "must be object" };
|
|
2583
|
+
if (vErrors === null) {
|
|
2584
|
+
vErrors = [err11];
|
|
2585
|
+
} else {
|
|
2586
|
+
vErrors.push(err11);
|
|
2587
|
+
}
|
|
2588
|
+
errors++;
|
|
2193
2589
|
}
|
|
2194
|
-
errors++;
|
|
2195
2590
|
}
|
|
2591
|
+
var _valid0 = _errs15 === errors;
|
|
2592
|
+
valid0 = valid0 || _valid0;
|
|
2196
2593
|
}
|
|
2197
|
-
var _valid0 = _errs14 === errors;
|
|
2198
|
-
valid0 = valid0 || _valid0;
|
|
2199
2594
|
}
|
|
2200
2595
|
}
|
|
2201
2596
|
}
|
|
@@ -2225,6 +2620,68 @@ function validate11(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
2225
2620
|
validate11.errors = vErrors;
|
|
2226
2621
|
return errors === 0;
|
|
2227
2622
|
}
|
|
2623
|
+
function validate33(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
2624
|
+
let vErrors = null;
|
|
2625
|
+
let errors = 0;
|
|
2626
|
+
if (errors === 0) {
|
|
2627
|
+
if (data && typeof data == "object" && !Array.isArray(data)) {
|
|
2628
|
+
let missing0;
|
|
2629
|
+
if (data.db === void 0 && (missing0 = "db") || data.kek === void 0 && (missing0 = "kek") || data.pk === void 0 && (missing0 = "pk")) {
|
|
2630
|
+
validate33.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
|
|
2631
|
+
return false;
|
|
2632
|
+
} else {
|
|
2633
|
+
const _errs1 = errors;
|
|
2634
|
+
for (const key0 in data) {
|
|
2635
|
+
if (!(key0 === "kek" || key0 === "db" || key0 === "pk")) {
|
|
2636
|
+
validate33.errors = [{ instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" }];
|
|
2637
|
+
return false;
|
|
2638
|
+
}
|
|
2639
|
+
}
|
|
2640
|
+
if (_errs1 === errors) {
|
|
2641
|
+
if (data.kek !== void 0) {
|
|
2642
|
+
const _errs2 = errors;
|
|
2643
|
+
if (!validate13(data.kek, { instancePath: instancePath + "/kek", parentData: data, parentDataProperty: "kek", rootData })) {
|
|
2644
|
+
vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);
|
|
2645
|
+
errors = vErrors.length;
|
|
2646
|
+
}
|
|
2647
|
+
var valid0 = _errs2 === errors;
|
|
2648
|
+
} else {
|
|
2649
|
+
var valid0 = true;
|
|
2650
|
+
}
|
|
2651
|
+
if (valid0) {
|
|
2652
|
+
if (data.db !== void 0) {
|
|
2653
|
+
const _errs3 = errors;
|
|
2654
|
+
if (!validate13(data.db, { instancePath: instancePath + "/db", parentData: data, parentDataProperty: "db", rootData })) {
|
|
2655
|
+
vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);
|
|
2656
|
+
errors = vErrors.length;
|
|
2657
|
+
}
|
|
2658
|
+
var valid0 = _errs3 === errors;
|
|
2659
|
+
} else {
|
|
2660
|
+
var valid0 = true;
|
|
2661
|
+
}
|
|
2662
|
+
if (valid0) {
|
|
2663
|
+
if (data.pk !== void 0) {
|
|
2664
|
+
const _errs4 = errors;
|
|
2665
|
+
if (!validate13(data.pk, { instancePath: instancePath + "/pk", parentData: data, parentDataProperty: "pk", rootData })) {
|
|
2666
|
+
vErrors = vErrors === null ? validate13.errors : vErrors.concat(validate13.errors);
|
|
2667
|
+
errors = vErrors.length;
|
|
2668
|
+
}
|
|
2669
|
+
var valid0 = _errs4 === errors;
|
|
2670
|
+
} else {
|
|
2671
|
+
var valid0 = true;
|
|
2672
|
+
}
|
|
2673
|
+
}
|
|
2674
|
+
}
|
|
2675
|
+
}
|
|
2676
|
+
}
|
|
2677
|
+
} else {
|
|
2678
|
+
validate33.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
|
|
2679
|
+
return false;
|
|
2680
|
+
}
|
|
2681
|
+
}
|
|
2682
|
+
validate33.errors = vErrors;
|
|
2683
|
+
return errors === 0;
|
|
2684
|
+
}
|
|
2228
2685
|
function validate10(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
|
|
2229
2686
|
let vErrors = null;
|
|
2230
2687
|
let errors = 0;
|
|
@@ -2358,6 +2815,18 @@ function validate10(data, { instancePath = "", parentData, parentDataProperty, r
|
|
|
2358
2815
|
} else {
|
|
2359
2816
|
var valid0 = true;
|
|
2360
2817
|
}
|
|
2818
|
+
if (valid0) {
|
|
2819
|
+
if (data.enrollSecureBoot !== void 0) {
|
|
2820
|
+
const _errs21 = errors;
|
|
2821
|
+
if (!validate33(data.enrollSecureBoot, { instancePath: instancePath + "/enrollSecureBoot", parentData: data, parentDataProperty: "enrollSecureBoot", rootData })) {
|
|
2822
|
+
vErrors = vErrors === null ? validate33.errors : vErrors.concat(validate33.errors);
|
|
2823
|
+
errors = vErrors.length;
|
|
2824
|
+
}
|
|
2825
|
+
var valid0 = _errs21 === errors;
|
|
2826
|
+
} else {
|
|
2827
|
+
var valid0 = true;
|
|
2828
|
+
}
|
|
2829
|
+
}
|
|
2361
2830
|
}
|
|
2362
2831
|
}
|
|
2363
2832
|
}
|
|
@@ -2382,7 +2851,7 @@ const spawnProcess = (command, args, options) => new Promise((resolve, reject) =
|
|
|
2382
2851
|
if (!code && !signal) {
|
|
2383
2852
|
resolve();
|
|
2384
2853
|
} else {
|
|
2385
|
-
|
|
2854
|
+
reject(new Error("Command failed"));
|
|
2386
2855
|
}
|
|
2387
2856
|
});
|
|
2388
2857
|
});
|
|
@@ -2414,7 +2883,7 @@ const build = async (config) => {
|
|
|
2414
2883
|
await genCode(config);
|
|
2415
2884
|
}
|
|
2416
2885
|
if (!config.skipExtract) {
|
|
2417
|
-
const extract = (await import("./extract-
|
|
2886
|
+
const extract = (await import("./extract-BvhlZgSs.js")).extract;
|
|
2418
2887
|
await extract(config.buildFolder);
|
|
2419
2888
|
}
|
|
2420
2889
|
if (!config.skipMake) {
|