mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
feat: api keys
This commit is contained in:
25
packages/server/src/modules/Auth/models/ApiKey.model.ts
Normal file
25
packages/server/src/modules/Auth/models/ApiKey.model.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { SystemModel } from '@/modules/System/models/SystemModel';
|
||||
|
||||
export class ApiKeyModel extends SystemModel {
|
||||
readonly key: string;
|
||||
readonly name?: string;
|
||||
readonly createdAt: Date;
|
||||
readonly expiresAt?: Date;
|
||||
readonly revoked?: boolean;
|
||||
readonly userId: number;
|
||||
readonly tenantId: number;
|
||||
|
||||
/**
|
||||
* Table name
|
||||
*/
|
||||
static get tableName() {
|
||||
return 'api_keys';
|
||||
}
|
||||
|
||||
/**
|
||||
* Timestamps columns.
|
||||
*/
|
||||
get timestamps() {
|
||||
return ['createdAt'];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user