"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var _a, _b, _c;
Object.defineProperty(exports, "__esModule", { value: true });
exports.DomainSecret = void 0;
const typeorm_1 = require("typeorm");
const shell_1 = require("@things-factory/shell");
const auth_base_1 = require("@things-factory/auth-base");
let DomainSecret = class DomainSecret {
};
__decorate([
    (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
    __metadata("design:type", String)
], DomainSecret.prototype, "id", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(type => shell_1.Domain),
    __metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
], DomainSecret.prototype, "domain", void 0);
__decorate([
    (0, typeorm_1.Column)(),
    __metadata("design:type", String)
], DomainSecret.prototype, "secret", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)(),
    __metadata("design:type", Date)
], DomainSecret.prototype, "createdAt", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)(),
    __metadata("design:type", Date)
], DomainSecret.prototype, "updatedAt", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
        nullable: true
    }),
    __metadata("design:type", typeof (_b = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _b : Object)
], DomainSecret.prototype, "creator", void 0);
__decorate([
    (0, typeorm_1.ManyToOne)(type => auth_base_1.User, {
        nullable: true
    }),
    __metadata("design:type", typeof (_c = typeof auth_base_1.User !== "undefined" && auth_base_1.User) === "function" ? _c : Object)
], DomainSecret.prototype, "updater", void 0);
DomainSecret = __decorate([
    (0, typeorm_1.Entity)(),
    (0, typeorm_1.Index)('ix_domain_secret_0', (domainSecret) => [domainSecret.domain, domainSecret.secret], {
        unique: true
    })
], DomainSecret);
exports.DomainSecret = DomainSecret;
//# sourceMappingURL=domain-secret.js.map