Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x | import { Company } from './company.js';
import { Component } from './component.js';
import { Domain } from './domain.js';
import { Draft } from './draft.js';
import { DraftComment } from './draft_comment.js';
import { Entity } from '../entity.js';
import { Invoice } from './invoice.js';
import { Job } from './job.js';
import { JobComment } from './job_comment.js';
import { JobNote } from './job_note.js';
import { Notification } from './notification.js';
import { Product } from './product.js';
import { ProductionComment } from './production_comment.js';
import { Theme } from './theme.js';
import { User } from './user.js';
import { Variation } from './variation.js';
import { VariationFieldsOption } from './variation_fields_option.js';
export class MerchiFile extends Entity {
protected static resourceName = 'files';
protected static singularName = 'file';
protected static pluralName = 'files';
public fileData?: File;
public fromFormFile = (file: File) => {
this.fileData = file;
this.mimetype = file.type || 'application/octet-stream';
this.name = file.name;
this.size = file.size;
};
@MerchiFile.property({type: Date})
public archived?: Date | null;
@MerchiFile.property()
public id?: number;
@MerchiFile.property()
public uploadId?: string;
@MerchiFile.property({type: String})
public name?: string | null;
@MerchiFile.property({type: String})
public mimetype?: string | null;
@MerchiFile.property()
public size?: number;
@MerchiFile.property({type: Date})
public creationDate?: Date | null;
@MerchiFile.property({type: String})
public cachedViewUrl?: string | null;
@MerchiFile.property({type: Date})
public viewUrlExpires?: Date | null;
@MerchiFile.property({type: String})
public cachedDownloadUrl?: string | null;
@MerchiFile.property({type: Date})
public downloadUrlExpires?: Date | null;
@MerchiFile.property({type: User})
public uploader?: User | null;
@MerchiFile.property()
public viewUrl?: string;
@MerchiFile.property()
public downloadUrl?: string;
@MerchiFile.property({arrayType: 'Component'})
public components?: Component[];
@MerchiFile.property({arrayType: 'Component'})
public componentFeatureImages?: Component[];
@MerchiFile.property({arrayType: 'DraftComment'})
public draftComments?: DraftComment[];
@MerchiFile.property({arrayType: 'Variation'})
public variations?: Variation[];
@MerchiFile.property({arrayType: 'Notification'})
public notification?: Notification[];
@MerchiFile.property({arrayType: 'Company'})
public companyLogos?: Company[];
@MerchiFile.property({arrayType: 'Product'})
public products?: Product[];
@MerchiFile.property({arrayType: 'Product'})
public featuredProducts?: Product[];
@MerchiFile.property({arrayType: 'Draft'})
public drafts?: Draft[];
@MerchiFile.property({arrayType: 'VariationFieldsOption'})
public options?: VariationFieldsOption[];
@MerchiFile.property({arrayType: 'JobComment'})
public jobComments?: JobComment[];
@MerchiFile.property({arrayType: 'JobNote'})
public jobNotes?: JobNote[];
@MerchiFile.property({arrayType: 'Job'})
public jobs?: Job[];
@MerchiFile.property({arrayType: 'Job'})
public clientJobs?: Job[];
@MerchiFile.property({arrayType: 'Domain'})
public domainLogos?: Domain[];
@MerchiFile.property({arrayType: 'Domain'})
public domainFavicons?: Domain[];
@MerchiFile.property({arrayType: 'User'})
public userProfilePictures?: User[];
@MerchiFile.property({arrayType: 'Invoice'})
public invoices?: Invoice[];
@MerchiFile.property({arrayType: 'Invoice'})
public invoicesPaid?: Invoice[];
@MerchiFile.property({arrayType: 'Theme'})
public themeMainCss?: Theme[];
@MerchiFile.property({arrayType: 'Theme'})
public themeMainCssUsing?: Theme[];
@MerchiFile.property({arrayType: 'Theme'})
public themeMainCssEditing?: Theme[];
@MerchiFile.property({arrayType: 'Theme'})
public themeEmailCss?: Theme[];
@MerchiFile.property({arrayType: 'Theme'})
public themeEmailCssUsing?: Theme[];
@MerchiFile.property({arrayType: 'Theme'})
public themeEmailCssEditing?: Theme[];
@MerchiFile.property({arrayType: 'Theme'})
public themes?: Theme[];
@MerchiFile.property({arrayType: 'Theme'})
public themeFeatureImages?: Theme[];
@MerchiFile.property({arrayType: 'Theme'})
public themeImages?: Theme[];
@MerchiFile.property({arrayType: 'ProductionComment'})
public productionComments?: ProductionComment[];
public isImage = () => {
Iif (this.mimetype === undefined) {
const err = 'mimetype is undefined, did you forget to embed it?';
throw new Error(err);
}
Iif (this.mimetype === null) {
return false;
}
return this.mimetype.split('/')[0] === 'image';
};
}
|