"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.BoardSecret = void 0;
const typeorm_1 = require("typeorm");
const shell_1 = require("@things-factory/shell");
const auth_base_1 = require("@things-factory/auth-base");
let BoardSecret = class BoardSecret {
};
__decorate([
    (0, typeorm_1.PrimaryColumn)('uuid'),
    __metadata("design:type", String)
], BoardSecret.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)
], BoardSecret.prototype, "domain", void 0);
__decorate([
    (0, typeorm_1.Column)(),
    __metadata("design:type", String)
], BoardSecret.prototype, "secret", void 0);
__decorate([
    (0, typeorm_1.Column)(),
    __metadata("design:type", String)
], BoardSecret.prototype, "targetType", void 0);
__decorate([
    (0, typeorm_1.Column)('uuid'),
    __metadata("design:type", String)
], BoardSecret.prototype, "targetId", void 0);
__decorate([
    (0, typeorm_1.CreateDateColumn)(),
    __metadata("design:type", Date)
], BoardSecret.prototype, "createdAt", void 0);
__decorate([
    (0, typeorm_1.UpdateDateColumn)(),
    __metadata("design:type", Date)
], BoardSecret.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)
], BoardSecret.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)
], BoardSecret.prototype, "updater", void 0);
BoardSecret = __decorate([
    (0, typeorm_1.Entity)(),
    (0, typeorm_1.Index)('ix_board_secret_0', (boardSecret) => [boardSecret.domain, boardSecret.secret], { unique: true })
], BoardSecret);
exports.BoardSecret = BoardSecret;
//# sourceMappingURL=board-secret.js.map