Update dependencies & fix misc formatting errors
This commit is contained in:
@@ -8,18 +8,18 @@ import {ModelBuilder} from '../model/ModelBuilder'
|
||||
* A model instance which stores records from the ORMCache driver.
|
||||
*/
|
||||
export class CacheModel extends Model<CacheModel> {
|
||||
protected static table = 'caches'; // FIXME allow configuring
|
||||
protected static table = 'caches' // FIXME allow configuring
|
||||
|
||||
protected static key = 'cache_key';
|
||||
protected static key = 'cache_key'
|
||||
|
||||
@Field(FieldType.varchar, 'cache_key')
|
||||
public cacheKey!: string;
|
||||
public cacheKey!: string
|
||||
|
||||
@Field(FieldType.text, 'cache_value')
|
||||
public cacheValue!: string;
|
||||
public cacheValue!: string
|
||||
|
||||
@Field(FieldType.timestamp, 'cache_expires')
|
||||
public cacheExpires?: Date;
|
||||
public cacheExpires?: Date
|
||||
|
||||
public static withCacheKey(key: string): ModelBuilder<CacheModel> {
|
||||
return this.query<CacheModel>()
|
||||
|
||||
@@ -35,7 +35,7 @@ export class ORMSession extends Session {
|
||||
this.data = this.session.json
|
||||
} else {
|
||||
this.session = <SessionModel> Container.getContainer().make(SessionModel)
|
||||
this.session.uuid = this.key
|
||||
this.session.sessionUuid = this.key
|
||||
this.data = {} as SessionData
|
||||
}
|
||||
}
|
||||
@@ -48,7 +48,7 @@ export class ORMSession extends Session {
|
||||
throw new SessionNotLoadedError()
|
||||
}
|
||||
|
||||
this.session.uuid = this.key
|
||||
this.session.sessionUuid = this.key
|
||||
this.session.json = JSON.stringify(this.data)
|
||||
await this.session.save()
|
||||
}
|
||||
|
||||
@@ -13,8 +13,8 @@ export class SessionModel extends Model<SessionModel> {
|
||||
protected static populateKeyOnInsert = true
|
||||
|
||||
@Field(FieldType.varchar, 'session_uuid')
|
||||
public uuid!: string;
|
||||
public sessionUuid!: string
|
||||
|
||||
@Field(FieldType.json, 'session_data')
|
||||
public json!: any;
|
||||
public json!: any
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user