mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
server-ts: Port bblob
This commit is contained in:
parent
2f15d79476
commit
eef8297ce1
@ -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;
|
@ -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;
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user