taon 19.0.56 → 19.0.58
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 +31 -46
- package/browser/fesm2022/taon.mjs.map +1 -1
- package/browser/lib/base-classes/base-angular-service.d.ts +16 -0
- package/browser/lib/base-classes/base-context.d.ts +0 -9
- package/browser/lib/base-classes/base-controller.d.ts +1 -1
- package/browser/lib/base-classes/base-file-upload.middleware.d.ts +2 -2
- package/browser/lib/base-classes/base-middleware.d.ts +3 -3
- package/browser/lib/base-classes/base.d.ts +0 -9
- package/browser/lib/constants.d.ts +2 -1
- package/browser/lib/create-context.d.ts +2 -20
- package/browser/lib/index.d.ts +1 -28
- package/browser/package.json +1 -1
- package/lib/base-classes/base-angular-service.d.ts +16 -0
- package/lib/base-classes/base-angular-service.js +32 -0
- package/lib/base-classes/base-angular-service.js.map +1 -1
- package/lib/base-classes/base-context.d.ts +0 -9
- package/lib/base-classes/base-controller.d.ts +1 -1
- package/lib/base-classes/base-controller.js.map +1 -1
- package/lib/base-classes/base-file-upload.middleware.d.ts +2 -2
- package/lib/base-classes/base-file-upload.middleware.js.map +1 -1
- package/lib/base-classes/base-middleware.d.ts +3 -3
- package/lib/base-classes/base.d.ts +0 -9
- package/lib/build-info._auto-generated_.d.ts +1 -1
- package/lib/build-info._auto-generated_.js +1 -1
- package/lib/constants.d.ts +2 -1
- package/lib/constants.js +6 -1
- package/lib/constants.js.map +1 -1
- package/lib/create-context.d.ts +2 -20
- package/lib/create-context.js +1 -44
- package/lib/create-context.js.map +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/index.d.ts +1 -28
- 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 +31 -46
- package/websql/fesm2022/taon.mjs.map +1 -1
- package/websql/lib/base-classes/base-angular-service.d.ts +16 -0
- package/websql/lib/base-classes/base-context.d.ts +0 -9
- package/websql/lib/base-classes/base-controller.d.ts +1 -1
- package/websql/lib/base-classes/base-file-upload.middleware.d.ts +2 -2
- package/websql/lib/base-classes/base-middleware.d.ts +3 -3
- package/websql/lib/base-classes/base.d.ts +0 -9
- package/websql/lib/constants.d.ts +2 -1
- package/websql/lib/create-context.d.ts +2 -20
- package/websql/lib/index.d.ts +1 -28
- package/websql/package.json +1 -1
|
@@ -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"}
|
package/lib/index.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export { BaseProvider } from './base-classes/base-provider';
|
|
|
22
22
|
export { BaseEntity } from './base-classes/base-entity';
|
|
23
23
|
export { BaseContext } from './base-classes/base-context';
|
|
24
24
|
export { BaseMigration } from './base-classes/base-migration';
|
|
25
|
-
export {
|
|
25
|
+
export { TaonAdditionalMiddlewareMethodInfo } from './base-classes/base-middleware';
|
|
26
26
|
export { createContext, TaonContext } from './create-context';
|
|
27
27
|
export { inject } from './inject';
|
|
28
28
|
export { Models } from './models';
|
|
@@ -51,15 +51,6 @@ export declare namespace Taon {
|
|
|
51
51
|
const isWebSQL: boolean;
|
|
52
52
|
const isElectron: boolean;
|
|
53
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>) => {
|
|
54
|
-
types: {
|
|
55
|
-
readonly controllers: any;
|
|
56
|
-
readonly repositories: any;
|
|
57
|
-
readonly providers: any;
|
|
58
|
-
readonly subscribers: any;
|
|
59
|
-
readonly migrations: any;
|
|
60
|
-
readonly middlewares: any;
|
|
61
|
-
};
|
|
62
|
-
readonly contexts: any;
|
|
63
54
|
readonly contextName: string;
|
|
64
55
|
readonly appId: string;
|
|
65
56
|
__ref(): Promise<endpointContext.EndpointContext>;
|
|
@@ -78,15 +69,6 @@ export declare namespace Taon {
|
|
|
78
69
|
};
|
|
79
70
|
};
|
|
80
71
|
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>) => () => {
|
|
81
|
-
types: {
|
|
82
|
-
readonly controllers: any;
|
|
83
|
-
readonly repositories: any;
|
|
84
|
-
readonly providers: any;
|
|
85
|
-
readonly subscribers: any;
|
|
86
|
-
readonly migrations: any;
|
|
87
|
-
readonly middlewares: any;
|
|
88
|
-
};
|
|
89
|
-
readonly contexts: any;
|
|
90
72
|
readonly contextName: string;
|
|
91
73
|
readonly appId: string;
|
|
92
74
|
__ref(): Promise<endpointContext.EndpointContext>;
|
|
@@ -116,15 +98,6 @@ export declare namespace Taon {
|
|
|
116
98
|
entities: Function[];
|
|
117
99
|
controllers: Function[];
|
|
118
100
|
}) => Promise<{
|
|
119
|
-
types: {
|
|
120
|
-
readonly controllers: any;
|
|
121
|
-
readonly repositories: any;
|
|
122
|
-
readonly providers: any;
|
|
123
|
-
readonly subscribers: any;
|
|
124
|
-
readonly migrations: any;
|
|
125
|
-
readonly middlewares: any;
|
|
126
|
-
};
|
|
127
|
-
readonly contexts: any;
|
|
128
101
|
readonly contextName: string;
|
|
129
102
|
readonly appId: string;
|
|
130
103
|
__ref(): Promise<endpointContext.EndpointContext>;
|
package/lib/ui/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
function
|
|
3
|
+
exports.dummy1756398517526 = dummy1756398517526;
|
|
4
|
+
function dummy1756398517526() { }
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
function
|
|
3
|
+
exports.dummy1756398518023 = dummy1756398518023;
|
|
4
|
+
function dummy1756398518023() { }
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
package/websql/fesm2022/taon.mjs
CHANGED
|
@@ -676,6 +676,10 @@ TAON_CONTEXT = new InjectionToken('TAON_CONTEXT');
|
|
|
676
676
|
let CURRENT_HOST_BACKEND_PORT;
|
|
677
677
|
//#region @browser
|
|
678
678
|
CURRENT_HOST_BACKEND_PORT = new InjectionToken('CURRENT_HOST_BACKEND_PORT');
|
|
679
|
+
//#endregion
|
|
680
|
+
let CURRENT_HOST_URL;
|
|
681
|
+
//#region @browser
|
|
682
|
+
CURRENT_HOST_URL = new InjectionToken('CURRENT_HOST_URL');
|
|
679
683
|
const apiPrefix = 'api';
|
|
680
684
|
|
|
681
685
|
const inject = (entity) => {
|
|
@@ -778,6 +782,28 @@ class BaseAngularsService {
|
|
|
778
782
|
constructor() {
|
|
779
783
|
//#region @browser
|
|
780
784
|
this.currentContext = inject$1(TAON_CONTEXT);
|
|
785
|
+
//#region @browser
|
|
786
|
+
this.CURRENT_HOST_BACKEND_PORT = inject$1(CURRENT_HOST_BACKEND_PORT, {
|
|
787
|
+
optional: true,
|
|
788
|
+
});
|
|
789
|
+
this.CURRENT_HOST_URL = inject$1(CURRENT_HOST_URL, {
|
|
790
|
+
optional: true,
|
|
791
|
+
});
|
|
792
|
+
// #endregion
|
|
793
|
+
}
|
|
794
|
+
/**
|
|
795
|
+
* @deprecated
|
|
796
|
+
* Returns the host URL for the backend service
|
|
797
|
+
* that is running on localhost (normal NodeJS/ExpressJS mode).
|
|
798
|
+
*/
|
|
799
|
+
get host() {
|
|
800
|
+
//#region @browser
|
|
801
|
+
if (this.CURRENT_HOST_URL) {
|
|
802
|
+
return this.CURRENT_HOST_URL;
|
|
803
|
+
}
|
|
804
|
+
return `http://localhost:${this.CURRENT_HOST_BACKEND_PORT}`;
|
|
805
|
+
//#endregion
|
|
806
|
+
return void 0;
|
|
781
807
|
}
|
|
782
808
|
injectController(ctor,
|
|
783
809
|
/**
|
|
@@ -787,7 +813,9 @@ class BaseAngularsService {
|
|
|
787
813
|
return inject(() => {
|
|
788
814
|
let currentContext;
|
|
789
815
|
//#region @browser
|
|
790
|
-
currentContext = overrideCurrentContext
|
|
816
|
+
currentContext = overrideCurrentContext
|
|
817
|
+
? overrideCurrentContext
|
|
818
|
+
: this.currentContext;
|
|
791
819
|
//#endregion
|
|
792
820
|
if (!currentContext) {
|
|
793
821
|
throw new Error('No context available. Make sure to initialize the context before injecting controllers.');
|
|
@@ -4967,50 +4995,7 @@ const createContext = (configFn) => {
|
|
|
4967
4995
|
// );
|
|
4968
4996
|
const endpointContextRef = new EndpointContext(config, configFn);
|
|
4969
4997
|
const res = {
|
|
4970
|
-
//#region types
|
|
4971
|
-
types: {
|
|
4972
|
-
//#region entites for
|
|
4973
|
-
// get entities() {
|
|
4974
|
-
// return config.entities;
|
|
4975
|
-
// },
|
|
4976
|
-
// entitiesFor(classInstace: BaseInjector) {
|
|
4977
|
-
// const ctx = classInstace.__endpoint_context__;
|
|
4978
|
-
// if (!entitiesCache[ctx.contextName]) {
|
|
4979
|
-
// entitiesCache[ctx.contextName] = {};
|
|
4980
|
-
// for (const entityClassName of Object.keys(config.entities)) {
|
|
4981
|
-
// entitiesCache[ctx.contextName][entityClassName] =
|
|
4982
|
-
// config.entities[entityClassName][
|
|
4983
|
-
// Taon.symbols.orignalClassClonesObj
|
|
4984
|
-
// ][ctx.contextName];
|
|
4985
|
-
// }
|
|
4986
|
-
// }
|
|
4987
|
-
// return entitiesCache[ctx.contextName] as typeof config.entities;
|
|
4988
|
-
// },
|
|
4989
|
-
//#endregion
|
|
4990
|
-
get controllers() {
|
|
4991
|
-
return config.controllers; // TODO QUICK_FIX new typescript generated wrong types
|
|
4992
|
-
},
|
|
4993
|
-
get repositories() {
|
|
4994
|
-
return config.repositories; // TODO QUICK_FIX new typescript generated wrong types
|
|
4995
|
-
},
|
|
4996
|
-
get providers() {
|
|
4997
|
-
return config.providers; // TODO QUICK_FIX new typescript generated wrong types
|
|
4998
|
-
},
|
|
4999
|
-
get subscribers() {
|
|
5000
|
-
return config.subscribers; // TODO QUICK_FIX new typescript generated wrong types
|
|
5001
|
-
},
|
|
5002
|
-
get migrations() {
|
|
5003
|
-
return config.migrations; // TODO QUICK_FIX new typescript generated wrong types
|
|
5004
|
-
},
|
|
5005
|
-
get middlewares() {
|
|
5006
|
-
return config.middlewares; // TODO QUICK_FIX new typescript generated wrong types
|
|
5007
|
-
},
|
|
5008
|
-
},
|
|
5009
|
-
//#endregion
|
|
5010
4998
|
//#region contexts
|
|
5011
|
-
get contexts() {
|
|
5012
|
-
return config.contexts; // TODO QUICK_FIX new typescript generated wrong types
|
|
5013
|
-
},
|
|
5014
4999
|
get contextName() {
|
|
5015
5000
|
return config.contextName;
|
|
5016
5001
|
},
|
|
@@ -5145,7 +5130,7 @@ const createContext = (configFn) => {
|
|
|
5145
5130
|
},
|
|
5146
5131
|
/**
|
|
5147
5132
|
* realtime communication with server
|
|
5148
|
-
*
|
|
5133
|
+
* TCP(upgrade) socket.io (or ipc) based.
|
|
5149
5134
|
*/
|
|
5150
5135
|
get realtime() {
|
|
5151
5136
|
return {
|
|
@@ -6842,5 +6827,5 @@ var Taon;
|
|
|
6842
6827
|
* Generated bundle index. Do not edit.
|
|
6843
6828
|
*/
|
|
6844
6829
|
|
|
6845
|
-
export { BaseContext, BaseController, BaseCustomRepository, BaseEntity, BaseMigration, BaseProvider, BaseRepository, CURRENT_HOST_BACKEND_PORT, ClassHelpers, EndpointContext, Models, TAON_CONTEXT, Taon, TaonAdminService, TaonEntityKeysToOmitArr, apiPrefix, createContext, inject };
|
|
6830
|
+
export { BaseContext, BaseController, BaseCustomRepository, BaseEntity, BaseMigration, BaseProvider, BaseRepository, CURRENT_HOST_BACKEND_PORT, CURRENT_HOST_URL, ClassHelpers, EndpointContext, Models, TAON_CONTEXT, Taon, TaonAdminService, TaonEntityKeysToOmitArr, apiPrefix, createContext, inject };
|
|
6846
6831
|
//# sourceMappingURL=taon.mjs.map
|