UNPKG

@kui-shell/plugin-tekton

Version:
29 lines 1.43 kB
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()); }); }; import { isKubeResource } from '@kui-shell/plugin-kubeui'; const mode = { mode: 'Run Config', content: (tab, _) => __awaiter(void 0, void 0, void 0, function* () { if (!isKubeResource(_)) { const { safeDump } = yield import('js-yaml'); const models = _.model.filter(_ => _.kind === 'PipelineRun' || _.kind === 'TaskRun'); const model = models.length === 1 && models[0]; return Object.assign({ type: 'custom', isEntity: true, contentType: 'yaml', resource: model || models, content: safeDump(model || models) }, model || {}); } }) }; export default mode; //# sourceMappingURL=run.js.map