taon 19.0.67 → 19.0.68
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/browser/fesm2022/taon.mjs +33 -21
- package/browser/fesm2022/taon.mjs.map +1 -1
- package/browser/lib/base-classes/base-middleware.d.ts +2 -2
- package/browser/lib/endpoint-context.d.ts +7 -4
- package/browser/lib/index.d.ts +1 -1
- package/browser/package.json +1 -1
- package/lib/base-classes/base-middleware.d.ts +2 -2
- package/lib/base-classes/base-middleware.js +1 -0
- package/lib/base-classes/base-middleware.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/decorators/classes/controller-config.d.ts +20 -0
- package/lib/decorators/classes/controller-config.js +21 -0
- package/lib/decorators/classes/controller-config.js.map +1 -0
- package/lib/decorators/classes/controller-options.d.ts +16 -0
- package/lib/decorators/classes/controller-options.js +20 -0
- package/lib/decorators/classes/controller-options.js.map +1 -0
- package/lib/endpoint-context.d.ts +7 -4
- package/lib/endpoint-context.js +26 -19
- package/lib/endpoint-context.js.map +1 -1
- package/lib/env/env.angular-node-app.d.ts +1 -2
- package/lib/env/env.angular-node-app.js +3 -4
- package/lib/env/env.angular-node-app.js.map +1 -1
- package/lib/env/env.docs-webapp.d.ts +1 -2
- package/lib/env/env.docs-webapp.js +3 -4
- package/lib/env/env.docs-webapp.js.map +1 -1
- package/lib/env/env.electron-app.d.ts +1 -2
- package/lib/env/env.electron-app.js +3 -4
- package/lib/env/env.electron-app.js.map +1 -1
- package/lib/env/env.mobile-app.d.ts +1 -2
- package/lib/env/env.mobile-app.js +3 -4
- package/lib/env/env.mobile-app.js.map +1 -1
- package/lib/env/env.npm-lib-and-cli-tool.d.ts +1 -2
- package/lib/env/env.npm-lib-and-cli-tool.js +3 -4
- package/lib/env/env.npm-lib-and-cli-tool.js.map +1 -1
- package/lib/env/env.vscode-plugin.d.ts +1 -2
- package/lib/env/env.vscode-plugin.js +3 -4
- package/lib/env/env.vscode-plugin.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +5 -0
- package/lib/index.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/fesm2022/taon.mjs +33 -21
- package/websql/fesm2022/taon.mjs.map +1 -1
- package/websql/lib/base-classes/base-middleware.d.ts +2 -2
- package/websql/lib/endpoint-context.d.ts +7 -4
- package/websql/lib/index.d.ts +1 -1
- package/websql/package.json +1 -1
|
@@ -30,10 +30,10 @@ export interface BaseMiddleware {
|
|
|
30
30
|
/**
|
|
31
31
|
* Specyfic controller method interceptor
|
|
32
32
|
*/
|
|
33
|
-
interceptServerMethod({ req, res, next }: TaonServerMiddlewareInterceptOptions, { methodName, expressPath, httpRequestType }: TaonAdditionalMiddlewareMethodInfo): Promise<void> | void;
|
|
33
|
+
interceptServerMethod({ req, res, next }: TaonServerMiddlewareInterceptOptions, { methodName, expressPath, httpRequestType, }: TaonAdditionalMiddlewareMethodInfo): Promise<void> | void;
|
|
34
34
|
/**
|
|
35
35
|
* Controller method frontned interceptor
|
|
36
36
|
* TODO not needed ?
|
|
37
37
|
*/
|
|
38
|
-
interceptClientMethod({ req, next }: TaonClientMiddlewareInterceptOptions, { methodName, expressPath, httpRequestType }: TaonAdditionalMiddlewareMethodInfo): Observable<AxiosResponse<any>>;
|
|
38
|
+
interceptClientMethod({ req, next }: TaonClientMiddlewareInterceptOptions, { methodName, expressPath, httpRequestType, }: TaonAdditionalMiddlewareMethodInfo): Observable<AxiosResponse<any>>;
|
|
39
39
|
}
|
|
@@ -18,12 +18,12 @@ export declare class EndpointContext {
|
|
|
18
18
|
* -> ONLY remote access from backend or frontend to specific backend
|
|
19
19
|
*/
|
|
20
20
|
private readonly cloneOptions;
|
|
21
|
+
private static ngZone;
|
|
22
|
+
static initNgZone(ngZone: NgZone): void;
|
|
21
23
|
/**
|
|
22
24
|
* JUST FOR TESTING PURPOSES
|
|
23
25
|
*/
|
|
24
26
|
readonly USE_MARIADB_MYSQL_IN_DOCKER: boolean;
|
|
25
|
-
private static ngZone;
|
|
26
|
-
static initNgZone(ngZone: NgZone): void;
|
|
27
27
|
disabledRealtime: boolean;
|
|
28
28
|
/**
|
|
29
29
|
* check whether context is inited
|
|
@@ -150,6 +150,9 @@ export declare class EndpointContext {
|
|
|
150
150
|
*/
|
|
151
151
|
get port(): Number | undefined;
|
|
152
152
|
get isHttpServer(): boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Check if context is for remote only
|
|
155
|
+
*/
|
|
153
156
|
get isRemoteHost(): boolean;
|
|
154
157
|
/**
|
|
155
158
|
* ipc/udp needs this
|
|
@@ -171,8 +174,8 @@ export declare class EndpointContext {
|
|
|
171
174
|
locationOnDisk: string;
|
|
172
175
|
}[];
|
|
173
176
|
get isProductionMode(): boolean;
|
|
174
|
-
get host(): string;
|
|
175
|
-
get
|
|
177
|
+
get host(): string | undefined;
|
|
178
|
+
get origin(): string | undefined;
|
|
176
179
|
initSubscribers(): Promise<any>;
|
|
177
180
|
initEntities(): Promise<void>;
|
|
178
181
|
destroy(): Promise<void>;
|
package/browser/lib/index.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export { ContextsEndpointStorage } from './endpoint-context-storage';
|
|
|
36
36
|
export { ClassHelpers } from './helpers/class-helpers';
|
|
37
37
|
export type { TaonClientMiddlewareInterceptOptions, TaonServerMiddlewareInterceptOptions, } from 'ng2-rest/browser';
|
|
38
38
|
export declare namespace Taon {
|
|
39
|
-
const error: (opt: Pick<RestErrorResponseWrapper, "message" | "status" | "details" | "code">) => void;
|
|
39
|
+
const error: (opt: Pick<RestErrorResponseWrapper, "message" | "status" | "details" | "code"> | string) => void;
|
|
40
40
|
type ResponseHtml = models.Models.Http.Response<string>;
|
|
41
41
|
export import Response = models.Models.Http.Response;
|
|
42
42
|
export import Http = http.Http;
|
package/browser/package.json
CHANGED
|
@@ -29,10 +29,10 @@ export interface BaseMiddleware {
|
|
|
29
29
|
/**
|
|
30
30
|
* Specyfic controller method interceptor
|
|
31
31
|
*/
|
|
32
|
-
interceptServerMethod({ req, res, next }: TaonServerMiddlewareInterceptOptions, { methodName, expressPath, httpRequestType }: TaonAdditionalMiddlewareMethodInfo): Promise<void> | void;
|
|
32
|
+
interceptServerMethod({ req, res, next }: TaonServerMiddlewareInterceptOptions, { methodName, expressPath, httpRequestType, }: TaonAdditionalMiddlewareMethodInfo): Promise<void> | void;
|
|
33
33
|
/**
|
|
34
34
|
* Controller method frontned interceptor
|
|
35
35
|
* TODO not needed ?
|
|
36
36
|
*/
|
|
37
|
-
interceptClientMethod({ req, next }: TaonClientMiddlewareInterceptOptions, { methodName, expressPath, httpRequestType }: TaonAdditionalMiddlewareMethodInfo): Observable<AxiosResponse<any>>;
|
|
37
|
+
interceptClientMethod({ req, next }: TaonClientMiddlewareInterceptOptions, { methodName, expressPath, httpRequestType, }: TaonAdditionalMiddlewareMethodInfo): Observable<AxiosResponse<any>>;
|
|
38
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-middleware.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"base-middleware.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AAUA,mDAA+C;AAC/C,YAAY;AAEZ;;;;GAIG;AACH,MAAsB,cAAe,SAAQ,4BAAY;CAAG;AAA5D,wCAA4D"}
|
|
@@ -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.68';
|
|
25
25
|
// THIS FILE IS GENERATED - DO NOT MODIFY
|
|
26
26
|
//# sourceMappingURL=build-info._auto-generated_.js.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Models } from '../../models';
|
|
2
|
+
import { TaonMiddlewareInheritanceObj } from '../http/http-methods-decorators';
|
|
3
|
+
import { TaonControllerOptions } from './controller-options';
|
|
4
|
+
export declare class ControllerConfig extends TaonControllerOptions {
|
|
5
|
+
methods: {
|
|
6
|
+
[methodName: string]: Models.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
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ControllerConfig = void 0;
|
|
4
|
+
const controller_options_1 = require("./controller-options");
|
|
5
|
+
class ControllerConfig extends controller_options_1.TaonControllerOptions {
|
|
6
|
+
methods = {};
|
|
7
|
+
/**
|
|
8
|
+
* Calculated path from parents controllers
|
|
9
|
+
*/
|
|
10
|
+
calculatedPath;
|
|
11
|
+
/**
|
|
12
|
+
* a way to transform entity before sending to browser
|
|
13
|
+
*/
|
|
14
|
+
browserTransformFn;
|
|
15
|
+
/**
|
|
16
|
+
* Calculated middlewares object from parents controllers
|
|
17
|
+
*/
|
|
18
|
+
calculatedMiddlewaresControllerObj;
|
|
19
|
+
}
|
|
20
|
+
exports.ControllerConfig = ControllerConfig;
|
|
21
|
+
//# sourceMappingURL=controller-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controller-config.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AAIA,6DAA6D;AAE7D,MAAa,gBAAiB,SAAQ,0CAAqB;IACzD,OAAO,GAAkD,EAAE,CAAC;IAC5D;;OAEG;IACH,cAAc,CAAU;IACxB;;OAEG;IACH,kBAAkB,CAAwB;IAC1C;;OAEG;IACH,kCAAkC,CAAgC;CACnE;AAdD,4CAcC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DecoratorAbstractOpt } from '../decorator-abstract-opt';
|
|
2
|
+
import type { TaonMiddlewareFunction } from '../http/http-methods-decorators';
|
|
3
|
+
export declare class TaonControllerOptions<ControllerClass = any> extends DecoratorAbstractOpt {
|
|
4
|
+
/**
|
|
5
|
+
* typeorm realtime subscribtion // TODO disabled for now, does not make sense ?s
|
|
6
|
+
*/
|
|
7
|
+
realtime?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* override default path for controller api
|
|
10
|
+
*/
|
|
11
|
+
path?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Middlewares to be applied to all methods in the controller
|
|
14
|
+
*/
|
|
15
|
+
middlewares?: TaonMiddlewareFunction;
|
|
16
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TaonControllerOptions = void 0;
|
|
4
|
+
const decorator_abstract_opt_1 = require("../decorator-abstract-opt");
|
|
5
|
+
class TaonControllerOptions extends decorator_abstract_opt_1.DecoratorAbstractOpt {
|
|
6
|
+
/**
|
|
7
|
+
* typeorm realtime subscribtion // TODO disabled for now, does not make sense ?s
|
|
8
|
+
*/
|
|
9
|
+
realtime;
|
|
10
|
+
/**
|
|
11
|
+
* override default path for controller api
|
|
12
|
+
*/
|
|
13
|
+
path;
|
|
14
|
+
/**
|
|
15
|
+
* Middlewares to be applied to all methods in the controller
|
|
16
|
+
*/
|
|
17
|
+
middlewares;
|
|
18
|
+
}
|
|
19
|
+
exports.TaonControllerOptions = TaonControllerOptions;
|
|
20
|
+
//# sourceMappingURL=controller-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controller-options.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AAAA,sEAAiE;AAGjE,MAAa,qBAEX,SAAQ,6CAAoB;IAC5B;;OAEG;IACH,QAAQ,CAAW;IACnB;;OAEG;IACH,IAAI,CAAU;IACd;;OAEG;IACH,WAAW,CAA0B;CACtC;AAfD,sDAeC"}
|
|
@@ -19,12 +19,12 @@ export declare class EndpointContext {
|
|
|
19
19
|
* -> ONLY remote access from backend or frontend to specific backend
|
|
20
20
|
*/
|
|
21
21
|
private readonly cloneOptions;
|
|
22
|
+
private static ngZone;
|
|
23
|
+
static initNgZone(ngZone: NgZone): void;
|
|
22
24
|
/**
|
|
23
25
|
* JUST FOR TESTING PURPOSES
|
|
24
26
|
*/
|
|
25
27
|
readonly USE_MARIADB_MYSQL_IN_DOCKER: boolean;
|
|
26
|
-
private static ngZone;
|
|
27
|
-
static initNgZone(ngZone: NgZone): void;
|
|
28
28
|
disabledRealtime: boolean;
|
|
29
29
|
/**
|
|
30
30
|
* check whether context is inited
|
|
@@ -152,6 +152,9 @@ export declare class EndpointContext {
|
|
|
152
152
|
*/
|
|
153
153
|
get port(): Number | undefined;
|
|
154
154
|
get isHttpServer(): boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Check if context is for remote only
|
|
157
|
+
*/
|
|
155
158
|
get isRemoteHost(): boolean;
|
|
156
159
|
/**
|
|
157
160
|
* ipc/udp needs this
|
|
@@ -173,8 +176,8 @@ export declare class EndpointContext {
|
|
|
173
176
|
locationOnDisk: string;
|
|
174
177
|
}[];
|
|
175
178
|
get isProductionMode(): boolean;
|
|
176
|
-
get host(): string;
|
|
177
|
-
get
|
|
179
|
+
get host(): string | undefined;
|
|
180
|
+
get origin(): string | undefined;
|
|
178
181
|
initSubscribers(): Promise<void>;
|
|
179
182
|
initEntities(): Promise<void>;
|
|
180
183
|
destroy(): Promise<void>;
|
package/lib/endpoint-context.js
CHANGED
|
@@ -44,10 +44,6 @@ class EndpointContext {
|
|
|
44
44
|
configFn;
|
|
45
45
|
cloneOptions;
|
|
46
46
|
//#region static
|
|
47
|
-
/**
|
|
48
|
-
* JUST FOR TESTING PURPOSES
|
|
49
|
-
*/
|
|
50
|
-
USE_MARIADB_MYSQL_IN_DOCKER = false;
|
|
51
47
|
/* */
|
|
52
48
|
/* */
|
|
53
49
|
/* */
|
|
@@ -56,15 +52,14 @@ class EndpointContext {
|
|
|
56
52
|
/* */
|
|
57
53
|
/* */
|
|
58
54
|
/* */
|
|
59
|
-
// public static findForTraget(classFnOrObject: any): EndpointContext {
|
|
60
|
-
// const obj = ClassHelpers.getClassFnFromObject(classFnOrObject) || {};
|
|
61
|
-
// return (
|
|
62
|
-
// classFnOrObject[Symbols.ctxInClassOrClassObj] ||
|
|
63
|
-
// obj[Symbols.ctxInClassOrClassObj]
|
|
64
|
-
// );
|
|
65
|
-
// }
|
|
66
55
|
//#endregion
|
|
67
56
|
//#region fields
|
|
57
|
+
//#region fields / use mariadb mysql in docker
|
|
58
|
+
/**
|
|
59
|
+
* JUST FOR TESTING PURPOSES
|
|
60
|
+
*/
|
|
61
|
+
USE_MARIADB_MYSQL_IN_DOCKER = false;
|
|
62
|
+
//#endregion
|
|
68
63
|
//#region fields / flags
|
|
69
64
|
disabledRealtime = false;
|
|
70
65
|
/**
|
|
@@ -73,8 +68,12 @@ class EndpointContext {
|
|
|
73
68
|
*/
|
|
74
69
|
inited = false;
|
|
75
70
|
//#endregion
|
|
71
|
+
//#region fields / db migrations
|
|
76
72
|
dbMigrations = new context_db_migrations_1.ContextDbMigrations(this);
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region fields / local instance obj symbol
|
|
77
75
|
localInstaceObjSymbol = Symbol('localInstaceObjSymbol');
|
|
76
|
+
//#endregion
|
|
78
77
|
//#region fields / all instances of classes from context
|
|
79
78
|
/**
|
|
80
79
|
* all instances of classes from context
|
|
@@ -101,7 +100,9 @@ class EndpointContext {
|
|
|
101
100
|
return this.cloneOptions?.sourceContext;
|
|
102
101
|
}
|
|
103
102
|
//#endregion
|
|
103
|
+
//#region fields / skip writing server routes
|
|
104
104
|
skipWritingServerRoutes = false;
|
|
105
|
+
//#endregion
|
|
105
106
|
//#region fields / types from contexts
|
|
106
107
|
injectableTypesfromContexts = [
|
|
107
108
|
models_1.Models.ClassType.CONTROLLER,
|
|
@@ -112,11 +113,12 @@ class EndpointContext {
|
|
|
112
113
|
models_1.Models.ClassType.MIGRATION,
|
|
113
114
|
];
|
|
114
115
|
//#endregion
|
|
116
|
+
//#region fields / all types from contexts
|
|
115
117
|
allTypesfromContexts = [
|
|
116
118
|
...this.injectableTypesfromContexts,
|
|
117
119
|
models_1.Models.ClassType.ENTITY,
|
|
118
120
|
];
|
|
119
|
-
|
|
121
|
+
//#endregion
|
|
120
122
|
//#region fields / express app
|
|
121
123
|
expressApp = {};
|
|
122
124
|
//#endregion
|
|
@@ -1100,7 +1102,7 @@ class EndpointContext {
|
|
|
1100
1102
|
return isNonRootProperPathName ? this.uri.pathname.replace(/\/$/, '') : '';
|
|
1101
1103
|
}
|
|
1102
1104
|
//#endregion
|
|
1103
|
-
//#region port from uri
|
|
1105
|
+
//#region methods & getters / port from uri
|
|
1104
1106
|
get uriPort() {
|
|
1105
1107
|
if (!this.uri?.origin?.includes('localhost')) {
|
|
1106
1108
|
return this.config?.hostPortNumber?.toString();
|
|
@@ -1121,12 +1123,15 @@ class EndpointContext {
|
|
|
1121
1123
|
return this.uriProtocol === 'https:';
|
|
1122
1124
|
}
|
|
1123
1125
|
//#endregion
|
|
1124
|
-
//#region methods & getters /
|
|
1126
|
+
//#region methods & getters / is remote host
|
|
1127
|
+
/**
|
|
1128
|
+
* Check if context is for remote only
|
|
1129
|
+
*/
|
|
1125
1130
|
get isRemoteHost() {
|
|
1126
1131
|
return !!this.cloneOptions?.useAsRemoteContext;
|
|
1127
1132
|
}
|
|
1128
1133
|
//#endregion
|
|
1129
|
-
//#region methods & getters /
|
|
1134
|
+
//#region methods & getters / context name
|
|
1130
1135
|
/**
|
|
1131
1136
|
* ipc/udp needs this
|
|
1132
1137
|
*/
|
|
@@ -1135,7 +1140,7 @@ class EndpointContext {
|
|
|
1135
1140
|
return this.config?.contextName || this.originalConfig?.contextName;
|
|
1136
1141
|
}
|
|
1137
1142
|
//#endregion
|
|
1138
|
-
//#region methods & getters /
|
|
1143
|
+
//#region methods & getters / context name for communication
|
|
1139
1144
|
/**
|
|
1140
1145
|
* ipc/udp needs this
|
|
1141
1146
|
*/
|
|
@@ -1154,7 +1159,7 @@ class EndpointContext {
|
|
|
1154
1159
|
return contextName;
|
|
1155
1160
|
}
|
|
1156
1161
|
//#endregion
|
|
1157
|
-
//#region methods & getters /
|
|
1162
|
+
//#region methods & getters / get context type
|
|
1158
1163
|
/**
|
|
1159
1164
|
* Check context type
|
|
1160
1165
|
*/
|
|
@@ -1198,8 +1203,8 @@ class EndpointContext {
|
|
|
1198
1203
|
return this.config.host;
|
|
1199
1204
|
}
|
|
1200
1205
|
//#endregion
|
|
1201
|
-
//#region methods & getters /
|
|
1202
|
-
get
|
|
1206
|
+
//#region methods & getters / origin
|
|
1207
|
+
get origin() {
|
|
1203
1208
|
return this.uri?.origin;
|
|
1204
1209
|
}
|
|
1205
1210
|
//#endregion
|
|
@@ -1971,6 +1976,7 @@ class EndpointContext {
|
|
|
1971
1976
|
};
|
|
1972
1977
|
}
|
|
1973
1978
|
//#endregion
|
|
1979
|
+
//#region methods & getters / send error
|
|
1974
1980
|
sendError(res, error, req, expressPath) {
|
|
1975
1981
|
//#region @backendFunc
|
|
1976
1982
|
let status = 500;
|
|
@@ -2006,6 +2012,7 @@ class EndpointContext {
|
|
|
2006
2012
|
});
|
|
2007
2013
|
//#endregion
|
|
2008
2014
|
}
|
|
2015
|
+
//#endregion
|
|
2009
2016
|
//#region methods & getters / init client
|
|
2010
2017
|
/**
|
|
2011
2018
|
* client can be browser or nodejs (when remote host)
|