feat(apps): Add Apps subsystem: App and AppConnection models, managers, typed request handlers, web UI routes and documentation
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
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';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user