oak-backend-base 3.2.3 → 3.3.1

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,37 +1,40 @@
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 } from "oak-domain/lib/types";
4
- import { DbStore } from "./DbStore";
5
- import { BackendRuntimeContext } from 'oak-frontend-base';
6
- import { IncomingHttpHeaders, IncomingMessage } from 'http';
7
- import { Namespace } from 'socket.io';
8
- import DataSubscriber from './cluster/DataSubscriber';
9
- export declare class AppLoader<ED extends EntityDict & BaseEntityDict, Cxt extends BackendRuntimeContext<ED>> extends GeneralAppLoader<ED, Cxt> {
10
- protected dbStore: DbStore<ED, Cxt>;
11
- private aspectDict;
12
- private externalDependencies;
13
- protected dataSubscriber?: DataSubscriber<ED, Cxt>;
14
- protected contextBuilder: (scene?: string) => (store: DbStore<ED, Cxt>) => Promise<Cxt>;
15
- private requireSth;
16
- protected makeContext(cxtStr?: string, headers?: IncomingHttpHeaders): Promise<Cxt>;
17
- constructor(path: string, contextBuilder: (scene?: string) => (store: DbStore<ED, Cxt>) => Promise<Cxt>, ns?: Namespace, nsServer?: Namespace);
18
- protected registerTrigger(trigger: Trigger<ED, keyof ED, Cxt>): void;
19
- initTriggers(): void;
20
- mount(initialize?: true): Promise<void>;
21
- unmount(): Promise<void>;
22
- execAspect(name: string, headers?: IncomingHttpHeaders, contextString?: string, params?: any): Promise<{
23
- opRecords: OpRecord<ED>[];
24
- result: any;
25
- message?: string;
26
- }>;
27
- initialize(dropIfExists?: boolean): Promise<void>;
28
- getStore(): DbStore<ED, Cxt>;
29
- getEndpoints(prefix: string): [string, "get" | "post" | "put" | "delete", string, (params: Record<string, string>, headers: IncomingHttpHeaders, req: IncomingMessage, body?: any) => Promise<any>][];
30
- protected operateInWatcher<T extends keyof ED>(entity: T, operation: ED[T]['Update'], context: Cxt): Promise<import("oak-domain/lib/types").OperationResult<ED>>;
31
- protected selectInWatcher<T extends keyof ED>(entity: T, selection: ED[T]['Selection'], context: Cxt): Promise<Partial<ED[T]["Schema"]>[]>;
32
- protected execWatcher(watcher: Watcher<ED, keyof ED, Cxt>): Promise<void>;
33
- startWatchers(): void;
34
- startTimers(): void;
35
- execStartRoutines(): Promise<void>;
36
- execRoutine(routine: (context: Cxt) => Promise<void>): Promise<void>;
37
- }
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
+ import { SyncConfig } from './types/Sync';
11
+ export declare class AppLoader<ED extends EntityDict & BaseEntityDict, Cxt extends BackendRuntimeContext<ED>> extends GeneralAppLoader<ED, Cxt> {
12
+ protected dbStore: DbStore<ED, Cxt>;
13
+ private aspectDict;
14
+ private externalDependencies;
15
+ protected dataSubscriber?: DataSubscriber<ED, Cxt>;
16
+ protected synchronizer?: Synchronizer<ED, Cxt>;
17
+ protected contextBuilder: (scene?: string) => (store: DbStore<ED, Cxt>) => Promise<Cxt>;
18
+ private requireSth;
19
+ protected makeContext(cxtStr?: string, headers?: IncomingHttpHeaders): Promise<Cxt>;
20
+ constructor(path: string, contextBuilder: (scene?: string) => (store: DbStore<ED, Cxt>) => Promise<Cxt>, ns?: Namespace, nsServer?: Namespace, syncConfig?: SyncConfig<ED, Cxt>);
21
+ protected registerTrigger(trigger: Trigger<ED, keyof ED, Cxt>): void;
22
+ initTriggers(): void;
23
+ mount(initialize?: true): Promise<void>;
24
+ unmount(): Promise<void>;
25
+ execAspect(name: string, headers?: IncomingHttpHeaders, contextString?: string, params?: any): Promise<{
26
+ opRecords: OpRecord<ED>[];
27
+ result: any;
28
+ message?: string;
29
+ }>;
30
+ initialize(dropIfExists?: boolean): Promise<void>;
31
+ getStore(): DbStore<ED, Cxt>;
32
+ getEndpoints(prefix: string): [string, "post" | "get" | "put" | "delete", string, (params: Record<string, string>, headers: IncomingHttpHeaders, req: IncomingMessage, body?: any) => Promise<any>][];
33
+ protected operateInWatcher<T extends keyof ED>(entity: T, operation: ED[T]['Update'], context: Cxt): Promise<OperationResult<ED>>;
34
+ protected selectInWatcher<T extends keyof ED>(entity: T, selection: ED[T]['Selection'], context: Cxt): Promise<Partial<ED[T]["Schema"]>[]>;
35
+ protected execWatcher(watcher: Watcher<ED, keyof ED, Cxt>): Promise<OperationResult<ED> | undefined>;
36
+ startWatchers(): void;
37
+ startTimers(): void;
38
+ execStartRoutines(): Promise<void>;
39
+ execRoutine(routine: (context: Cxt) => Promise<void>): Promise<void>;
40
+ }