UNPKG

@jameslnewell/buildkite-pipelines

Version:
123 lines (122 loc) 4.29 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "WaitStep", { enumerable: true, get: function() { return WaitStep; } }); const _condition = require("./helpers/condition"); const _dependencies = require("./helpers/dependencies"); function _check_private_redeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } } function _class_apply_descriptor_get(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; } function _class_apply_descriptor_set(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } } function _class_extract_field_descriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); } function _class_private_field_get(receiver, privateMap) { var descriptor = _class_extract_field_descriptor(receiver, privateMap, "get"); return _class_apply_descriptor_get(receiver, descriptor); } function _class_private_field_init(obj, privateMap, value) { _check_private_redeclaration(obj, privateMap); privateMap.set(obj, value); } function _class_private_field_set(receiver, privateMap, value) { var descriptor = _class_extract_field_descriptor(receiver, privateMap, "set"); _class_apply_descriptor_set(receiver, descriptor, value); return value; } var _continueOnFailure = /*#__PURE__*/ new WeakMap(), _conditionHelper = /*#__PURE__*/ new WeakMap(), _dependenciesHelper = /*#__PURE__*/ new WeakMap(); class WaitStep { /** * @deprecated Use .setContinueOnFailure() instead */ continueOnFailure(continueOnFailure) { return this.setContinueOnFailure(continueOnFailure); } setContinueOnFailure(continueOnFailure) { _class_private_field_set(this, _continueOnFailure, continueOnFailure); return this; } getCondition() { return _class_private_field_get(this, _conditionHelper).getCondition(); } /** * @deprecated Use .setCondition() instead */ condition(condition) { return this.setCondition(condition); } setCondition(condition) { _class_private_field_get(this, _conditionHelper).setCondition(condition); return this; } getDependencies() { return _class_private_field_get(this, _dependenciesHelper).getDependencies(); } /** * @deprecated Use .addDependency() instead */ dependOn(dependency) { return this.addDependency(dependency); } addDependency(dependency) { _class_private_field_get(this, _dependenciesHelper).addDependency(dependency); return this; } /** * @deprecated Use .setAllowDependencyFailure() instead */ allowDependencyFailure(allow) { return this.setAllowDependencyFailure(allow); } setAllowDependencyFailure(allow) { _class_private_field_get(this, _dependenciesHelper).setAllowDependencyFailure(allow); return this; } build() { const object = { wait: null, ..._class_private_field_get(this, _dependenciesHelper).build() }; if (_class_private_field_get(this, _continueOnFailure) !== undefined) { object.continue_on_failure = _class_private_field_get(this, _continueOnFailure); } return object; } constructor(){ _class_private_field_init(this, _continueOnFailure, { writable: true, value: void 0 }); _class_private_field_init(this, _conditionHelper, { writable: true, value: new _condition.ConditionHelper() }); _class_private_field_init(this, _dependenciesHelper, { writable: true, value: new _dependencies.DependenciesHelper() }); } } //# sourceMappingURL=WaitStep.js.map