"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.ScopeGarbageCollectorCmd = void 0;
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
/**
 * private command. the underscore prefix is intended.
 */
class ScopeGarbageCollectorCmd {
  constructor(scope) {
    this.scope = scope;
    _defineProperty(this, "name", '_scope-gc');
    _defineProperty(this, "description", `delete objects that have no reference from the components/lanes of this scope`);
    _defineProperty(this, "extendedDescription", 'the deleted objects are copied into "deleted-objects" directory in the local scope');
    _defineProperty(this, "alias", '');
    _defineProperty(this, "options", [['v', 'verbose', 'show verbose output'], ['d', 'dry-run', 'print the refs that are going to be deleted without actually deleting them'], ['f', 'find-comp-id-origin <comp-id>', 'find the origin of a specific component'], ['s', 'find-scope-id-origin <scope-id>', 'find the origin of all components of the given scope. for multiple scopes, wrap with quotes and separate with commas'], ['r', 'restore', 'restore deleted objects (copy objects from "deleted-objects" directory to the scope)'], ['', 'restore-overwrite', 'same as --restore but overwrite existing objects']]);
    _defineProperty(this, "loader", true);
    _defineProperty(this, "private", true);
    _defineProperty(this, "remoteOp", true);
  }
  async report(_args, opts) {
    await this.scope.legacyScope.garbageCollect(opts);
    return `completed successfully`;
  }
}
exports.ScopeGarbageCollectorCmd = ScopeGarbageCollectorCmd;

//# sourceMappingURL=_scope-garbage-collector.cmd.js.map