UNPKG

@sprucelabs/spruce-cli

Version:

Command line interface for building Spruce skills.

62 lines 2.12 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const schema_1 = require("@sprucelabs/schema"); const AbstractAction_1 = __importDefault(require("../../AbstractAction")); const optionsSchema = (0, schema_1.buildSchema)({ id: 'setRemoteOptions', description: 'Point your skill to different Mercury environments.', fields: { remote: { label: 'Set remote', hint: 'Start with developer and read more here: https://developer.spruce.bot/#/skills/index', type: 'select', isRequired: true, options: { choices: [ { value: 'local', label: 'Local', }, { value: 'demo', label: 'Demo', }, { value: 'developer', label: 'Development', }, { value: 'sandbox', label: 'Sandbox', }, { value: 'polish', label: 'Polish', }, { value: 'production', label: 'Production', }, ], }, }, }, }); class SyncAction extends AbstractAction_1.default { commandAliases = ['set.remote [remote]']; optionsSchema = optionsSchema; invocationMessage = 'Set remote... 🜒'; async execute(options) { const { remote } = this.validateAndNormalizeOptions(options); const r = this.Service('remote'); r.set(remote); return { summaryLines: [`Remote: ${remote}`, `Host: ${r.getHost()}`], }; } } exports.default = SyncAction; //# sourceMappingURL=SetRemoteAction.js.map