UNPKG

habits-cli

Version:

The habits application seeks to help individuals build up healthy habits.

46 lines (45 loc) 2.19 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.GetEndpointCommand = void 0; var models_1 = require("../../../models"); var config_1 = require("../../../config"); var types_1 = require("../../../types"); var services_1 = require("../../../services"); var chalk_1 = __importDefault(require("chalk")); var GetEndpointCommand = (function (_super) { __extends(GetEndpointCommand, _super); function GetEndpointCommand() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.description = "get endpoint that the habits client requests to"; _this.name = "endpoint"; return _this; } GetEndpointCommand.prototype.run = function () { var endpointName = config_1.userConfig.get("endpointName") || config_1.defaultValues.endpointName; var endpointUrl = types_1.Endpoints[endpointName]; var table = services_1.display.table.createCompact(); table.push([chalk_1.default.cyan(chalk_1.default.bold("Name")), endpointName]); table.push([chalk_1.default.cyan(chalk_1.default.bold("URL")), endpointUrl]); services_1.display.table.print(table); }; return GetEndpointCommand; }(models_1.Command)); exports.GetEndpointCommand = GetEndpointCommand;