"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.initCompareCertReq = void 0;
const SchemaHelpers_1 = require("../../utils/serialization/SchemaHelpers");
const AJVSchemaEnum_1 = require("../enum/AJVSchemaEnum");
const schemaCompareCert = {
    type: 'object',
    properties: {
        certs: {
            type: 'array',
            items: {
                type: 'object',
                properties: {
                    marker: { type: 'string' },
                    score: { type: 'number' },
                },
                required: ['marker'],
            },
        },
        record: {
            type: 'object',
            properties: {
                networkId: { type: 'string' },
                counter: { type: 'number' },
                previous: { type: 'string' },
                start: { type: 'number' },
                duration: { type: 'number' },
                networkConfigHash: { type: 'string' },
                mode: {
                    type: 'string',
                    enum: ['forming', 'processing', 'safety', 'recovery', 'restart', 'restore', 'shutdown'],
                },
                safetyMode: { type: 'boolean' },
                safetyNum: { type: 'number' },
                networkStateHash: { type: 'string' },
                refreshedArchivers: { type: 'array', items: true },
                refreshedConsensors: { type: 'array', items: true },
                joinedArchivers: { type: 'array', items: true },
                leavingArchivers: { type: 'array', items: true },
                archiversAtShutdown: { type: 'array', items: true },
                syncing: { type: 'number' },
                joinedConsensors: { type: 'array', items: true },
                standbyAdd: { type: 'array', items: true },
                standbyRemove: { type: 'array', items: { type: 'string' } },
                startedSyncing: { type: 'array', items: { type: 'string' } },
                lostAfterSelection: { type: 'array', items: { type: 'string' } },
                finishedSyncing: { type: 'array', items: { type: 'string' } },
                standbyRefresh: { type: 'array', items: { type: 'string' } },
                active: { type: 'number' },
                standby: { type: 'number' },
                activated: { type: 'array', items: { type: 'string' } },
                activatedPublicKeys: { type: 'array', items: { type: 'string' } },
                maxSyncTime: { type: 'number' },
                apoptosized: { type: 'array', items: { type: 'string' } },
                lost: { type: 'array', items: { type: 'string' } },
                lostSyncing: { type: 'array', items: { type: 'string' } },
                refuted: { type: 'array', items: { type: 'string' } },
                appRemoved: { type: 'array', items: { type: 'string' } },
                expired: { type: 'number' },
                removed: { type: 'array', items: { type: 'string' } },
                nodeListHash: { type: 'string' },
                archiverListHash: { type: 'string' },
                standbyNodeListHash: { type: 'string' },
                random: { type: 'number' },
                joined: { type: 'array', items: { type: 'string' } },
                returned: { type: 'array', items: { type: 'string' } },
                networkDataHash: {
                    type: 'array',
                    items: {
                        type: 'object',
                        properties: { hash: { type: 'string' }, cycle: { type: 'number' } },
                        required: ['hash', 'cycle'],
                    },
                },
                desired: { type: 'number' },
                target: { type: 'number' },
            },
            required: [
                'networkId',
                'counter',
                'previous',
                'start',
                'duration',
                'networkConfigHash',
                'nodeListHash',
                'archiverListHash',
                'standbyNodeListHash',
            ],
            additionalProperties: true,
        },
    },
    required: ['certs'],
    additionalProperties: true,
};
function initCompareCertReq() {
    addSchemaDependencies();
    addSchemas();
}
exports.initCompareCertReq = initCompareCertReq;
// Function to add schema dependencies
function addSchemaDependencies() {
    // No dependencies
}
// Function to register the schema
function addSchemas() {
    (0, SchemaHelpers_1.addSchema)(AJVSchemaEnum_1.AJVSchemaEnum.CompareCertReq, schemaCompareCert);
    (0, SchemaHelpers_1.addSchema)(AJVSchemaEnum_1.AJVSchemaEnum.CompareCertResp, schemaCompareCert);
}
//# sourceMappingURL=CompareCert.js.map