UNPKG

@randombenj/db

Version:

Display, search and copy LXD-images using a web interface.

87 lines 3.59 kB
"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); }; Object.defineProperty(exports, "__esModule", { value: true }); const typeorm_1 = require("typeorm"); const _1 = require("."); let Image = class Image extends typeorm_1.BaseEntity { /** * Returns a 12 character long fingerprint */ get readableFingerprint() { return this.fingerprint.substring(0, 12); } }; __decorate([ typeorm_1.PrimaryGeneratedColumn(), __metadata("design:type", Number) ], Image.prototype, "id", void 0); __decorate([ typeorm_1.OneToMany(type => _1.ImageAvailability, imageAvailability => imageAvailability.image), typeorm_1.JoinColumn(), __metadata("design:type", Array) ], Image.prototype, "imageAvailabilities", void 0); __decorate([ typeorm_1.Column({ unique: true, type: 'varchar', nullable: true }), __metadata("design:type", String) ], Image.prototype, "fingerprint", void 0); __decorate([ typeorm_1.Column({ type: 'varchar', nullable: true }), __metadata("design:type", String) ], Image.prototype, "size", void 0); __decorate([ typeorm_1.Column({ type: 'varchar', nullable: true }), __metadata("design:type", String) ], Image.prototype, "label", void 0); __decorate([ typeorm_1.Column({ type: 'varchar', nullable: true }), __metadata("design:type", String) ], Image.prototype, "serial", void 0); __decorate([ typeorm_1.Column({ type: 'varchar', nullable: true }), __metadata("design:type", String) ], Image.prototype, "description", void 0); __decorate([ typeorm_1.Column({ type: 'boolean', nullable: true }), __metadata("design:type", Boolean) ], Image.prototype, "autoUpdate", void 0); __decorate([ typeorm_1.Column({ type: 'varchar', nullable: true }), __metadata("design:type", Date) ], Image.prototype, "createdAt", void 0); __decorate([ typeorm_1.Column({ type: 'varchar', nullable: true }), __metadata("design:type", Date) ], Image.prototype, "expiresAt", void 0); __decorate([ typeorm_1.Column({ type: 'varchar', nullable: true }), __metadata("design:type", Date) ], Image.prototype, "lastUsedAt", void 0); __decorate([ typeorm_1.Column({ type: 'varchar', nullable: true }), __metadata("design:type", Date) ], Image.prototype, "uploadedAt", void 0); __decorate([ typeorm_1.ManyToOne(type => _1.OperatingSystemArchitecture), __metadata("design:type", _1.OperatingSystemArchitecture) ], Image.prototype, "osArchitecture", void 0); __decorate([ typeorm_1.OneToMany(type => _1.Alias, alias => alias.image), __metadata("design:type", Array) ], Image.prototype, "aliases", void 0); __decorate([ typeorm_1.Column({ type: 'boolean', nullable: true }), __metadata("design:type", Boolean) ], Image.prototype, "public", void 0); Image = __decorate([ typeorm_1.Entity() ], Image); exports.Image = Image; //# sourceMappingURL=image.entity.js.map