taon 19.0.6 → 19.0.8
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 +175 -175
- 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 +4040 -4072
- package/browser/fesm2022/taon.mjs.map +1 -1
- package/browser/lib/base-classes/base-angular-service.d.ts +14 -0
- package/browser/lib/base-classes/base-custom-repository.d.ts +4 -0
- package/browser/lib/base-classes/base-entity.d.ts +9 -0
- package/browser/lib/base-classes/base-injector.d.ts +15 -9
- package/browser/lib/base-classes/base-repository.d.ts +27 -13
- package/browser/lib/base-classes/base.d.ts +8 -4
- package/browser/lib/create-context.d.ts +2 -1
- package/browser/lib/endpoint-context.d.ts +6 -5
- package/browser/lib/index.d.ts +7 -6
- package/browser/package.json +1 -1
- package/cli.js.map +1 -1
- package/client/README.md +24 -24
- package/client/fesm2022/taon.mjs +4040 -4072
- package/client/fesm2022/taon.mjs.map +1 -1
- package/client/lib/base-classes/base-angular-service.d.ts +14 -0
- package/client/lib/base-classes/base-custom-repository.d.ts +4 -0
- package/client/lib/base-classes/base-entity.d.ts +9 -0
- package/client/lib/base-classes/base-injector.d.ts +15 -9
- package/client/lib/base-classes/base-repository.d.ts +27 -13
- package/client/lib/base-classes/base.d.ts +8 -4
- package/client/lib/create-context.d.ts +2 -1
- package/client/lib/endpoint-context.d.ts +6 -5
- package/client/lib/index.d.ts +7 -6
- package/client/package.json +1 -1
- package/index.js.map +1 -1
- package/lib/base-classes/base-abstract-entity.js.map +1 -1
- package/lib/base-classes/base-angular-service.d.ts +10 -0
- package/lib/base-classes/base-angular-service.js +19 -0
- package/lib/base-classes/base-angular-service.js.map +1 -0
- package/lib/base-classes/base-class.js.map +1 -1
- package/lib/base-classes/base-context.js.map +1 -1
- package/lib/base-classes/base-controller.js.map +1 -1
- package/lib/base-classes/base-crud-controller.js.map +1 -1
- package/lib/base-classes/base-custom-repository.d.ts +3 -0
- package/lib/base-classes/base-custom-repository.js +19 -0
- package/lib/base-classes/base-custom-repository.js.map +1 -0
- package/lib/base-classes/base-entity.d.ts +10 -1
- package/lib/base-classes/base-entity.js +13 -2
- package/lib/base-classes/base-entity.js.map +1 -1
- package/lib/base-classes/base-injector.d.ts +15 -9
- package/lib/base-classes/base-injector.js +19 -17
- package/lib/base-classes/base-injector.js.map +1 -1
- package/lib/base-classes/base-migration.js.map +1 -1
- package/lib/base-classes/base-provider.js.map +1 -1
- package/lib/base-classes/base-repository.d.ts +25 -12
- package/lib/base-classes/base-repository.js +32 -80
- package/lib/base-classes/base-repository.js.map +1 -1
- package/lib/base-classes/base-subscriber-for-entity.js.map +1 -1
- package/lib/base-classes/base-subscriber.d.ts +4 -0
- package/lib/base-classes/base-subscriber.js +25 -0
- package/lib/base-classes/base-subscriber.js.map +1 -0
- package/lib/base-classes/base.d.ts +8 -4
- package/lib/base-classes/base.js +9 -5
- package/lib/base-classes/base.js.map +1 -1
- package/lib/build-info._auto-generated_.d.ts +1 -1
- package/lib/build-info._auto-generated_.js +1 -1
- package/lib/build-info._auto-generated_.js.map +1 -1
- package/lib/constants.js.map +1 -1
- package/lib/context-db-migrations.js.map +1 -1
- package/lib/create-context.d.ts +1 -0
- package/lib/create-context.js +1 -5
- package/lib/create-context.js.map +1 -1
- package/lib/decorators/classes/controller-decorator.js.map +1 -1
- package/lib/decorators/classes/entity-decorator.js.map +1 -1
- package/lib/decorators/classes/migration-decorator.js.map +1 -1
- package/lib/decorators/classes/provider-decorator.js.map +1 -1
- package/lib/decorators/classes/repository-decorator.js.map +1 -1
- package/lib/decorators/classes/subscriber-decorator.js.map +1 -1
- package/lib/decorators/http/http-decorators.js.map +1 -1
- package/lib/decorators/http/http-methods-decorators.js.map +1 -1
- package/lib/decorators/http/http-params-decorators.js.map +1 -1
- package/lib/dependency-injection/di-container.js.map +1 -1
- package/lib/endpoint-context.d.ts +8 -5
- package/lib/endpoint-context.js +170 -179
- package/lib/endpoint-context.js.map +1 -1
- package/lib/entity-process.js.map +1 -1
- package/lib/env.js.map +1 -1
- package/lib/formly/formly-group-wrapper-component.js.map +1 -1
- package/lib/formly/formly-repeat-component.js.map +1 -1
- package/lib/formly/formly.models.js.map +1 -1
- package/lib/formly/fromly.js.map +1 -1
- package/lib/formly/type-from-entity.js.map +1 -1
- package/lib/get-response-value.js.map +1 -1
- package/lib/helpers/class-helpers.js.map +1 -1
- package/lib/helpers/taon-helpers.js.map +1 -1
- package/lib/index._auto-generated_.js.map +1 -1
- package/lib/index.d.ts +7 -6
- package/lib/index.js +11 -10
- package/lib/index.js.map +1 -1
- package/lib/inject.js +3 -1
- package/lib/inject.js.map +1 -1
- package/lib/models.js.map +1 -1
- package/lib/orm.d.ts +15 -2
- package/lib/orm.js +41 -3
- package/lib/orm.js.map +1 -1
- package/lib/realtime/realtime-client.js.map +1 -1
- package/lib/realtime/realtime-core.js.map +1 -1
- package/lib/realtime/realtime-server.js.map +1 -1
- package/lib/realtime/realtime-strategy/index.js.map +1 -1
- package/lib/realtime/realtime-strategy/realtime-abstract-mock.d.ts +10 -0
- package/lib/realtime/realtime-strategy/realtime-abstract-mock.js +214 -0
- package/lib/realtime/realtime-strategy/realtime-abstract-mock.js.map +1 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/index.d.ts +0 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/index.js +5 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/index.js.map +1 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/realtime-strategy-ipc-main-namespace.d.ts +22 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/realtime-strategy-ipc-main-namespace.js +139 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/realtime-strategy-ipc-main-namespace.js.map +1 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/realtime-strategy-ipc-main-wrapper.d.ts +16 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/realtime-strategy-ipc-main-wrapper.js +68 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/realtime-strategy-ipc-main-wrapper.js.map +1 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/realtime-strategy-ipc-renderer-namespace.d.ts +10 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/realtime-strategy-ipc-renderer-namespace.js +56 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/realtime-strategy-ipc-renderer-namespace.js.map +1 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/realtime-strategy-ipc-renderer-wrapper.d.ts +10 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/realtime-strategy-ipc-renderer-wrapper.js +50 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/realtime-strategy-ipc-renderer-wrapper.js.map +1 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/realtime-strategy-ipc.models.d.ts +13 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/realtime-strategy-ipc.models.js +3 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc-models/realtime-strategy-ipc.models.js.map +1 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-ipc.js.map +1 -1
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/index.d.ts +2 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/index.js +6 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/index.js.map +1 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/realtime-strategy-mock-client.d.ts +16 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/realtime-strategy-mock-client.js +54 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/realtime-strategy-mock-client.js.map +1 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/realtime-strategy-mock-namespaces.d.ts +17 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/realtime-strategy-mock-namespaces.js +52 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/realtime-strategy-mock-namespaces.js.map +1 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/realtime-strategy-mock-server.d.ts +11 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/realtime-strategy-mock-server.js +39 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/realtime-strategy-mock-server.js.map +1 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/realtime-strategy-mock-socket.d.ts +13 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/realtime-strategy-mock-socket.js +46 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/realtime-strategy-mock-socket.js.map +1 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/realtime-strategy-mock.models.d.ts +11 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/realtime-strategy-mock.models.js +3 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-mock-models/realtime-strategy-mock.models.js.map +1 -0
- package/lib/realtime/realtime-strategy/realtime-strategy-mock.js.map +1 -1
- package/lib/realtime/realtime-strategy/realtime-strategy-socket-io.js.map +1 -1
- package/lib/realtime/realtime-strategy/realtime-strategy.js.map +1 -1
- package/lib/realtime/realtime-subs-manager.js.map +1 -1
- package/lib/realtime/realtime.models.js.map +1 -1
- package/lib/storage.js.map +1 -1
- package/lib/symbols.js.map +1 -1
- package/lib/ui/directives/firedev-inject-html.directive.d.ts +6 -0
- package/lib/ui/directives/firedev-long-press.directive.d.ts +22 -0
- package/lib/ui/directives/index.js +2 -2
- package/lib/ui/directives/index.js.map +1 -1
- package/lib/ui/directives/view-mode.js.map +1 -1
- package/lib/ui/index.js +2 -2
- package/lib/ui/index.js.map +1 -1
- package/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.d.ts +2 -0
- package/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.js +5 -0
- package/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/index.js.map +1 -0
- package/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.component.d.ts +29 -0
- package/lib/ui/taon-admin-mode-configuration/components/taon-admin-edit-mode/taon-admin-edit-mode.module.d.ts +2 -0
- package/lib/ui/taon-admin-mode-configuration/components/taon-db-admin/index.d.ts +1 -0
- package/lib/ui/taon-admin-mode-configuration/components/taon-db-admin/index.js +5 -0
- package/lib/ui/taon-admin-mode-configuration/components/taon-db-admin/index.js.map +1 -0
- package/lib/ui/taon-admin-mode-configuration/components/taon-db-admin/taon-db-admin.component.d.ts +8 -0
- package/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.d.ts +2 -0
- package/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.js +5 -0
- package/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/index.js.map +1 -0
- package/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.component.d.ts +13 -0
- package/lib/ui/taon-admin-mode-configuration/components/taon-file-general-opt/taon-file-general-opt.module.d.ts +2 -0
- package/lib/ui/taon-admin-mode-configuration/index.js +2 -2
- package/lib/ui/taon-admin-mode-configuration/index.js.map +1 -1
- package/lib/ui/taon-admin-mode-configuration/models/taon-admin-mode-tabs.d.ts +5 -0
- package/lib/ui/taon-admin-mode-configuration/models/taon-admin-mode-tabs.js +3 -0
- package/lib/ui/taon-admin-mode-configuration/models/taon-admin-mode-tabs.js.map +1 -0
- package/lib/ui/taon-admin-mode-configuration/taon-admin-control.service.d.ts +14 -0
- package/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.module.d.ts +2 -0
- package/lib/ui/taon-admin-mode-configuration/taon-admin.models.js.map +1 -1
- package/lib/ui/taon-github-fork-me-corner/index.js +2 -2
- package/lib/ui/taon-github-fork-me-corner/index.js.map +1 -1
- package/lib/ui/taon-github-fork-me-ribbon/index.js +2 -2
- package/lib/ui/taon-github-fork-me-ribbon/index.js.map +1 -1
- package/lib/ui/taon-notifications/index.js.map +1 -1
- package/lib/ui/taon-notifications/taon-notifications.models.js +2 -2
- package/lib/ui/taon-notifications/taon-notifications.models.js.map +1 -1
- package/lib/ui/taon-progress-bar/index.js +2 -2
- package/lib/ui/taon-progress-bar/index.js.map +1 -1
- package/lib/ui/taon-session-passcode/index.js +2 -2
- package/lib/ui/taon-session-passcode/index.js.map +1 -1
- package/lib/ui/taon-table/index.js +2 -2
- package/lib/ui/taon-table/index.js.map +1 -1
- package/lib/ui/taon.models.js.map +1 -1
- package/lib/ui/toan-full-material.module.d.ts +2 -0
- package/lib/validators.js.map +1 -1
- package/migrations/index.js.map +1 -1
- package/migrations/migrations_index._auto-generated_.js.map +1 -1
- package/old-app .js.map +1 -1
- package/package.json +1 -1
- package/playground.js.map +1 -1
- package/tmp-environment.json +3 -3
- package/websql/README.md +24 -24
- package/websql/fesm2022/taon.mjs +4771 -4745
- package/websql/fesm2022/taon.mjs.map +1 -1
- package/websql/lib/base-classes/base-angular-service.d.ts +14 -0
- package/websql/lib/base-classes/base-custom-repository.d.ts +4 -0
- package/websql/lib/base-classes/base-entity.d.ts +9 -0
- package/websql/lib/base-classes/base-injector.d.ts +15 -9
- package/websql/lib/base-classes/base-repository.d.ts +25 -12
- package/websql/lib/base-classes/base.d.ts +8 -4
- package/websql/lib/create-context.d.ts +2 -1
- package/websql/lib/endpoint-context.d.ts +8 -5
- package/websql/lib/index.d.ts +7 -6
- package/websql/lib/orm.d.ts +15 -2
- package/websql/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { TaonContext } from '../create-context';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* TODO prevent calling methods when not initialized
|
|
6
|
+
* with init(ctx)
|
|
7
|
+
*/
|
|
8
|
+
export declare abstract class BaseAngularsService {
|
|
9
|
+
protected currentContext: TaonContext;
|
|
10
|
+
init(currentContext: TaonContext): void;
|
|
11
|
+
protected abstract initControllers(): void;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BaseAngularsService, never>;
|
|
13
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<BaseAngularsService>;
|
|
14
|
+
}
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
+
import { RelationPath } from 'taon-typeorm/browser';
|
|
2
3
|
import { BaseClass } from './base-class';
|
|
3
4
|
export declare abstract class BaseEntity<
|
|
4
5
|
/**
|
|
5
6
|
* type for cloning
|
|
6
7
|
*/
|
|
7
8
|
CloneT extends BaseClass = any> extends BaseClass<CloneT> {
|
|
9
|
+
/**
|
|
10
|
+
* simple check if relation is ok
|
|
11
|
+
*/
|
|
12
|
+
relation(relationName: RelationPath<CloneT>): string;
|
|
13
|
+
/**
|
|
14
|
+
* simple check if relation is ok
|
|
15
|
+
*/
|
|
16
|
+
relations(relationNames: RelationPath<CloneT>[]): string[];
|
|
8
17
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import { EndpointContext } from '../endpoint-context';
|
|
3
|
-
import type { BaseRepository } from './base-repository';
|
|
4
3
|
import { BaseClass } from './base-class';
|
|
4
|
+
import { BaseCustomRepository } from './base-custom-repository';
|
|
5
|
+
import type { BaseRepository } from './base-repository';
|
|
5
6
|
export declare class BaseInjector<CloneT extends BaseClass = any> {
|
|
6
7
|
/**
|
|
7
8
|
* for proxy purposes
|
|
@@ -29,14 +30,23 @@ export declare class BaseInjector<CloneT extends BaseClass = any> {
|
|
|
29
30
|
* inject crud repo for entity
|
|
30
31
|
*/
|
|
31
32
|
injectRepo<T>(entityForCrud: new (...args: any[]) => T): BaseRepository<T>;
|
|
32
|
-
injectCustomRepository<T>(cutomRepositoryClass: new (...args: any[]) => T): T;
|
|
33
|
+
injectCustomRepository<T extends BaseCustomRepository>(cutomRepositoryClass: new (...args: any[]) => T): T;
|
|
34
|
+
/**
|
|
35
|
+
* aliast to this.injectRepository()
|
|
36
|
+
*/
|
|
37
|
+
injectCustomRepo<T extends BaseCustomRepository>(cutomRepositoryClass: new (...args: any[]) => T): T;
|
|
33
38
|
/**
|
|
34
|
-
*
|
|
39
|
+
* example usage:
|
|
40
|
+
* ...
|
|
41
|
+
* exampleController = this.injectController(ExampleController);
|
|
42
|
+
* ...
|
|
35
43
|
*/
|
|
36
|
-
injectCustomRepo<T>(cutomRepositoryClass: new (...args: any[]) => T): T;
|
|
37
44
|
injectController<T>(ctor: new (...args: any[]) => T): T;
|
|
38
45
|
/**
|
|
39
|
-
*
|
|
46
|
+
* example usage:
|
|
47
|
+
* ...
|
|
48
|
+
* exampleSubscriber = this.injectSubscriber(ExampleSubscriber)
|
|
49
|
+
* ...
|
|
40
50
|
*/
|
|
41
51
|
injectSubscriber<T>(ctor: new (...args: any[]) => T): T;
|
|
42
52
|
/**
|
|
@@ -52,10 +62,6 @@ export declare class BaseInjector<CloneT extends BaseClass = any> {
|
|
|
52
62
|
* TODO
|
|
53
63
|
*/
|
|
54
64
|
injectContextProvider<T>(ctor: new (...args: any[]) => T): T;
|
|
55
|
-
/**
|
|
56
|
-
* Repositories to init (by controller)
|
|
57
|
-
*/
|
|
58
|
-
protected __repositories_to_init__: BaseRepository<any>[];
|
|
59
65
|
/**
|
|
60
66
|
* Inject: Controllers, Providers, Repositories, Services, etc.
|
|
61
67
|
* TODO addd nest js injecting
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import type
|
|
3
|
-
import type { QueryDeepPartialEntity } from 'taon-typeorm/
|
|
4
|
-
import type { UpsertOptions } from 'taon-typeorm/
|
|
5
|
-
import type { DataSource as DataSourceType } from 'taon-typeorm/browser';
|
|
2
|
+
import { type DeepPartial, type FindManyOptions, type FindOneOptions, type FindOptionsWhere, type InsertResult, type Repository, type SaveOptions, type UpdateResult } from 'taon-typeorm/browser';
|
|
3
|
+
import type { QueryDeepPartialEntity } from 'taon-typeorm/browser';
|
|
4
|
+
import type { UpsertOptions } from 'taon-typeorm/browser';
|
|
5
|
+
import type { DataSource as DataSourceType, QueryRunner, SelectQueryBuilder } from 'taon-typeorm/browser';
|
|
6
6
|
import { MySqlQuerySource } from 'taon-type-sql/browser';
|
|
7
|
-
import {
|
|
7
|
+
import { BaseCustomRepository } from './base-custom-repository';
|
|
8
8
|
export declare abstract class BaseRepository<Entity extends {
|
|
9
9
|
id?: any;
|
|
10
|
-
}> extends
|
|
11
|
-
private __entityClassResolveFn;
|
|
10
|
+
}> extends BaseCustomRepository {
|
|
12
11
|
abstract entityClassResolveFn: () => any;
|
|
13
12
|
constructor(__entityClassResolveFn: () => any);
|
|
14
13
|
private __dbQuery;
|
|
15
14
|
get dbQuery(): MySqlQuerySource;
|
|
16
15
|
get connection(): DataSourceType;
|
|
17
|
-
protected get repository():
|
|
16
|
+
protected get repository(): Repository<Entity>;
|
|
18
17
|
/**
|
|
19
18
|
* target for repository
|
|
20
19
|
*/
|
|
@@ -22,9 +21,8 @@ export declare abstract class BaseRepository<Entity extends {
|
|
|
22
21
|
/**
|
|
23
22
|
* alias to repository
|
|
24
23
|
*/
|
|
25
|
-
protected get repo():
|
|
24
|
+
protected get repo(): Repository<Entity>;
|
|
26
25
|
get repositoryExists(): boolean;
|
|
27
|
-
__init(context?: any): Promise<void>;
|
|
28
26
|
/**
|
|
29
27
|
* Checks if entity has an id.
|
|
30
28
|
* If entity composite compose ids, it will check them all.
|
|
@@ -46,9 +44,20 @@ export declare abstract class BaseRepository<Entity extends {
|
|
|
46
44
|
* -> it will actuall create new entity in db
|
|
47
45
|
* in oposite to typeorm create method
|
|
48
46
|
*/
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Creates a new entity instance.
|
|
49
|
+
*/
|
|
50
|
+
create(): Entity;
|
|
51
|
+
/**
|
|
52
|
+
* Creates new entities and copies all entity properties from given objects into their new entities.
|
|
53
|
+
* Note that it copies only properties that are present in entity schema.
|
|
54
|
+
*/
|
|
55
|
+
create(entityLikeArray: DeepPartial<Entity>[]): Entity[];
|
|
56
|
+
/**
|
|
57
|
+
* Creates a new entity instance and copies all entity properties from this object into a new entity.
|
|
58
|
+
* Note that it copies only properties that are present in entity schema.
|
|
59
|
+
*/
|
|
60
|
+
create(entityLike: DeepPartial<Entity>): Entity;
|
|
52
61
|
bulkSave(items: Entity[], options?: SaveOptions & {
|
|
53
62
|
reload: false;
|
|
54
63
|
}): Promise<Entity[]>;
|
|
@@ -227,6 +236,11 @@ export declare abstract class BaseRepository<Entity extends {
|
|
|
227
236
|
* Raw query execution is supported only by relational databases (MongoDB is not supported).
|
|
228
237
|
*/
|
|
229
238
|
query(query: string, parameters?: any[]): Promise<any>;
|
|
239
|
+
/**
|
|
240
|
+
* Executes a raw SQL query and returns a raw database results.
|
|
241
|
+
* Raw query execution is supported only by relational databases (MongoDB is not supported).
|
|
242
|
+
*/
|
|
243
|
+
createQueryBuilder(alias?: string, queryRunner?: QueryRunner): SelectQueryBuilder<Entity>;
|
|
230
244
|
/**
|
|
231
245
|
* Clears all the data from the given table/collection (truncates/drops it).
|
|
232
246
|
*
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
+
import * as abstractEntity from './base-abstract-entity';
|
|
3
|
+
import * as baseService from './base-angular-service';
|
|
4
|
+
import * as baseClass from './base-class';
|
|
2
5
|
import * as controller from './base-controller';
|
|
3
6
|
import * as crudController from './base-crud-controller';
|
|
7
|
+
import * as customRepository from './base-custom-repository';
|
|
4
8
|
import * as entity from './base-entity';
|
|
5
|
-
import * as
|
|
6
|
-
import * as repository from './base-repository';
|
|
9
|
+
import * as baseMigration from './base-migration';
|
|
7
10
|
import * as provider from './base-provider';
|
|
8
|
-
import * as
|
|
11
|
+
import * as repository from './base-repository';
|
|
9
12
|
import * as baseSubscriberEntity from './base-subscriber-for-entity';
|
|
10
|
-
import * as baseMigration from './base-migration';
|
|
11
13
|
export declare namespace Base {
|
|
12
14
|
export import Controller = controller.BaseController;
|
|
13
15
|
export import CrudController = crudController.BaseCrudController;
|
|
@@ -17,8 +19,10 @@ export declare namespace Base {
|
|
|
17
19
|
export import Provider = provider.BaseProvider;
|
|
18
20
|
export import Class = baseClass.BaseClass;
|
|
19
21
|
export import Repository = repository.BaseRepository;
|
|
22
|
+
export import CustomRepository = customRepository.BaseCustomRepository;
|
|
20
23
|
export import SubscriberForEntity = baseSubscriberEntity.BaseSubscriberForEntity;
|
|
21
24
|
export import Migration = baseMigration.BaseMigration;
|
|
25
|
+
export import AngularService = baseService.BaseAngularsService;
|
|
22
26
|
const Context: {
|
|
23
27
|
types: {
|
|
24
28
|
readonly controllers: any;
|
|
@@ -82,4 +82,5 @@ export declare const createContext: <CTX extends Record<string, object>, CTRL ex
|
|
|
82
82
|
readonly client: import("./realtime/realtime-client").RealtimeClient;
|
|
83
83
|
readonly server: import("./realtime/realtime-server").RealtimeServer;
|
|
84
84
|
};
|
|
85
|
-
};
|
|
85
|
+
};
|
|
86
|
+
export type TaonContext = ReturnType<typeof createContext>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
-
import {
|
|
3
|
-
import type { Application } from 'express';
|
|
2
|
+
import type { Server } from 'http';
|
|
4
3
|
import type { NgZone } from '@angular/core';
|
|
4
|
+
import type { Application } from 'express';
|
|
5
5
|
import { DataSource } from 'taon-typeorm/browser';
|
|
6
|
-
import type { Server } from 'http';
|
|
7
6
|
import type { BaseClass } from './base-classes/base-class';
|
|
8
7
|
import { ContextDbMigrations } from './context-db-migrations';
|
|
8
|
+
import { Models } from './models';
|
|
9
9
|
export declare class EndpointContext {
|
|
10
10
|
private originalConfig;
|
|
11
11
|
private configFn;
|
|
@@ -65,7 +65,7 @@ export declare class EndpointContext {
|
|
|
65
65
|
}): Promise<void>;
|
|
66
66
|
private getAutoGeneratedConfig;
|
|
67
67
|
get ngZone(): any;
|
|
68
|
-
startServer():
|
|
68
|
+
startServer(): Promise<void>;
|
|
69
69
|
displayRoutes(app: any): void;
|
|
70
70
|
get modeAllowsDatabaseCreation(): boolean;
|
|
71
71
|
private cloneClassWithNewMetadata;
|
|
@@ -74,10 +74,11 @@ export declare class EndpointContext {
|
|
|
74
74
|
private getRecrusiveClassesfromContexts;
|
|
75
75
|
getClassInstanceObjBy(classType: Models.ClassType): any;
|
|
76
76
|
private getClassesInstancesArrBy;
|
|
77
|
-
inject<T>(ctor: new (...args: any[]) => T, options
|
|
77
|
+
inject<T>(ctor: new (...args: any[]) => T, options: {
|
|
78
78
|
localInstance?: boolean;
|
|
79
79
|
contextClassInstance?: BaseClass;
|
|
80
80
|
locaInstanceConstructorArgs?: ConstructorParameters<typeof ctor>;
|
|
81
|
+
parentInstanceThatWillGetInjectedStuff: object;
|
|
81
82
|
}): T;
|
|
82
83
|
/**
|
|
83
84
|
* alias for inject
|
package/client/lib/index.d.ts
CHANGED
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import 'reflect-metadata';
|
|
3
|
-
import
|
|
3
|
+
import { NgZone } from '@angular/core';
|
|
4
4
|
import * as base from './base-classes/base';
|
|
5
5
|
import * as controllerDecorator from './decorators/classes/controller-decorator';
|
|
6
6
|
import * as entityDecorator from './decorators/classes/entity-decorator';
|
|
7
|
+
import * as migrationDecorator from './decorators/classes/migration-decorator';
|
|
7
8
|
import * as providerDecorator from './decorators/classes/provider-decorator';
|
|
8
9
|
import * as repositoryDecorator from './decorators/classes/repository-decorator';
|
|
9
10
|
import * as subscriberDecorator from './decorators/classes/subscriber-decorator';
|
|
10
|
-
import * as
|
|
11
|
-
import * as orm from './orm';
|
|
12
|
-
import * as models from './models';
|
|
11
|
+
import * as http from './decorators/http/http-decorators';
|
|
13
12
|
import * as endpointContext from './endpoint-context';
|
|
13
|
+
import * as models from './models';
|
|
14
|
+
import * as orm from './orm';
|
|
14
15
|
import * as allSymbols from './symbols';
|
|
15
|
-
import { NgZone } from '@angular/core';
|
|
16
16
|
export * from './ui';
|
|
17
17
|
export { EndpointContext } from './endpoint-context';
|
|
18
18
|
export { BaseRepository } from './base-classes/base-repository';
|
|
19
|
+
export { BaseCustomRepository } from './base-classes/base-custom-repository';
|
|
19
20
|
export { BaseController } from './base-classes/base-controller';
|
|
20
21
|
export { BaseProvider } from './base-classes/base-provider';
|
|
21
22
|
export { BaseEntity } from './base-classes/base-entity';
|
|
22
23
|
export { BaseContext } from './base-classes/base-context';
|
|
23
24
|
export { BaseMigration } from './base-classes/base-migration';
|
|
24
|
-
export { createContext } from './create-context';
|
|
25
|
+
export { createContext, TaonContext } from './create-context';
|
|
25
26
|
export { inject } from './inject';
|
|
26
27
|
export { Models } from './models';
|
|
27
28
|
export * from './constants';
|
package/client/package.json
CHANGED
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["c:/Users/darek/projects/npm/taon-dev/taon/src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-abstract-entity.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"base-abstract-entity.js","sourceRoot":"","sources":["c:/Users/darek/projects/npm/taon-dev/taon/src/lib/base-classes/base-abstract-entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,iBAAiB;AACjB,0CAA0C;AAC1C,YAAY;AACZ,gCAA6B;AAC7B,+CAA2C;AAG3C,kBAAkB;AAClB,IAAI,eAAe,GAAG,GAAG,EAAE;IACzB,OAAO,CAAC,MAAW,EAAE,EAAE,GAAE,CAAC,CAAC;AAC7B,CAAC,CAAC;AAEF,iBAAiB;AACjB,eAAe,GAAG,YAAM,CAAC;AACzB,YAAY;AAGL,IAAe,kBAAkB,GAAjC,MAAe,kBAEpB,SAAQ,wBAAkB;IAC1B,iBAAiB;IAGjB,AADA,YAAY;IACZ,EAAE,CAAS;IAEX,iBAAiB;IAGjB,AADA,YAAY;IACZ,OAAO,CAAS;CACjB,CAAA;AAZqB,gDAAkB;AAMtC;IAFC,SAAG,CAAC,MAAM,CAAC,SAAS,EAAE;IACvB,YAAY;8CACD;AAKX;IAFC,SAAG,CAAC,MAAM,CAAC,OAAO,EAAE;IACrB,YAAY;mDACI;6BAXI,kBAAkB;IADvC,eAAe,EAAE;GACI,kBAAkB,CAYvC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TaonContext } from '../create-context';
|
|
2
|
+
/**
|
|
3
|
+
* TODO prevent calling methods when not initialized
|
|
4
|
+
* with init(ctx)
|
|
5
|
+
*/
|
|
6
|
+
export declare abstract class BaseAngularsService {
|
|
7
|
+
protected currentContext: TaonContext;
|
|
8
|
+
init(currentContext: TaonContext): void;
|
|
9
|
+
protected abstract initControllers(): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* */
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.BaseAngularsService = void 0;
|
|
5
|
+
/**
|
|
6
|
+
* TODO prevent calling methods when not initialized
|
|
7
|
+
* with init(ctx)
|
|
8
|
+
*/
|
|
9
|
+
/* */
|
|
10
|
+
/* */
|
|
11
|
+
class BaseAngularsService {
|
|
12
|
+
currentContext;
|
|
13
|
+
init(currentContext) {
|
|
14
|
+
this.currentContext = currentContext;
|
|
15
|
+
this.initControllers();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.BaseAngularsService = BaseAngularsService;
|
|
19
|
+
//# sourceMappingURL=base-angular-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-angular-service.js","sourceRoot":"","sources":["c:/Users/darek/projects/npm/taon-dev/taon/src/lib/base-classes/base-angular-service.ts"],"names":[],"mappings":";AAAA,KAAK;;;AAIL;;;GAGG;AACH,KAAK;AACL,KAAK;AAEL,MAAsB,mBAAmB;IAC7B,cAAc,CAAc;IAC/B,IAAI,CAAC,cAA2B;QACrC,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,eAAe,EAAE,CAAC;IACzB,CAAC;CAGF;AARD,kDAQC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-class.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"base-class.js","sourceRoot":"","sources":["c:/Users/darek/projects/npm/taon-dev/taon/src/lib/base-classes/base-class.ts"],"names":[],"mappings":";;;AAAA,iBAAiB;AACjB,gDAA8C;AAC9C,sCAAiC;AAEjC,4DAAwD;AACxD,YAAY;AAEZ,MAAa,SAAS;IACpB,mCAAmC;IACnC;;;OAGG;IACH,KAAK,CAAC,CAAC,KAAI,CAAC;IACZ,YAAY;IAEZ,eAAe;IACR,KAAK,CAAC,QAA0B;QACrC,MAAM,OAAO,GAAG,4BAAY,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;QACxD,MAAM,MAAM,GAAG,OAAC,CAAC,KAAK,CAAC,IAAI,OAAO,EAAE,EAAE,OAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;QACzD,UAAI,CAAC,MAAM,CACT,QAAQ,IAAI,EAAE,EACd,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE;YACpB,IAAI,OAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,OAAC,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,OAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC/D,WAAW;YACb,CAAC;iBAAM,CAAC;gBACN,OAAC,CAAC,GAAG,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;YACnC,CAAC;QACH,CAAC,EACD;YACE,WAAW,EAAE,KAAK;SACnB,CACF,CAAC;QACF,wBAAwB;QACxB,OAAO,MAAM,CAAC;IAChB,CAAC;CAEF;AA9BD,8BA8BC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-context.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"base-context.js","sourceRoot":"","sources":["c:/Users/darek/projects/npm/taon-dev/taon/src/lib/base-classes/base-context.ts"],"names":[],"mappings":";;;AAAA,sDAAkD;AAClD,uDAAmD;AAEnD,MAAM,WAAW,GAAG,IAAA,8BAAa,EAAC,GAAG,EAAE,CAAC,CAAC;IACvC,WAAW,EAAE,aAAa;IAC1B,QAAQ,EAAE,IAAI;IACd,YAAY,EAAE;QACZ,aAAa;QACb,cAAc,EAAd,gCAAc;KACf;CACF,CAAC,CAAC,CAAC;AAEK,kCAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-controller.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"base-controller.js","sourceRoot":"","sources":["c:/Users/darek/projects/npm/taon-dev/taon/src/lib/base-classes/base-controller.ts"],"names":[],"mappings":";;;;;;;;;AAAA,qFAA4E;AAC5E,mDAA+C;AAGxC,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,4BAAY;IAC9C;;;OAGG;IACH,iBAAiB;QACf,OAAO,KAAK,CAAC,CAAC;IAChB,CAAC;CACF,CAAA;AARY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,qCAAc,EAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;GACnC,cAAc,CAQ1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-crud-controller.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"base-crud-controller.js","sourceRoot":"","sources":["c:/Users/darek/projects/npm/taon-dev/taon/src/lib/base-classes/base-crud-controller.ts"],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AA,IAAA,6BAAI,EAAC,IAAI,CAAC,CAAA;+CAOhB;AAKD;IADC,IAAA,6BAAG,EAAC,MAAM,CAAC;IAET,WAAA,IAAA,6BAAI,EAAC,IAAI,CAAC,CAAA;IACV,WAAA,IAAA,6BAAI,GAAE,CAAA;oDASR;AAKD;IADC,IAAA,+BAAK,EAAC,MAAM,CAAC;IAEX,WAAA,IAAA,6BAAI,EAAC,IAAI,CAAC,CAAA;IACV,WAAA,IAAA,6BAAI,GAAE,CAAA;mDASR;AAKD;IADC,IAAA,6BAAG,GAAE;IACM,WAAA,IAAA,6BAAI,GAAE,CAAA;oDAUjB;AAKD;IADC,IAAA,gCAAM,EAAC,MAAM,CAAC;IACH,WAAA,IAAA,6BAAI,EAAC,IAAI,CAAC,CAAA;oDAOrB;AAKD;IADC,IAAA,gCAAM,EAAC,kBAAkB,CAAC;IAExB,WAAA,IAAA,6BAAI,EAAC,KAAK,CAAC,CAAA;oDAQb;AAKD;IADC,IAAA,8BAAI,GAAE;IACC,WAAA,IAAA,6BAAI,GAAE,CAAA;gDAOb;AAKD;IADC,IAAA,8BAAI,GAAE;IACK,WAAA,IAAA,6BAAI,GAAE,CAAA;oDAOjB;6BA9PmB,kBAAkB;IADvC,IAAA,qCAAc,EAAC,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAC;GAC9B,kBAAkB,CAgQvC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.BaseCustomRepository = void 0;
|
|
10
|
+
const repository_decorator_1 = require("../decorators/classes/repository-decorator");
|
|
11
|
+
const base_injector_1 = require("./base-injector");
|
|
12
|
+
//#endregion
|
|
13
|
+
let BaseCustomRepository = class BaseCustomRepository extends base_injector_1.BaseInjector {
|
|
14
|
+
};
|
|
15
|
+
exports.BaseCustomRepository = BaseCustomRepository;
|
|
16
|
+
exports.BaseCustomRepository = BaseCustomRepository = __decorate([
|
|
17
|
+
(0, repository_decorator_1.TaonRepository)({ className: 'BaseCustomRepository' })
|
|
18
|
+
], BaseCustomRepository);
|
|
19
|
+
//# sourceMappingURL=base-custom-repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-custom-repository.js","sourceRoot":"","sources":["c:/Users/darek/projects/npm/taon-dev/taon/src/lib/base-classes/base-custom-repository.ts"],"names":[],"mappings":";;;;;;;;;AAGA,qFAA4E;AAE5E,mDAA+C;AAC/C,YAAY;AAGL,IAAe,oBAAoB,GAAnC,MAAe,oBAAqB,SAAQ,4BAAY;CAAG,CAAA;AAA5C,oDAAoB;+BAApB,oBAAoB;IADzC,IAAA,qCAAc,EAAC,EAAE,SAAS,EAAE,sBAAsB,EAAE,CAAC;GAChC,oBAAoB,CAAwB"}
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
+
import { RelationPath } from 'taon-typeorm';
|
|
1
2
|
import { BaseClass } from './base-class';
|
|
2
3
|
export declare abstract class BaseEntity<
|
|
3
4
|
/**
|
|
4
5
|
* type for cloning
|
|
5
6
|
*/
|
|
6
7
|
CloneT extends BaseClass = any> extends BaseClass<CloneT> {
|
|
7
|
-
|
|
8
|
+
/**
|
|
9
|
+
* simple check if relation is ok
|
|
10
|
+
*/
|
|
11
|
+
relation(relationName: RelationPath<CloneT>): string;
|
|
12
|
+
/**
|
|
13
|
+
* simple check if relation is ok
|
|
14
|
+
*/
|
|
15
|
+
relations(relationNames: RelationPath<CloneT>[]): string[];
|
|
16
|
+
}
|
|
@@ -7,8 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.BaseEntity = void 0;
|
|
10
|
-
|
|
11
|
-
const lib_1 = require("taon-typeorm/lib");
|
|
10
|
+
const lib_1 = require("taon-typeorm/lib"); // @websql
|
|
12
11
|
const base_class_1 = require("./base-class");
|
|
13
12
|
let EntityDecorator = () => {
|
|
14
13
|
return (target) => { };
|
|
@@ -17,6 +16,18 @@ let EntityDecorator = () => {
|
|
|
17
16
|
EntityDecorator = lib_1.Entity;
|
|
18
17
|
//#endregion
|
|
19
18
|
let BaseEntity = class BaseEntity extends base_class_1.BaseClass {
|
|
19
|
+
/**
|
|
20
|
+
* simple check if relation is ok
|
|
21
|
+
*/
|
|
22
|
+
relation(relationName) {
|
|
23
|
+
return relationName;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* simple check if relation is ok
|
|
27
|
+
*/
|
|
28
|
+
relations(relationNames) {
|
|
29
|
+
return relationNames;
|
|
30
|
+
}
|
|
20
31
|
};
|
|
21
32
|
exports.BaseEntity = BaseEntity;
|
|
22
33
|
exports.BaseEntity = BaseEntity = __decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-entity.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"base-entity.js","sourceRoot":"","sources":["c:/Users/darek/projects/npm/taon-dev/taon/src/lib/base-classes/base-entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,0CAA0C,CAAC,UAAU;AAMrD,6CAAyC;AAEzC,IAAI,eAAe,GAAG,GAAG,EAAE;IACzB,OAAO,CAAC,MAAW,EAAE,EAAE,GAAE,CAAC,CAAC;AAC7B,CAAC,CAAC;AAEF,iBAAiB;AACjB,eAAe,GAAG,YAAM,CAAC;AACzB,YAAY;AAGL,IAAe,UAAU,GAAzB,MAAe,UAKpB,SAAQ,sBAAiB;IACzB;;OAEG;IACH,QAAQ,CAAC,YAAkC;QACzC,OAAO,YAAsB,CAAC;IAChC,CAAC;IAED;;OAEG;IACH,SAAS,CAAC,aAAqC;QAC7C,OAAO,aAAyB,CAAC;IACnC,CAAC;CACF,CAAA;AAnBqB,gCAAU;qBAAV,UAAU;IAD/B,eAAe,EAAE;GACI,UAAU,CAmB/B"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { EndpointContext } from '../endpoint-context';
|
|
2
|
-
import type { BaseRepository } from './base-repository';
|
|
3
2
|
import { BaseClass } from './base-class';
|
|
3
|
+
import { BaseCustomRepository } from './base-custom-repository';
|
|
4
|
+
import type { BaseRepository } from './base-repository';
|
|
4
5
|
export declare class BaseInjector<CloneT extends BaseClass = any> {
|
|
5
6
|
/**
|
|
6
7
|
* for proxy purposes
|
|
@@ -28,14 +29,23 @@ export declare class BaseInjector<CloneT extends BaseClass = any> {
|
|
|
28
29
|
* inject crud repo for entity
|
|
29
30
|
*/
|
|
30
31
|
injectRepo<T>(entityForCrud: new (...args: any[]) => T): BaseRepository<T>;
|
|
31
|
-
injectCustomRepository<T>(cutomRepositoryClass: new (...args: any[]) => T): T;
|
|
32
|
+
injectCustomRepository<T extends BaseCustomRepository>(cutomRepositoryClass: new (...args: any[]) => T): T;
|
|
33
|
+
/**
|
|
34
|
+
* aliast to this.injectRepository()
|
|
35
|
+
*/
|
|
36
|
+
injectCustomRepo<T extends BaseCustomRepository>(cutomRepositoryClass: new (...args: any[]) => T): T;
|
|
32
37
|
/**
|
|
33
|
-
*
|
|
38
|
+
* example usage:
|
|
39
|
+
* ...
|
|
40
|
+
* exampleController = this.injectController(ExampleController);
|
|
41
|
+
* ...
|
|
34
42
|
*/
|
|
35
|
-
injectCustomRepo<T>(cutomRepositoryClass: new (...args: any[]) => T): T;
|
|
36
43
|
injectController<T>(ctor: new (...args: any[]) => T): T;
|
|
37
44
|
/**
|
|
38
|
-
*
|
|
45
|
+
* example usage:
|
|
46
|
+
* ...
|
|
47
|
+
* exampleSubscriber = this.injectSubscriber(ExampleSubscriber)
|
|
48
|
+
* ...
|
|
39
49
|
*/
|
|
40
50
|
injectSubscriber<T>(ctor: new (...args: any[]) => T): T;
|
|
41
51
|
/**
|
|
@@ -51,10 +61,6 @@ export declare class BaseInjector<CloneT extends BaseClass = any> {
|
|
|
51
61
|
* TODO
|
|
52
62
|
*/
|
|
53
63
|
injectContextProvider<T>(ctor: new (...args: any[]) => T): T;
|
|
54
|
-
/**
|
|
55
|
-
* Repositories to init (by controller)
|
|
56
|
-
*/
|
|
57
|
-
protected __repositories_to_init__: BaseRepository<any>[];
|
|
58
64
|
/**
|
|
59
65
|
* Inject: Controllers, Providers, Repositories, Services, etc.
|
|
60
66
|
* TODO addd nest js injecting
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BaseInjector = void 0;
|
|
4
4
|
//#region imports
|
|
5
5
|
const lib_1 = require("tnp-core/lib");
|
|
6
|
-
const symbols_1 = require("../symbols");
|
|
7
6
|
const class_helpers_1 = require("../helpers/class-helpers");
|
|
7
|
+
const symbols_1 = require("../symbols");
|
|
8
8
|
//#endregion
|
|
9
9
|
class BaseInjector {
|
|
10
10
|
/**
|
|
@@ -20,12 +20,7 @@ class BaseInjector {
|
|
|
20
20
|
* class initialization hook
|
|
21
21
|
* taon after class instace creation
|
|
22
22
|
*/
|
|
23
|
-
async _() {
|
|
24
|
-
const reposToInit = this.__repositories_to_init__;
|
|
25
|
-
for (const repo of reposToInit) {
|
|
26
|
-
await repo.__init(this);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
23
|
+
async _() { }
|
|
29
24
|
//#endregion
|
|
30
25
|
//#region context
|
|
31
26
|
/**
|
|
@@ -53,7 +48,6 @@ class BaseInjector {
|
|
|
53
48
|
resolveClassFromContext: 'BaseRepository',
|
|
54
49
|
locaInstanceConstructorArgs: [() => entityForCrud],
|
|
55
50
|
});
|
|
56
|
-
this.__repositories_to_init__.push(repoProxy);
|
|
57
51
|
return repoProxy;
|
|
58
52
|
}
|
|
59
53
|
//#endregion
|
|
@@ -62,31 +56,41 @@ class BaseInjector {
|
|
|
62
56
|
const repoProxy = this.__inject(cutomRepositoryClass, {
|
|
63
57
|
localInstance: true,
|
|
64
58
|
locaInstanceConstructorArgs: [
|
|
65
|
-
() =>
|
|
59
|
+
() => {
|
|
60
|
+
const classToProcess = this.ctx.allClassesInstances[class_helpers_1.ClassHelpers.getName(cutomRepositoryClass)];
|
|
61
|
+
return classToProcess.entityClassResolveFn();
|
|
62
|
+
},
|
|
66
63
|
],
|
|
67
64
|
});
|
|
68
|
-
this.__repositories_to_init__.push(repoProxy);
|
|
69
65
|
return repoProxy;
|
|
70
66
|
}
|
|
71
67
|
//#endregion
|
|
72
68
|
//#region inject / custom repo
|
|
73
69
|
/**
|
|
74
|
-
* aliast to .injectRepository()
|
|
70
|
+
* aliast to this.injectRepository()
|
|
75
71
|
*/
|
|
76
72
|
injectCustomRepo(cutomRepositoryClass) {
|
|
77
73
|
const repoProxy = this.injectCustomRepository(cutomRepositoryClass);
|
|
78
|
-
this.__repositories_to_init__.push(repoProxy);
|
|
79
74
|
return repoProxy;
|
|
80
75
|
}
|
|
81
76
|
//#endregion
|
|
82
77
|
//#region inject / controller
|
|
78
|
+
/**
|
|
79
|
+
* example usage:
|
|
80
|
+
* ...
|
|
81
|
+
* exampleController = this.injectController(ExampleController);
|
|
82
|
+
* ...
|
|
83
|
+
*/
|
|
83
84
|
injectController(ctor) {
|
|
84
85
|
return this.__inject(ctor, { localInstance: false });
|
|
85
86
|
}
|
|
86
87
|
//#endregion
|
|
87
88
|
//#region inject / ctrl
|
|
88
89
|
/**
|
|
89
|
-
*
|
|
90
|
+
* example usage:
|
|
91
|
+
* ...
|
|
92
|
+
* exampleSubscriber = this.injectSubscriber(ExampleSubscriber)
|
|
93
|
+
* ...
|
|
90
94
|
*/
|
|
91
95
|
injectSubscriber(ctor) {
|
|
92
96
|
return this.__inject(ctor, { localInstance: false });
|
|
@@ -117,10 +121,6 @@ class BaseInjector {
|
|
|
117
121
|
return this.__inject(ctor, { localInstance: false });
|
|
118
122
|
}
|
|
119
123
|
//#endregion
|
|
120
|
-
/**
|
|
121
|
-
* Repositories to init (by controller)
|
|
122
|
-
*/
|
|
123
|
-
__repositories_to_init__ = [];
|
|
124
124
|
//#region inject / __ inject
|
|
125
125
|
/**
|
|
126
126
|
* Inject: Controllers, Providers, Repositories, Services, etc.
|
|
@@ -145,6 +145,7 @@ class BaseInjector {
|
|
|
145
145
|
var instance = resultContext.inject(ctor, {
|
|
146
146
|
...options,
|
|
147
147
|
contextClassInstance,
|
|
148
|
+
parentInstanceThatWillGetInjectedStuff: this,
|
|
148
149
|
});
|
|
149
150
|
if (!instance) {
|
|
150
151
|
throw new Error(`Not able to inject "${class_helpers_1.ClassHelpers.getName(ctor) || ctor.name}" inside ` +
|
|
@@ -176,6 +177,7 @@ class BaseInjector {
|
|
|
176
177
|
var instance = resultContext.inject(ctor, {
|
|
177
178
|
...options,
|
|
178
179
|
contextClassInstance,
|
|
180
|
+
parentInstanceThatWillGetInjectedStuff: this,
|
|
179
181
|
});
|
|
180
182
|
if (!instance) {
|
|
181
183
|
const classNameNotResolved = class_helpers_1.ClassHelpers.getName(ctor) || ctor.name;
|