mirror of
https://github.com/zadam/trilium.git
synced 2025-11-07 05:46:10 +01:00
24 lines
750 B
JavaScript
24 lines
750 B
JavaScript
|
|
"use strict";
|
||
|
|
|
||
|
|
const dateUtils = require('../../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();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
module.exports = ApiToken;
|