"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BFastOptionsSchema = exports.isBFastOptions = void 0;
const jsonschema_1 = require("jsonschema");
function isBFastOptions(options, onReason) {
    const v = (0, jsonschema_1.validate)(options, exports.BFastOptionsSchema, { required: true });
    if (onReason)
        onReason(v.errors.map(x => x.property + ' ' + x.message).join(','));
    return v.valid;
}
exports.isBFastOptions = isBFastOptions;
exports.BFastOptionsSchema = {
    type: "object",
    properties: {
        useLocalIpfs: { type: "boolean" },
        port: { type: "string", minLength: 1 },
        masterKey: { type: "string", minLength: 1 },
        applicationId: { type: "string", minLength: 1 },
        projectId: { type: "string", minLength: 1 },
        logs: { type: "boolean" },
        databaseURI: { type: "string", minLength: 1 },
        taarifaToken: { type: "string", minLength: 1 },
        web3Token: { type: "string", minLength: 1 },
        adapters: {
            type: "object",
            properties: {
                auth: {},
                email: {},
                s3Storage: {
                    type: "object",
                    properties: {
                        accessKey: { type: "string", minLength: 1 },
                        bucket: { type: "string", minLength: 1 },
                        direct: { type: "boolean" },
                        endPoint: { type: "string", minLength: 1 },
                        prefix: { type: "string", minLength: 1 },
                        region: { type: "string", minLength: 1 },
                        useSSL: { type: "boolean" },
                        secretKey: { type: "string", minLength: 1 },
                    },
                    required: ['accessKey', 'bucket', 'endPoint', 'secretKey']
                }
            }
        }
    },
    required: ['port', 'masterKey', 'applicationId', 'projectId', 'databaseURI']
};
