38 lines
879 B
TypeScript
38 lines
879 B
TypeScript
import * as plugins from '../plugins.js';
|
|
|
|
import type { PassportManager } from './classes.passportmanager.js';
|
|
|
|
@plugins.smartdata.Manager()
|
|
export class PassportDevice extends plugins.smartdata.SmartDataDbDoc<
|
|
PassportDevice,
|
|
plugins.idpInterfaces.data.IPassportDevice,
|
|
PassportManager
|
|
> {
|
|
@plugins.smartdata.unI()
|
|
public id: string;
|
|
|
|
@plugins.smartdata.svDb()
|
|
public data: plugins.idpInterfaces.data.IPassportDevice['data'] = {
|
|
userId: '',
|
|
label: '',
|
|
platform: 'unknown',
|
|
status: 'active',
|
|
publicKeyAlgorithm: 'p256',
|
|
publicKeyX963Base64: '',
|
|
capabilities: {
|
|
gps: false,
|
|
nfc: false,
|
|
push: false,
|
|
},
|
|
pushRegistration: undefined,
|
|
appVersion: undefined,
|
|
createdAt: 0,
|
|
lastSeenAt: undefined,
|
|
lastChallengeAt: undefined,
|
|
};
|
|
|
|
public isActive() {
|
|
return this.data.status === 'active';
|
|
}
|
|
}
|