taon 18.0.19 → 18.0.20
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/assets/shared/shared_folder_info.txt +1 -1
- package/browser/esm2022/lib/base-classes/base-abstract-entity.mjs +1 -1
- package/browser/esm2022/lib/base-classes/base-crud-controller.mjs +1 -1
- package/browser/esm2022/lib/base-classes/base.mjs +3 -3
- package/browser/esm2022/lib/create-context.mjs +6 -5
- package/browser/esm2022/lib/decorators/http/http-methods-decorators.mjs +1 -1
- package/browser/esm2022/lib/endpoint-context.mjs +24 -12
- package/browser/esm2022/lib/entity-process.mjs +1 -10
- package/browser/esm2022/lib/get-response-value.mjs +1 -15
- package/browser/esm2022/lib/models.mjs +1 -1
- package/browser/fesm2022/taon.mjs +28 -29
- package/browser/fesm2022/taon.mjs.map +1 -1
- package/browser/lib/base-classes/base-abstract-entity.d.ts +2 -1
- package/browser/lib/base-classes/base-crud-controller.d.ts +1 -1
- package/browser/lib/base-classes/base.d.ts +3 -2
- package/browser/lib/create-context.d.ts +3 -3
- package/browser/lib/decorators/http/http-methods-decorators.d.ts +9 -0
- package/browser/lib/endpoint-context.d.ts +2 -2
- package/browser/lib/models.d.ts +2 -4
- package/client/esm2022/lib/base-classes/base-abstract-entity.mjs +1 -1
- package/client/esm2022/lib/base-classes/base-crud-controller.mjs +1 -1
- package/client/esm2022/lib/base-classes/base.mjs +3 -3
- package/client/esm2022/lib/create-context.mjs +6 -5
- package/client/esm2022/lib/decorators/http/http-methods-decorators.mjs +1 -1
- package/client/esm2022/lib/endpoint-context.mjs +24 -12
- package/client/esm2022/lib/entity-process.mjs +1 -10
- package/client/esm2022/lib/get-response-value.mjs +1 -15
- package/client/esm2022/lib/models.mjs +1 -1
- package/client/fesm2022/taon.mjs +28 -29
- package/client/fesm2022/taon.mjs.map +1 -1
- package/client/lib/base-classes/base-abstract-entity.d.ts +2 -1
- package/client/lib/base-classes/base-crud-controller.d.ts +1 -1
- package/client/lib/base-classes/base.d.ts +3 -2
- package/client/lib/create-context.d.ts +3 -3
- package/client/lib/decorators/http/http-methods-decorators.d.ts +9 -0
- package/client/lib/endpoint-context.d.ts +2 -2
- package/client/lib/models.d.ts +2 -4
- package/lib/base-classes/base-abstract-entity.d.ts +1 -0
- package/lib/base-classes/base-crud-controller.d.ts +1 -1
- package/lib/base-classes/base.d.ts +3 -2
- package/lib/base-classes/base.js +2 -2
- package/lib/base-classes/base.js.map +1 -1
- package/lib/create-context.d.ts +3 -3
- package/lib/create-context.js +17 -4
- package/lib/create-context.js.map +1 -1
- package/lib/decorators/http/http-methods-decorators.d.ts +9 -0
- package/lib/decorators/http/http-methods-decorators.js.map +1 -1
- package/lib/endpoint-context.d.ts +2 -2
- package/lib/endpoint-context.js +38 -38
- package/lib/endpoint-context.js.map +1 -1
- package/lib/entity-process.js +0 -9
- package/lib/entity-process.js.map +1 -1
- package/lib/get-response-value.js +14 -37
- package/lib/get-response-value.js.map +1 -1
- package/lib/models.d.ts +2 -5
- package/lib/models.js.map +1 -1
- package/lib/ui/directives/index.js +2 -2
- package/lib/ui/index.js +2 -2
- package/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.js +2 -2
- package/lib/ui/taon-admin-mode-configuration/components/taon-db-admin/index.js +2 -2
- package/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.js +2 -2
- package/lib/ui/taon-admin-mode-configuration/index.js +2 -2
- package/lib/ui/taon-github-fork-me-corner/index.js +2 -2
- package/lib/ui/taon-github-fork-me-ribbon/index.js +2 -2
- package/lib/ui/taon-notifications/taon-notifications.models.js +2 -2
- package/lib/ui/taon-progress-bar/index.js +2 -2
- package/lib/ui/taon-session-passcode/index.js +2 -2
- package/lib/ui/taon-table/index.js +2 -2
- package/package.json +7 -7
- package/tmp-environment.json +36 -31
- package/websql/esm2022/lib/base-classes/base-abstract-entity.mjs +1 -1
- package/websql/esm2022/lib/base-classes/base-crud-controller.mjs +1 -1
- package/websql/esm2022/lib/base-classes/base.mjs +3 -3
- package/websql/esm2022/lib/create-context.mjs +6 -5
- package/websql/esm2022/lib/decorators/http/http-methods-decorators.mjs +1 -1
- package/websql/esm2022/lib/endpoint-context.mjs +24 -12
- package/websql/esm2022/lib/entity-process.mjs +1 -10
- package/websql/esm2022/lib/get-response-value.mjs +4 -24
- package/websql/esm2022/lib/models.mjs +1 -1
- package/websql/fesm2022/taon.mjs +31 -38
- package/websql/fesm2022/taon.mjs.map +1 -1
- package/websql/lib/base-classes/base-abstract-entity.d.ts +2 -1
- package/websql/lib/base-classes/base-crud-controller.d.ts +1 -1
- package/websql/lib/base-classes/base.d.ts +3 -2
- package/websql/lib/create-context.d.ts +3 -3
- package/websql/lib/decorators/http/http-methods-decorators.d.ts +9 -0
- package/websql/lib/endpoint-context.d.ts +2 -2
- package/websql/lib/models.d.ts +2 -5
|
@@ -4,4 +4,5 @@ import type { BaseClass } from './base-class';
|
|
|
4
4
|
export declare abstract class BaseAbstractEntity<CloneT extends BaseClass = any> extends BaseEntity<CloneT> {
|
|
5
5
|
id: string;
|
|
6
6
|
version: number;
|
|
7
|
-
}
|
|
7
|
+
}
|
|
8
|
+
export type AbstractEntityOmitKeys<ENTITY> = Omit<ENTITY, 'id' | 'version' | '_' | 'clone'>;
|
|
@@ -6,7 +6,7 @@ import { Models } from '../models';
|
|
|
6
6
|
* Please override property entityClassFn with entity class.
|
|
7
7
|
*/
|
|
8
8
|
export declare abstract class BaseCrudController<Entity> extends BaseController {
|
|
9
|
-
protected db
|
|
9
|
+
protected db: BaseRepository<Entity>;
|
|
10
10
|
/**
|
|
11
11
|
* Please provide entity as class propery entityClassFn:
|
|
12
12
|
* @returns class function
|
|
@@ -5,15 +5,16 @@ import * as entity from './base-entity';
|
|
|
5
5
|
import * as abstractEntity from './base-abstract-entity';
|
|
6
6
|
import * as repository from './base-repository';
|
|
7
7
|
import * as provider from './base-provider';
|
|
8
|
-
import * as
|
|
8
|
+
import * as baseClass from './base-class';
|
|
9
9
|
import * as baseSubscriberEntity from './base-subscriber-for-entity';
|
|
10
10
|
export declare namespace Base {
|
|
11
11
|
export import Controller = controller.BaseController;
|
|
12
12
|
export import CrudController = crudController.BaseCrudController;
|
|
13
13
|
export import Entity = entity.BaseEntity;
|
|
14
14
|
export import AbstractEntity = abstractEntity.BaseAbstractEntity;
|
|
15
|
+
export import AbstractEntityOmitKeys = abstractEntity.AbstractEntityOmitKeys;
|
|
15
16
|
export import Provider = provider.BaseProvider;
|
|
16
|
-
export import Class =
|
|
17
|
+
export import Class = baseClass.BaseClass;
|
|
17
18
|
export import Repository = repository.BaseRepository;
|
|
18
19
|
export import SubscriberForEntity = baseSubscriberEntity.BaseSubscriberForEntity;
|
|
19
20
|
const Context: {
|
|
@@ -16,9 +16,9 @@ export declare const createContext: <CTX extends Record<string, object>, CTRL ex
|
|
|
16
16
|
*/
|
|
17
17
|
__ref(): Promise<EndpointContext>;
|
|
18
18
|
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
* only for internal use
|
|
20
|
+
* @deprecated
|
|
21
|
+
*/
|
|
22
22
|
readonly __refSync: EndpointContext;
|
|
23
23
|
getClassInstance<T>(ctor: new (...args: any[]) => T): T;
|
|
24
24
|
getClass<T>(ctor: new (...args: any[]) => T): new (...args: any[]) => T;
|
|
@@ -2,7 +2,16 @@
|
|
|
2
2
|
import { CoreModels } from 'tnp-core/browser';
|
|
3
3
|
import { Models as ModelsNg2Rest } from 'ng2-rest/browser';
|
|
4
4
|
export interface TaonHttpDecoratorOptions {
|
|
5
|
+
/**
|
|
6
|
+
* ! BE CAREFULL
|
|
7
|
+
* This method is only for very special cases
|
|
8
|
+
* Path for the method is automatically generated
|
|
9
|
+
*/
|
|
5
10
|
path?: string;
|
|
11
|
+
/**
|
|
12
|
+
* ! BE CAREFULL
|
|
13
|
+
* If true, the path will be global
|
|
14
|
+
*/
|
|
6
15
|
pathIsGlobal?: boolean;
|
|
7
16
|
overrideContentType?: CoreModels.ContentType;
|
|
8
17
|
overridResponseType?: ModelsNg2Rest.ResponseTypeAxios;
|
|
@@ -52,8 +52,8 @@ export declare class EndpointContext {
|
|
|
52
52
|
constructor(originalConfig: Models.ContextOptions<any, any, any, any, any, any>, configFn: (env: any) => Models.ContextOptions<any, any, any, any, any, any>);
|
|
53
53
|
init(options?: {
|
|
54
54
|
initFromRecrusiveContextResovle?: boolean;
|
|
55
|
-
overrideHost?: string;
|
|
56
|
-
overrideRemoteHost?: string;
|
|
55
|
+
overrideHost?: string | null;
|
|
56
|
+
overrideRemoteHost?: string | null;
|
|
57
57
|
}): Promise<void>;
|
|
58
58
|
private getAutoGeneratedConfig;
|
|
59
59
|
get ngZone(): any;
|
package/client/lib/models.d.ts
CHANGED
|
@@ -81,7 +81,7 @@ export declare namespace Models {
|
|
|
81
81
|
productionMode?: boolean;
|
|
82
82
|
abstract?: boolean;
|
|
83
83
|
logs?: boolean | ContectionOptionsLogs;
|
|
84
|
-
database?: boolean | DatabaseConfig
|
|
84
|
+
database?: boolean | Partial<DatabaseConfig>;
|
|
85
85
|
disabledRealtime?: boolean;
|
|
86
86
|
https?: {
|
|
87
87
|
key: string;
|
|
@@ -164,12 +164,10 @@ export declare namespace Models {
|
|
|
164
164
|
interface ClientAction<T> {
|
|
165
165
|
received?: Rest.PromiseObservableMix<Rest.HttpResponse<T>>;
|
|
166
166
|
}
|
|
167
|
-
interface __Response<T> {
|
|
168
|
-
}
|
|
169
167
|
interface AsyncResponse<T> {
|
|
170
168
|
(req?: ExpressRequest, res?: ExpressResponse): Promise<SyncResponse<T> | SyncResponseFunc<T>>;
|
|
171
169
|
}
|
|
172
|
-
type Response<T = string> = (
|
|
170
|
+
type Response<T = string> = (AsyncResponse<T>) & ClientAction<T>;
|
|
173
171
|
class Errors {
|
|
174
172
|
message: string;
|
|
175
173
|
private code;
|
|
@@ -5,7 +5,7 @@ import { Models } from '../models';
|
|
|
5
5
|
* Please override property entityClassFn with entity class.
|
|
6
6
|
*/
|
|
7
7
|
export declare abstract class BaseCrudController<Entity> extends BaseController {
|
|
8
|
-
protected db
|
|
8
|
+
protected db: BaseRepository<Entity>;
|
|
9
9
|
/**
|
|
10
10
|
* Please provide entity as class propery entityClassFn:
|
|
11
11
|
* @returns class function
|
|
@@ -4,15 +4,16 @@ import * as entity from './base-entity';
|
|
|
4
4
|
import * as abstractEntity from './base-abstract-entity';
|
|
5
5
|
import * as repository from './base-repository';
|
|
6
6
|
import * as provider from './base-provider';
|
|
7
|
-
import * as
|
|
7
|
+
import * as baseClass from './base-class';
|
|
8
8
|
import * as baseSubscriberEntity from './base-subscriber-for-entity';
|
|
9
9
|
export declare namespace Base {
|
|
10
10
|
export import Controller = controller.BaseController;
|
|
11
11
|
export import CrudController = crudController.BaseCrudController;
|
|
12
12
|
export import Entity = entity.BaseEntity;
|
|
13
13
|
export import AbstractEntity = abstractEntity.BaseAbstractEntity;
|
|
14
|
+
export import AbstractEntityOmitKeys = abstractEntity.AbstractEntityOmitKeys;
|
|
14
15
|
export import Provider = provider.BaseProvider;
|
|
15
|
-
export import Class =
|
|
16
|
+
export import Class = baseClass.BaseClass;
|
|
16
17
|
export import Repository = repository.BaseRepository;
|
|
17
18
|
export import SubscriberForEntity = baseSubscriberEntity.BaseSubscriberForEntity;
|
|
18
19
|
const Context: {
|
package/lib/base-classes/base.js
CHANGED
|
@@ -7,7 +7,7 @@ var entity = require("./base-entity");
|
|
|
7
7
|
var abstractEntity = require("./base-abstract-entity");
|
|
8
8
|
var repository = require("./base-repository");
|
|
9
9
|
var provider = require("./base-provider");
|
|
10
|
-
var
|
|
10
|
+
var baseClass = require("./base-class");
|
|
11
11
|
var baseContext = require("./base-context");
|
|
12
12
|
var baseSubscriberEntity = require("./base-subscriber-for-entity");
|
|
13
13
|
var Base;
|
|
@@ -17,7 +17,7 @@ var Base;
|
|
|
17
17
|
Base.Entity = entity.BaseEntity;
|
|
18
18
|
Base.AbstractEntity = abstractEntity.BaseAbstractEntity;
|
|
19
19
|
Base.Provider = provider.BaseProvider;
|
|
20
|
-
Base.Class =
|
|
20
|
+
Base.Class = baseClass.BaseClass;
|
|
21
21
|
Base.Repository = repository.BaseRepository;
|
|
22
22
|
Base.SubscriberForEntity = baseSubscriberEntity.BaseSubscriberForEntity;
|
|
23
23
|
Base.Context = baseContext.BaseContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AAAA,8CAAgD;AAChD,uDAAyD;AACzD,sCAAwC;AACxC,uDAAyD;AACzD,8CAAgD;AAChD,0CAA4C;AAC5C,wCAA0C;AAC1C,4CAA8C;AAC9C,mEAAqE;AACrE,IAAiB,IAAI,
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AAAA,8CAAgD;AAChD,uDAAyD;AACzD,sCAAwC;AACxC,uDAAyD;AACzD,8CAAgD;AAChD,0CAA4C;AAC5C,wCAA0C;AAC1C,4CAA8C;AAC9C,mEAAqE;AACrE,IAAiB,IAAI,CAWpB;AAXD,WAAiB,IAAI;IACL,eAAU,GAAG,UAAU,CAAC,cAAc,CAAC;IACvC,mBAAc,GAAG,cAAc,CAAC,kBAAkB,CAAC;IACnD,WAAM,GAAG,MAAM,CAAC,UAAU,CAAC;IAC3B,mBAAc,GAAG,cAAc,CAAC,kBAAkB,CAAC;IAEnD,aAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC;IACjC,UAAK,GAAG,SAAS,CAAC,SAAS,CAAC;IAC5B,eAAU,GAAG,UAAU,CAAC,cAAc,CAAC;IACvC,wBAAmB,GAAG,oBAAoB,CAAC,uBAAuB,CAAC;IACpE,YAAO,GAAG,WAAW,CAAC,WAAW,CAAC;AACjD,CAAC,EAXgB,IAAI,oBAAJ,IAAI,QAWpB"}
|
package/lib/create-context.d.ts
CHANGED
|
@@ -15,9 +15,9 @@ export declare const createContext: <CTX extends Record<string, object>, CTRL ex
|
|
|
15
15
|
*/
|
|
16
16
|
__ref(): Promise<EndpointContext>;
|
|
17
17
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
* only for internal use
|
|
19
|
+
* @deprecated
|
|
20
|
+
*/
|
|
21
21
|
readonly __refSync: EndpointContext;
|
|
22
22
|
getClassInstance<T>(ctor: new (...args: any[]) => T): T;
|
|
23
23
|
getClass<T>(ctor: new (...args: any[]) => T): new (...args: any[]) => T;
|
package/lib/create-context.js
CHANGED
|
@@ -80,9 +80,9 @@ var createContext = function (configFn) {
|
|
|
80
80
|
});
|
|
81
81
|
},
|
|
82
82
|
/**
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
* only for internal use
|
|
84
|
+
* @deprecated
|
|
85
|
+
*/
|
|
86
86
|
get __refSync() {
|
|
87
87
|
return endpointContextRef;
|
|
88
88
|
},
|
|
@@ -159,6 +159,19 @@ var createContext = function (configFn) {
|
|
|
159
159
|
_a.sent();
|
|
160
160
|
_a.label = 8;
|
|
161
161
|
case 8:
|
|
162
|
+
///#region TODO this may be usefull but for now
|
|
163
|
+
// 2 separate contexts are fine
|
|
164
|
+
// const shouldStartRemoteHost = endpointContextRef.mode !== 'remote-backend(tcp+udp)';
|
|
165
|
+
// if(shouldStartRemoteHost) {
|
|
166
|
+
// const endpointContextRemoteHostRef = new EndpointContext(config, configFn);
|
|
167
|
+
// await endpointContextRemoteHostRef.init({
|
|
168
|
+
// overrideRemoteHost: endpointContextRef.host,
|
|
169
|
+
// overrideHost: null,
|
|
170
|
+
// });
|
|
171
|
+
// endpointContextRemoteHostRef.initMetadata();
|
|
172
|
+
// endpointContextRef.__contextForControllerInstanceAccess = endpointContextRemoteHostRef;
|
|
173
|
+
// }
|
|
174
|
+
//#endregion
|
|
162
175
|
resolve(endpointContextRef);
|
|
163
176
|
return [2 /*return*/];
|
|
164
177
|
}
|
|
@@ -183,7 +196,7 @@ var createContext = function (configFn) {
|
|
|
183
196
|
},
|
|
184
197
|
get server() {
|
|
185
198
|
return endpointContextRef.realtimeServer;
|
|
186
|
-
}
|
|
199
|
+
},
|
|
187
200
|
};
|
|
188
201
|
},
|
|
189
202
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-context.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;;AAAA,iBAAiB;AACjB,qCAAmC;AACnC,uDAAqD;AAGrD,6BAA4B;AAC5B,KAAK;AACL,KAAK;AAGL,uCAAuC;AACvC,qCAAqC;AACrC,YAAY;AAEL,IAAM,aAAa,GAAG,UAU3B,QAEyE;IAEzE,IAAI,MAAM,GAAG,QAAQ,CAAC,SAAG,CAAC,CAAC;IAE3B,IAAM,kBAAkB,GAAG,IAAI,kCAAe,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAEjE,IAAM,GAAG,GAAG;QACV,eAAe;QACf,KAAK,EAAE;YACL,qBAAqB;YACrB,mBAAmB;YACnB,4BAA4B;YAC5B,KAAK;YACL,4CAA4C;YAC5C,mDAAmD;YACnD,2CAA2C;YAC3C,2CAA2C;YAC3C,oEAAoE;YACpE,0DAA0D;YAC1D,4CAA4C;YAC5C,+CAA+C;YAC/C,8BAA8B;YAC9B,QAAQ;YACR,MAAM;YACN,qEAAqE;YACrE,KAAK;YACL,YAAY;YACZ,IAAI,WAAW;gBACb,OAAO,MAAM,CAAC,WAAW,CAAC;YAC5B,CAAC;YACD,IAAI,YAAY;gBACd,OAAO,MAAM,CAAC,YAAY,CAAC;YAC7B,CAAC;YACD,IAAI,SAAS;gBACX,OAAO,MAAM,CAAC,SAAS,CAAC;YAC1B,CAAC;YACD,IAAI,WAAW;gBACb,OAAO,MAAM,CAAC,WAAW,CAAC;YAC5B,CAAC;SACF;QACD,YAAY;QACZ,kBAAkB;QAClB,IAAI,QAAQ;YACV,OAAO,MAAM,CAAC,QAAQ,CAAC;QACzB,CAAC;QACD,IAAI,WAAW;YACb,OAAO,MAAM,CAAC,WAAW,CAAC;QAC5B,CAAC;QACD,YAAY;QACZ,iBAAiB;QAC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CAAC;KACF,CAAC;IACF,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAzLW,QAAA,aAAa,iBAyLxB;AACF,YAAY"}
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { CoreModels } from 'tnp-core/src';
|
|
2
2
|
import { Models as ModelsNg2Rest } from 'ng2-rest/src';
|
|
3
3
|
export interface TaonHttpDecoratorOptions {
|
|
4
|
+
/**
|
|
5
|
+
* ! BE CAREFULL
|
|
6
|
+
* This method is only for very special cases
|
|
7
|
+
* Path for the method is automatically generated
|
|
8
|
+
*/
|
|
4
9
|
path?: string;
|
|
10
|
+
/**
|
|
11
|
+
* ! BE CAREFULL
|
|
12
|
+
* If true, the path will be global
|
|
13
|
+
*/
|
|
5
14
|
pathIsGlobal?: boolean;
|
|
6
15
|
overrideContentType?: CoreModels.ContentType;
|
|
7
16
|
overridResponseType?: ModelsNg2Rest.ResponseTypeAxios;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-methods-decorators.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"http-methods-decorators.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;AA0FA,kBAmBC;AAED,oBAmBC;AAED,oBAmBC;AAED,kBAmBC;AAED,sBAmBC;AAED,wBAmBC;AAtND,qCAAyC;AACzC,uCAAsC;AACtC,yCAAwC;AAExC,IAAM,OAAO,GAAG,UACd,MAAmC,EACnC,IAAY,EACZ,MAAgB,EAChB,WAAmB,EACnB,UAA8B,EAC9B,aAAgD,EAChD,YAAqB;IAErB,IAAI,OAAiC,CAAC;IACtC,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE,CAAC;QACtC,OAAO,GAAG,aAAa,CAAC;QACxB,aAAa,GAAG,OAAO,CAAC,IAAW,CAAC;QACpC,YAAY,GAAG,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC;QACtC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IACtB,CAAC;SAA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,SAAgB,GAAG,CACjB,aAAiD,EACjD,YAAoB;IAApB,6BAAA,EAAA,oBAAoB;IAEpB,OAAO,UACL,MAAW,EACX,WAAmB,EACnB,UAA8B;QAE9B,OAAO,CACL,KAAK,EACL,aAAuB,EACvB,MAAM,EACN,WAAW,EACX,UAAU,EACV,aAAa,EACb,YAAY,CACb,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAED,SAAgB,KAAK,CACnB,aAAiD,EACjD,YAAoB;IAApB,6BAAA,EAAA,oBAAoB;IAEpB,OAAO,UACL,MAAW,EACX,WAAmB,EACnB,UAA8B;QAE9B,OAAO,CACL,OAAO,EACP,aAAuB,EACvB,MAAM,EACN,WAAW,EACX,UAAU,EACV,aAAa,EACb,YAAY,CACb,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAED,SAAgB,MAAM,CACpB,aAAiD,EACjD,YAAoB;IAApB,6BAAA,EAAA,oBAAoB;IAEpB,OAAO,UACL,MAAW,EACX,WAAmB,EACnB,UAA8B;QAE9B,OAAO,CACL,QAAQ,EACR,aAAuB,EACvB,MAAM,EACN,WAAW,EACX,UAAU,EACV,aAAa,EACb,YAAY,CACb,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -52,8 +52,8 @@ export declare class EndpointContext {
|
|
|
52
52
|
constructor(originalConfig: Models.ContextOptions<any, any, any, any, any, any>, configFn: (env: any) => Models.ContextOptions<any, any, any, any, any, any>);
|
|
53
53
|
init(options?: {
|
|
54
54
|
initFromRecrusiveContextResovle?: boolean;
|
|
55
|
-
overrideHost?: string;
|
|
56
|
-
overrideRemoteHost?: string;
|
|
55
|
+
overrideHost?: string | null;
|
|
56
|
+
overrideRemoteHost?: string | null;
|
|
57
57
|
}): Promise<void>;
|
|
58
58
|
private getAutoGeneratedConfig;
|
|
59
59
|
get ngZone(): any;
|
package/lib/endpoint-context.js
CHANGED
|
@@ -91,6 +91,7 @@ var EndpointContext = /** @class */ (function () {
|
|
|
91
91
|
this.allTypesfromContexts = tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(this.injectableTypesfromContexts), false), [
|
|
92
92
|
models_1.Models.ClassType.ENTITY,
|
|
93
93
|
], false);
|
|
94
|
+
// public __contextForControllerInstanceAccess?: EndpointContext;
|
|
94
95
|
//#region fields / express app
|
|
95
96
|
this.expressApp = {};
|
|
96
97
|
//#endregion
|
|
@@ -302,43 +303,27 @@ var EndpointContext = /** @class */ (function () {
|
|
|
302
303
|
this.inited = true;
|
|
303
304
|
this.config = this.configFn(env_1.ENV);
|
|
304
305
|
if (overrideHost && overrideRemoteHost) {
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
306
|
+
tnp_core_2.Helpers.throw("[taon-config] You can't have overrideHost and overrideRemoteHost at the same time");
|
|
307
|
+
}
|
|
308
|
+
this.config.host = !tnp_core_2._.isUndefined(overrideHost)
|
|
309
|
+
? overrideHost
|
|
310
|
+
: this.config.host;
|
|
311
|
+
this.config.remoteHost = !tnp_core_2._.isUndefined(overrideRemoteHost)
|
|
312
|
+
? overrideRemoteHost
|
|
313
|
+
: this.config.remoteHost;
|
|
314
|
+
this.config.host = this.host === null ? void 0 : this.host;
|
|
315
|
+
this.config.remoteHost =
|
|
316
|
+
this.remoteHost === null ? void 0 : this.remoteHost;
|
|
317
|
+
if (this.config.host &&
|
|
318
|
+
!this.config.host.startsWith('http://') &&
|
|
319
|
+
!this.config.host.startsWith('https://')) {
|
|
320
|
+
tnp_core_2.Helpers.throw("[taon-config] Your 'host' must start with http:// or https://");
|
|
321
|
+
}
|
|
322
|
+
if (this.config.remoteHost &&
|
|
323
|
+
!this.config.remoteHost.startsWith('http://') &&
|
|
324
|
+
!this.config.remoteHost.startsWith('https://')) {
|
|
325
|
+
tnp_core_2.Helpers.throw("[taon-config] Your 'remoteHost' must start with http:// or https://");
|
|
312
326
|
}
|
|
313
|
-
this.config.host = overrideHost ? overrideHost : this.config.host;
|
|
314
|
-
this.config.remoteHost = overrideRemoteHost ? overrideRemoteHost : this.config.remoteHost;
|
|
315
|
-
// console.log(
|
|
316
|
-
// `[${
|
|
317
|
-
// this.contextName
|
|
318
|
-
// }] init context... from resolve: ${!!initFromRecrusiveContextResovle}`,
|
|
319
|
-
// );
|
|
320
|
-
//#region debug config
|
|
321
|
-
// console.log(
|
|
322
|
-
// `[taon][${this.config.contextName}] - resolve config from fn`,
|
|
323
|
-
// {
|
|
324
|
-
// config: this.config,
|
|
325
|
-
// },
|
|
326
|
-
// );
|
|
327
|
-
// for (const ctrlName of Object.keys(config.controllers || {})) {
|
|
328
|
-
// console.log(`${ctrlName} = ${!!config.controllers[ctrlName]}`);
|
|
329
|
-
// }
|
|
330
|
-
// for (const entityName of Object.keys(config.entities || {})) {
|
|
331
|
-
// console.log(`${entityName} = ${!!config.entities[entityName]}`);
|
|
332
|
-
// }
|
|
333
|
-
// for (const providersName of Object.keys(config.providers || {})) {
|
|
334
|
-
// console.log(`${providersName} = ${!!config.providers[providersName]}`);
|
|
335
|
-
// }
|
|
336
|
-
// for (const repositoryName of Object.keys(config.repositories || {})) {
|
|
337
|
-
// console.log(
|
|
338
|
-
// `${repositoryName} = ${!!config.repositories[repositoryName]}`,
|
|
339
|
-
// );
|
|
340
|
-
// }
|
|
341
|
-
//#endregion
|
|
342
327
|
//#region resolve mode
|
|
343
328
|
if (this.config.host) {
|
|
344
329
|
this.mode = 'backend-frontend(tcp+udp)';
|
|
@@ -347,7 +332,7 @@ var EndpointContext = /** @class */ (function () {
|
|
|
347
332
|
}
|
|
348
333
|
if (this.config.remoteHost) {
|
|
349
334
|
if (this.config.host) {
|
|
350
|
-
tnp_core_2.Helpers.
|
|
335
|
+
tnp_core_2.Helpers.throw("[taon] You can't have remoteHost and host at the same time");
|
|
351
336
|
}
|
|
352
337
|
this.mode = 'remote-backend(tcp+udp)';
|
|
353
338
|
}
|
|
@@ -371,7 +356,7 @@ var EndpointContext = /** @class */ (function () {
|
|
|
371
356
|
this.databaseConfig = this.getAutoGeneratedConfig();
|
|
372
357
|
}
|
|
373
358
|
else if (tnp_core_2._.isObject(this.config.database)) {
|
|
374
|
-
this.databaseConfig = tnp_core_2._.cloneDeep(this.config.database);
|
|
359
|
+
this.databaseConfig = tnp_core_2._.merge(this.getAutoGeneratedConfig(), tnp_core_2._.cloneDeep(this.config.database));
|
|
375
360
|
}
|
|
376
361
|
//#endregion
|
|
377
362
|
//#region resolve session
|
|
@@ -828,14 +813,29 @@ var EndpointContext = /** @class */ (function () {
|
|
|
828
813
|
* alias for inject
|
|
829
814
|
*/
|
|
830
815
|
EndpointContext.prototype.getInstanceBy = function (ctor) {
|
|
816
|
+
// if (!!this.__contextForControllerInstanceAccess) {
|
|
817
|
+
// const className = ClassHelpers.getName(ctor);
|
|
818
|
+
// const allControllers = this.getClassFunByArr(Models.ClassType.CONTROLLER);
|
|
819
|
+
// // TODO QUICK_FIX cache controllers
|
|
820
|
+
// for (const ctrl of allControllers) {
|
|
821
|
+
// if (ClassHelpers.getName(ctrl) === className) {
|
|
822
|
+
// // console.log('injecting from contextForControllerInstanceAcesss', className);
|
|
823
|
+
// return this.__contextForControllerInstanceAccess.inject(ctor, {
|
|
824
|
+
// localInstance: false,
|
|
825
|
+
// });
|
|
826
|
+
// }
|
|
827
|
+
// }
|
|
828
|
+
// }
|
|
831
829
|
return this.inject(ctor, { localInstance: false });
|
|
832
830
|
};
|
|
833
831
|
//#endregion
|
|
832
|
+
//#region methods & getters / check if context initialized
|
|
834
833
|
EndpointContext.prototype.checkIfContextInitialized = function () {
|
|
835
834
|
if (tnp_core_2._.isUndefined(this.config)) {
|
|
836
835
|
throw new Error("Please check if your context has been initialized.\n\n // ...\n await Context.initialize();\n // ...\n\n\n ");
|
|
837
836
|
}
|
|
838
837
|
};
|
|
838
|
+
//#endregion
|
|
839
839
|
//#region methods & getters / get class function by class type name
|
|
840
840
|
EndpointContext.prototype.getClassFunBy = function (classType) {
|
|
841
841
|
this.checkIfContextInitialized();
|