moeralib
Version:
Library to interact with Moera decentralized social network
839 lines • 134 kB
JavaScript
// This file is generated
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NAMING_API_VALIDATORS = exports.SigningKeyInfoArray = exports.SigningKeyInfo = exports.RegisteredNameInfoArray = exports.RegisteredNameInfo = exports.OperationStatusInfo = exports.OperationStatus = exports.ErrorResult = exports.StringResult = exports.BooleanResult = exports.ObjectResult = void 0;
exports.ObjectResult = validate11;
const schema12 = { "type": "object", "properties": { "jsonrpc": { "type": "string" }, "result": { "type": "object", "nullable": true }, "id": { "type": "integer" } }, "additionalProperties": false, "required": ["jsonrpc", "id"] };
function validate11(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
let vErrors = null;
let errors = 0;
if (errors === 0) {
if (data && typeof data == "object" && !Array.isArray(data)) {
let missing0;
if (((data.jsonrpc === undefined) && (missing0 = "jsonrpc")) || ((data.id === undefined) && (missing0 = "id"))) {
validate11.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
return false;
}
else {
const _errs1 = errors;
for (const key0 in data) {
if (!(((key0 === "jsonrpc") || (key0 === "result")) || (key0 === "id"))) {
delete data[key0];
}
}
if (_errs1 === errors) {
if (data.jsonrpc !== undefined) {
let data0 = data.jsonrpc;
const _errs2 = errors;
if (typeof data0 !== "string") {
let dataType0 = typeof data0;
let coerced0 = undefined;
if (dataType0 == 'object' && Array.isArray(data0) && data0.length == 1) {
data0 = data0[0];
dataType0 = typeof data0;
if (typeof data0 === "string") {
coerced0 = data0;
}
}
if (!(coerced0 !== undefined)) {
if (dataType0 == "number" || dataType0 == "boolean") {
coerced0 = "" + data0;
}
else if (data0 === null) {
coerced0 = "";
}
else {
validate11.errors = [{ instancePath: instancePath + "/jsonrpc", schemaPath: "#/properties/jsonrpc/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
return false;
}
}
if (coerced0 !== undefined) {
data0 = coerced0;
if (data !== undefined) {
data["jsonrpc"] = coerced0;
}
}
}
var valid0 = _errs2 === errors;
}
else {
var valid0 = true;
}
if (valid0) {
if (data.result !== undefined) {
let data1 = data.result;
const _errs4 = errors;
if ((!(data1 && typeof data1 == "object" && !Array.isArray(data1))) && (data1 !== null)) {
let dataType1 = typeof data1;
let coerced1 = undefined;
if (dataType1 == 'object' && Array.isArray(data1) && data1.length == 1) {
data1 = data1[0];
dataType1 = typeof data1;
if ((data1 && typeof data1 == "object" && !Array.isArray(data1)) && (data1 === null)) {
coerced1 = data1;
}
}
if (!(coerced1 !== undefined)) {
if (data1 === "" || data1 === 0 || data1 === false) {
coerced1 = null;
}
else {
validate11.errors = [{ instancePath: instancePath + "/result", schemaPath: "#/properties/result/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
return false;
}
}
if (coerced1 !== undefined) {
data1 = coerced1;
if (data !== undefined) {
data["result"] = coerced1;
}
}
}
var valid0 = _errs4 === errors;
}
else {
var valid0 = true;
}
if (valid0) {
if (data.id !== undefined) {
let data2 = data.id;
const _errs7 = errors;
if (!(((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))) {
let dataType2 = typeof data2;
let coerced2 = undefined;
if (dataType2 == 'object' && Array.isArray(data2) && data2.length == 1) {
data2 = data2[0];
dataType2 = typeof data2;
if (((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2))) {
coerced2 = data2;
}
}
if (!(coerced2 !== undefined)) {
if (dataType2 === "boolean" || data2 === null
|| (dataType2 === "string" && data2 && data2 == +data2 && !(data2 % 1))) {
coerced2 = +data2;
}
else {
validate11.errors = [{ instancePath: instancePath + "/id", schemaPath: "#/properties/id/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
return false;
}
}
if (coerced2 !== undefined) {
data2 = coerced2;
if (data !== undefined) {
data["id"] = coerced2;
}
}
}
var valid0 = _errs7 === errors;
}
else {
var valid0 = true;
}
}
}
}
}
}
else {
validate11.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
return false;
}
}
validate11.errors = vErrors;
return errors === 0;
}
exports.BooleanResult = validate12;
const schema13 = { "type": "object", "properties": { "jsonrpc": { "type": "string" }, "result": { "type": "boolean", "nullable": true }, "id": { "type": "integer" } }, "additionalProperties": false, "required": ["jsonrpc", "id"] };
function validate12(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
let vErrors = null;
let errors = 0;
if (errors === 0) {
if (data && typeof data == "object" && !Array.isArray(data)) {
let missing0;
if (((data.jsonrpc === undefined) && (missing0 = "jsonrpc")) || ((data.id === undefined) && (missing0 = "id"))) {
validate12.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
return false;
}
else {
const _errs1 = errors;
for (const key0 in data) {
if (!(((key0 === "jsonrpc") || (key0 === "result")) || (key0 === "id"))) {
delete data[key0];
}
}
if (_errs1 === errors) {
if (data.jsonrpc !== undefined) {
let data0 = data.jsonrpc;
const _errs2 = errors;
if (typeof data0 !== "string") {
let dataType0 = typeof data0;
let coerced0 = undefined;
if (dataType0 == 'object' && Array.isArray(data0) && data0.length == 1) {
data0 = data0[0];
dataType0 = typeof data0;
if (typeof data0 === "string") {
coerced0 = data0;
}
}
if (!(coerced0 !== undefined)) {
if (dataType0 == "number" || dataType0 == "boolean") {
coerced0 = "" + data0;
}
else if (data0 === null) {
coerced0 = "";
}
else {
validate12.errors = [{ instancePath: instancePath + "/jsonrpc", schemaPath: "#/properties/jsonrpc/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
return false;
}
}
if (coerced0 !== undefined) {
data0 = coerced0;
if (data !== undefined) {
data["jsonrpc"] = coerced0;
}
}
}
var valid0 = _errs2 === errors;
}
else {
var valid0 = true;
}
if (valid0) {
if (data.result !== undefined) {
let data1 = data.result;
const _errs4 = errors;
if ((typeof data1 !== "boolean") && (data1 !== null)) {
let dataType1 = typeof data1;
let coerced1 = undefined;
if (dataType1 == 'object' && Array.isArray(data1) && data1.length == 1) {
data1 = data1[0];
dataType1 = typeof data1;
if ((typeof data1 === "boolean") && (data1 === null)) {
coerced1 = data1;
}
}
if (!(coerced1 !== undefined)) {
if (data1 === "false" || data1 === 0 || data1 === null) {
coerced1 = false;
}
else if (data1 === "true" || data1 === 1) {
coerced1 = true;
}
else if (data1 === "" || data1 === 0 || data1 === false) {
coerced1 = null;
}
else {
validate12.errors = [{ instancePath: instancePath + "/result", schemaPath: "#/properties/result/type", keyword: "type", params: { type: "boolean" }, message: "must be boolean" }];
return false;
}
}
if (coerced1 !== undefined) {
data1 = coerced1;
if (data !== undefined) {
data["result"] = coerced1;
}
}
}
var valid0 = _errs4 === errors;
}
else {
var valid0 = true;
}
if (valid0) {
if (data.id !== undefined) {
let data2 = data.id;
const _errs7 = errors;
if (!(((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))) {
let dataType2 = typeof data2;
let coerced2 = undefined;
if (dataType2 == 'object' && Array.isArray(data2) && data2.length == 1) {
data2 = data2[0];
dataType2 = typeof data2;
if (((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2))) {
coerced2 = data2;
}
}
if (!(coerced2 !== undefined)) {
if (dataType2 === "boolean" || data2 === null
|| (dataType2 === "string" && data2 && data2 == +data2 && !(data2 % 1))) {
coerced2 = +data2;
}
else {
validate12.errors = [{ instancePath: instancePath + "/id", schemaPath: "#/properties/id/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
return false;
}
}
if (coerced2 !== undefined) {
data2 = coerced2;
if (data !== undefined) {
data["id"] = coerced2;
}
}
}
var valid0 = _errs7 === errors;
}
else {
var valid0 = true;
}
}
}
}
}
}
else {
validate12.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
return false;
}
}
validate12.errors = vErrors;
return errors === 0;
}
exports.StringResult = validate13;
const schema14 = { "type": "object", "properties": { "jsonrpc": { "type": "string" }, "result": { "type": "string", "nullable": true }, "id": { "type": "integer" } }, "additionalProperties": false, "required": ["jsonrpc", "id"] };
function validate13(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
let vErrors = null;
let errors = 0;
if (errors === 0) {
if (data && typeof data == "object" && !Array.isArray(data)) {
let missing0;
if (((data.jsonrpc === undefined) && (missing0 = "jsonrpc")) || ((data.id === undefined) && (missing0 = "id"))) {
validate13.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
return false;
}
else {
const _errs1 = errors;
for (const key0 in data) {
if (!(((key0 === "jsonrpc") || (key0 === "result")) || (key0 === "id"))) {
delete data[key0];
}
}
if (_errs1 === errors) {
if (data.jsonrpc !== undefined) {
let data0 = data.jsonrpc;
const _errs2 = errors;
if (typeof data0 !== "string") {
let dataType0 = typeof data0;
let coerced0 = undefined;
if (dataType0 == 'object' && Array.isArray(data0) && data0.length == 1) {
data0 = data0[0];
dataType0 = typeof data0;
if (typeof data0 === "string") {
coerced0 = data0;
}
}
if (!(coerced0 !== undefined)) {
if (dataType0 == "number" || dataType0 == "boolean") {
coerced0 = "" + data0;
}
else if (data0 === null) {
coerced0 = "";
}
else {
validate13.errors = [{ instancePath: instancePath + "/jsonrpc", schemaPath: "#/properties/jsonrpc/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
return false;
}
}
if (coerced0 !== undefined) {
data0 = coerced0;
if (data !== undefined) {
data["jsonrpc"] = coerced0;
}
}
}
var valid0 = _errs2 === errors;
}
else {
var valid0 = true;
}
if (valid0) {
if (data.result !== undefined) {
let data1 = data.result;
const _errs4 = errors;
if ((typeof data1 !== "string") && (data1 !== null)) {
let dataType1 = typeof data1;
let coerced1 = undefined;
if (dataType1 == 'object' && Array.isArray(data1) && data1.length == 1) {
data1 = data1[0];
dataType1 = typeof data1;
if ((typeof data1 === "string") && (data1 === null)) {
coerced1 = data1;
}
}
if (!(coerced1 !== undefined)) {
if (dataType1 == "number" || dataType1 == "boolean") {
coerced1 = "" + data1;
}
else if (data1 === null) {
coerced1 = "";
}
else if (data1 === "" || data1 === 0 || data1 === false) {
coerced1 = null;
}
else {
validate13.errors = [{ instancePath: instancePath + "/result", schemaPath: "#/properties/result/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
return false;
}
}
if (coerced1 !== undefined) {
data1 = coerced1;
if (data !== undefined) {
data["result"] = coerced1;
}
}
}
var valid0 = _errs4 === errors;
}
else {
var valid0 = true;
}
if (valid0) {
if (data.id !== undefined) {
let data2 = data.id;
const _errs7 = errors;
if (!(((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))) {
let dataType2 = typeof data2;
let coerced2 = undefined;
if (dataType2 == 'object' && Array.isArray(data2) && data2.length == 1) {
data2 = data2[0];
dataType2 = typeof data2;
if (((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2))) {
coerced2 = data2;
}
}
if (!(coerced2 !== undefined)) {
if (dataType2 === "boolean" || data2 === null
|| (dataType2 === "string" && data2 && data2 == +data2 && !(data2 % 1))) {
coerced2 = +data2;
}
else {
validate13.errors = [{ instancePath: instancePath + "/id", schemaPath: "#/properties/id/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
return false;
}
}
if (coerced2 !== undefined) {
data2 = coerced2;
if (data !== undefined) {
data["id"] = coerced2;
}
}
}
var valid0 = _errs7 === errors;
}
else {
var valid0 = true;
}
}
}
}
}
}
else {
validate13.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
return false;
}
}
validate13.errors = vErrors;
return errors === 0;
}
exports.ErrorResult = validate14;
const schema15 = { "type": "object", "properties": { "jsonrpc": { "type": "string" }, "error": { "type": "object", "properties": { "code": { "type": "integer" }, "message": { "type": "string" } }, "additionalProperties": false, "required": ["code", "message"] }, "id": { "type": "integer" } }, "additionalProperties": false, "required": ["jsonrpc", "error", "id"] };
function validate14(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
let vErrors = null;
let errors = 0;
if (errors === 0) {
if (data && typeof data == "object" && !Array.isArray(data)) {
let missing0;
if ((((data.jsonrpc === undefined) && (missing0 = "jsonrpc")) || ((data.error === undefined) && (missing0 = "error"))) || ((data.id === undefined) && (missing0 = "id"))) {
validate14.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
return false;
}
else {
const _errs1 = errors;
for (const key0 in data) {
if (!(((key0 === "jsonrpc") || (key0 === "error")) || (key0 === "id"))) {
delete data[key0];
}
}
if (_errs1 === errors) {
if (data.jsonrpc !== undefined) {
let data0 = data.jsonrpc;
const _errs2 = errors;
if (typeof data0 !== "string") {
let dataType0 = typeof data0;
let coerced0 = undefined;
if (dataType0 == 'object' && Array.isArray(data0) && data0.length == 1) {
data0 = data0[0];
dataType0 = typeof data0;
if (typeof data0 === "string") {
coerced0 = data0;
}
}
if (!(coerced0 !== undefined)) {
if (dataType0 == "number" || dataType0 == "boolean") {
coerced0 = "" + data0;
}
else if (data0 === null) {
coerced0 = "";
}
else {
validate14.errors = [{ instancePath: instancePath + "/jsonrpc", schemaPath: "#/properties/jsonrpc/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
return false;
}
}
if (coerced0 !== undefined) {
data0 = coerced0;
if (data !== undefined) {
data["jsonrpc"] = coerced0;
}
}
}
var valid0 = _errs2 === errors;
}
else {
var valid0 = true;
}
if (valid0) {
if (data.error !== undefined) {
let data1 = data.error;
const _errs4 = errors;
if (errors === _errs4) {
if (data1 && typeof data1 == "object" && !Array.isArray(data1)) {
let missing1;
if (((data1.code === undefined) && (missing1 = "code")) || ((data1.message === undefined) && (missing1 = "message"))) {
validate14.errors = [{ instancePath: instancePath + "/error", schemaPath: "#/properties/error/required", keyword: "required", params: { missingProperty: missing1 }, message: "must have required property '" + missing1 + "'" }];
return false;
}
else {
const _errs6 = errors;
for (const key1 in data1) {
if (!((key1 === "code") || (key1 === "message"))) {
delete data1[key1];
}
}
if (_errs6 === errors) {
if (data1.code !== undefined) {
let data2 = data1.code;
const _errs7 = errors;
if (!(((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2)))) {
let dataType1 = typeof data2;
let coerced1 = undefined;
if (dataType1 == 'object' && Array.isArray(data2) && data2.length == 1) {
data2 = data2[0];
dataType1 = typeof data2;
if (((typeof data2 == "number") && (!(data2 % 1) && !isNaN(data2))) && (isFinite(data2))) {
coerced1 = data2;
}
}
if (!(coerced1 !== undefined)) {
if (dataType1 === "boolean" || data2 === null
|| (dataType1 === "string" && data2 && data2 == +data2 && !(data2 % 1))) {
coerced1 = +data2;
}
else {
validate14.errors = [{ instancePath: instancePath + "/error/code", schemaPath: "#/properties/error/properties/code/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
return false;
}
}
if (coerced1 !== undefined) {
data2 = coerced1;
if (data1 !== undefined) {
data1["code"] = coerced1;
}
}
}
var valid1 = _errs7 === errors;
}
else {
var valid1 = true;
}
if (valid1) {
if (data1.message !== undefined) {
let data3 = data1.message;
const _errs9 = errors;
if (typeof data3 !== "string") {
let dataType2 = typeof data3;
let coerced2 = undefined;
if (dataType2 == 'object' && Array.isArray(data3) && data3.length == 1) {
data3 = data3[0];
dataType2 = typeof data3;
if (typeof data3 === "string") {
coerced2 = data3;
}
}
if (!(coerced2 !== undefined)) {
if (dataType2 == "number" || dataType2 == "boolean") {
coerced2 = "" + data3;
}
else if (data3 === null) {
coerced2 = "";
}
else {
validate14.errors = [{ instancePath: instancePath + "/error/message", schemaPath: "#/properties/error/properties/message/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
return false;
}
}
if (coerced2 !== undefined) {
data3 = coerced2;
if (data1 !== undefined) {
data1["message"] = coerced2;
}
}
}
var valid1 = _errs9 === errors;
}
else {
var valid1 = true;
}
}
}
}
}
else {
validate14.errors = [{ instancePath: instancePath + "/error", schemaPath: "#/properties/error/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
return false;
}
}
var valid0 = _errs4 === errors;
}
else {
var valid0 = true;
}
if (valid0) {
if (data.id !== undefined) {
let data4 = data.id;
const _errs11 = errors;
if (!(((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4))) && (isFinite(data4)))) {
let dataType3 = typeof data4;
let coerced3 = undefined;
if (dataType3 == 'object' && Array.isArray(data4) && data4.length == 1) {
data4 = data4[0];
dataType3 = typeof data4;
if (((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4))) && (isFinite(data4))) {
coerced3 = data4;
}
}
if (!(coerced3 !== undefined)) {
if (dataType3 === "boolean" || data4 === null
|| (dataType3 === "string" && data4 && data4 == +data4 && !(data4 % 1))) {
coerced3 = +data4;
}
else {
validate14.errors = [{ instancePath: instancePath + "/id", schemaPath: "#/properties/id/type", keyword: "type", params: { type: "integer" }, message: "must be integer" }];
return false;
}
}
if (coerced3 !== undefined) {
data4 = coerced3;
if (data !== undefined) {
data["id"] = coerced3;
}
}
}
var valid0 = _errs11 === errors;
}
else {
var valid0 = true;
}
}
}
}
}
}
else {
validate14.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" }];
return false;
}
}
validate14.errors = vErrors;
return errors === 0;
}
exports.OperationStatus = validate15;
const schema16 = { "type": "string", "enum": ["WAITING", "ADDED", "STARTED", "SUCCEEDED", "FAILED", "UNKNOWN"] };
function validate15(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
let vErrors = null;
let errors = 0;
if (typeof data !== "string") {
let dataType0 = typeof data;
let coerced0 = undefined;
if (dataType0 == 'object' && Array.isArray(data) && data.length == 1) {
data = data[0];
dataType0 = typeof data;
if (typeof data === "string") {
coerced0 = data;
}
}
if (!(coerced0 !== undefined)) {
if (dataType0 == "number" || dataType0 == "boolean") {
coerced0 = "" + data;
}
else if (data === null) {
coerced0 = "";
}
else {
validate15.errors = [{ instancePath, schemaPath: "#/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
return false;
}
}
if (coerced0 !== undefined) {
data = coerced0;
if (parentData !== undefined) {
parentData[parentDataProperty] = coerced0;
}
}
}
if (!((((((data === "WAITING") || (data === "ADDED")) || (data === "STARTED")) || (data === "SUCCEEDED")) || (data === "FAILED")) || (data === "UNKNOWN"))) {
validate15.errors = [{ instancePath, schemaPath: "#/enum", keyword: "enum", params: { allowedValues: schema16.enum }, message: "must be equal to one of the allowed values" }];
return false;
}
validate15.errors = vErrors;
return errors === 0;
}
exports.OperationStatusInfo = validate16;
const schema17 = { "type": "object", "properties": { "operationId": { "type": "string" }, "name": { "type": "string" }, "generation": { "type": "number" }, "status": { "$ref": "naming#/definitions/OperationStatus" }, "added": { "type": "integer", "nullable": true }, "completed": { "type": "integer", "nullable": true }, "errorCode": { "type": "string", "nullable": true }, "errorMessage": { "type": "string", "nullable": true } }, "additionalProperties": false, "required": ["operationId", "name", "generation", "status"] };
function validate16(data, { instancePath = "", parentData, parentDataProperty, rootData = data } = {}) {
let vErrors = null;
let errors = 0;
if (errors === 0) {
if (data && typeof data == "object" && !Array.isArray(data)) {
let missing0;
if (((((data.operationId === undefined) && (missing0 = "operationId")) || ((data.name === undefined) && (missing0 = "name"))) || ((data.generation === undefined) && (missing0 = "generation"))) || ((data.status === undefined) && (missing0 = "status"))) {
validate16.errors = [{ instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: missing0 }, message: "must have required property '" + missing0 + "'" }];
return false;
}
else {
const _errs1 = errors;
for (const key0 in data) {
if (!((((((((key0 === "operationId") || (key0 === "name")) || (key0 === "generation")) || (key0 === "status")) || (key0 === "added")) || (key0 === "completed")) || (key0 === "errorCode")) || (key0 === "errorMessage"))) {
delete data[key0];
}
}
if (_errs1 === errors) {
if (data.operationId !== undefined) {
let data0 = data.operationId;
const _errs2 = errors;
if (typeof data0 !== "string") {
let dataType0 = typeof data0;
let coerced0 = undefined;
if (dataType0 == 'object' && Array.isArray(data0) && data0.length == 1) {
data0 = data0[0];
dataType0 = typeof data0;
if (typeof data0 === "string") {
coerced0 = data0;
}
}
if (!(coerced0 !== undefined)) {
if (dataType0 == "number" || dataType0 == "boolean") {
coerced0 = "" + data0;
}
else if (data0 === null) {
coerced0 = "";
}
else {
validate16.errors = [{ instancePath: instancePath + "/operationId", schemaPath: "#/properties/operationId/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
return false;
}
}
if (coerced0 !== undefined) {
data0 = coerced0;
if (data !== undefined) {
data["operationId"] = coerced0;
}
}
}
var valid0 = _errs2 === errors;
}
else {
var valid0 = true;
}
if (valid0) {
if (data.name !== undefined) {
let data1 = data.name;
const _errs4 = errors;
if (typeof data1 !== "string") {
let dataType1 = typeof data1;
let coerced1 = undefined;
if (dataType1 == 'object' && Array.isArray(data1) && data1.length == 1) {
data1 = data1[0];
dataType1 = typeof data1;
if (typeof data1 === "string") {
coerced1 = data1;
}
}
if (!(coerced1 !== undefined)) {
if (dataType1 == "number" || dataType1 == "boolean") {
coerced1 = "" + data1;
}
else if (data1 === null) {
coerced1 = "";
}
else {
validate16.errors = [{ instancePath: instancePath + "/name", schemaPath: "#/properties/name/type", keyword: "type", params: { type: "string" }, message: "must be string" }];
return false;
}
}
if (coerced1 !== undefined) {
data1 = coerced1;
if (data !== undefined) {
data["name"] = coerced1;
}
}
}
var valid0 = _errs4 === errors;
}
else {
var valid0 = true;
}
if (valid0) {
if (data.generation !== undefined) {
let data2 = data.generation;
const _errs6 = errors;
if (!((typeof data2 == "number") && (isFinite(data2)))) {
let dataType2 = typeof data2;
let coerced2 = undefined;
if (dataType2 == 'object' && Array.isArray(data2) && data2.length == 1) {
data2 = data2[0];
dataType2 = typeof data2;
if ((typeof data2 == "number") && (isFinite(data2))) {
coerced2 = data2;
}
}
if (!(coerced2 !== undefined)) {
if (dataType2 == "boolean" || data2 === null
|| (dataType2 == "string" && data2 && data2 == +data2)) {
coerced2 = +data2;
}
else {
validate16.errors = [{ instancePath: instancePath + "/generation", schemaPath: "#/properties/generation/type", keyword: "type", params: { type: "number" }, message: "must be number" }];
return false;
}
}
if (coerced2 !== undefined) {
data2 = coerced2;
if (data !== undefined) {
data["generation"] = coerced2;
}
}
}
var valid0 = _errs6 === errors;
}
else {
var valid0 = true;
}
if (valid0) {
if (data.status !== undefined) {
let data3 = data.status;
const _errs8 = errors;
if (typeof data3 !== "string") {
let dataType3 = typeof data3;
let coerced3 = undefined;
if (dataType3 == 'object' && Array.isArray(data3) && data3.length == 1) {
data3 = data3[0];
dataType3 = typeof data3;
if (typeof data3 === "string") {
coerced3 = data3;
}
}
if (!(coerced3 !== undefined)) {
if (dataType3 == "number" || dataType3 == "boolean