oak-backend-base 3.3.3 → 3.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,43 +1,43 @@
1
- /// <reference types="node" />
2
- import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
3
- import { AppLoader as GeneralAppLoader, Trigger, EntityDict, Watcher, OpRecord, OperationResult } from "oak-domain/lib/types";
4
- import { DbStore } from "./DbStore";
5
- import { BackendRuntimeContext } from 'oak-frontend-base/lib/context/BackendRuntimeContext';
6
- import { IncomingHttpHeaders, IncomingMessage } from 'http';
7
- import { Namespace } from 'socket.io';
8
- import DataSubscriber from './cluster/DataSubscriber';
9
- import Synchronizer from './Synchronizer';
10
- export declare class AppLoader<ED extends EntityDict & BaseEntityDict, Cxt extends BackendRuntimeContext<ED>> extends GeneralAppLoader<ED, Cxt> {
11
- protected dbStore: DbStore<ED, Cxt>;
12
- private aspectDict;
13
- private externalDependencies;
14
- protected dataSubscriber?: DataSubscriber<ED, Cxt>;
15
- protected synchronizers?: Synchronizer<ED, Cxt>[];
16
- protected contextBuilder: (scene?: string) => (store: DbStore<ED, Cxt>) => Promise<Cxt>;
17
- private requireSth;
18
- protected makeContext(cxtStr?: string, headers?: IncomingHttpHeaders): Promise<Cxt>;
19
- /**
20
- * 后台启动的configuration,统一放在这里读取
21
- */
22
- private getConfiguration;
23
- constructor(path: string, contextBuilder: (scene?: string) => (store: DbStore<ED, Cxt>) => Promise<Cxt>, ns?: Namespace, nsServer?: Namespace);
24
- protected registerTrigger(trigger: Trigger<ED, keyof ED, Cxt>): void;
25
- initTriggers(): void;
26
- mount(initialize?: true): Promise<void>;
27
- unmount(): Promise<void>;
28
- execAspect(name: string, headers?: IncomingHttpHeaders, contextString?: string, params?: any): Promise<{
29
- opRecords: OpRecord<ED>[];
30
- result: any;
31
- message?: string;
32
- }>;
33
- initialize(dropIfExists?: boolean): Promise<void>;
34
- getStore(): DbStore<ED, Cxt>;
35
- getEndpoints(prefix: string): [string, "post" | "get" | "put" | "delete", string, (params: Record<string, string>, headers: IncomingHttpHeaders, req: IncomingMessage, body?: any) => Promise<any>][];
36
- protected operateInWatcher<T extends keyof ED>(entity: T, operation: ED[T]['Update'], context: Cxt): Promise<OperationResult<ED>>;
37
- protected selectInWatcher<T extends keyof ED>(entity: T, selection: ED[T]['Selection'], context: Cxt): Promise<Partial<ED[T]["Schema"]>[]>;
38
- protected execWatcher(watcher: Watcher<ED, keyof ED, Cxt>): Promise<OperationResult<ED> | undefined>;
39
- startWatchers(): void;
40
- startTimers(): void;
41
- execStartRoutines(): Promise<void>;
42
- execRoutine(routine: (context: Cxt) => Promise<void>): Promise<void>;
43
- }
1
+ /// <reference types="node" />
2
+ import { EntityDict as BaseEntityDict } from 'oak-domain/lib/base-app-domain';
3
+ import { AppLoader as GeneralAppLoader, Trigger, EntityDict, Watcher, OpRecord, OperationResult } from "oak-domain/lib/types";
4
+ import { DbStore } from "./DbStore";
5
+ import { BackendRuntimeContext } from 'oak-frontend-base/lib/context/BackendRuntimeContext';
6
+ import { IncomingHttpHeaders, IncomingMessage } from 'http';
7
+ import { Namespace } from 'socket.io';
8
+ import DataSubscriber from './cluster/DataSubscriber';
9
+ import Synchronizer from './Synchronizer';
10
+ export declare class AppLoader<ED extends EntityDict & BaseEntityDict, Cxt extends BackendRuntimeContext<ED>> extends GeneralAppLoader<ED, Cxt> {
11
+ protected dbStore: DbStore<ED, Cxt>;
12
+ private aspectDict;
13
+ private externalDependencies;
14
+ protected dataSubscriber?: DataSubscriber<ED, Cxt>;
15
+ protected synchronizers?: Synchronizer<ED, Cxt>[];
16
+ protected contextBuilder: (scene?: string) => (store: DbStore<ED, Cxt>) => Promise<Cxt>;
17
+ private requireSth;
18
+ protected makeContext(cxtStr?: string, headers?: IncomingHttpHeaders): Promise<Cxt>;
19
+ /**
20
+ * 后台启动的configuration,统一放在这里读取
21
+ */
22
+ private getConfiguration;
23
+ constructor(path: string, contextBuilder: (scene?: string) => (store: DbStore<ED, Cxt>) => Promise<Cxt>, ns?: Namespace, nsServer?: Namespace);
24
+ protected registerTrigger(trigger: Trigger<ED, keyof ED, Cxt>): void;
25
+ initTriggers(): void;
26
+ mount(initialize?: true): Promise<void>;
27
+ unmount(): Promise<void>;
28
+ execAspect(name: string, headers?: IncomingHttpHeaders, contextString?: string, params?: any): Promise<{
29
+ opRecords: OpRecord<ED>[];
30
+ result: any;
31
+ message?: string;
32
+ }>;
33
+ initialize(dropIfExists?: boolean): Promise<void>;
34
+ getStore(): DbStore<ED, Cxt>;
35
+ getEndpoints(prefix: string): [string, "post" | "get" | "put" | "delete", string, (params: Record<string, string>, headers: IncomingHttpHeaders, req: IncomingMessage, body?: any) => Promise<any>][];
36
+ protected operateInWatcher<T extends keyof ED>(entity: T, operation: ED[T]['Update'], context: Cxt): Promise<OperationResult<ED>>;
37
+ protected selectInWatcher<T extends keyof ED>(entity: T, selection: ED[T]['Selection'], context: Cxt): Promise<Partial<ED[T]["Schema"]>[]>;
38
+ protected execWatcher(watcher: Watcher<ED, keyof ED, Cxt>): Promise<OperationResult<ED> | undefined>;
39
+ startWatchers(): void;
40
+ startTimers(): void;
41
+ execStartRoutines(): Promise<void>;
42
+ execRoutine(routine: (context: Cxt) => Promise<void>): Promise<void>;
43
+ }