taon 19.0.51 → 19.0.53
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.
- package/README.md +160 -160
- package/bin/start.js +279 -279
- package/bin/taon +6 -6
- package/bin/taon-debug +5 -5
- package/bin/taon-debug-brk +5 -5
- package/browser/README.md +24 -24
- package/browser/fesm2022/taon.mjs +188 -95
- package/browser/fesm2022/taon.mjs.map +1 -1
- package/browser/lib/base-classes/base-angular-service.d.ts +3 -6
- package/browser/lib/base-classes/base-context.d.ts +1 -0
- package/browser/lib/base-classes/base-controller.d.ts +0 -6
- package/browser/lib/base-classes/base-injector.d.ts +4 -5
- package/browser/lib/base-classes/base-middleware.d.ts +17 -0
- package/browser/lib/base-classes/base.d.ts +3 -0
- package/browser/lib/constants.d.ts +1 -1
- package/browser/lib/create-context.d.ts +4 -2
- package/browser/lib/decorators/classes/middleware-decorator.d.ts +8 -0
- package/browser/lib/endpoint-context.d.ts +7 -6
- package/browser/lib/index.d.ts +8 -2
- package/browser/lib/models.d.ts +65 -5
- package/browser/package.json +1 -1
- package/lib/base-classes/base-angular-service.d.ts +3 -6
- package/lib/base-classes/base-angular-service.js +12 -16
- package/lib/base-classes/base-angular-service.js.map +1 -1
- package/lib/base-classes/base-context.d.ts +1 -0
- package/lib/base-classes/base-controller.d.ts +0 -6
- package/lib/base-classes/base-controller.js +0 -8
- package/lib/base-classes/base-controller.js.map +1 -1
- package/lib/base-classes/base-injector.d.ts +4 -5
- package/lib/base-classes/base-injector.js +6 -7
- package/lib/base-classes/base-injector.js.map +1 -1
- package/lib/base-classes/base-middleware.d.ts +20 -0
- package/lib/base-classes/base-middleware.js +13 -0
- package/lib/base-classes/base-middleware.js.map +1 -0
- package/lib/base-classes/base.d.ts +3 -0
- package/lib/base-classes/base.js +2 -0
- package/lib/base-classes/base.js.map +1 -1
- package/lib/build-info._auto-generated_.d.ts +1 -1
- package/lib/build-info._auto-generated_.js +1 -1
- package/lib/constants.d.ts +1 -1
- package/lib/constants.js +2 -3
- package/lib/constants.js.map +1 -1
- package/lib/create-context.d.ts +4 -2
- package/lib/create-context.js +40 -36
- package/lib/create-context.js.map +1 -1
- package/lib/decorators/classes/middleware-decorator.d.ts +7 -0
- package/lib/decorators/classes/middleware-decorator.js +21 -0
- package/lib/decorators/classes/middleware-decorator.js.map +1 -0
- package/lib/decorators/classes/provider-decorator.js +1 -1
- package/lib/decorators/classes/provider-decorator.js.map +1 -1
- package/lib/endpoint-context.d.ts +7 -6
- package/lib/endpoint-context.js +87 -32
- package/lib/endpoint-context.js.map +1 -1
- package/lib/index.d.ts +8 -2
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/models.d.ts +65 -5
- package/lib/models.js +7 -5
- package/lib/models.js.map +1 -1
- package/lib/realtime/realtime-client.js +2 -1
- package/lib/realtime/realtime-client.js.map +1 -1
- package/lib/ui/index.js +2 -2
- package/lib/ui/taon-admin-mode-configuration/index.js +2 -2
- package/package.json +1 -1
- package/websql/README.md +24 -24
- package/websql/fesm2022/taon.mjs +192 -97
- package/websql/fesm2022/taon.mjs.map +1 -1
- package/websql/lib/base-classes/base-angular-service.d.ts +3 -6
- package/websql/lib/base-classes/base-context.d.ts +1 -0
- package/websql/lib/base-classes/base-controller.d.ts +0 -6
- package/websql/lib/base-classes/base-injector.d.ts +4 -5
- package/websql/lib/base-classes/base-middleware.d.ts +21 -0
- package/websql/lib/base-classes/base.d.ts +3 -0
- package/websql/lib/constants.d.ts +1 -1
- package/websql/lib/create-context.d.ts +4 -2
- package/websql/lib/decorators/classes/middleware-decorator.d.ts +8 -0
- package/websql/lib/endpoint-context.d.ts +7 -6
- package/websql/lib/index.d.ts +8 -2
- package/websql/lib/models.d.ts +65 -5
- package/websql/package.json +1 -1
- package/env.d.ts +0 -3
- package/environments/angular-node-app/env.angular-node-app.__.d.ts +0 -3
- package/environments/angular-node-app/env.angular-node-app.dev.d.ts +0 -3
- package/environments/angular-node-app/env.angular-node-app.localhost.d.ts +0 -3
- package/environments/angular-node-app/env.angular-node-app.prod.d.ts +0 -3
- package/environments/angular-node-app/env.angular-node-app.stage.d.ts +0 -3
- package/environments/docs-webapp/env.docs-webapp.__.d.ts +0 -3
- package/environments/electron-app/env.electron-app.__.d.ts +0 -3
- package/environments/electron-app/env.electron-app.prod.d.ts +0 -3
- package/environments/mobile-app/env.mobile-app.__.d.ts +0 -3
- package/environments/mobile-app/env.mobile-app.prod.d.ts +0 -3
- package/environments/npm-lib-and-cli-tool/env.npm-lib-and-cli-tool.__.d.ts +0 -3
- package/environments/npm-lib-and-cli-tool/env.npm-lib-and-cli-tool.prod.d.ts +0 -3
- package/environments/vscode-plugin/env.vscode-plugin.__.d.ts +0 -6
- package/environments/vscode-plugin/env.vscode-plugin.prod.d.ts +0 -4
- package/lib/ui/directives/index.d.ts +0 -3
- package/lib/ui/directives/index.js +0 -5
- package/lib/ui/directives/index.js.map +0 -1
- package/lib/ui/directives/safe.pipe.d.ts +0 -7
- package/lib/ui/directives/taon-inject-html.directive.d.ts +0 -6
- package/lib/ui/directives/taon-long-press.directive.d.ts +0 -22
- package/lib/ui/directives/view-mode.d.ts +0 -5
- package/lib/ui/directives/view-mode.js +0 -10
- package/lib/ui/directives/view-mode.js.map +0 -1
- package/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.component.d.ts +0 -43
- package/lib/ui/taon-admin-mode-configuration/taon-admin.models.d.ts +0 -5
- package/lib/ui/taon-admin-mode-configuration/taon-admin.models.js +0 -3
- package/lib/ui/taon-admin-mode-configuration/taon-admin.models.js.map +0 -1
- package/lib/ui/taon-full-material.module.d.ts +0 -5
- package/lib/ui/taon-github-fork-me-corner/index.d.ts +0 -2
- package/lib/ui/taon-github-fork-me-corner/index.js +0 -5
- package/lib/ui/taon-github-fork-me-corner/index.js.map +0 -1
- package/lib/ui/taon-github-fork-me-corner/taon-github-fork-me-corner.component.d.ts +0 -3
- package/lib/ui/taon-github-fork-me-corner/taon-github-fork-me-corner.module.d.ts +0 -2
- package/lib/ui/taon-github-fork-me-ribbon/index.d.ts +0 -2
- package/lib/ui/taon-github-fork-me-ribbon/index.js +0 -5
- package/lib/ui/taon-github-fork-me-ribbon/index.js.map +0 -1
- package/lib/ui/taon-github-fork-me-ribbon/taon-github-fork-me-ribbon.component.d.ts +0 -3
- package/lib/ui/taon-github-fork-me-ribbon/taon-github-fork-me-ribbon.module.d.ts +0 -2
- package/lib/ui/taon-notifications/index.d.ts +0 -4
- package/lib/ui/taon-notifications/index.js +0 -24
- package/lib/ui/taon-notifications/index.js.map +0 -1
- package/lib/ui/taon-notifications/taon-notifications.component.d.ts +0 -9
- package/lib/ui/taon-notifications/taon-notifications.models.d.ts +0 -6
- package/lib/ui/taon-notifications/taon-notifications.models.js +0 -5
- package/lib/ui/taon-notifications/taon-notifications.models.js.map +0 -1
- package/lib/ui/taon-notifications/taon-notifications.module.d.ts +0 -2
- package/lib/ui/taon-notifications/taon-notifications.service.d.ts +0 -11
- package/lib/ui/taon-progress-bar/index.d.ts +0 -2
- package/lib/ui/taon-progress-bar/index.js +0 -5
- package/lib/ui/taon-progress-bar/index.js.map +0 -1
- package/lib/ui/taon-progress-bar/taon-progress-bar.component.d.ts +0 -13
- package/lib/ui/taon-progress-bar/taon-progress-bar.module.d.ts +0 -2
- package/lib/ui/taon-session-passcode/index.d.ts +0 -1
- package/lib/ui/taon-session-passcode/index.js +0 -5
- package/lib/ui/taon-session-passcode/index.js.map +0 -1
- package/lib/ui/taon-session-passcode/taon-session-passcode.component.d.ts +0 -35
- package/lib/ui/taon-table/index.d.ts +0 -2
- package/lib/ui/taon-table/index.js +0 -5
- package/lib/ui/taon-table/index.js.map +0 -1
- package/lib/ui/taon-table/taon-table.component.d.ts +0 -34
- package/lib/ui/taon-table/taon-table.module.d.ts +0 -2
- package/lib/ui/taon.models.d.ts +0 -11
- package/lib/ui/taon.models.js +0 -3
- package/lib/ui/taon.models.js.map +0 -1
- package/tmp-environment.json +0 -32
|
@@ -7,15 +7,12 @@ import * as i0 from "@angular/core";
|
|
|
7
7
|
*/
|
|
8
8
|
export declare abstract class BaseAngularsService {
|
|
9
9
|
protected readonly currentContext: TaonContext;
|
|
10
|
-
protected readonly CURRENT_HOST_BACKEND_PORT: number | undefined;
|
|
11
10
|
constructor();
|
|
11
|
+
injectController<T>(ctor: new (...args: any[]) => T,
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
* Returns the host URL for the backend service
|
|
15
|
-
* that is running on localhost (normal NodeJS/ExpressJS mode).
|
|
13
|
+
* optional override context
|
|
16
14
|
*/
|
|
17
|
-
|
|
18
|
-
injectController<T>(ctor: new (...args: any[]) => T): T;
|
|
15
|
+
overrideCurrentContext?: TaonContext): T;
|
|
19
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaseAngularsService, never>;
|
|
20
17
|
static ɵprov: i0.ɵɵInjectableDeclaration<BaseAngularsService>;
|
|
21
18
|
}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import { BaseInjector } from './base-injector';
|
|
3
3
|
export declare class BaseController extends BaseInjector {
|
|
4
|
-
/**
|
|
5
|
-
* @deprecated use migration instead
|
|
6
|
-
* THIS ONLY WORKS IF NO MIGRATIONS PROVIDED IN CONFIG
|
|
7
|
-
* Purpose: init example data for db.
|
|
8
|
-
*/
|
|
9
|
-
initExampleDbData(): Promise<any>;
|
|
10
4
|
}
|
|
@@ -53,14 +53,13 @@ export declare class BaseInjector {
|
|
|
53
53
|
*/
|
|
54
54
|
injectCtrl<T>(ctor: new (...args: any[]) => T): T;
|
|
55
55
|
/**
|
|
56
|
-
*
|
|
56
|
+
* inject middleware for context
|
|
57
57
|
*/
|
|
58
|
-
|
|
58
|
+
injectMiddleware<T>(ctor: new (...args: any[]) => T): T;
|
|
59
59
|
/**
|
|
60
|
-
*
|
|
61
|
-
* TODO
|
|
60
|
+
* inject provider for context
|
|
62
61
|
*/
|
|
63
|
-
|
|
62
|
+
injectProvider<T>(ctor: new (...args: any[]) => T): T;
|
|
64
63
|
/**
|
|
65
64
|
* Inject: Controllers, Providers, Repositories, Services, etc.
|
|
66
65
|
* TODO addd nest js injecting
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import type { AxiosRequestConfig } from 'axios';
|
|
3
|
+
import { BaseInjector } from './base-injector';
|
|
4
|
+
export interface TaonMiddlewareInterceptOptions {
|
|
5
|
+
client?: {
|
|
6
|
+
req: AxiosRequestConfig<unknown>;
|
|
7
|
+
} | undefined;
|
|
8
|
+
server?: {} | undefined;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* TODO
|
|
12
|
+
* - global provider available in all contexts
|
|
13
|
+
* - provider available in own context
|
|
14
|
+
*/
|
|
15
|
+
export declare abstract class BaseMiddleware extends BaseInjector {
|
|
16
|
+
abstract intercept({ server, client, }: TaonMiddlewareInterceptOptions): Promise<void>;
|
|
17
|
+
}
|
|
@@ -6,6 +6,7 @@ import * as controller from './base-controller';
|
|
|
6
6
|
import * as crudController from './base-crud-controller';
|
|
7
7
|
import * as customRepository from './base-custom-repository';
|
|
8
8
|
import * as entity from './base-entity';
|
|
9
|
+
import * as baseMiddleware from './base-middleware';
|
|
9
10
|
import * as baseMigration from './base-migration';
|
|
10
11
|
import * as provider from './base-provider';
|
|
11
12
|
import * as repository from './base-repository';
|
|
@@ -22,6 +23,7 @@ export declare namespace Base {
|
|
|
22
23
|
export import CustomRepository = customRepository.BaseCustomRepository;
|
|
23
24
|
export import SubscriberForEntity = baseSubscriberEntity.BaseSubscriberForEntity;
|
|
24
25
|
export import Migration = baseMigration.BaseMigration;
|
|
26
|
+
export import Middleware = baseMiddleware.BaseMiddleware;
|
|
25
27
|
export import AngularService = baseService.BaseAngularsService;
|
|
26
28
|
const Context: {
|
|
27
29
|
types: {
|
|
@@ -30,6 +32,7 @@ export declare namespace Base {
|
|
|
30
32
|
readonly providers: any;
|
|
31
33
|
readonly subscribers: any;
|
|
32
34
|
readonly migrations: any;
|
|
35
|
+
readonly middlewares: any;
|
|
33
36
|
};
|
|
34
37
|
readonly contexts: any;
|
|
35
38
|
readonly contextName: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
export type TaonEntityKeysToOmit = 'ctrl' | 'clone' | '__endpoint_context__' | 'ctx' | 'inject' | '_' | 'relation' | 'relations' | 'inject' | 'injectRepo' | 'injectCustomRepository' | 'injectCustomRepo' | 'injectController' | 'injectCtrl' | '
|
|
2
|
+
export type TaonEntityKeysToOmit = 'ctrl' | 'clone' | '__endpoint_context__' | 'ctx' | 'inject' | '_' | 'relation' | 'relations' | 'inject' | 'injectRepo' | 'injectCustomRepository' | 'injectCustomRepo' | 'injectController' | 'injectCtrl' | 'injectProvider' | 'injectMiddleware';
|
|
3
3
|
export declare const TaonEntityKeysToOmitArr: TaonEntityKeysToOmit[];
|
|
4
4
|
import { InjectionToken } from '@angular/core';
|
|
5
5
|
import type { TaonContext } from './create-context';
|
|
@@ -6,13 +6,14 @@ import { Models } from './models';
|
|
|
6
6
|
* Context function can be used to dynamically
|
|
7
7
|
* create context with specific configuration.
|
|
8
8
|
*/
|
|
9
|
-
export declare const createContextTemplate: <CTX extends Record<string, object>, CTRL extends Record<string, new (...args: any[]) => any>, ENTITY extends Record<string, new (...args: any[]) => any>, REPO extends Record<string, new (...args: any[]) => any>, PROVIDER extends Record<string, new (...args: any[]) => any>, SUBSCRIBER extends Record<string, new (...args: any[]) => any>, MIGRATION extends Record<string, new (...args: any[]) => any>>(configFn: (env: any) => Models.ContextOptions<CTX, CTRL, ENTITY, REPO, PROVIDER, SUBSCRIBER, MIGRATION>) => () => {
|
|
9
|
+
export declare const createContextTemplate: <CTX extends Record<string, object>, CTRL extends Record<string, new (...args: any[]) => any>, ENTITY extends Record<string, new (...args: any[]) => any>, REPO extends Record<string, new (...args: any[]) => any>, PROVIDER extends Record<string, new (...args: any[]) => any>, SUBSCRIBER extends Record<string, new (...args: any[]) => any>, MIGRATION extends Record<string, new (...args: any[]) => any>, MIDDLEWARE extends Record<string, new (...args: any[]) => any>>(configFn: (env: any) => Models.ContextOptions<CTX, CTRL, ENTITY, REPO, PROVIDER, SUBSCRIBER, MIGRATION, MIDDLEWARE>) => () => {
|
|
10
10
|
types: {
|
|
11
11
|
readonly controllers: any;
|
|
12
12
|
readonly repositories: any;
|
|
13
13
|
readonly providers: any;
|
|
14
14
|
readonly subscribers: any;
|
|
15
15
|
readonly migrations: any;
|
|
16
|
+
readonly middlewares: any;
|
|
16
17
|
};
|
|
17
18
|
readonly contexts: any;
|
|
18
19
|
readonly contextName: string;
|
|
@@ -52,13 +53,14 @@ export declare const createContextTemplate: <CTX extends Record<string, object>,
|
|
|
52
53
|
* REQURIED PROPERTY:
|
|
53
54
|
* - contextName
|
|
54
55
|
*/
|
|
55
|
-
export declare const createContext: <CTX extends Record<string, object>, CTRL extends Record<string, new (...args: any[]) => any>, ENTITY extends Record<string, new (...args: any[]) => any>, REPO extends Record<string, new (...args: any[]) => any>, PROVIDER extends Record<string, new (...args: any[]) => any>, SUBSCRIBER extends Record<string, new (...args: any[]) => any>, MIGRATION extends Record<string, new (...args: any[]) => any>>(configFn: (env: any) => Models.ContextOptions<CTX, CTRL, ENTITY, REPO, PROVIDER, SUBSCRIBER, MIGRATION>) => {
|
|
56
|
+
export declare const createContext: <CTX extends Record<string, object>, CTRL extends Record<string, new (...args: any[]) => any>, ENTITY extends Record<string, new (...args: any[]) => any>, REPO extends Record<string, new (...args: any[]) => any>, PROVIDER extends Record<string, new (...args: any[]) => any>, SUBSCRIBER extends Record<string, new (...args: any[]) => any>, MIGRATION extends Record<string, new (...args: any[]) => any>, MIDDLEWARES extends Record<string, new (...args: any[]) => any>>(configFn: (env: any) => Models.ContextOptions<CTX, CTRL, ENTITY, REPO, PROVIDER, SUBSCRIBER, MIGRATION, MIDDLEWARES>) => {
|
|
56
57
|
types: {
|
|
57
58
|
readonly controllers: any;
|
|
58
59
|
readonly repositories: any;
|
|
59
60
|
readonly providers: any;
|
|
60
61
|
readonly subscribers: any;
|
|
61
62
|
readonly migrations: any;
|
|
63
|
+
readonly middlewares: any;
|
|
62
64
|
};
|
|
63
65
|
readonly contexts: any;
|
|
64
66
|
readonly contextName: string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { Models } from '../../models';
|
|
3
|
+
/**
|
|
4
|
+
* Provider decorator
|
|
5
|
+
*/
|
|
6
|
+
export declare function TaonMiddleware<T = any>(options?: TaonMiddlewareOptions<T>): (constructor: Function) => void;
|
|
7
|
+
export declare class TaonMiddlewareOptions<T = any> extends Models.DecoratorAbstractOpt {
|
|
8
|
+
}
|
|
@@ -4,6 +4,7 @@ import type { NgZone } from '@angular/core';
|
|
|
4
4
|
import type { Application } from 'express';
|
|
5
5
|
import { DataSource } from 'taon-typeorm/browser';
|
|
6
6
|
import type { BaseInjector } from './base-classes/base-injector';
|
|
7
|
+
export type { TaonMiddlewareInterceptOptions } from './base-classes/base-middleware';
|
|
7
8
|
import { ContextDbMigrations } from './context-db-migrations';
|
|
8
9
|
import { Models } from './models';
|
|
9
10
|
export declare class EndpointContext {
|
|
@@ -53,7 +54,7 @@ export declare class EndpointContext {
|
|
|
53
54
|
/**
|
|
54
55
|
* available after init()
|
|
55
56
|
*/
|
|
56
|
-
config: Models.ContextOptions<any, any, any, any, any, any, any>;
|
|
57
|
+
config: Models.ContextOptions<any, any, any, any, any, any, any, any>;
|
|
57
58
|
get logHttp(): boolean;
|
|
58
59
|
get logRealtime(): boolean;
|
|
59
60
|
get logFramework(): boolean;
|
|
@@ -62,8 +63,8 @@ export declare class EndpointContext {
|
|
|
62
63
|
/**
|
|
63
64
|
* Inside docker there is not need for https secure server
|
|
64
65
|
*/
|
|
65
|
-
|
|
66
|
-
constructor(originalConfig: Models.ContextOptions<any, any, any, any, any, any, any>, configFn: (env: any) => Models.ContextOptions<any, any, any, any, any, any, any>);
|
|
66
|
+
readonly isRunningInsideDocker: boolean;
|
|
67
|
+
constructor(originalConfig: Models.ContextOptions<any, any, any, any, any, any, any, any>, configFn: (env: any) => Models.ContextOptions<any, any, any, any, any, any, any, any>);
|
|
67
68
|
init(options?: {
|
|
68
69
|
initFromRecrusiveContextResovle?: boolean;
|
|
69
70
|
overrideHost?: string | null;
|
|
@@ -97,13 +98,12 @@ export declare class EndpointContext {
|
|
|
97
98
|
isCLassType(classType: Models.ClassType, classFn: Function): boolean;
|
|
98
99
|
/**
|
|
99
100
|
* Only for injectable types
|
|
100
|
-
* Only for classType: CONTROLLER, REPOSITORY, PROVIDER
|
|
101
|
+
* Only for classType: CONTROLLER, REPOSITORY, PROVIDER, MIDDLEWARES
|
|
101
102
|
*/
|
|
102
103
|
getClassFunByClassName(className: string): Function;
|
|
103
104
|
getClassFunByClass(classFunction: Function): Function;
|
|
104
105
|
getClassFunByArr(classType: Models.ClassType): Function[];
|
|
105
106
|
private createInstances;
|
|
106
|
-
reinitControllers(): Promise<void>;
|
|
107
107
|
initClasses(): Promise<void>;
|
|
108
108
|
isActiveOn(classInstance: object): boolean;
|
|
109
109
|
get frontendHostUri(): URL;
|
|
@@ -156,7 +156,8 @@ export declare class EndpointContext {
|
|
|
156
156
|
initControllers(): Promise<void>;
|
|
157
157
|
writeActiveRoutes(): void;
|
|
158
158
|
get middlewares(): Models.MiddlewareType[];
|
|
159
|
-
private
|
|
159
|
+
private initFrontnedMiddlewares;
|
|
160
|
+
private initBackendMiddlewares;
|
|
160
161
|
private initServer;
|
|
161
162
|
/**
|
|
162
163
|
* client can be browser or nodejs (when remote host)
|
package/browser/lib/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { NgZone } from '@angular/core';
|
|
|
4
4
|
import * as base from './base-classes/base';
|
|
5
5
|
import * as controllerDecorator from './decorators/classes/controller-decorator';
|
|
6
6
|
import * as entityDecorator from './decorators/classes/entity-decorator';
|
|
7
|
+
import * as middlewareDecorator from './decorators/classes/middleware-decorator';
|
|
7
8
|
import * as migrationDecorator from './decorators/classes/migration-decorator';
|
|
8
9
|
import * as providerDecorator from './decorators/classes/provider-decorator';
|
|
9
10
|
import * as repositoryDecorator from './decorators/classes/repository-decorator';
|
|
@@ -27,6 +28,7 @@ export { inject } from './inject';
|
|
|
27
28
|
export { Models } from './models';
|
|
28
29
|
export * from './constants';
|
|
29
30
|
export { ClassHelpers } from './helpers/class-helpers';
|
|
31
|
+
export type { TaonMiddlewareInterceptOptions } from './base-classes/base-middleware';
|
|
30
32
|
export declare namespace Taon {
|
|
31
33
|
export import Response = models.Models.Http.Response;
|
|
32
34
|
export import Http = http.Http;
|
|
@@ -43,17 +45,19 @@ export declare namespace Taon {
|
|
|
43
45
|
export import Repository = repositoryDecorator.TaonRepository;
|
|
44
46
|
export import Subscriber = subscriberDecorator.TaonSubscriber;
|
|
45
47
|
export import Migration = migrationDecorator.TaonMigration;
|
|
48
|
+
export import Middleware = middlewareDecorator.TaonMiddleware;
|
|
46
49
|
const isBrowser: boolean;
|
|
47
50
|
const isNode: boolean;
|
|
48
51
|
const isWebSQL: boolean;
|
|
49
52
|
const isElectron: boolean;
|
|
50
|
-
const createContext: <CTX extends Record<string, object>, CTRL extends Record<string, new (...args: any[]) => any>, ENTITY extends Record<string, new (...args: any[]) => any>, REPO extends Record<string, new (...args: any[]) => any>, PROVIDER extends Record<string, new (...args: any[]) => any>, SUBSCRIBER extends Record<string, new (...args: any[]) => any>, MIGRATION extends Record<string, new (...args: any[]) => any>>(configFn: (env: any) => models.Models.ContextOptions<CTX, CTRL, ENTITY, REPO, PROVIDER, SUBSCRIBER, MIGRATION>) => {
|
|
53
|
+
const createContext: <CTX extends Record<string, object>, CTRL extends Record<string, new (...args: any[]) => any>, ENTITY extends Record<string, new (...args: any[]) => any>, REPO extends Record<string, new (...args: any[]) => any>, PROVIDER extends Record<string, new (...args: any[]) => any>, SUBSCRIBER extends Record<string, new (...args: any[]) => any>, MIGRATION extends Record<string, new (...args: any[]) => any>, MIDDLEWARES extends Record<string, new (...args: any[]) => any>>(configFn: (env: any) => models.Models.ContextOptions<CTX, CTRL, ENTITY, REPO, PROVIDER, SUBSCRIBER, MIGRATION, MIDDLEWARES>) => {
|
|
51
54
|
types: {
|
|
52
55
|
readonly controllers: any;
|
|
53
56
|
readonly repositories: any;
|
|
54
57
|
readonly providers: any;
|
|
55
58
|
readonly subscribers: any;
|
|
56
59
|
readonly migrations: any;
|
|
60
|
+
readonly middlewares: any;
|
|
57
61
|
};
|
|
58
62
|
readonly contexts: any;
|
|
59
63
|
readonly contextName: string;
|
|
@@ -73,13 +77,14 @@ export declare namespace Taon {
|
|
|
73
77
|
readonly server: import("./realtime/realtime-server").RealtimeServer;
|
|
74
78
|
};
|
|
75
79
|
};
|
|
76
|
-
const createContextTemplate: <CTX extends Record<string, object>, CTRL extends Record<string, new (...args: any[]) => any>, ENTITY extends Record<string, new (...args: any[]) => any>, REPO extends Record<string, new (...args: any[]) => any>, PROVIDER extends Record<string, new (...args: any[]) => any>, SUBSCRIBER extends Record<string, new (...args: any[]) => any>, MIGRATION extends Record<string, new (...args: any[]) => any>>(configFn: (env: any) => models.Models.ContextOptions<CTX, CTRL, ENTITY, REPO, PROVIDER, SUBSCRIBER, MIGRATION>) => () => {
|
|
80
|
+
const createContextTemplate: <CTX extends Record<string, object>, CTRL extends Record<string, new (...args: any[]) => any>, ENTITY extends Record<string, new (...args: any[]) => any>, REPO extends Record<string, new (...args: any[]) => any>, PROVIDER extends Record<string, new (...args: any[]) => any>, SUBSCRIBER extends Record<string, new (...args: any[]) => any>, MIGRATION extends Record<string, new (...args: any[]) => any>, MIDDLEWARE extends Record<string, new (...args: any[]) => any>>(configFn: (env: any) => models.Models.ContextOptions<CTX, CTRL, ENTITY, REPO, PROVIDER, SUBSCRIBER, MIGRATION, MIDDLEWARE>) => () => {
|
|
77
81
|
types: {
|
|
78
82
|
readonly controllers: any;
|
|
79
83
|
readonly repositories: any;
|
|
80
84
|
readonly providers: any;
|
|
81
85
|
readonly subscribers: any;
|
|
82
86
|
readonly migrations: any;
|
|
87
|
+
readonly middlewares: any;
|
|
83
88
|
};
|
|
84
89
|
readonly contexts: any;
|
|
85
90
|
readonly contextName: string;
|
|
@@ -117,6 +122,7 @@ export declare namespace Taon {
|
|
|
117
122
|
readonly providers: any;
|
|
118
123
|
readonly subscribers: any;
|
|
119
124
|
readonly migrations: any;
|
|
125
|
+
readonly middlewares: any;
|
|
120
126
|
};
|
|
121
127
|
readonly contexts: any;
|
|
122
128
|
readonly contextName: string;
|
package/browser/lib/models.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import { CoreModels } from 'tnp-core/browser';
|
|
3
2
|
import { Response as ExpressResponse, Request as ExpressRequest } from 'express';
|
|
4
3
|
import { Models as ModelsNg2Rest } from 'ng2-rest/browser';
|
|
4
|
+
import { CoreModels } from 'tnp-core/browser';
|
|
5
5
|
export declare namespace Models {
|
|
6
6
|
type FrameworkMode = 'backend-frontend(tcp+udp)' | 'remote-backend(tcp+udp)' | 'backend-frontend(ipc-electron)' | 'backend-frontend(websql-electron)' | 'backend-frontend(websql)';
|
|
7
7
|
enum ClassType {
|
|
@@ -10,9 +10,10 @@ export declare namespace Models {
|
|
|
10
10
|
REPOSITORY = "REPOSITORY",
|
|
11
11
|
PROVIDER = "PROVIDER",
|
|
12
12
|
SUBSCRIBER = "SUBSCRIBER",
|
|
13
|
-
MIGRATION = "MIGRATION"
|
|
13
|
+
MIGRATION = "MIGRATION",
|
|
14
|
+
MIDDLEWARE = "MIDDLEWARE"
|
|
14
15
|
}
|
|
15
|
-
const ClassTypeKey: { [key in ClassType]: keyof ContextOptions<any, any, any, any, any, any, any>; };
|
|
16
|
+
const ClassTypeKey: { [key in ClassType]: keyof ContextOptions<any, any, any, any, any, any, any, any>; };
|
|
16
17
|
type MiddlewareType = [Function, any[]];
|
|
17
18
|
/**
|
|
18
19
|
* DROP_DB+MIGRATIONS (default for development)
|
|
@@ -81,7 +82,7 @@ export declare namespace Models {
|
|
|
81
82
|
db?: boolean;
|
|
82
83
|
migrations?: boolean;
|
|
83
84
|
};
|
|
84
|
-
interface ContextOptions<CONTEXTS, CONTROLLERS, ENTITIES, REPOSITORIES, PROVIDERS, SUBSCRIBERS, MIGRATIONS> {
|
|
85
|
+
interface ContextOptions<CONTEXTS, CONTROLLERS, ENTITIES, REPOSITORIES, PROVIDERS, SUBSCRIBERS, MIGRATIONS, MIDDLEWARES> {
|
|
85
86
|
appId?: string;
|
|
86
87
|
contextName: string;
|
|
87
88
|
/**
|
|
@@ -122,29 +123,88 @@ export declare namespace Models {
|
|
|
122
123
|
* Default: true
|
|
123
124
|
*/
|
|
124
125
|
useIpcWhenElectron?: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* taon contexts here
|
|
128
|
+
* (module like structure)
|
|
129
|
+
*/
|
|
125
130
|
contexts?: CONTEXTS;
|
|
131
|
+
/**
|
|
132
|
+
* taon controller here
|
|
133
|
+
* (glue between frontend and backend)
|
|
134
|
+
*/
|
|
126
135
|
controllers?: CONTROLLERS;
|
|
136
|
+
/**
|
|
137
|
+
* taon entities
|
|
138
|
+
* (entities are used to create tables in db)
|
|
139
|
+
*/
|
|
127
140
|
entities?: ENTITIES;
|
|
141
|
+
/**
|
|
142
|
+
* taon repositories
|
|
143
|
+
* (repositories are used to access data from db)
|
|
144
|
+
*/
|
|
128
145
|
repositories?: REPOSITORIES;
|
|
146
|
+
/**
|
|
147
|
+
* taon providers
|
|
148
|
+
* (context singletons)
|
|
149
|
+
*/
|
|
129
150
|
providers?: PROVIDERS;
|
|
151
|
+
/**
|
|
152
|
+
* taon subscribers
|
|
153
|
+
* (subscribers are used to listen to db events)
|
|
154
|
+
*/
|
|
130
155
|
subscribers?: SUBSCRIBERS;
|
|
156
|
+
/**
|
|
157
|
+
* taon migrations
|
|
158
|
+
* (migrations are used to update db schema and achieve proper CI/CD)
|
|
159
|
+
*/
|
|
131
160
|
migrations?: MIGRATIONS;
|
|
161
|
+
/**
|
|
162
|
+
* taon middlewares
|
|
163
|
+
* middlewares are used to intercept requests
|
|
164
|
+
* and responses in the context
|
|
165
|
+
*/
|
|
166
|
+
middlewares?: MIDDLEWARES;
|
|
167
|
+
/**
|
|
168
|
+
* Config for express session
|
|
169
|
+
*/
|
|
132
170
|
session?: ISession;
|
|
171
|
+
/**
|
|
172
|
+
* taon is not going to write .rest files to cwd()
|
|
173
|
+
*/
|
|
133
174
|
skipWritingServerRoutes?: boolean;
|
|
175
|
+
/**
|
|
176
|
+
* TODO - this is still in progress
|
|
177
|
+
* @deprecated
|
|
178
|
+
*/
|
|
134
179
|
productionMode?: boolean;
|
|
180
|
+
/**
|
|
181
|
+
* If you want your context to never be started as separated server
|
|
182
|
+
* use abstract: true
|
|
183
|
+
* @default: false
|
|
184
|
+
*/
|
|
135
185
|
abstract?: boolean;
|
|
136
186
|
logs?: boolean | ConnectionOptionsLogs;
|
|
137
187
|
database?: boolean | Partial<DatabaseConfig>;
|
|
188
|
+
/**
|
|
189
|
+
* disable default realtime communication through TCP upgrade sockets
|
|
190
|
+
*/
|
|
138
191
|
disabledRealtime?: boolean;
|
|
192
|
+
/**
|
|
193
|
+
* Will be removed soon - cloud will handle certs and https
|
|
194
|
+
* @deprecated
|
|
195
|
+
*/
|
|
139
196
|
https?: {
|
|
140
197
|
key: string;
|
|
141
198
|
cert: string;
|
|
142
199
|
};
|
|
200
|
+
/**
|
|
201
|
+
* TODO - will be removed soon
|
|
202
|
+
* @deprecated
|
|
203
|
+
*/
|
|
143
204
|
publicAssets?: {
|
|
144
205
|
serverPath: string;
|
|
145
206
|
locationOnDisk: string;
|
|
146
207
|
}[];
|
|
147
|
-
middlewares?: MiddlewareType[];
|
|
148
208
|
}
|
|
149
209
|
class DecoratorAbstractOpt {
|
|
150
210
|
className: string;
|
package/browser/package.json
CHANGED
|
@@ -5,13 +5,10 @@ import { TaonContext } from '../create-context';
|
|
|
5
5
|
*/
|
|
6
6
|
export declare abstract class BaseAngularsService {
|
|
7
7
|
protected readonly currentContext: TaonContext;
|
|
8
|
-
protected readonly CURRENT_HOST_BACKEND_PORT: number | undefined;
|
|
9
8
|
constructor();
|
|
9
|
+
injectController<T>(ctor: new (...args: any[]) => T,
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
* Returns the host URL for the backend service
|
|
13
|
-
* that is running on localhost (normal NodeJS/ExpressJS mode).
|
|
11
|
+
* optional override context
|
|
14
12
|
*/
|
|
15
|
-
|
|
16
|
-
injectController<T>(ctor: new (...args: any[]) => T): T;
|
|
13
|
+
overrideCurrentContext?: TaonContext): T;
|
|
17
14
|
}
|
|
@@ -12,26 +12,22 @@ const inject_1 = require("../inject");
|
|
|
12
12
|
class BaseAngularsService {
|
|
13
13
|
/* */
|
|
14
14
|
/* */
|
|
15
|
-
CURRENT_HOST_BACKEND_PORT;
|
|
16
15
|
constructor() {
|
|
17
|
-
/* */
|
|
18
|
-
/* */
|
|
19
|
-
/* */
|
|
20
|
-
/* */
|
|
21
16
|
}
|
|
17
|
+
injectController(ctor,
|
|
22
18
|
/**
|
|
23
|
-
*
|
|
24
|
-
* Returns the host URL for the backend service
|
|
25
|
-
* that is running on localhost (normal NodeJS/ExpressJS mode).
|
|
19
|
+
* optional override context
|
|
26
20
|
*/
|
|
27
|
-
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
21
|
+
overrideCurrentContext) {
|
|
22
|
+
return (0, inject_1.inject)(() => {
|
|
23
|
+
let currentContext;
|
|
24
|
+
/* */
|
|
25
|
+
/* */
|
|
26
|
+
if (!currentContext) {
|
|
27
|
+
throw new Error('No context available. Make sure to initialize the context before injecting controllers.');
|
|
28
|
+
}
|
|
29
|
+
return currentContext ? currentContext.getClass(ctor) : void 0;
|
|
30
|
+
});
|
|
35
31
|
}
|
|
36
32
|
}
|
|
37
33
|
exports.BaseAngularsService = BaseAngularsService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-angular-service.js","sourceRoot":"","sources":[""],"names":[],"mappings":";AAAA,KAAK;;;AAIL,sCAAiD;AAEjD;;;GAGG;AACH,KAAK;AACL,KAAK;AAEL,MAAsB,mBAAmB;IACzC,KAAK;IACL,KAAK;
|
|
1
|
+
{"version":3,"file":"base-angular-service.js","sourceRoot":"","sources":[""],"names":[],"mappings":";AAAA,KAAK;;;AAIL,sCAAiD;AAEjD;;;GAGG;AACH,KAAK;AACL,KAAK;AAEL,MAAsB,mBAAmB;IACzC,KAAK;IACL,KAAK;IAEH;IAEA,CAAC;IAED,gBAAgB,CACd,IAA+B;IAC/B;;OAEG;IACH,sBAAoC;QAEpC,OAAO,IAAA,eAAU,EAAC,GAAG,EAAE;YACrB,IAAI,cAA2B,CAAC;YACtC,KAAK;YACL,KAAK;YAEC,IAAI,CAAC,cAAc,EAAE,CAAC;gBACpB,MAAM,IAAI,KAAK,CACb,yFAAyF,CAC1F,CAAC;YACJ,CAAC;YACD,OAAO,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA,CAAC,CAAC,KAAK,CAAC,CAAC;QAChE,CAAC,CAAM,CAAC;IACV,CAAC;CACF;AA5BD,kDA4BC"}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
1
|
import { BaseInjector } from './base-injector';
|
|
2
2
|
export declare class BaseController extends BaseInjector {
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated use migration instead
|
|
5
|
-
* THIS ONLY WORKS IF NO MIGRATIONS PROVIDED IN CONFIG
|
|
6
|
-
* Purpose: init example data for db.
|
|
7
|
-
*/
|
|
8
|
-
initExampleDbData(): Promise<any>;
|
|
9
3
|
}
|
|
@@ -10,14 +10,6 @@ exports.BaseController = void 0;
|
|
|
10
10
|
const controller_decorator_1 = require("../decorators/classes/controller-decorator");
|
|
11
11
|
const base_injector_1 = require("./base-injector");
|
|
12
12
|
let BaseController = class BaseController extends base_injector_1.BaseInjector {
|
|
13
|
-
/**
|
|
14
|
-
* @deprecated use migration instead
|
|
15
|
-
* THIS ONLY WORKS IF NO MIGRATIONS PROVIDED IN CONFIG
|
|
16
|
-
* Purpose: init example data for db.
|
|
17
|
-
*/
|
|
18
|
-
initExampleDbData() {
|
|
19
|
-
return void 0;
|
|
20
|
-
}
|
|
21
13
|
};
|
|
22
14
|
exports.BaseController = BaseController;
|
|
23
15
|
exports.BaseController = BaseController = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-controller.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;;;;;;;AAAA,qFAA4E;AAE5E,mDAA+C;AAGxC,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,4BAAY;
|
|
1
|
+
{"version":3,"file":"base-controller.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;;;;;;;AAAA,qFAA4E;AAE5E,mDAA+C;AAGxC,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,4BAAY;CAE/C,CAAA;AAFY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,qCAAc,EAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;GACnC,cAAc,CAE1B"}
|
|
@@ -52,14 +52,13 @@ export declare class BaseInjector {
|
|
|
52
52
|
*/
|
|
53
53
|
injectCtrl<T>(ctor: new (...args: any[]) => T): T;
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
55
|
+
* inject middleware for context
|
|
56
56
|
*/
|
|
57
|
-
|
|
57
|
+
injectMiddleware<T>(ctor: new (...args: any[]) => T): T;
|
|
58
58
|
/**
|
|
59
|
-
*
|
|
60
|
-
* TODO
|
|
59
|
+
* inject provider for context
|
|
61
60
|
*/
|
|
62
|
-
|
|
61
|
+
injectProvider<T>(ctor: new (...args: any[]) => T): T;
|
|
63
62
|
/**
|
|
64
63
|
* Inject: Controllers, Providers, Repositories, Services, etc.
|
|
65
64
|
* TODO addd nest js injecting
|
|
@@ -106,18 +106,17 @@ class BaseInjector {
|
|
|
106
106
|
//#endregion
|
|
107
107
|
//#region inject / global provider
|
|
108
108
|
/**
|
|
109
|
-
*
|
|
109
|
+
* inject middleware for context
|
|
110
110
|
*/
|
|
111
|
-
|
|
111
|
+
injectMiddleware(ctor) {
|
|
112
112
|
return this.__inject(ctor, { localInstance: false });
|
|
113
113
|
}
|
|
114
114
|
//#endregion
|
|
115
115
|
//#region inject / context provider
|
|
116
116
|
/**
|
|
117
|
-
*
|
|
118
|
-
* TODO
|
|
117
|
+
* inject provider for context
|
|
119
118
|
*/
|
|
120
|
-
|
|
119
|
+
injectProvider(ctor) {
|
|
121
120
|
return this.__inject(ctor, { localInstance: false });
|
|
122
121
|
}
|
|
123
122
|
//#endregion
|
|
@@ -151,7 +150,7 @@ class BaseInjector {
|
|
|
151
150
|
throw new Error(`Not able to inject "${class_helpers_1.ClassHelpers.getName(ctor) || ctor.name}" inside ` +
|
|
152
151
|
`property "${propName?.toString()}" on class "${class_helpers_1.ClassHelpers.getName(this)}".
|
|
153
152
|
|
|
154
|
-
Please add "${class_helpers_1.ClassHelpers.getName(ctor) || ctor.name}" to (entites or contorllers or providers or repositories)
|
|
153
|
+
Please add "${class_helpers_1.ClassHelpers.getName(ctor) || ctor.name}" to (entites or contorllers or providers or repositories or middlewares)
|
|
155
154
|
|
|
156
155
|
`);
|
|
157
156
|
}
|
|
@@ -184,7 +183,7 @@ class BaseInjector {
|
|
|
184
183
|
throw new Error(`Not able to inject "${classNameNotResolved}" inside ` +
|
|
185
184
|
`property "${propName?.toString()}" on class "${class_helpers_1.ClassHelpers.getName(this)}".
|
|
186
185
|
|
|
187
|
-
Please add "${class_helpers_1.ClassHelpers.getName(ctor) || ctor.name}" to (entites or contorllers or providers or repositories)
|
|
186
|
+
Please add "${class_helpers_1.ClassHelpers.getName(ctor) || ctor.name}" to (entites or contorllers or providers or repositories or middlewares)
|
|
188
187
|
|
|
189
188
|
`);
|
|
190
189
|
}
|
|
@@ -1 +1 @@
|
|
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;wBACV,oBAAoB;wBACpB,sCAAsC,EAAE,IAAI;qBAC7C,CAAC,CAAC;oBACH,IAAI,CAAC,QAAQ,EAAE,CAAC;wBACd,MAAM,oBAAoB,GACxB,4BAAY,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC;wBAC1C,MAAM,IAAI,KAAK,CACb,uBAAuB,oBAAoB,WAAW;4BACpD,aAAa,QAAQ,EAAE,QAAQ,EAAE,gBAAgB,4BAAY,CAAC,OAAO,CACnE,IAAI,CACL;;4BAGH,4BAAY,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,IACrC;;eAEC,CACA,CAAC;oBACJ,CAAC;oBACD,QAAQ,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC;gBAC7B,CAAC;gBACD,OAAO,IAAI,CAAC;YACd,CAAC;SACF,CACG,CAAC;IACT,CAAC;CAIF;AA1QD,oCA0QC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AxiosRequestConfig } from 'axios';
|
|
2
|
+
import type express from 'express';
|
|
3
|
+
import { BaseInjector } from './base-injector';
|
|
4
|
+
export interface TaonMiddlewareInterceptOptions {
|
|
5
|
+
client?: {
|
|
6
|
+
req: AxiosRequestConfig<unknown>;
|
|
7
|
+
} | undefined;
|
|
8
|
+
server?: {
|
|
9
|
+
req: express.Request;
|
|
10
|
+
res: express.Response;
|
|
11
|
+
} | undefined;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* TODO
|
|
15
|
+
* - global provider available in all contexts
|
|
16
|
+
* - provider available in own context
|
|
17
|
+
*/
|
|
18
|
+
export declare abstract class BaseMiddleware extends BaseInjector {
|
|
19
|
+
abstract intercept({ server, client, }: TaonMiddlewareInterceptOptions): Promise<void>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseMiddleware = void 0;
|
|
4
|
+
const base_injector_1 = require("./base-injector");
|
|
5
|
+
/**
|
|
6
|
+
* TODO
|
|
7
|
+
* - global provider available in all contexts
|
|
8
|
+
* - provider available in own context
|
|
9
|
+
*/
|
|
10
|
+
class BaseMiddleware extends base_injector_1.BaseInjector {
|
|
11
|
+
}
|
|
12
|
+
exports.BaseMiddleware = BaseMiddleware;
|
|
13
|
+
//# sourceMappingURL=base-middleware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-middleware.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AAIA,mDAA+C;AAsB/C;;;;GAIG;AACH,MAAsB,cAAe,SAAQ,4BAAY;CAKxD;AALD,wCAKC"}
|