server-ts: Port bblob

This commit is contained in:
Elian Doran 2024-02-17 01:06:07 +02:00
parent 2f15d79476
commit eef8297ce1
No known key found for this signature in database
2 changed files with 18 additions and 7 deletions

View File

@ -1,18 +1,21 @@
import { BlobRow } from "./rows";
class BBlob { class BBlob {
static get entityName() { return "blobs"; } static get entityName() { return "blobs"; }
static get primaryKeyName() { return "blobId"; } static get primaryKeyName() { return "blobId"; }
static get hashedProperties() { return ["blobId", "content"]; } static get hashedProperties() { return ["blobId", "content"]; }
constructor(row) { blobId: string;
/** @type {string} */ content: string | Buffer;
contentLength: number;
dateModified: string;
utcDateModified: string;
constructor(row: BlobRow) {
this.blobId = row.blobId; this.blobId = row.blobId;
/** @type {string|Buffer} */
this.content = row.content; this.content = row.content;
/** @type {int} */
this.contentLength = row.contentLength; this.contentLength = row.contentLength;
/** @type {string} */
this.dateModified = row.dateModified; this.dateModified = row.dateModified;
/** @type {string} */
this.utcDateModified = row.utcDateModified; this.utcDateModified = row.utcDateModified;
} }
@ -27,4 +30,4 @@ class BBlob {
} }
} }
module.exports = BBlob; export = BBlob;

View File

@ -51,4 +51,12 @@ export interface EtapiTokenRow {
utcDateCreated?: string; utcDateCreated?: string;
utcDateModified?: string; utcDateModified?: string;
isDeleted: boolean; isDeleted: boolean;
}
export interface BlobRow {
blobId: string;
content: string | Buffer;
contentLength: number;
dateModified: string;
utcDateModified: string;
} }