@sphereon/ssi-sdk.data-store
Version:
55 lines • 2.71 kB
JavaScript
;
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);
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ConnectionEntity = void 0;
const typeorm_1 = require("typeorm");
const BaseConfigEntity_1 = require("./BaseConfigEntity");
const types_1 = require("../../types");
const IdentityEntity_1 = require("./IdentityEntity");
let ConnectionEntity = class ConnectionEntity extends typeorm_1.BaseEntity {
};
exports.ConnectionEntity = ConnectionEntity;
__decorate([
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
__metadata("design:type", String)
], ConnectionEntity.prototype, "id", void 0);
__decorate([
(0, typeorm_1.Column)('simple-enum', { name: 'type', enum: types_1.ConnectionType, nullable: false }),
__metadata("design:type", String)
], ConnectionEntity.prototype, "type", void 0);
__decorate([
(0, typeorm_1.Column)('text', { name: 'tenant_id', nullable: true }),
__metadata("design:type", String)
], ConnectionEntity.prototype, "tenantId", void 0);
__decorate([
(0, typeorm_1.Column)('text', { name: 'owner_id', nullable: true }),
__metadata("design:type", String)
], ConnectionEntity.prototype, "ownerId", void 0);
__decorate([
(0, typeorm_1.OneToOne)(() => BaseConfigEntity_1.BaseConfigEntity, (config) => config.connection, {
cascade: true,
onDelete: 'CASCADE',
eager: true,
nullable: false,
}),
__metadata("design:type", BaseConfigEntity_1.BaseConfigEntity)
], ConnectionEntity.prototype, "config", void 0);
__decorate([
(0, typeorm_1.OneToOne)(() => IdentityEntity_1.IdentityEntity, (identity) => identity.connection, {
onDelete: 'CASCADE',
}),
(0, typeorm_1.JoinColumn)({ name: 'identity_id' }),
__metadata("design:type", IdentityEntity_1.IdentityEntity)
], ConnectionEntity.prototype, "identity", void 0);
exports.ConnectionEntity = ConnectionEntity = __decorate([
(0, typeorm_1.Entity)('Connection')
], ConnectionEntity);
//# sourceMappingURL=ConnectionEntity.js.map