Move to ESM, use ytsr, implement caching

Closes #315
This commit is contained in:
Max Isom 2021-09-19 22:04:34 -04:00
parent efcdeb78c8
commit fd782219ef
No known key found for this signature in database
GPG key ID: 25C9B1A7F6798880
31 changed files with 314 additions and 158 deletions

15
src/models/cache.ts Normal file
View file

@ -0,0 +1,15 @@
import {Table, Column, PrimaryKey, Model} from 'sequelize-typescript';
import sequelize from 'sequelize';
@Table
export default class Cache extends Model<Cache> {
@PrimaryKey
@Column
key!: string;
@Column(sequelize.TEXT)
value!: string;
@Column
expiresAt!: Date;
}

View file

@ -1,7 +1,9 @@
import Settings from './settings';
import Shortcut from './shortcut';
import Cache from './cache.js';
import Settings from './settings.js';
import Shortcut from './shortcut.js';
export {
Cache,
Settings,
Shortcut
};