taon 19.0.54 → 19.0.56
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 +271 -156
- package/browser/fesm2022/taon.mjs.map +1 -1
- package/browser/lib/config/controller-config.d.ts +22 -0
- package/{websql/lib/decorators/classes → browser/lib/config}/controller-options.d.ts +6 -1
- package/browser/lib/config/method-config.d.ts +39 -0
- package/browser/lib/config/param-config.d.ts +9 -0
- package/browser/lib/decorators/classes/controller-decorator.d.ts +1 -1
- package/browser/lib/decorators/http/http-methods-decorators.d.ts +14 -1
- package/browser/lib/endpoint-context.d.ts +3 -1
- package/browser/lib/helpers/class-helpers.d.ts +5 -2
- package/browser/lib/helpers/clone-obj.d.ts +2 -0
- package/browser/lib/helpers/taon-helpers.d.ts +5 -5
- package/browser/lib/models.d.ts +1 -32
- package/browser/lib/symbols.d.ts +0 -2
- package/browser/lib/validators.d.ts +2 -2
- package/browser/package.json +1 -1
- package/lib/base-classes/base-class.js +2 -16
- package/lib/base-classes/base-class.js.map +1 -1
- package/lib/base-classes/base-controller.js +4 -1
- package/lib/base-classes/base-controller.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/config/controller-config.d.ts +21 -0
- package/lib/config/controller-config.js +34 -0
- package/lib/config/controller-config.js.map +1 -0
- package/lib/{decorators/classes → config}/controller-options.d.ts +6 -1
- package/lib/config/controller-options.js +8 -0
- package/lib/config/controller-options.js.map +1 -0
- package/lib/config/method-config.d.ts +38 -0
- package/lib/config/method-config.js +12 -0
- package/lib/config/method-config.js.map +1 -0
- package/lib/config/param-config.d.ts +8 -0
- package/lib/config/param-config.js +8 -0
- package/lib/config/param-config.js.map +1 -0
- package/lib/decorators/classes/controller-decorator.d.ts +1 -1
- package/lib/decorators/classes/controller-decorator.js +6 -1
- package/lib/decorators/classes/controller-decorator.js.map +1 -1
- package/lib/decorators/classes/middleware-decorator.js.map +1 -1
- package/lib/decorators/classes/provider-decorator.js.map +1 -1
- package/lib/decorators/decorator-abstract-opt.js +0 -1
- package/lib/decorators/decorator-abstract-opt.js.map +1 -1
- package/lib/decorators/http/http-methods-decorators.d.ts +14 -1
- package/lib/decorators/http/http-methods-decorators.js +3 -10
- package/lib/decorators/http/http-methods-decorators.js.map +1 -1
- package/lib/decorators/http/http-params-decorators.js +10 -16
- package/lib/decorators/http/http-params-decorators.js.map +1 -1
- package/lib/endpoint-context.d.ts +3 -1
- package/lib/endpoint-context.js +244 -144
- package/lib/endpoint-context.js.map +1 -1
- package/lib/helpers/class-helpers.d.ts +5 -2
- package/lib/helpers/class-helpers.js +47 -35
- package/lib/helpers/class-helpers.js.map +1 -1
- package/lib/helpers/clone-obj.d.ts +1 -0
- package/lib/helpers/clone-obj.js +22 -0
- package/lib/helpers/clone-obj.js.map +1 -0
- package/lib/helpers/taon-helpers.d.ts +5 -5
- package/lib/helpers/taon-helpers.js.map +1 -1
- package/lib/models.d.ts +1 -32
- package/lib/models.js +0 -33
- package/lib/models.js.map +1 -1
- package/lib/symbols.d.ts +0 -2
- package/lib/symbols.js +5 -7
- package/lib/symbols.js.map +1 -1
- package/lib/ui/index.js +2 -2
- package/lib/ui/taon-admin-mode-configuration/index.js +2 -2
- package/lib/validators.d.ts +2 -2
- package/lib/validators.js.map +1 -1
- package/package.json +1 -1
- package/scss/vars.scss +6 -6
- package/websql/README.md +24 -24
- package/websql/fesm2022/taon.mjs +272 -157
- package/websql/fesm2022/taon.mjs.map +1 -1
- package/websql/lib/config/controller-config.d.ts +22 -0
- package/{browser/lib/decorators/classes → websql/lib/config}/controller-options.d.ts +6 -1
- package/websql/lib/config/method-config.d.ts +39 -0
- package/websql/lib/config/param-config.d.ts +9 -0
- package/websql/lib/decorators/classes/controller-decorator.d.ts +1 -1
- package/websql/lib/decorators/http/http-methods-decorators.d.ts +14 -1
- package/websql/lib/endpoint-context.d.ts +3 -1
- package/websql/lib/helpers/class-helpers.d.ts +5 -2
- package/websql/lib/helpers/clone-obj.d.ts +2 -0
- package/websql/lib/helpers/taon-helpers.d.ts +5 -5
- package/websql/lib/models.d.ts +1 -32
- package/websql/lib/symbols.d.ts +0 -2
- package/websql/lib/validators.d.ts +2 -2
- package/websql/package.json +1 -1
- package/browser/lib/decorators/classes/controller-config.d.ts +0 -10
- package/lib/decorators/classes/controller-config.d.ts +0 -9
- package/lib/decorators/classes/controller-config.js +0 -11
- package/lib/decorators/classes/controller-config.js.map +0 -1
- package/lib/decorators/classes/controller-options.js +0 -16
- package/lib/decorators/classes/controller-options.js.map +0 -1
- package/lib/env.d.ts +0 -2
- package/lib/env.js +0 -7
- package/lib/env.js.map +0 -1
- package/lib/storage.d.ts +0 -1
- package/lib/storage.js +0 -6
- package/lib/storage.js.map +0 -1
- 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 -39
- package/websql/lib/decorators/classes/controller-config.d.ts +0 -10
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { TaonMiddlewareInheritanceObj } from '../decorators/http/http-methods-decorators';
|
|
3
|
+
import { TaonControllerOptions } from './controller-options';
|
|
4
|
+
import { MethodConfig } from './method-config';
|
|
5
|
+
export declare class ControllerConfig extends TaonControllerOptions {
|
|
6
|
+
methods: {
|
|
7
|
+
[methodName: string]: Partial<MethodConfig>;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Calculated path from parents controllers
|
|
11
|
+
*/
|
|
12
|
+
calculatedPath?: string;
|
|
13
|
+
/**
|
|
14
|
+
* a way to transform entity before sending to browser
|
|
15
|
+
*/
|
|
16
|
+
browserTransformFn?: (entity: any) => any;
|
|
17
|
+
/**
|
|
18
|
+
* Calculated middlewares object from parents controllers
|
|
19
|
+
*/
|
|
20
|
+
calculatedMiddlewaresControllerObj?: TaonMiddlewareInheritanceObj;
|
|
21
|
+
}
|
|
22
|
+
export declare const controllerConfigFrom: (partial: Partial<ControllerConfig>) => ControllerConfig;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import { DecoratorAbstractOpt } from '../decorator-abstract-opt';
|
|
2
|
+
import { DecoratorAbstractOpt } from '../decorators/decorator-abstract-opt';
|
|
3
|
+
import type { TaonMiddlewareFunction } from '../decorators/http/http-methods-decorators';
|
|
3
4
|
export declare class TaonControllerOptions<ControllerClass = any> extends DecoratorAbstractOpt {
|
|
4
5
|
/**
|
|
5
6
|
* typeorm realtime subscribtion // TODO disabled for now, does not make sense ?s
|
|
@@ -9,4 +10,8 @@ export declare class TaonControllerOptions<ControllerClass = any> extends Decora
|
|
|
9
10
|
* override default path for controller api
|
|
10
11
|
*/
|
|
11
12
|
path?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Middlewares to be applied to all methods in the controller
|
|
15
|
+
*/
|
|
16
|
+
middlewares?: TaonMiddlewareFunction;
|
|
12
17
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { CoreModels } from 'tnp-core/browser';
|
|
3
|
+
import type { BaseMiddleware } from '../base-classes/base-middleware';
|
|
4
|
+
import type { TaonHttpDecoratorOptions, TaonMiddlewareFunction, TaonMiddlewareInheritanceObj } from '../decorators/http/http-methods-decorators';
|
|
5
|
+
import { ParamConfig } from './param-config';
|
|
6
|
+
/**
|
|
7
|
+
* @link './decorators/http/http-methods-decorators.ts' TaonHttpDecoratorOptions
|
|
8
|
+
*/
|
|
9
|
+
export declare class MethodConfig implements Pick<TaonHttpDecoratorOptions, 'path' | 'middlewares'> {
|
|
10
|
+
methodName: string;
|
|
11
|
+
global?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* override default content type
|
|
14
|
+
*/
|
|
15
|
+
contentType?: any;
|
|
16
|
+
/**
|
|
17
|
+
* override default axiso response type
|
|
18
|
+
*/
|
|
19
|
+
responseType?: any;
|
|
20
|
+
path: string;
|
|
21
|
+
descriptor: PropertyDescriptor;
|
|
22
|
+
type: CoreModels.HttpMethod;
|
|
23
|
+
parameters: {
|
|
24
|
+
[paramName: string]: Partial<ParamConfig>;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Middlewares from controller method options
|
|
28
|
+
*/
|
|
29
|
+
middlewares?: TaonMiddlewareFunction;
|
|
30
|
+
/**
|
|
31
|
+
* Calculated middlewares object from parents controllers
|
|
32
|
+
*/
|
|
33
|
+
calculatedMiddlewaresMethodObj?: TaonMiddlewareInheritanceObj;
|
|
34
|
+
/**
|
|
35
|
+
* Middlewares array in proper order and ready to be used in
|
|
36
|
+
* express or in axios interceptors.
|
|
37
|
+
*/
|
|
38
|
+
calculatedMiddlewares: (typeof BaseMiddleware)[];
|
|
39
|
+
}
|
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
import { Models as ModelsNg2Rest } from 'ng2-rest/browser';
|
|
3
3
|
import { CoreModels } from 'tnp-core/browser';
|
|
4
4
|
import { BaseMiddleware } from '../../base-classes/base-middleware';
|
|
5
|
+
export type TaonMiddlewareInheritanceObj = {
|
|
6
|
+
[parentMiddlewaresName: string]: typeof BaseMiddleware;
|
|
7
|
+
};
|
|
8
|
+
export type TaonMiddlewareFunction = (options: {
|
|
9
|
+
/**
|
|
10
|
+
* middlewares inherited from parent class
|
|
11
|
+
*/
|
|
12
|
+
parentMiddlewares: TaonMiddlewareInheritanceObj;
|
|
13
|
+
/**
|
|
14
|
+
* Get real class name - needed when code is minified
|
|
15
|
+
*/
|
|
16
|
+
className: (middlewareClass: Function) => string;
|
|
17
|
+
}) => TaonMiddlewareInheritanceObj;
|
|
5
18
|
export interface TaonHttpDecoratorOptions {
|
|
6
19
|
/**
|
|
7
20
|
* @deprecated don't use in production - keep stuff encapsulated
|
|
@@ -17,7 +30,7 @@ export interface TaonHttpDecoratorOptions {
|
|
|
17
30
|
pathIsGlobal?: boolean;
|
|
18
31
|
overrideContentType?: CoreModels.ContentType;
|
|
19
32
|
overrideResponseType?: ModelsNg2Rest.ResponseTypeAxios;
|
|
20
|
-
middlewares?:
|
|
33
|
+
middlewares?: TaonMiddlewareFunction;
|
|
21
34
|
}
|
|
22
35
|
export declare function GET(pathOrOptions?: string | TaonHttpDecoratorOptions, pathIsGlobal?: boolean): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
|
|
23
36
|
export declare function HEAD(pathOrOptions?: string | TaonHttpDecoratorOptions, pathIsGlobal?: boolean): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
|
|
@@ -107,7 +107,6 @@ export declare class EndpointContext {
|
|
|
107
107
|
isActiveOn(classInstance: object): boolean;
|
|
108
108
|
get frontendHostUri(): URL;
|
|
109
109
|
get uri(): URL;
|
|
110
|
-
get uriPort(): string | undefined;
|
|
111
110
|
get uriProtocol(): string | undefined;
|
|
112
111
|
/**
|
|
113
112
|
* Examples
|
|
@@ -128,6 +127,7 @@ export declare class EndpointContext {
|
|
|
128
127
|
* https://localhost/path/to/ -> '/path/to/somewhere' # remove last slash
|
|
129
128
|
*/
|
|
130
129
|
get uriPathnameOrNothingIfRoot(): string;
|
|
130
|
+
get uriPort(): string | undefined;
|
|
131
131
|
/**
|
|
132
132
|
* Port from uri as number
|
|
133
133
|
* @returns {Number | undefined}
|
|
@@ -153,6 +153,8 @@ export declare class EndpointContext {
|
|
|
153
153
|
initEntities(): Promise<void>;
|
|
154
154
|
destroy(): Promise<void>;
|
|
155
155
|
initDatabaseConnection(): Promise<void>;
|
|
156
|
+
private updateCalculatedPathsForControllers;
|
|
157
|
+
private mergeControllerMethodsConfigs;
|
|
156
158
|
initControllers(): Promise<void>;
|
|
157
159
|
writeActiveRoutes(): void;
|
|
158
160
|
get middlewares(): Models.MiddlewareType[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import { ControllerConfig } from '../
|
|
2
|
+
import { ControllerConfig } from '../config/controller-config';
|
|
3
|
+
import { MethodConfig } from '../config/method-config';
|
|
3
4
|
export declare namespace ClassHelpers {
|
|
4
5
|
/**
|
|
5
6
|
* TODO - repalce in every place when getting class fn from object
|
|
@@ -12,11 +13,13 @@ export declare namespace ClassHelpers {
|
|
|
12
13
|
const isContextClassObject: (obj: any) => boolean;
|
|
13
14
|
const setName: (target: Function, className: string) => void;
|
|
14
15
|
const hasParentClassWithName: (target: Function, className: string, targets?: any[]) => boolean;
|
|
15
|
-
const getControllerConfig: (target: Function) => ControllerConfig | undefined;
|
|
16
16
|
/**
|
|
17
17
|
* Express async handler for middleware functions.
|
|
18
18
|
*/
|
|
19
19
|
const asyncHandler: (fn: any) => (req: any, res: any, next: any) => void;
|
|
20
20
|
const getMethodsNames: (classOrClassInstance: any, allMethodsNames?: any[]) => string[];
|
|
21
21
|
const getControllerConfigs: (target: Function, configs?: ControllerConfig[], callerTarget?: Function) => ControllerConfig[];
|
|
22
|
+
const ensureClassConfig: (target: Function) => Partial<ControllerConfig>;
|
|
23
|
+
const ensureMethodConfig: (target: any, propertyKey: string | symbol) => Partial<MethodConfig>;
|
|
24
|
+
const getClassConfig: (constructor: Function) => Partial<ControllerConfig> | undefined;
|
|
22
25
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import type { ControllerConfig } from '../
|
|
3
|
-
import {
|
|
2
|
+
import type { ControllerConfig } from '../config/controller-config';
|
|
3
|
+
import { MethodConfig } from '../config/method-config';
|
|
4
4
|
export declare namespace TaonHelpers {
|
|
5
5
|
const fillUpTo: (s: string, nCharacters: number) => string;
|
|
6
6
|
const isGoodPath: (p: string) => boolean;
|
|
7
7
|
const tryTransformParam: (param: any) => any;
|
|
8
|
-
const getExpressPath: (c: ControllerConfig, pathOrClassConfig:
|
|
8
|
+
const getExpressPath: (c: ControllerConfig, pathOrClassConfig: Partial<MethodConfig>) => string;
|
|
9
9
|
const defaultType: (value: any) => {};
|
|
10
10
|
const parseJSONwithStringJSONs: (object: Object, waring?: boolean) => Object;
|
|
11
11
|
const isPlainFileOrFolder: (filePath: any) => boolean;
|
|
12
|
-
const ipcKeyNameResponse: (target: Function, methodConfig:
|
|
13
|
-
const ipcKeyNameRequest: (target: Function, methodConfig:
|
|
12
|
+
const ipcKeyNameResponse: (target: Function, methodConfig: Partial<MethodConfig>, expressPath: string) => string;
|
|
13
|
+
const ipcKeyNameRequest: (target: Function, methodConfig: Partial<MethodConfig>, expressPath: string) => string;
|
|
14
14
|
const websqlMocks: (headers: any) => {
|
|
15
15
|
request: Express.Request;
|
|
16
16
|
response: Express.Response;
|
package/browser/lib/models.d.ts
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
import { Response as ExpressResponse, Request as ExpressRequest } from 'express';
|
|
3
3
|
import { Models as ModelsNg2Rest } from 'ng2-rest/browser';
|
|
4
4
|
import { CoreModels } from 'tnp-core/browser';
|
|
5
|
-
import type { BaseMiddleware } from './base-classes/base-middleware';
|
|
6
|
-
import type { TaonHttpDecoratorOptions } from './decorators/http/http-methods-decorators';
|
|
7
5
|
export declare namespace Models {
|
|
8
6
|
type FrameworkMode = 'backend-frontend(tcp+udp)' | 'remote-backend(tcp+udp)' | 'backend-frontend(ipc-electron)' | 'backend-frontend(websql-electron)' | 'backend-frontend(websql)';
|
|
9
7
|
enum ClassType {
|
|
@@ -212,35 +210,6 @@ export declare namespace Models {
|
|
|
212
210
|
*/
|
|
213
211
|
cwd?: string;
|
|
214
212
|
}
|
|
215
|
-
class ParamConfig {
|
|
216
|
-
paramName: string;
|
|
217
|
-
paramType: CoreModels.ParamType;
|
|
218
|
-
index: number;
|
|
219
|
-
defaultType: any;
|
|
220
|
-
expireInSeconds?: number;
|
|
221
|
-
}
|
|
222
|
-
/**
|
|
223
|
-
* @link './decorators/http/http-methods-decorators.ts' TaonHttpDecoratorOptions
|
|
224
|
-
*/
|
|
225
|
-
class MethodConfig implements Pick<TaonHttpDecoratorOptions, 'path' | 'middlewares'> {
|
|
226
|
-
methodName: string;
|
|
227
|
-
global?: boolean;
|
|
228
|
-
/**
|
|
229
|
-
* override default content type
|
|
230
|
-
*/
|
|
231
|
-
contentType?: any;
|
|
232
|
-
/**
|
|
233
|
-
* override default axiso response type
|
|
234
|
-
*/
|
|
235
|
-
responseType?: any;
|
|
236
|
-
path: string;
|
|
237
|
-
descriptor: PropertyDescriptor;
|
|
238
|
-
type: CoreModels.HttpMethod;
|
|
239
|
-
parameters: {
|
|
240
|
-
[paramName: string]: ParamConfig;
|
|
241
|
-
};
|
|
242
|
-
middlewares?: (typeof BaseMiddleware)[];
|
|
243
|
-
}
|
|
244
213
|
namespace Http {
|
|
245
214
|
export import Rest = ModelsNg2Rest;
|
|
246
215
|
type ContextENDPOINT = {
|
|
@@ -259,7 +228,7 @@ export declare namespace Models {
|
|
|
259
228
|
/**
|
|
260
229
|
* @deprecated use request() mehods instead
|
|
261
230
|
*/
|
|
262
|
-
received?: Rest.PromiseObservableMix<Rest.HttpResponse<T>>;
|
|
231
|
+
readonly received?: Rest.PromiseObservableMix<Rest.HttpResponse<T>>;
|
|
263
232
|
request?(axiosConfig?: ModelsNg2Rest.Ng2RestAxiosRequestConfig): Rest.PromiseObservableMix<Rest.HttpResponse<T>>;
|
|
264
233
|
}
|
|
265
234
|
interface AsyncResponse<T> {
|
package/browser/lib/symbols.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import {
|
|
2
|
+
import { MethodConfig } from './config/method-config';
|
|
3
3
|
export declare namespace Validators {
|
|
4
4
|
const classNameVlidation: (className: any, target: Function) => any;
|
|
5
|
-
const checkIfMethodsWithReponseTYpeAlowed: (methods:
|
|
5
|
+
const checkIfMethodsWithReponseTYpeAlowed: (methods: MethodConfig[], current: MethodConfig) => void;
|
|
6
6
|
const validateClassFunctions: (controllers: any[], entities: any[], proviers: any[], repositories: any[]) => void;
|
|
7
7
|
const preventUndefinedModel: (model: any, id: any) => void;
|
|
8
8
|
}
|
package/browser/package.json
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BaseClass = void 0;
|
|
4
|
-
//#region imports
|
|
5
|
-
const lib_1 = require("lodash-walk-object/lib");
|
|
6
|
-
const lib_2 = require("tnp-core/lib");
|
|
7
4
|
const class_helpers_1 = require("../helpers/class-helpers");
|
|
5
|
+
const clone_obj_1 = require("../helpers/clone-obj");
|
|
8
6
|
//#endregion
|
|
9
7
|
class BaseClass {
|
|
10
8
|
//#region class initialization hook
|
|
@@ -17,19 +15,7 @@ class BaseClass {
|
|
|
17
15
|
//#region clone
|
|
18
16
|
clone(override) {
|
|
19
17
|
const classFn = class_helpers_1.ClassHelpers.getClassFnFromObject(this);
|
|
20
|
-
|
|
21
|
-
lib_1.walk.Object(override || {}, (value, lodashPath) => {
|
|
22
|
-
if (lib_2._.isNil(value) || lib_2._.isFunction(value) || lib_2._.isObject(value)) {
|
|
23
|
-
// skipping
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
lib_2._.set(result, lodashPath, value);
|
|
27
|
-
}
|
|
28
|
-
}, {
|
|
29
|
-
walkGetters: false,
|
|
30
|
-
});
|
|
31
|
-
// console.log({result})
|
|
32
|
-
return result;
|
|
18
|
+
return (0, clone_obj_1.cloneObj)(override, classFn);
|
|
33
19
|
}
|
|
34
20
|
}
|
|
35
21
|
exports.BaseClass = BaseClass;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-class.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"base-class.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AAIA,4DAAwD;AACxD,oDAAgD;AAEhD,YAAY;AAEZ,MAAa,SAAS;IACpB,mCAAmC;IACnC;;;OAGG;IACH,KAAK,CAAC,CAAC,KAAmB,CAAC;IAC3B,YAAY;IAEZ,eAAe;IACR,KAAK,CAAC,QAA0B;QACrC,MAAM,OAAO,GAAG,4BAAY,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;QACxD,OAAO,IAAA,oBAAQ,EAAS,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC7C,CAAC;CAEF;AAfD,8BAeC"}
|
|
@@ -61,7 +61,10 @@ exports.BaseController = BaseController;
|
|
|
61
61
|
__decorate([
|
|
62
62
|
(0, http_methods_decorators_1.POST)({
|
|
63
63
|
overrideContentType: 'multipart/form-data',
|
|
64
|
-
middlewares:
|
|
64
|
+
middlewares: ({ parentMiddlewares }) => ({
|
|
65
|
+
...parentMiddlewares,
|
|
66
|
+
BaseFileUploadMiddleware: base_file_upload_middleware_1.BaseFileUploadMiddleware,
|
|
67
|
+
}),
|
|
65
68
|
}),
|
|
66
69
|
__param(0, (0, http_params_decorators_1.Body)())
|
|
67
70
|
], BaseController.prototype, "uploadFormDataToServer", null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-controller.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;;;;;;;;;;AAAA,sCAAsC,CAAC,WAAW;AAClD,sCAA4D,CAAC,WAAW;AAExE,qFAA4E;AAC5E,wFAAkE;AAClE,sFAA8E;AAG9E,+EAAyE;AACzE,mDAA+C;AAcxC,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,4BAAY;IAC9C,oCAAoC;
|
|
1
|
+
{"version":3,"file":"base-controller.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;;;;;;;;;;AAAA,sCAAsC,CAAC,WAAW;AAClD,sCAA4D,CAAC,WAAW;AAExE,qFAA4E;AAC5E,wFAAkE;AAClE,sFAA8E;AAG9E,+EAAyE;AACzE,mDAA+C;AAcxC,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,4BAAY;IAC9C,oCAAoC;IAQpC,sBAAsB,CACZ,QAAkB;QAE1B,sBAAsB;QACtB,OAAO,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;YACxB,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC;YACxB,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,MAAM,qBAAqB,CAAC;YAC9B,CAAC;YACD,OAAQ,KAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;gBAC9B,MAAM,QAAQ,GAAG,IAAA,uBAAiB,EAAC,UAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;gBACzD,MAAM,QAAQ,GAAG,IAAA,uBAAiB,EAChC,UAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CACtC,CAAC;gBACF,OAAO;oBACL,EAAE,EAAE,IAAI;oBACR,YAAY,EAAE,CAAC,CAAC,YAAY;oBAC5B,OAAO,EAAE,UAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;oBAChC,SAAS,EAAE,QAAQ;oBACnB,IAAI,EAAE,CAAC,CAAC,IAAI;oBACZ,QAAQ,EAAE,CAAC,CAAC,QAAQ;iBACrB,CAAC;YACJ,CAAC,CAAC,CAAC;QACL,CAAC,CAAC;QACF,YAAY;IACd,CAAC;IACD,YAAY;IAEZ,qCAAqC;IACrC,KAAK,CAAC,uBAAuB,CAC3B,WAAmB;QAEnB,sBAAsB;QACtB,MAAM,IAAI,GAAG,SAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QACvC,MAAM,MAAM,GAAG,SAAG,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;QAEjD,MAAM,IAAI,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC5B,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE;YAC1B,QAAQ,EAAE,UAAI,CAAC,QAAQ,CAAC,WAAW,CAAC;YACpC,WAAW,EAAE,IAAI,CAAC,IAAI;SACvB,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC;QAC9D,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;QACtB,YAAY;IACd,CAAC;CAEF,CAAA;AAxDY,wCAAc;AASzB;IAPC,IAAA,8BAAI,EAAC;QACJ,mBAAmB,EAAE,qBAAqB;QAC1C,WAAW,EAAE,CAAC,EAAE,iBAAiB,EAAE,EAAE,EAAE,CAAC,CAAC;YACvC,GAAG,iBAAiB;YACpB,wBAAwB,EAAxB,sDAAwB;SACzB,CAAC;KACH,CAAC;IAEC,WAAA,IAAA,6BAAI,GAAE,CAAA;4DAwBR;yBAlCU,cAAc;IAH1B,IAAA,qCAAc,EAAiB;QAC9B,SAAS,EAAE,gBAAgB;KAC5B,CAAC;GACW,cAAc,CAwD1B"}
|
|
@@ -21,6 +21,6 @@ exports.PROJECT_NPM_NAME = 'taon';
|
|
|
21
21
|
/**
|
|
22
22
|
* Autogenerated by current cli tool. Use *tnp release* to bump version.
|
|
23
23
|
*/
|
|
24
|
-
exports.CURRENT_PACKAGE_VERSION = '19.0.
|
|
24
|
+
exports.CURRENT_PACKAGE_VERSION = '19.0.56';
|
|
25
25
|
// THIS FILE IS GENERATED - DO NOT MODIFY
|
|
26
26
|
//# sourceMappingURL=build-info._auto-generated_.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TaonMiddlewareInheritanceObj } from '../decorators/http/http-methods-decorators';
|
|
2
|
+
import { TaonControllerOptions } from './controller-options';
|
|
3
|
+
import { MethodConfig } from './method-config';
|
|
4
|
+
export declare class ControllerConfig extends TaonControllerOptions {
|
|
5
|
+
methods: {
|
|
6
|
+
[methodName: string]: Partial<MethodConfig>;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Calculated path from parents controllers
|
|
10
|
+
*/
|
|
11
|
+
calculatedPath?: string;
|
|
12
|
+
/**
|
|
13
|
+
* a way to transform entity before sending to browser
|
|
14
|
+
*/
|
|
15
|
+
browserTransformFn?: (entity: any) => any;
|
|
16
|
+
/**
|
|
17
|
+
* Calculated middlewares object from parents controllers
|
|
18
|
+
*/
|
|
19
|
+
calculatedMiddlewaresControllerObj?: TaonMiddlewareInheritanceObj;
|
|
20
|
+
}
|
|
21
|
+
export declare const controllerConfigFrom: (partial: Partial<ControllerConfig>) => ControllerConfig;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.controllerConfigFrom = exports.ControllerConfig = void 0;
|
|
4
|
+
// import { cloneObj } from '../helpers/clone-obj';
|
|
5
|
+
const controller_options_1 = require("./controller-options");
|
|
6
|
+
// import { ParamConfig } from './param-config';
|
|
7
|
+
class ControllerConfig extends controller_options_1.TaonControllerOptions {
|
|
8
|
+
}
|
|
9
|
+
exports.ControllerConfig = ControllerConfig;
|
|
10
|
+
const controllerConfigFrom = (partial) => {
|
|
11
|
+
const newObj = partial || {};
|
|
12
|
+
newObj.methods = newObj.methods || {};
|
|
13
|
+
for (const methodName in newObj.methods) {
|
|
14
|
+
if (newObj.methods.hasOwnProperty(methodName)) {
|
|
15
|
+
// newObj.methods[methodName] = new MethodConfig().clone(
|
|
16
|
+
// newObj.methods[methodName],
|
|
17
|
+
// );
|
|
18
|
+
newObj.methods[methodName] = newObj.methods[methodName] || {};
|
|
19
|
+
const params = newObj.methods[methodName].parameters || {};
|
|
20
|
+
newObj.methods[methodName].parameters = params
|
|
21
|
+
? params
|
|
22
|
+
: {};
|
|
23
|
+
for (const paramName in params) {
|
|
24
|
+
if (params.hasOwnProperty(paramName)) {
|
|
25
|
+
params[paramName] = params[paramName] || {};
|
|
26
|
+
// params[paramName] = new ParamConfig().clone(params[paramName]);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return newObj;
|
|
32
|
+
};
|
|
33
|
+
exports.controllerConfigFrom = controllerConfigFrom;
|
|
34
|
+
//# sourceMappingURL=controller-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controller-config.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AAEA,mDAAmD;AAEnD,6DAA6D;AAE7D,gDAAgD;AAEhD,MAAa,gBAAiB,SAAQ,0CAAqB;CAmB1D;AAnBD,4CAmBC;AAEM,MAAM,oBAAoB,GAAG,CAClC,OAAkC,EAChB,EAAE;IACpB,MAAM,MAAM,GAAqB,OAAO,IAAK,EAAU,CAAC;IACxD,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC;IACtC,KAAK,MAAM,UAAU,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACxC,IAAI,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE,CAAC;YAC9C,yDAAyD;YACzD,gCAAgC;YAChC,KAAK;YAEL,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;YAE9D,MAAM,MAAM,GACT,MAAM,CAAC,OAAO,CAAC,UAAU,CAAkB,CAAC,UAAU,IAAI,EAAE,CAAC;YAC/D,MAAM,CAAC,OAAO,CAAC,UAAU,CAAkB,CAAC,UAAU,GAAG,MAAM;gBAC9D,CAAC,CAAC,MAAM;gBACR,CAAC,CAAC,EAAE,CAAC;YAEP,KAAK,MAAM,SAAS,IAAI,MAAM,EAAE,CAAC;gBAC/B,IAAI,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,CAAC;oBACrC,MAAM,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;oBAC5C,kEAAkE;gBACpE,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AA5BW,QAAA,oBAAoB,wBA4B/B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { DecoratorAbstractOpt } from '../decorator-abstract-opt';
|
|
1
|
+
import { DecoratorAbstractOpt } from '../decorators/decorator-abstract-opt';
|
|
2
|
+
import type { TaonMiddlewareFunction } from '../decorators/http/http-methods-decorators';
|
|
2
3
|
export declare class TaonControllerOptions<ControllerClass = any> extends DecoratorAbstractOpt {
|
|
3
4
|
/**
|
|
4
5
|
* typeorm realtime subscribtion // TODO disabled for now, does not make sense ?s
|
|
@@ -8,4 +9,8 @@ export declare class TaonControllerOptions<ControllerClass = any> extends Decora
|
|
|
8
9
|
* override default path for controller api
|
|
9
10
|
*/
|
|
10
11
|
path?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Middlewares to be applied to all methods in the controller
|
|
14
|
+
*/
|
|
15
|
+
middlewares?: TaonMiddlewareFunction;
|
|
11
16
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TaonControllerOptions = void 0;
|
|
4
|
+
const decorator_abstract_opt_1 = require("../decorators/decorator-abstract-opt");
|
|
5
|
+
class TaonControllerOptions extends decorator_abstract_opt_1.DecoratorAbstractOpt {
|
|
6
|
+
}
|
|
7
|
+
exports.TaonControllerOptions = TaonControllerOptions;
|
|
8
|
+
//# sourceMappingURL=controller-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controller-options.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AAAA,iFAA4E;AAG5E,MAAa,qBAEX,SAAQ,6CAAoB;CAa7B;AAfD,sDAeC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CoreModels } from 'tnp-core';
|
|
2
|
+
import type { BaseMiddleware } from '../base-classes/base-middleware';
|
|
3
|
+
import type { TaonHttpDecoratorOptions, TaonMiddlewareFunction, TaonMiddlewareInheritanceObj } from '../decorators/http/http-methods-decorators';
|
|
4
|
+
import { ParamConfig } from './param-config';
|
|
5
|
+
/**
|
|
6
|
+
* @link './decorators/http/http-methods-decorators.ts' TaonHttpDecoratorOptions
|
|
7
|
+
*/
|
|
8
|
+
export declare class MethodConfig implements Pick<TaonHttpDecoratorOptions, 'path' | 'middlewares'> {
|
|
9
|
+
methodName: string;
|
|
10
|
+
global?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* override default content type
|
|
13
|
+
*/
|
|
14
|
+
contentType?: any;
|
|
15
|
+
/**
|
|
16
|
+
* override default axiso response type
|
|
17
|
+
*/
|
|
18
|
+
responseType?: any;
|
|
19
|
+
path: string;
|
|
20
|
+
descriptor: PropertyDescriptor;
|
|
21
|
+
type: CoreModels.HttpMethod;
|
|
22
|
+
parameters: {
|
|
23
|
+
[paramName: string]: Partial<ParamConfig>;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Middlewares from controller method options
|
|
27
|
+
*/
|
|
28
|
+
middlewares?: TaonMiddlewareFunction;
|
|
29
|
+
/**
|
|
30
|
+
* Calculated middlewares object from parents controllers
|
|
31
|
+
*/
|
|
32
|
+
calculatedMiddlewaresMethodObj?: TaonMiddlewareInheritanceObj;
|
|
33
|
+
/**
|
|
34
|
+
* Middlewares array in proper order and ready to be used in
|
|
35
|
+
* express or in axios interceptors.
|
|
36
|
+
*/
|
|
37
|
+
calculatedMiddlewares: (typeof BaseMiddleware)[];
|
|
38
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
//#region models / method config
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.MethodConfig = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* @link './decorators/http/http-methods-decorators.ts' TaonHttpDecoratorOptions
|
|
7
|
+
*/
|
|
8
|
+
class MethodConfig {
|
|
9
|
+
}
|
|
10
|
+
exports.MethodConfig = MethodConfig;
|
|
11
|
+
//#endregion
|
|
12
|
+
//# sourceMappingURL=method-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"method-config.js","sourceRoot":"","sources":[""],"names":[],"mappings":";AAAA,gCAAgC;;;AAahC;;GAEG;AACH,MAAa,YAAY;CAoCxB;AApCD,oCAoCC;AACD,YAAY"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ParamConfig = void 0;
|
|
4
|
+
// import { cloneObj } from '../helpers/clone-obj';
|
|
5
|
+
class ParamConfig {
|
|
6
|
+
}
|
|
7
|
+
exports.ParamConfig = ParamConfig;
|
|
8
|
+
//# sourceMappingURL=param-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"param-config.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AAEA,mDAAmD;AAEnD,MAAa,WAAW;CAWvB;AAXD,kCAWC"}
|
|
@@ -9,8 +9,13 @@ const symbols_1 = require("../../symbols");
|
|
|
9
9
|
function TaonController(options) {
|
|
10
10
|
return function (constructor) {
|
|
11
11
|
class_helpers_1.ClassHelpers.setName(constructor, options?.className);
|
|
12
|
-
Reflect.defineMetadata(symbols_1.Symbols.metadata.options.controller, options, constructor);
|
|
13
12
|
Reflect.defineMetadata(symbols_1.Symbols.metadata.className, options?.className || constructor.name, constructor);
|
|
13
|
+
const cfg = class_helpers_1.ClassHelpers.ensureClassConfig(constructor);
|
|
14
|
+
options = options || {};
|
|
15
|
+
cfg.className = options.className || constructor.name;
|
|
16
|
+
cfg.path = options.path || '';
|
|
17
|
+
cfg.realtime = options.realtime;
|
|
18
|
+
cfg.middlewares = options.middlewares;
|
|
14
19
|
};
|
|
15
20
|
}
|
|
16
21
|
//# sourceMappingURL=controller-decorator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controller-decorator.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"controller-decorator.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;AAOA,wCAiBC;AAvBD,+DAA2D;AAC3D,2CAAwC;AAExC;;GAEG;AACH,SAAgB,cAAc,CAC5B,OAAgD;IAEhD,OAAO,UAAU,WAAqB;QACpC,4BAAY,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;QACtD,OAAO,CAAC,cAAc,CACpB,iBAAO,CAAC,QAAQ,CAAC,SAAS,EAC1B,OAAO,EAAE,SAAS,IAAI,WAAW,CAAC,IAAI,EACtC,WAAW,CACZ,CAAC;QACF,MAAM,GAAG,GAAG,4BAAY,CAAC,iBAAiB,CAAC,WAAW,CAAC,CAAC;QACxD,OAAO,GAAG,OAAO,IAAK,EAAU,CAAC;QACjC,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,WAAW,CAAC,IAAI,CAAC;QACtD,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,EAAE,CAAC;QAC9B,GAAG,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QAChC,GAAG,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IACxC,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware-decorator.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AAOA,
|
|
1
|
+
{"version":3,"file":"middleware-decorator.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AAOA,wCAgBC;AAvBD,+DAA2D;AAC3D,2CAAwC;AACxC,sEAAiE;AAEjE;;GAEG;AACH,SAAgB,cAAc,CAC5B,OAAkC;IAElC,OAAO,UAAU,WAAqB;QACpC,OAAO,CAAC,cAAc,CACpB,iBAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EACjC,OAAO,EACP,WAAW,CACZ,CAAC;QACF,OAAO,CAAC,cAAc,CACpB,iBAAO,CAAC,QAAQ,CAAC,SAAS,EAC1B,OAAO,EAAE,SAAS,IAAI,WAAW,CAAC,IAAI,EACtC,WAAW,CACZ,CAAC;QACF,4BAAY,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,EAAE,SAAS,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;IAC5E,CAAC,CAAC;AACJ,CAAC;AAED,MAAa,qBAA+B,SAAQ,6CAAoB;CAEvE;AAFD,sDAEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-decorator.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AAOA,
|
|
1
|
+
{"version":3,"file":"provider-decorator.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AAOA,oCAgBC;AAvBD,+DAA2D;AAC3D,2CAAwC;AACxC,sEAAiE;AAEjE;;GAEG;AACH,SAAgB,YAAY,CAC1B,OAAgC;IAEhC,OAAO,UAAU,WAAqB;QACpC,OAAO,CAAC,cAAc,CACpB,iBAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EACjC,OAAO,EACP,WAAW,CACZ,CAAC;QACF,OAAO,CAAC,cAAc,CACpB,iBAAO,CAAC,QAAQ,CAAC,SAAS,EAC1B,OAAO,EAAE,SAAS,IAAI,WAAW,CAAC,IAAI,EACtC,WAAW,CACZ,CAAC;QACF,4BAAY,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,EAAE,SAAS,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC;IAC5E,CAAC,CAAC;AACJ,CAAC;AAED,MAAa,mBAA6B,SAAQ,6CAAoB;CAErE;AAFD,kDAEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorator-abstract-opt.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"decorator-abstract-opt.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AACA,MAAa,oBAAoB;CAEhC;AAFD,oDAEC"}
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import { Models as ModelsNg2Rest } from 'ng2-rest';
|
|
2
2
|
import { CoreModels } from 'tnp-core';
|
|
3
3
|
import { BaseMiddleware } from '../../base-classes/base-middleware';
|
|
4
|
+
export type TaonMiddlewareInheritanceObj = {
|
|
5
|
+
[parentMiddlewaresName: string]: typeof BaseMiddleware;
|
|
6
|
+
};
|
|
7
|
+
export type TaonMiddlewareFunction = (options: {
|
|
8
|
+
/**
|
|
9
|
+
* middlewares inherited from parent class
|
|
10
|
+
*/
|
|
11
|
+
parentMiddlewares: TaonMiddlewareInheritanceObj;
|
|
12
|
+
/**
|
|
13
|
+
* Get real class name - needed when code is minified
|
|
14
|
+
*/
|
|
15
|
+
className: (middlewareClass: Function) => string;
|
|
16
|
+
}) => TaonMiddlewareInheritanceObj;
|
|
4
17
|
export interface TaonHttpDecoratorOptions {
|
|
5
18
|
/**
|
|
6
19
|
* @deprecated don't use in production - keep stuff encapsulated
|
|
@@ -16,7 +29,7 @@ export interface TaonHttpDecoratorOptions {
|
|
|
16
29
|
pathIsGlobal?: boolean;
|
|
17
30
|
overrideContentType?: CoreModels.ContentType;
|
|
18
31
|
overrideResponseType?: ModelsNg2Rest.ResponseTypeAxios;
|
|
19
|
-
middlewares?:
|
|
32
|
+
middlewares?: TaonMiddlewareFunction;
|
|
20
33
|
}
|
|
21
34
|
export declare function GET(pathOrOptions?: string | TaonHttpDecoratorOptions, pathIsGlobal?: boolean): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
|
|
22
35
|
export declare function HEAD(pathOrOptions?: string | TaonHttpDecoratorOptions, pathIsGlobal?: boolean): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
|