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,21 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import type { AxiosRequestConfig } from 'axios';
|
|
3
|
+
import type express from 'express';
|
|
4
|
+
import { BaseInjector } from './base-injector';
|
|
5
|
+
export interface TaonMiddlewareInterceptOptions {
|
|
6
|
+
client?: {
|
|
7
|
+
req: AxiosRequestConfig<unknown>;
|
|
8
|
+
} | undefined;
|
|
9
|
+
server?: {
|
|
10
|
+
req: express.Request;
|
|
11
|
+
res: express.Response;
|
|
12
|
+
} | undefined;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* TODO
|
|
16
|
+
* - global provider available in all contexts
|
|
17
|
+
* - provider available in own context
|
|
18
|
+
*/
|
|
19
|
+
export declare abstract class BaseMiddleware extends BaseInjector {
|
|
20
|
+
abstract intercept({ server, client, }: TaonMiddlewareInterceptOptions): Promise<void>;
|
|
21
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -5,6 +5,7 @@ import type { Application } from 'express';
|
|
|
5
5
|
import type { Repository } from 'taon-typeorm/websql';
|
|
6
6
|
import { DataSource } from 'taon-typeorm/websql';
|
|
7
7
|
import type { BaseInjector } from './base-classes/base-injector';
|
|
8
|
+
export type { TaonMiddlewareInterceptOptions } from './base-classes/base-middleware';
|
|
8
9
|
import { ContextDbMigrations } from './context-db-migrations';
|
|
9
10
|
import { Models } from './models';
|
|
10
11
|
export declare class EndpointContext {
|
|
@@ -55,7 +56,7 @@ export declare class EndpointContext {
|
|
|
55
56
|
/**
|
|
56
57
|
* available after init()
|
|
57
58
|
*/
|
|
58
|
-
config: Models.ContextOptions<any, any, any, any, any, any, any>;
|
|
59
|
+
config: Models.ContextOptions<any, any, any, any, any, any, any, any>;
|
|
59
60
|
get logHttp(): boolean;
|
|
60
61
|
get logRealtime(): boolean;
|
|
61
62
|
get logFramework(): boolean;
|
|
@@ -64,8 +65,8 @@ export declare class EndpointContext {
|
|
|
64
65
|
/**
|
|
65
66
|
* Inside docker there is not need for https secure server
|
|
66
67
|
*/
|
|
67
|
-
|
|
68
|
-
constructor(originalConfig: Models.ContextOptions<any, any, any, any, any, any, any>, configFn: (env: any) => Models.ContextOptions<any, any, any, any, any, any, any>);
|
|
68
|
+
readonly isRunningInsideDocker: boolean;
|
|
69
|
+
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>);
|
|
69
70
|
init(options?: {
|
|
70
71
|
initFromRecrusiveContextResovle?: boolean;
|
|
71
72
|
overrideHost?: string | null;
|
|
@@ -99,13 +100,12 @@ export declare class EndpointContext {
|
|
|
99
100
|
isCLassType(classType: Models.ClassType, classFn: Function): boolean;
|
|
100
101
|
/**
|
|
101
102
|
* Only for injectable types
|
|
102
|
-
* Only for classType: CONTROLLER, REPOSITORY, PROVIDER
|
|
103
|
+
* Only for classType: CONTROLLER, REPOSITORY, PROVIDER, MIDDLEWARES
|
|
103
104
|
*/
|
|
104
105
|
getClassFunByClassName(className: string): Function;
|
|
105
106
|
getClassFunByClass(classFunction: Function): Function;
|
|
106
107
|
getClassFunByArr(classType: Models.ClassType): Function[];
|
|
107
108
|
private createInstances;
|
|
108
|
-
reinitControllers(): Promise<void>;
|
|
109
109
|
initClasses(): Promise<void>;
|
|
110
110
|
isActiveOn(classInstance: object): boolean;
|
|
111
111
|
get frontendHostUri(): URL;
|
|
@@ -158,7 +158,8 @@ export declare class EndpointContext {
|
|
|
158
158
|
initControllers(): Promise<void>;
|
|
159
159
|
writeActiveRoutes(): void;
|
|
160
160
|
get middlewares(): Models.MiddlewareType[];
|
|
161
|
-
private
|
|
161
|
+
private initFrontnedMiddlewares;
|
|
162
|
+
private initBackendMiddlewares;
|
|
162
163
|
private initServer;
|
|
163
164
|
/**
|
|
164
165
|
* client can be browser or nodejs (when remote host)
|
package/websql/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/websql/lib/models.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import { CoreModels } from 'tnp-core/websql';
|
|
3
2
|
import { RequestHandler } from 'express';
|
|
4
3
|
import { Response as ExpressResponse, Request as ExpressRequest } from 'express';
|
|
5
4
|
import { Models as ModelsNg2Rest } from 'ng2-rest/websql';
|
|
5
|
+
import { CoreModels } from 'tnp-core/websql';
|
|
6
6
|
export declare namespace Models {
|
|
7
7
|
type FrameworkMode = 'backend-frontend(tcp+udp)' | 'remote-backend(tcp+udp)' | 'backend-frontend(ipc-electron)' | 'backend-frontend(websql-electron)' | 'backend-frontend(websql)';
|
|
8
8
|
enum ClassType {
|
|
@@ -11,9 +11,10 @@ export declare namespace Models {
|
|
|
11
11
|
REPOSITORY = "REPOSITORY",
|
|
12
12
|
PROVIDER = "PROVIDER",
|
|
13
13
|
SUBSCRIBER = "SUBSCRIBER",
|
|
14
|
-
MIGRATION = "MIGRATION"
|
|
14
|
+
MIGRATION = "MIGRATION",
|
|
15
|
+
MIDDLEWARE = "MIDDLEWARE"
|
|
15
16
|
}
|
|
16
|
-
const ClassTypeKey: { [key in ClassType]: keyof ContextOptions<any, any, any, any, any, any, any>; };
|
|
17
|
+
const ClassTypeKey: { [key in ClassType]: keyof ContextOptions<any, any, any, any, any, any, any, any>; };
|
|
17
18
|
type MiddlewareType = [Function, any[]];
|
|
18
19
|
/**
|
|
19
20
|
* DROP_DB+MIGRATIONS (default for development)
|
|
@@ -82,7 +83,7 @@ export declare namespace Models {
|
|
|
82
83
|
db?: boolean;
|
|
83
84
|
migrations?: boolean;
|
|
84
85
|
};
|
|
85
|
-
interface ContextOptions<CONTEXTS, CONTROLLERS, ENTITIES, REPOSITORIES, PROVIDERS, SUBSCRIBERS, MIGRATIONS> {
|
|
86
|
+
interface ContextOptions<CONTEXTS, CONTROLLERS, ENTITIES, REPOSITORIES, PROVIDERS, SUBSCRIBERS, MIGRATIONS, MIDDLEWARES> {
|
|
86
87
|
appId?: string;
|
|
87
88
|
contextName: string;
|
|
88
89
|
/**
|
|
@@ -123,29 +124,88 @@ export declare namespace Models {
|
|
|
123
124
|
* Default: true
|
|
124
125
|
*/
|
|
125
126
|
useIpcWhenElectron?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* taon contexts here
|
|
129
|
+
* (module like structure)
|
|
130
|
+
*/
|
|
126
131
|
contexts?: CONTEXTS;
|
|
132
|
+
/**
|
|
133
|
+
* taon controller here
|
|
134
|
+
* (glue between frontend and backend)
|
|
135
|
+
*/
|
|
127
136
|
controllers?: CONTROLLERS;
|
|
137
|
+
/**
|
|
138
|
+
* taon entities
|
|
139
|
+
* (entities are used to create tables in db)
|
|
140
|
+
*/
|
|
128
141
|
entities?: ENTITIES;
|
|
142
|
+
/**
|
|
143
|
+
* taon repositories
|
|
144
|
+
* (repositories are used to access data from db)
|
|
145
|
+
*/
|
|
129
146
|
repositories?: REPOSITORIES;
|
|
147
|
+
/**
|
|
148
|
+
* taon providers
|
|
149
|
+
* (context singletons)
|
|
150
|
+
*/
|
|
130
151
|
providers?: PROVIDERS;
|
|
152
|
+
/**
|
|
153
|
+
* taon subscribers
|
|
154
|
+
* (subscribers are used to listen to db events)
|
|
155
|
+
*/
|
|
131
156
|
subscribers?: SUBSCRIBERS;
|
|
157
|
+
/**
|
|
158
|
+
* taon migrations
|
|
159
|
+
* (migrations are used to update db schema and achieve proper CI/CD)
|
|
160
|
+
*/
|
|
132
161
|
migrations?: MIGRATIONS;
|
|
162
|
+
/**
|
|
163
|
+
* taon middlewares
|
|
164
|
+
* middlewares are used to intercept requests
|
|
165
|
+
* and responses in the context
|
|
166
|
+
*/
|
|
167
|
+
middlewares?: MIDDLEWARES;
|
|
168
|
+
/**
|
|
169
|
+
* Config for express session
|
|
170
|
+
*/
|
|
133
171
|
session?: ISession;
|
|
172
|
+
/**
|
|
173
|
+
* taon is not going to write .rest files to cwd()
|
|
174
|
+
*/
|
|
134
175
|
skipWritingServerRoutes?: boolean;
|
|
176
|
+
/**
|
|
177
|
+
* TODO - this is still in progress
|
|
178
|
+
* @deprecated
|
|
179
|
+
*/
|
|
135
180
|
productionMode?: boolean;
|
|
181
|
+
/**
|
|
182
|
+
* If you want your context to never be started as separated server
|
|
183
|
+
* use abstract: true
|
|
184
|
+
* @default: false
|
|
185
|
+
*/
|
|
136
186
|
abstract?: boolean;
|
|
137
187
|
logs?: boolean | ConnectionOptionsLogs;
|
|
138
188
|
database?: boolean | Partial<DatabaseConfig>;
|
|
189
|
+
/**
|
|
190
|
+
* disable default realtime communication through TCP upgrade sockets
|
|
191
|
+
*/
|
|
139
192
|
disabledRealtime?: boolean;
|
|
193
|
+
/**
|
|
194
|
+
* Will be removed soon - cloud will handle certs and https
|
|
195
|
+
* @deprecated
|
|
196
|
+
*/
|
|
140
197
|
https?: {
|
|
141
198
|
key: string;
|
|
142
199
|
cert: string;
|
|
143
200
|
};
|
|
201
|
+
/**
|
|
202
|
+
* TODO - will be removed soon
|
|
203
|
+
* @deprecated
|
|
204
|
+
*/
|
|
144
205
|
publicAssets?: {
|
|
145
206
|
serverPath: string;
|
|
146
207
|
locationOnDisk: string;
|
|
147
208
|
}[];
|
|
148
|
-
middlewares?: MiddlewareType[];
|
|
149
209
|
}
|
|
150
210
|
class DecoratorAbstractOpt {
|
|
151
211
|
className: string;
|
package/websql/package.json
CHANGED
package/env.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;AAAA,gDAAwC;AAAxC,SAAgB,kBAAkB,KAAK,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { PipeTransform } from '@angular/core';
|
|
2
|
-
import { DomSanitizer, SafeHtml, SafeStyle, SafeScript, SafeUrl, SafeResourceUrl } from '@angular/platform-browser';
|
|
3
|
-
export declare class SafePipe implements PipeTransform {
|
|
4
|
-
protected sanitizer: DomSanitizer;
|
|
5
|
-
constructor(sanitizer: DomSanitizer);
|
|
6
|
-
transform(value: any, type: string): SafeHtml | SafeStyle | SafeScript | SafeUrl | SafeResourceUrl;
|
|
7
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { EventEmitter } from '@angular/core';
|
|
2
|
-
import { _ } from 'tnp-core';
|
|
3
|
-
export declare class TaonLongPress {
|
|
4
|
-
pressDuration: number;
|
|
5
|
-
onLongPress: EventEmitter<any>;
|
|
6
|
-
onLongPressing: EventEmitter<any>;
|
|
7
|
-
onLongPressEnd: EventEmitter<any>;
|
|
8
|
-
private pressing;
|
|
9
|
-
private longPressing;
|
|
10
|
-
private timeout;
|
|
11
|
-
private mouseX;
|
|
12
|
-
private mouseY;
|
|
13
|
-
get press(): boolean;
|
|
14
|
-
get longPress(): boolean;
|
|
15
|
-
allowTrigger: boolean;
|
|
16
|
-
triggerEnd: (() => void) & _.Cancelable;
|
|
17
|
-
onMouseDown(event: any): void;
|
|
18
|
-
onMouseMove(event: any): void;
|
|
19
|
-
loop(event: any): void;
|
|
20
|
-
endPress(emit?: boolean): void;
|
|
21
|
-
onMouseUp(): void;
|
|
22
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ViewMode = void 0;
|
|
4
|
-
var ViewMode;
|
|
5
|
-
(function (ViewMode) {
|
|
6
|
-
ViewMode["Add"] = "Add";
|
|
7
|
-
ViewMode["Edit"] = "Edit";
|
|
8
|
-
ViewMode["Preview"] = "Preview";
|
|
9
|
-
})(ViewMode || (exports.ViewMode = ViewMode = {}));
|
|
10
|
-
//# sourceMappingURL=view-mode.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"view-mode.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AAAA,IAAY,QAIX;AAJD,WAAY,QAAQ;IAClB,uBAAW,CAAA;IACX,yBAAa,CAAA;IACb,+BAAmB,CAAA;AACrB,CAAC,EAJW,QAAQ,wBAAR,QAAQ,QAInB"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { CdkDragEnd, Point } from '@angular/cdk/drag-drop';
|
|
2
|
-
import { ChangeDetectorRef, EventEmitter, OnInit, AfterViewInit, OnDestroy } from '@angular/core';
|
|
3
|
-
import { Subject } from 'rxjs';
|
|
4
|
-
import { BreakpointsService } from 'static-columns';
|
|
5
|
-
import { TaonAdminService } from './taon-admin.service';
|
|
6
|
-
export declare class TaonAdminModeConfigurationComponent implements OnInit, AfterViewInit, OnDestroy {
|
|
7
|
-
private breakpointsService;
|
|
8
|
-
$destroy: Subject<unknown>;
|
|
9
|
-
readonly cdr: ChangeDetectorRef;
|
|
10
|
-
readonly taonAdminService: TaonAdminService;
|
|
11
|
-
readonly isDesktop: boolean;
|
|
12
|
-
isWebSQLMode: boolean;
|
|
13
|
-
hideTaonToolsInProduction: boolean;
|
|
14
|
-
isIframe: boolean;
|
|
15
|
-
height: number;
|
|
16
|
-
openedOnce: boolean;
|
|
17
|
-
reloading: boolean;
|
|
18
|
-
showPasscode: boolean;
|
|
19
|
-
passcode: string;
|
|
20
|
-
message: string;
|
|
21
|
-
dragPositionX: number;
|
|
22
|
-
dragPositionY: number;
|
|
23
|
-
dragPositionZero: Point;
|
|
24
|
-
dragPosition: Point;
|
|
25
|
-
selectedIndex: number;
|
|
26
|
-
tabGroup: any;
|
|
27
|
-
wasOpenDraggablePopup: boolean;
|
|
28
|
-
taonAdminModeConfigurationDataChanged: EventEmitter<any>;
|
|
29
|
-
taonAdminModeConfigurationData: any;
|
|
30
|
-
get opened(): boolean;
|
|
31
|
-
set opened(v: boolean);
|
|
32
|
-
constructor(breakpointsService: BreakpointsService);
|
|
33
|
-
ngOnInit(): Promise<void>;
|
|
34
|
-
ngAfterViewInit(): void;
|
|
35
|
-
ngOnDestroy(): void;
|
|
36
|
-
onResize(event: Event): void;
|
|
37
|
-
reloadTabs(): Promise<void>;
|
|
38
|
-
toogle(): Promise<void>;
|
|
39
|
-
toogleFullScreen(): Promise<void>;
|
|
40
|
-
resetDrag(): void;
|
|
41
|
-
moved(c: CdkDragEnd): void;
|
|
42
|
-
scrollTabs(event: any): void;
|
|
43
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"taon-admin.models.js","sourceRoot":"","sources":[""],"names":[],"mappings":""}
|