"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.addSchemas = exports.addSchemaDependencies = exports.initSpreadTxToGroupSyncingReq = exports.schemaShardusMemoryPatternsInput = exports.schemaOpaqueTransaction = exports.schemaTransactionKeys = exports.schemaSpreadTxToGroupSyncingReq = void 0;
const SchemaHelpers_1 = require("../../utils/serialization/SchemaHelpers");
exports.schemaSpreadTxToGroupSyncingReq = {
    type: 'object',
    properties: {
        timestamp: { type: 'number' },
        txId: { type: 'string' },
        keys: { $ref: 'TransactionKeys' },
        data: { $ref: 'OpaqueTransaction' },
        appData: { type: 'unknown' },
        shardusMemoryPatterns: { $ref: 'ShardusMemoryPatternsInput' },
    },
    required: ['timestamp', 'txId', 'keys', 'data', 'appData', 'shardusMemoryPatterns'],
};
exports.schemaTransactionKeys = {
    type: 'object',
    properties: {
        sourceKeys: { type: 'array', items: { type: 'string' } },
        targetKeys: { type: 'array', items: { type: 'string' } },
        allKeys: { type: 'array', items: { type: 'string' } },
        timestamp: { type: 'number' },
        debugInfo: { type: 'string' },
    },
    required: ['sourceKeys', 'targetKeys', 'allKeys', 'timestamp'],
};
exports.schemaOpaqueTransaction = { type: 'object' };
exports.schemaShardusMemoryPatternsInput = {
    type: 'object',
    properties: {
        ro: { type: 'array', items: { type: 'string' } },
        rw: { type: 'array', items: { type: 'string' } },
        wo: { type: 'array', items: { type: 'string' } },
        on: { type: 'array', items: { type: 'string' } },
        ri: { type: 'array', items: { type: 'string' } },
    },
    required: ['ro', 'rw', 'wo', 'on', 'ri'],
};
function initSpreadTxToGroupSyncingReq() {
    addSchemaDependencies();
    addSchemas();
}
exports.initSpreadTxToGroupSyncingReq = initSpreadTxToGroupSyncingReq;
function addSchemaDependencies() {
    (0, SchemaHelpers_1.addSchemaDependency)('TransactionKeys', 'SpreadTxToGroupSyncingReq');
    (0, SchemaHelpers_1.addSchemaDependency)('OpaqueTransaction', 'SpreadTxToGroupSyncingReq');
    (0, SchemaHelpers_1.addSchemaDependency)('ShardusMemoryPatternsInput', 'SpreadTxToGroupSyncingReq');
}
exports.addSchemaDependencies = addSchemaDependencies;
function addSchemas() {
    (0, SchemaHelpers_1.addSchema)('TransactionKeys', exports.schemaTransactionKeys);
    (0, SchemaHelpers_1.addSchema)('OpaqueTransaction', exports.schemaOpaqueTransaction);
    (0, SchemaHelpers_1.addSchema)('ShardusMemoryPatternsInput', exports.schemaShardusMemoryPatternsInput);
    (0, SchemaHelpers_1.addSchema)('SpreadTxToGroupSyncingReq', exports.schemaSpreadTxToGroupSyncingReq);
}
exports.addSchemas = addSchemas;
//# sourceMappingURL=SpreadTxToGroupSyncingReq.js.map