import { BaseEntityClass } from '../base/base.entity'; import { DeviceEntity, ClientEntity, RequestOriginMeta } from '..'; import { ServerApplicationServiceEntity } from './services'; /** * SERVER is always associated with a device but usually does not have a display (relies on DEVICE) * SERVER_DISCOURSE is always associated with a device but comes with it's own integration secret * SERVER_OAUTH may be associated with a device but comes with an oauth secret * CLIENT is usually a desktop or public display application * CLIENT_OIDC is usually a mobile application that's shared publicly * CLIENT_KYC is KYC specific */ export declare enum APPLICATION_TYPE { SERVER = "server", SERVER_MATRIX = "server_matrix", SERVER_DISCOURSE = "server_discourse", SERVER_OAUTH2 = "server_oauth2", SERVER_BLOCKCHAIN = "server_blockchain", CLIENT = "client", CLIENT_OIDC = "client_oidc", CLIENT_KYC = "client_kyc" } /** * This is crucial for the client application to receive user, group and organization updates */ export interface ClientApplicationMetadata extends RequestOriginMeta { hostname?: string; isDependent: boolean; /** Only dependent */ /** * Optionally hide a dependent application from user lists */ isHidden?: boolean; /** * This identifies the entities this application supports * currently allowed are: 'users', 'groups', 'organization' */ dependentEntities?: string[]; /** * Client identifier * * Together with endpoint /applications/.well-known this allows * a application to identify the right application to connect to. * * For example, an application designed to specifically access the * document repository server, can identify the endpoint from the list * of applications under /.well-known via reference 'documentRepository' */ clientIdentifier?: string; /** * Optional description to be published under /applications/.well-known * This is also visible in front-end */ description?: string; /** * Specifically for Blockchain */ chainId?: string; contractCheckBalance?: string; } export declare enum THIRD_PARTY_INTEGRATION_METADATA { DISCOURSE = "discourse", ERPNEXT = "erpnext", MATRIX = "matrix" } export interface ThirdPartyIntegrationMetadata { type: THIRD_PARTY_INTEGRATION_METADATA; } export interface DiscourseIntegrationMetadata { type: THIRD_PARTY_INTEGRATION_METADATA.DISCOURSE; } /** * Applications * * An application is automatically created, whenever you register a device. * A device may host multiple applications. */ export declare class ApplicationEntity extends BaseEntityClass { name: string; type: APPLICATION_TYPE; isEnabled: boolean; metadata: ClientApplicationMetadata; /** * Callback URL for 3rd-party OpenID and others * - Application type `SERVER_OAUTH2` or `SERVER_DISCOURSE` */ callBackUrl: string; /** * OIDC Client */ client: ClientEntity; /** * Device the application runs on * - Application type all except `CLIENT_OIDC` and `SERVER_OAUTH2 */ device: DeviceEntity; /** * When a 3rd party integration is enabled, and needs to store additional data * - Application type `SERVER_DISCOURSE` or `SERVER_OAUTH2` */ thirdPartyIntegrationMetadata: ThirdPartyIntegrationMetadata; /** * 3rd party integration secret * - Application type `SERVER_DISCOURSE` * * Note: Unlike `SERVER_DISCOURSE`, `SERVER_OAUTH2 relies on OIDC * to save the authentication secret. */ thirdPartyIntegrationSharedSecret: string; /** * Services that belong to this application (for ex. a nodejs webserver) * Application type `SERVER` */ services: ServerApplicationServiceEntity[]; constructor(partial: Partial); }