41 lines
995 B
TypeScript
41 lines
995 B
TypeScript
import * as plugins from '../plugins.js';
|
|
import type { AppManager } from './classes.appmanager.js';
|
|
|
|
@plugins.smartdata.Manager()
|
|
export class App extends plugins.smartdata.SmartDataDbDoc<
|
|
App,
|
|
plugins.idpInterfaces.data.IAppDocument,
|
|
AppManager
|
|
> {
|
|
// INSTANCE
|
|
@plugins.smartdata.unI()
|
|
id: plugins.idpInterfaces.data.IAppDocument['id'];
|
|
|
|
@plugins.smartdata.svDb()
|
|
type: plugins.idpInterfaces.data.IAppDocument['type'];
|
|
|
|
@plugins.smartdata.svDb()
|
|
data: plugins.idpInterfaces.data.IAppDocument['data'];
|
|
|
|
/**
|
|
* Check if the app is a global app
|
|
*/
|
|
public isGlobalApp(): this is App & { type: 'global' } {
|
|
return this.type === 'global';
|
|
}
|
|
|
|
/**
|
|
* Check if the app is a partner app
|
|
*/
|
|
public isPartnerApp(): this is App & { type: 'partner' } {
|
|
return this.type === 'partner';
|
|
}
|
|
|
|
/**
|
|
* Check if the app is a custom OIDC app
|
|
*/
|
|
public isCustomOidcApp(): this is App & { type: 'custom_oidc' } {
|
|
return this.type === 'custom_oidc';
|
|
}
|
|
}
|