41 lines
2.1 KiB
TypeScript
41 lines
2.1 KiB
TypeScript
import { RuntimeContext } from './RuntimeContext';
|
||
import { EntityDict } from '../oak-app-domain';
|
||
import { SerializedData } from './FrontendRuntimeContext';
|
||
import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity';
|
||
import { BackendRuntimeContext as BRC } from 'oak-frontend-base/lib/context/BackendRuntimeContext';
|
||
/**
|
||
* general数据结构要求的后台上下文
|
||
*/
|
||
export declare abstract class BackendRuntimeContext<ED extends EntityDict & BaseEntityDict> extends BRC<ED> implements RuntimeContext {
|
||
protected application?: Partial<ED['application']['Schema']>;
|
||
protected token?: Partial<ED['token']['Schema']>;
|
||
protected amIRoot?: boolean;
|
||
protected amIReallyRoot?: boolean;
|
||
protected rootMode?: boolean;
|
||
private userId?;
|
||
protected applicationProjection: import("../oak-app-domain/Application/Schema").Projection;
|
||
refineOpRecords(): Promise<void>;
|
||
setTokenValue(tokenValue?: string, userId?: string): Promise<void>;
|
||
setApplication(appId: string): Promise<void>;
|
||
initialize(data?: SerializedData, later?: boolean): Promise<void>;
|
||
getApplicationId(): ED["application"]["Schema"]["id"] | undefined;
|
||
getSystemId(): ED["application"]["Schema"]["systemId"] | undefined;
|
||
getApplication(): Partial<ED["application"]["Schema"]> | undefined;
|
||
openRootMode(): () => void;
|
||
getTokenValue(allowUnloggedIn?: boolean): "oak-root-token" | ED["token"]["Schema"]["value"] | undefined;
|
||
getToken(allowUnloggedIn?: boolean): Partial<ED["token"]["Schema"]> | undefined;
|
||
getCurrentUserId(allowUnloggedIn?: boolean): string;
|
||
setCurrentUserId(userId: string | undefined): void;
|
||
protected getSerializedData(): Promise<SerializedData>;
|
||
isRoot(): boolean;
|
||
isReallyRoot(): boolean;
|
||
sendMessage(data: ED['message']['CreateSingle']['data']): Promise<import("oak-domain/lib/types").OperationResult<ED>>;
|
||
allowUserUpdate(): boolean;
|
||
/**
|
||
* 获得当前系统的访问路径,根据application/system/domain之间的关联
|
||
* http://www.xxx.com/oak-api
|
||
*/
|
||
composeAccessPath(): string;
|
||
}
|
||
export default BackendRuntimeContext;
|