"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.GrpcServerApiServer = void 0;
const health_check_response_pb = __importStar(require("../../generated/proto/protoc-gen-ts/models/health_check_response_pb"));
const memory_usage_pb = __importStar(require("../../generated/proto/protoc-gen-ts/models/memory_usage_pb"));
const default_service = __importStar(require("../../generated/proto/protoc-gen-ts/services/default_service"));
const openapi_json_1 = __importDefault(require("../../../json/openapi.json"));
const safe_stable_stringify_1 = require("safe-stable-stringify");
class GrpcServerApiServer extends default_service.org.hyperledger.cactus
    .cmd_api_server.UnimplementedDefaultServiceService {
    GetHealthCheckV1(call, callback) {
        const memoryUsage = new memory_usage_pb.org.hyperledger.cactus.cmd_api_server.MemoryUsagePB(process.memoryUsage());
        const healthCheckResponse = new health_check_response_pb.org.hyperledger.cactus.cmd_api_server.HealthCheckResponsePB({
            success: true,
            createdAt: new Date().toJSON(),
            memoryUsage,
        });
        callback(null, healthCheckResponse);
    }
    GetPrometheusMetricsV1(call, callback) {
        const res = new default_service.org.hyperledger.cactus.cmd_api_server.GetPrometheusMetricsV1Response();
        callback(null, res);
    }
    GetOpenApiSpecV1(call, callback) {
        const res = new default_service.org.hyperledger.cactus.cmd_api_server.GetOpenApiSpecV1Response();
        const specAsJson = (0, safe_stable_stringify_1.stringify)(openapi_json_1.default);
        res.data = specAsJson;
        callback(null, res);
    }
}
exports.GrpcServerApiServer = GrpcServerApiServer;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ3JwYy1zZXJ2ZXItYXBpLXNlcnZlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9tYWluL3R5cGVzY3JpcHQvd2ViLXNlcnZpY2VzL2dycGMvZ3JwYy1zZXJ2ZXItYXBpLXNlcnZlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUdBLDhIQUFnSDtBQUNoSCw0R0FBOEY7QUFDOUYsOEdBQWdHO0FBRWhHLDhFQUE2QztBQUM3QyxpRUFBa0Q7QUFFbEQsTUFBYSxtQkFBb0IsU0FBUSxlQUFlLENBQUMsR0FBRyxDQUFDLFdBQVcsQ0FBQyxNQUFNO0tBQzVFLGNBQWMsQ0FBQyxrQ0FBa0M7SUFDbEQsZ0JBQWdCLENBQ2QsSUFHQyxFQUNELFFBQStHO1FBRS9HLE1BQU0sV0FBVyxHQUNmLElBQUksZUFBZSxDQUFDLEdBQUcsQ0FBQyxXQUFXLENBQUMsTUFBTSxDQUFDLGNBQWMsQ0FBQyxhQUFhLENBQ3JFLE9BQU8sQ0FBQyxXQUFXLEVBQUUsQ0FDdEIsQ0FBQztRQUVKLE1BQU0sbUJBQW1CLEdBQ3ZCLElBQUksd0JBQXdCLENBQUMsR0FBRyxDQUFDLFdBQVcsQ0FBQyxNQUFNLENBQUMsY0FBYyxDQUFDLHFCQUFxQixDQU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