"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.sendRuleRequest = exports.config = exports.serverUrl = exports.databaseFactory = void 0;
const index_1 = require("./index");
const mongo_database_1 = require("./factories/mongo-database");
const axios_1 = __importDefault(require("axios"));
const databaseFactory = () => {
    return new mongo_database_1.MongoDatabaseFactory();
};
exports.databaseFactory = databaseFactory;
exports.serverUrl = 'http://localhost:3111/v2';
exports.config = {
    applicationId: 'bfast',
    useLocalIpfs: true,
    projectId: 'bfast',
    port: '3111',
    logs: false,
    web3Token: (0, index_1.getEnv)(process.env['WEB_3_TOKEN']),
    adapters: { s3Storage: undefined },
    masterKey: 'bfast',
    taarifaToken: undefined,
    databaseURI: 'mongodb://localhost/bfast',
    rsaKeyPairInJson: {},
    rsaPublicKeyInJson: {}
};
const sendRuleRequest = async function sendRequest(data, code = 200) {
    const response = await axios_1.default.post(exports.serverUrl, data);
    if (response.status !== code) {
        throw { message: 'status code not equal' };
    }
    return response.data;
};
exports.sendRuleRequest = sendRuleRequest;
