var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
    function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
    var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
    var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
    var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
    var _, done = false;
    for (var i = decorators.length - 1; i >= 0; i--) {
        var context = {};
        for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
        for (var p in contextIn.access) context.access[p] = contextIn.access[p];
        context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
        var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
        if (kind === "accessor") {
            if (result === void 0) continue;
            if (result === null || typeof result !== "object") throw new TypeError("Object expected");
            if (_ = accept(result.get)) descriptor.get = _;
            if (_ = accept(result.set)) descriptor.set = _;
            if (_ = accept(result.init)) initializers.unshift(_);
        }
        else if (_ = accept(result)) {
            if (kind === "field") initializers.unshift(_);
            else descriptor[key] = _;
        }
    }
    if (target) Object.defineProperty(target, contextIn.name, descriptor);
    done = true;
};
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
    var useValue = arguments.length > 2;
    for (var i = 0; i < initializers.length; i++) {
        value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
    }
    return useValue ? value : void 0;
};
import * as plugins from '../../plugins.js';
import { DcRouterDb } from '../classes.dcrouter-db.js';
const getDb = () => DcRouterDb.getInstance().getDb();
let RemoteIngressEdgeDoc = (() => {
    let _classDecorators = [plugins.smartdata.Collection(() => getDb())];
    let _classDescriptor;
    let _classExtraInitializers = [];
    let _classThis;
    let _classSuper = plugins.smartdata.SmartDataDbDoc;
    let _id_decorators;
    let _id_initializers = [];
    let _id_extraInitializers = [];
    let _name_decorators;
    let _name_initializers = [];
    let _name_extraInitializers = [];
    let _secret_decorators;
    let _secret_initializers = [];
    let _secret_extraInitializers = [];
    let _listenPorts_decorators;
    let _listenPorts_initializers = [];
    let _listenPorts_extraInitializers = [];
    let _listenPortsUdp_decorators;
    let _listenPortsUdp_initializers = [];
    let _listenPortsUdp_extraInitializers = [];
    let _enabled_decorators;
    let _enabled_initializers = [];
    let _enabled_extraInitializers = [];
    let _autoDerivePorts_decorators;
    let _autoDerivePorts_initializers = [];
    let _autoDerivePorts_extraInitializers = [];
    let _performance_decorators;
    let _performance_initializers = [];
    let _performance_extraInitializers = [];
    let _tags_decorators;
    let _tags_initializers = [];
    let _tags_extraInitializers = [];
    let _createdAt_decorators;
    let _createdAt_initializers = [];
    let _createdAt_extraInitializers = [];
    let _updatedAt_decorators;
    let _updatedAt_initializers = [];
    let _updatedAt_extraInitializers = [];
    var RemoteIngressEdgeDoc = class extends _classSuper {
        static { _classThis = this; }
        static {
            const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
            _id_decorators = [plugins.smartdata.unI(), plugins.smartdata.svDb()];
            _name_decorators = [plugins.smartdata.svDb()];
            _secret_decorators = [plugins.smartdata.svDb()];
            _listenPorts_decorators = [plugins.smartdata.svDb()];
            _listenPortsUdp_decorators = [plugins.smartdata.svDb()];
            _enabled_decorators = [plugins.smartdata.svDb()];
            _autoDerivePorts_decorators = [plugins.smartdata.svDb()];
            _performance_decorators = [plugins.smartdata.svDb()];
            _tags_decorators = [plugins.smartdata.svDb()];
            _createdAt_decorators = [plugins.smartdata.svDb()];
            _updatedAt_decorators = [plugins.smartdata.svDb()];
            __esDecorate(null, null, _id_decorators, { kind: "field", name: "id", static: false, private: false, access: { has: obj => "id" in obj, get: obj => obj.id, set: (obj, value) => { obj.id = value; } }, metadata: _metadata }, _id_initializers, _id_extraInitializers);
            __esDecorate(null, null, _name_decorators, { kind: "field", name: "name", static: false, private: false, access: { has: obj => "name" in obj, get: obj => obj.name, set: (obj, value) => { obj.name = value; } }, metadata: _metadata }, _name_initializers, _name_extraInitializers);
            __esDecorate(null, null, _secret_decorators, { kind: "field", name: "secret", static: false, private: false, access: { has: obj => "secret" in obj, get: obj => obj.secret, set: (obj, value) => { obj.secret = value; } }, metadata: _metadata }, _secret_initializers, _secret_extraInitializers);
            __esDecorate(null, null, _listenPorts_decorators, { kind: "field", name: "listenPorts", static: false, private: false, access: { has: obj => "listenPorts" in obj, get: obj => obj.listenPorts, set: (obj, value) => { obj.listenPorts = value; } }, metadata: _metadata }, _listenPorts_initializers, _listenPorts_extraInitializers);
            __esDecorate(null, null, _listenPortsUdp_decorators, { kind: "field", name: "listenPortsUdp", static: false, private: false, access: { has: obj => "listenPortsUdp" in obj, get: obj => obj.listenPortsUdp, set: (obj, value) => { obj.listenPortsUdp = value; } }, metadata: _metadata }, _listenPortsUdp_initializers, _listenPortsUdp_extraInitializers);
            __esDecorate(null, null, _enabled_decorators, { kind: "field", name: "enabled", static: false, private: false, access: { has: obj => "enabled" in obj, get: obj => obj.enabled, set: (obj, value) => { obj.enabled = value; } }, metadata: _metadata }, _enabled_initializers, _enabled_extraInitializers);
            __esDecorate(null, null, _autoDerivePorts_decorators, { kind: "field", name: "autoDerivePorts", static: false, private: false, access: { has: obj => "autoDerivePorts" in obj, get: obj => obj.autoDerivePorts, set: (obj, value) => { obj.autoDerivePorts = value; } }, metadata: _metadata }, _autoDerivePorts_initializers, _autoDerivePorts_extraInitializers);
            __esDecorate(null, null, _performance_decorators, { kind: "field", name: "performance", static: false, private: false, access: { has: obj => "performance" in obj, get: obj => obj.performance, set: (obj, value) => { obj.performance = value; } }, metadata: _metadata }, _performance_initializers, _performance_extraInitializers);
            __esDecorate(null, null, _tags_decorators, { kind: "field", name: "tags", static: false, private: false, access: { has: obj => "tags" in obj, get: obj => obj.tags, set: (obj, value) => { obj.tags = value; } }, metadata: _metadata }, _tags_initializers, _tags_extraInitializers);
            __esDecorate(null, null, _createdAt_decorators, { kind: "field", name: "createdAt", static: false, private: false, access: { has: obj => "createdAt" in obj, get: obj => obj.createdAt, set: (obj, value) => { obj.createdAt = value; } }, metadata: _metadata }, _createdAt_initializers, _createdAt_extraInitializers);
            __esDecorate(null, null, _updatedAt_decorators, { kind: "field", name: "updatedAt", static: false, private: false, access: { has: obj => "updatedAt" in obj, get: obj => obj.updatedAt, set: (obj, value) => { obj.updatedAt = value; } }, metadata: _metadata }, _updatedAt_initializers, _updatedAt_extraInitializers);
            __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
            RemoteIngressEdgeDoc = _classThis = _classDescriptor.value;
            if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
            __runInitializers(_classThis, _classExtraInitializers);
        }
        id = __runInitializers(this, _id_initializers, void 0);
        name = (__runInitializers(this, _id_extraInitializers), __runInitializers(this, _name_initializers, ''));
        secret = (__runInitializers(this, _name_extraInitializers), __runInitializers(this, _secret_initializers, void 0));
        listenPorts = (__runInitializers(this, _secret_extraInitializers), __runInitializers(this, _listenPorts_initializers, void 0));
        listenPortsUdp = (__runInitializers(this, _listenPorts_extraInitializers), __runInitializers(this, _listenPortsUdp_initializers, void 0));
        enabled = (__runInitializers(this, _listenPortsUdp_extraInitializers), __runInitializers(this, _enabled_initializers, void 0));
        autoDerivePorts = (__runInitializers(this, _enabled_extraInitializers), __runInitializers(this, _autoDerivePorts_initializers, void 0));
        performance = (__runInitializers(this, _autoDerivePorts_extraInitializers), __runInitializers(this, _performance_initializers, void 0));
        tags = (__runInitializers(this, _performance_extraInitializers), __runInitializers(this, _tags_initializers, void 0));
        createdAt = (__runInitializers(this, _tags_extraInitializers), __runInitializers(this, _createdAt_initializers, void 0));
        updatedAt = (__runInitializers(this, _createdAt_extraInitializers), __runInitializers(this, _updatedAt_initializers, void 0));
        constructor() {
            super();
            __runInitializers(this, _updatedAt_extraInitializers);
        }
        static async findById(id) {
            return await RemoteIngressEdgeDoc.getInstance({ id });
        }
        static async findAll() {
            return await RemoteIngressEdgeDoc.getInstances({});
        }
        static async findEnabled() {
            return await RemoteIngressEdgeDoc.getInstances({ enabled: true });
        }
    };
    return RemoteIngressEdgeDoc = _classThis;
})();
export { RemoteIngressEdgeDoc };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xhc3Nlcy5yZW1vdGUtaW5ncmVzcy1lZGdlLmRvYy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3RzL2RiL2RvY3VtZW50cy9jbGFzc2VzLnJlbW90ZS1pbmdyZXNzLWVkZ2UuZG9jLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSxPQUFPLEtBQUssT0FBTyxNQUFNLGtCQUFrQixDQUFDO0FBQzVDLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUd2RCxNQUFNLEtBQUssR0FBRyxHQUFHLEVBQUUsQ0FBQyxVQUFVLENBQUMsV0FBVyxFQUFFLENBQUMsS0FBSyxFQUFFLENBQUM7SUFHeEMsb0JBQW9COzRCQURoQyxPQUFPLENBQUMsU0FBUyxDQUFDLFVBQVUsQ0FBQyxHQUFHLEVBQUUsQ0FBQyxLQUFLLEVBQUUsQ0FBQzs7OztzQkFDRixPQUFPLENBQUMsU0FBUyxDQUFDLGNBQWM7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7b0NBQXhDLFNBQVEsV0FBNEU7Ozs7OEJBQ25ILE9BQU8sQ0FBQyxTQUFTLENBQUMsR0FBRyxFQUFFLEVBQ3ZCLE9BQU8sQ0FBQyxTQUFTLENBQU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