moved becca to top level source dir

This commit is contained in:
zadam
2021-05-17 22:10:00 +02:00
parent 439ef4a8cb
commit a5d702b143
8 changed files with 14 additions and 14 deletions

View File

@@ -0,0 +1,31 @@
"use strict";
const dateUtils = require('../../services/date_utils.js');
const AbstractEntity = require("./abstract_entity.js");
/**
* ApiToken is an entity representing token used to authenticate against Trilium API from client applications. Currently used only by Trilium Sender.
*/
class ApiToken extends AbstractEntity {
static get entityName() { return "api_tokens"; }
static get primaryKeyName() { return "apiTokenId"; }
static get hashedProperties() { return ["apiTokenId", "token", "utcDateCreated"]; }
constructor(row) {
super();
this.apiTokenId = row.apiTokenId;
this.token = row.token;
this.utcDateCreated = row.utcDateCreated || dateUtils.utcNowDateTime();
}
getPojo() {
return {
apiTokenId: this.apiTokenId,
token: this.token,
utcDateCreated: this.utcDateCreated
}
}
}
module.exports = ApiToken;