UNPKG

@nestbox-ai/cli

Version:

The cli tools that helps developers to build agents

36 lines 2.03 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.registerDocProcHealthCommand = registerDocProcHealthCommand; const apiUtils_1 = require("./apiUtils"); const helpers_1 = require("./helpers"); function registerDocProcHealthCommand(docProcCommand) { docProcCommand .command('health') .description('Get document processing API client health') .option('--project <projectId>', 'Project ID or name (defaults to current project)') .option('--instance <instanceId>', 'Document processing instance ID') .option('--json', 'Output JSON') .action((options) => { (0, helpers_1.withDocProcErrorHandling)(() => __awaiter(this, void 0, void 0, function* () { const apis = (0, apiUtils_1.createDocProcApis)(); if (!apis) return; const context = yield (0, helpers_1.resolveDocProcContext)(apis, options); const response = yield apis.documentProcessingApi.documentProcessingControllerGetHealth(context.projectId, context.instanceId); const data = (0, helpers_1.getResponseData)(response); if ((0, helpers_1.maybePrintJson)(data, options.json)) return; console.log(JSON.stringify(data, null, 2)); })); }); } //# sourceMappingURL=health.js.map