taon 19.0.86 → 21.0.6
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 +1953 -1238
- package/browser/fesm2022/taon.mjs.map +1 -1
- package/browser/package.json +1 -1
- package/browser/types/taon.d.ts +2152 -0
- package/lib/base-classes/base-abstract-entity.d.ts +1 -1
- package/lib/base-classes/base-abstract-entity.js +12 -12
- package/lib/base-classes/base-abstract-entity.js.map +1 -1
- package/lib/base-classes/base-angular-service.d.ts +1 -1
- package/lib/base-classes/base-angular-service.js +6 -3
- package/lib/base-classes/base-angular-service.js.map +1 -1
- package/lib/base-classes/base-context.d.ts +2 -2
- package/lib/base-classes/base-controller.js +7 -1
- package/lib/base-classes/base-controller.js.map +1 -1
- package/lib/base-classes/base-crud-controller.js +52 -12
- package/lib/base-classes/base-crud-controller.js.map +1 -1
- package/lib/base-classes/base-entity.js +2 -6
- package/lib/base-classes/base-entity.js.map +1 -1
- package/lib/base-classes/base-repository.d.ts +1 -1
- package/lib/base-classes/base-repository.js +15 -10
- package/lib/base-classes/base-repository.js.map +1 -1
- package/lib/base-classes/base.d.ts +1 -46
- package/lib/base-classes/base.js +17 -30
- 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/create-context.d.ts +4 -4
- package/lib/decorators/classes/entity-decorator.js +1 -1
- package/lib/decorators/classes/entity-decorator.js.map +1 -1
- package/lib/decorators/http/http-decorators.d.ts +1 -19
- package/lib/decorators/http/http-decorators.js +20 -22
- package/lib/decorators/http/http-decorators.js.map +1 -1
- package/lib/endpoint-context.d.ts +2 -2
- package/lib/formly/{formly-group-wrapper-component.d.ts → formly-group-wrapper.component.d.ts} +1 -1
- package/lib/formly/{formly-repeat-component.d.ts → formly-repeat.component.d.ts} +1 -1
- package/lib/formly/fromly.js +24 -24
- package/lib/formly/fromly.js.map +1 -1
- package/lib/index.d.ts +146 -45
- package/lib/index.js +166 -55
- package/lib/index.js.map +1 -1
- package/lib/orm/columns.d.ts +28 -0
- package/lib/orm/columns.js +102 -0
- package/lib/orm/columns.js.map +1 -0
- package/lib/orm/index.d.ts +1 -0
- package/lib/orm/index.js +73 -0
- package/lib/orm/index.js.map +1 -0
- package/lib/realtime/realtime-core.d.ts +1 -1
- package/lib/realtime/realtime-strategy/realtime-strategy-socket-io.d.ts +1 -2
- package/lib/realtime/realtime-strategy/realtime-strategy-socket-io.js.map +1 -1
- package/lib/realtime/realtime-strategy/realtime-strategy.d.ts +1 -1
- package/lib/realtime/realtime-subs-manager.d.ts +1 -1
- package/lib/symbols.d.ts +31 -31
- package/lib/symbols.js +59 -59
- package/lib/symbols.js.map +1 -1
- package/lib/ui/index.js +2 -2
- package/lib/ui/taon-admin-mode-configuration/index.js +2 -2
- package/package.json +6 -6
- package/websql/fesm2022/taon.mjs +1316 -648
- package/websql/fesm2022/taon.mjs.map +1 -1
- package/websql/package.json +1 -1
- package/websql/types/taon.d.ts +2161 -0
- package/browser/index.d.ts +0 -6
- package/browser/lib/base-classes/base-abstract-entity.d.ts +0 -8
- package/browser/lib/base-classes/base-angular-service.d.ts +0 -34
- package/browser/lib/base-classes/base-class.d.ts +0 -16
- package/browser/lib/base-classes/base-context.d.ts +0 -21
- package/browser/lib/base-classes/base-controller.d.ts +0 -83
- package/browser/lib/base-classes/base-crud-controller.d.ts +0 -29
- package/browser/lib/base-classes/base-custom-repository.d.ts +0 -4
- package/browser/lib/base-classes/base-entity.d.ts +0 -17
- package/browser/lib/base-classes/base-file-upload.middleware.d.ts +0 -15
- package/browser/lib/base-classes/base-injector.d.ts +0 -68
- package/browser/lib/base-classes/base-middleware.d.ts +0 -39
- package/browser/lib/base-classes/base-migration.d.ts +0 -12
- package/browser/lib/base-classes/base-provider.d.ts +0 -9
- package/browser/lib/base-classes/base-repository.d.ts +0 -267
- package/browser/lib/base-classes/base-subscriber-for-entity.d.ts +0 -82
- package/browser/lib/base-classes/base.d.ts +0 -47
- package/browser/lib/config/controller-config.d.ts +0 -22
- package/browser/lib/config/controller-options.d.ts +0 -17
- package/browser/lib/config/method-config.d.ts +0 -40
- package/browser/lib/config/param-config.d.ts +0 -9
- package/browser/lib/constants.d.ts +0 -10
- package/browser/lib/context-db-migrations.d.ts +0 -18
- package/browser/lib/create-context.d.ts +0 -79
- package/browser/lib/decorators/classes/controller-decorator.d.ts +0 -6
- package/browser/lib/decorators/classes/entity-decorator.d.ts +0 -20
- package/browser/lib/decorators/classes/middleware-decorator.d.ts +0 -8
- package/browser/lib/decorators/classes/migration-decorator.d.ts +0 -8
- package/browser/lib/decorators/classes/provider-decorator.d.ts +0 -8
- package/browser/lib/decorators/classes/repository-decorator.d.ts +0 -8
- package/browser/lib/decorators/classes/subscriber-decorator.d.ts +0 -9
- package/browser/lib/decorators/decorator-abstract-opt.d.ts +0 -4
- package/browser/lib/decorators/http/http-decorators.d.ts +0 -21
- package/browser/lib/decorators/http/http-methods-decorators.d.ts +0 -71
- package/browser/lib/decorators/http/http-params-decorators.d.ts +0 -9
- package/browser/lib/dependency-injection/di-container.d.ts +0 -6
- package/browser/lib/endpoint-context-storage.d.ts +0 -12
- package/browser/lib/endpoint-context.d.ts +0 -198
- package/browser/lib/entity-process.d.ts +0 -40
- package/browser/lib/get-response-value.d.ts +0 -7
- package/browser/lib/helpers/class-helpers.d.ts +0 -25
- package/browser/lib/helpers/clone-obj.d.ts +0 -2
- package/browser/lib/helpers/taon-helpers.d.ts +0 -19
- package/browser/lib/index.d.ts +0 -129
- package/browser/lib/inject.d.ts +0 -5
- package/browser/lib/models.d.ts +0 -257
- package/browser/lib/orm.d.ts +0 -3
- package/browser/lib/realtime/realtime-client.d.ts +0 -42
- package/browser/lib/realtime/realtime-core.d.ts +0 -41
- package/browser/lib/realtime/realtime-server.d.ts +0 -44
- package/browser/lib/realtime/realtime-strategy/index.d.ts +0 -5
- package/browser/lib/realtime/realtime-strategy/realtime-strategy-ipc.d.ts +0 -82
- package/browser/lib/realtime/realtime-strategy/realtime-strategy-mock.d.ts +0 -15
- package/browser/lib/realtime/realtime-strategy/realtime-strategy-socket-io.d.ts +0 -16
- package/browser/lib/realtime/realtime-strategy/realtime-strategy.d.ts +0 -12
- package/browser/lib/realtime/realtime-subs-manager.d.ts +0 -15
- package/browser/lib/realtime/realtime.models.d.ts +0 -28
- package/browser/lib/symbols.d.ts +0 -66
- package/browser/lib/ui/index.d.ts +0 -2
- package/browser/lib/ui/taon-admin-mode-configuration/index.d.ts +0 -2
- package/browser/lib/ui/taon-admin-mode-configuration/taon-admin.service.d.ts +0 -22
- package/browser/lib/validators.d.ts +0 -8
- package/browser/public-api.d.ts +0 -2
- package/lib/formly/formly-group-wrapper-component.js +0 -51
- package/lib/formly/formly-group-wrapper-component.js.map +0 -1
- package/lib/formly/formly-repeat-component.js +0 -95
- package/lib/formly/formly-repeat-component.js.map +0 -1
- package/lib/orm.d.ts +0 -68
- package/lib/orm.js +0 -112
- package/lib/orm.js.map +0 -1
- package/websql/index.d.ts +0 -6
- package/websql/lib/base-classes/base-abstract-entity.d.ts +0 -8
- package/websql/lib/base-classes/base-angular-service.d.ts +0 -34
- package/websql/lib/base-classes/base-class.d.ts +0 -16
- package/websql/lib/base-classes/base-context.d.ts +0 -21
- package/websql/lib/base-classes/base-controller.d.ts +0 -83
- package/websql/lib/base-classes/base-crud-controller.d.ts +0 -29
- package/websql/lib/base-classes/base-custom-repository.d.ts +0 -4
- package/websql/lib/base-classes/base-entity.d.ts +0 -17
- package/websql/lib/base-classes/base-file-upload.middleware.d.ts +0 -15
- package/websql/lib/base-classes/base-injector.d.ts +0 -68
- package/websql/lib/base-classes/base-middleware.d.ts +0 -39
- package/websql/lib/base-classes/base-migration.d.ts +0 -12
- package/websql/lib/base-classes/base-provider.d.ts +0 -9
- package/websql/lib/base-classes/base-repository.d.ts +0 -272
- package/websql/lib/base-classes/base-subscriber-for-entity.d.ts +0 -82
- package/websql/lib/base-classes/base.d.ts +0 -47
- package/websql/lib/config/controller-config.d.ts +0 -22
- package/websql/lib/config/controller-options.d.ts +0 -17
- package/websql/lib/config/method-config.d.ts +0 -40
- package/websql/lib/config/param-config.d.ts +0 -9
- package/websql/lib/constants.d.ts +0 -10
- package/websql/lib/context-db-migrations.d.ts +0 -18
- package/websql/lib/create-context.d.ts +0 -79
- package/websql/lib/decorators/classes/controller-decorator.d.ts +0 -6
- package/websql/lib/decorators/classes/entity-decorator.d.ts +0 -20
- package/websql/lib/decorators/classes/middleware-decorator.d.ts +0 -8
- package/websql/lib/decorators/classes/migration-decorator.d.ts +0 -8
- package/websql/lib/decorators/classes/provider-decorator.d.ts +0 -8
- package/websql/lib/decorators/classes/repository-decorator.d.ts +0 -8
- package/websql/lib/decorators/classes/subscriber-decorator.d.ts +0 -9
- package/websql/lib/decorators/decorator-abstract-opt.d.ts +0 -4
- package/websql/lib/decorators/http/http-decorators.d.ts +0 -21
- package/websql/lib/decorators/http/http-methods-decorators.d.ts +0 -71
- package/websql/lib/decorators/http/http-params-decorators.d.ts +0 -9
- package/websql/lib/dependency-injection/di-container.d.ts +0 -6
- package/websql/lib/endpoint-context-storage.d.ts +0 -12
- package/websql/lib/endpoint-context.d.ts +0 -200
- package/websql/lib/entity-process.d.ts +0 -40
- package/websql/lib/get-response-value.d.ts +0 -7
- package/websql/lib/helpers/class-helpers.d.ts +0 -25
- package/websql/lib/helpers/clone-obj.d.ts +0 -2
- package/websql/lib/helpers/taon-helpers.d.ts +0 -19
- package/websql/lib/index.d.ts +0 -129
- package/websql/lib/inject.d.ts +0 -5
- package/websql/lib/models.d.ts +0 -261
- package/websql/lib/orm.d.ts +0 -69
- package/websql/lib/realtime/realtime-client.d.ts +0 -42
- package/websql/lib/realtime/realtime-core.d.ts +0 -41
- package/websql/lib/realtime/realtime-server.d.ts +0 -44
- package/websql/lib/realtime/realtime-strategy/index.d.ts +0 -5
- package/websql/lib/realtime/realtime-strategy/realtime-strategy-ipc.d.ts +0 -82
- package/websql/lib/realtime/realtime-strategy/realtime-strategy-mock.d.ts +0 -15
- package/websql/lib/realtime/realtime-strategy/realtime-strategy-socket-io.d.ts +0 -16
- package/websql/lib/realtime/realtime-strategy/realtime-strategy.d.ts +0 -12
- package/websql/lib/realtime/realtime-subs-manager.d.ts +0 -15
- package/websql/lib/realtime/realtime.models.d.ts +0 -28
- package/websql/lib/symbols.d.ts +0 -66
- package/websql/lib/ui/index.d.ts +0 -2
- package/websql/lib/ui/taon-admin-mode-configuration/index.d.ts +0 -2
- package/websql/lib/ui/taon-admin-mode-configuration/taon-admin.service.d.ts +0 -22
- package/websql/lib/validators.d.ts +0 -8
- package/websql/public-api.d.ts +0 -2
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import type { AxiosResponse } from 'axios';
|
|
3
|
-
import { TaonClientMiddlewareInterceptOptions, TaonServerMiddlewareInterceptOptions } from 'ng2-rest/websql';
|
|
4
|
-
import { Observable } from 'rxjs';
|
|
5
|
-
import { CoreModels } from 'tnp-core/websql';
|
|
6
|
-
import { TaonBaseInjector } from './base-injector';
|
|
7
|
-
/**
|
|
8
|
-
* TODO
|
|
9
|
-
* - global provider available in all contexts
|
|
10
|
-
* - provider available in own context
|
|
11
|
-
*/
|
|
12
|
-
export declare abstract class TaonBaseMiddleware extends TaonBaseInjector {
|
|
13
|
-
}
|
|
14
|
-
export interface TaonAdditionalMiddlewareMethodInfo {
|
|
15
|
-
methodName: string;
|
|
16
|
-
expressPath: string;
|
|
17
|
-
httpRequestType: CoreModels.HttpMethod;
|
|
18
|
-
}
|
|
19
|
-
export interface TaonBaseMiddleware {
|
|
20
|
-
/**
|
|
21
|
-
* Global interceptor for whole context
|
|
22
|
-
* backend request
|
|
23
|
-
*/
|
|
24
|
-
interceptServer({ req, res, next, }: TaonServerMiddlewareInterceptOptions): Promise<void> | void;
|
|
25
|
-
/**
|
|
26
|
-
* Global interceptor for whole context
|
|
27
|
-
* client requests
|
|
28
|
-
*/
|
|
29
|
-
interceptClient({ req, next, }: TaonClientMiddlewareInterceptOptions): Observable<AxiosResponse<any>>;
|
|
30
|
-
/**
|
|
31
|
-
* Specyfic controller method interceptor
|
|
32
|
-
*/
|
|
33
|
-
interceptServerMethod({ req, res, next }: TaonServerMiddlewareInterceptOptions, { methodName, expressPath, httpRequestType, }: TaonAdditionalMiddlewareMethodInfo): Promise<void> | void;
|
|
34
|
-
/**
|
|
35
|
-
* Controller method frontned interceptor
|
|
36
|
-
* TODO not needed ?
|
|
37
|
-
*/
|
|
38
|
-
interceptClientMethod({ req, next }: TaonClientMiddlewareInterceptOptions, { methodName, expressPath, httpRequestType, }: TaonAdditionalMiddlewareMethodInfo): Observable<AxiosResponse<any>>;
|
|
39
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import { MigrationInterface, QueryRunner } from 'taon-typeorm/websql';
|
|
3
|
-
import { TaonBaseInjector } from './base-injector';
|
|
4
|
-
export declare class TaonBaseMigration extends TaonBaseInjector implements MigrationInterface {
|
|
5
|
-
/**
|
|
6
|
-
* by default is READY to run
|
|
7
|
-
*/
|
|
8
|
-
isReadyToRun(): boolean;
|
|
9
|
-
getDescription(): string;
|
|
10
|
-
up(queryRunner: QueryRunner): Promise<any>;
|
|
11
|
-
down(queryRunner: QueryRunner): Promise<any>;
|
|
12
|
-
}
|
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import { type DeepPartial, type FindManyOptions, type FindOneOptions, type FindOptionsWhere, type InsertResult, type Repository, type SaveOptions, type UpdateResult } from 'taon-typeorm/websql';
|
|
3
|
-
import type { QueryDeepPartialEntity } from 'taon-typeorm/websql';
|
|
4
|
-
import type { UpsertOptions } from 'taon-typeorm/websql';
|
|
5
|
-
import type { DataSource as DataSourceType, QueryRunner, SelectQueryBuilder } from 'taon-typeorm/websql';
|
|
6
|
-
import { MySqlQuerySource } from 'taon-type-sql/websql';
|
|
7
|
-
import { TaonBaseCustomRepository } from './base-custom-repository';
|
|
8
|
-
export declare abstract class TaonBaseRepository<Entity extends {
|
|
9
|
-
id?: any;
|
|
10
|
-
}> extends TaonBaseCustomRepository {
|
|
11
|
-
abstract entityClassResolveFn: () => any;
|
|
12
|
-
constructor(__entityClassResolveFn: () => any);
|
|
13
|
-
private __dbQuery;
|
|
14
|
-
get dbQuery(): MySqlQuerySource;
|
|
15
|
-
get connection(): DataSourceType;
|
|
16
|
-
protected get repository(): Repository<Entity>;
|
|
17
|
-
/**
|
|
18
|
-
* target for repository
|
|
19
|
-
*/
|
|
20
|
-
get target(): Function;
|
|
21
|
-
/**
|
|
22
|
-
* alias to repository
|
|
23
|
-
*/
|
|
24
|
-
protected get repo(): Repository<Entity>;
|
|
25
|
-
get repositoryExists(): boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Checks if entity has an id.
|
|
28
|
-
* If entity composite compose ids, it will check them all.
|
|
29
|
-
*/
|
|
30
|
-
hasId(entity: Entity): boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Gets entity mixed id.
|
|
33
|
-
*/
|
|
34
|
-
getId(entity: Entity): any;
|
|
35
|
-
/**
|
|
36
|
-
Saves a given entity in the database.
|
|
37
|
-
* If entity does not exist in the database then inserts, otherwise updates.
|
|
38
|
-
*/
|
|
39
|
-
save(item: Entity, options?: SaveOptions & {
|
|
40
|
-
reload: false;
|
|
41
|
-
}): Promise<Entity>;
|
|
42
|
-
/**
|
|
43
|
-
* alias to save
|
|
44
|
-
* -> it will actuall create new entity in db
|
|
45
|
-
* in oposite to typeorm create method
|
|
46
|
-
*/
|
|
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;
|
|
61
|
-
bulkSave(items: Entity[], options?: SaveOptions & {
|
|
62
|
-
reload: false;
|
|
63
|
-
}): Promise<Entity[]>;
|
|
64
|
-
/**
|
|
65
|
-
* @deprecated use bulkSave instead
|
|
66
|
-
*/
|
|
67
|
-
bulkCreate(items: Entity[], options?: SaveOptions & {
|
|
68
|
-
reload: false;
|
|
69
|
-
}): Promise<Entity[]>;
|
|
70
|
-
/**
|
|
71
|
-
* Saves all given entities in the database.
|
|
72
|
-
* If entities do not exist in the database then inserts, otherwise updates.
|
|
73
|
-
*/
|
|
74
|
-
/**
|
|
75
|
-
* Merges multiple entities (or entity-like objects) into a given entity.
|
|
76
|
-
*/
|
|
77
|
-
merge(mergeIntoEntity: Entity, ...entityLikes: Entity[]): Entity;
|
|
78
|
-
/**
|
|
79
|
-
* Creates a new entity from the given plain javascript object. If entity already exist in the database, then
|
|
80
|
-
* it loads it (and everything related to it), replaces all values with the new ones from the given object
|
|
81
|
-
* and returns this new entity. This new entity is actually a loaded from the db entity with all properties
|
|
82
|
-
* replaced from the new object.
|
|
83
|
-
*
|
|
84
|
-
* Note that given entity-like object must have an entity id / primary key to find entity by.
|
|
85
|
-
* Returns undefined if entity with given id was not found.
|
|
86
|
-
*/
|
|
87
|
-
preload(entityLike: Entity): Promise<Entity | undefined>;
|
|
88
|
-
/**
|
|
89
|
-
* Removes a given entities from the database.
|
|
90
|
-
*/
|
|
91
|
-
remove(idOrEntity: number | string | Entity): Promise<Entity>;
|
|
92
|
-
/**
|
|
93
|
-
* alias to remove
|
|
94
|
-
*/
|
|
95
|
-
delete(idOrEntity: number | string | Partial<Entity>): Promise<Entity>;
|
|
96
|
-
/**
|
|
97
|
-
* alias to removeById
|
|
98
|
-
*/
|
|
99
|
-
deleteById(id: number | string): Promise<Entity>;
|
|
100
|
-
bulkRemove(idsOrEntities: (number | string | Entity)[]): Promise<Entity[]>;
|
|
101
|
-
bulkDelete(ids: (number | string | Entity)[]): Promise<Entity[]>;
|
|
102
|
-
/**
|
|
103
|
-
* Records the delete date of all given entities.
|
|
104
|
-
*/
|
|
105
|
-
softRemove<T extends Entity>(entities: T[], options: SaveOptions & {
|
|
106
|
-
reload: false;
|
|
107
|
-
}): Promise<T[]>;
|
|
108
|
-
/**
|
|
109
|
-
* Records the delete date of all given entities.
|
|
110
|
-
*/
|
|
111
|
-
softRemove<T extends Entity>(entities: T[], options?: SaveOptions): Promise<(T & Entity)[]>;
|
|
112
|
-
/**
|
|
113
|
-
* Records the delete date of a given entity.
|
|
114
|
-
*/
|
|
115
|
-
softRemove<T extends Entity>(entity: T, options: SaveOptions & {
|
|
116
|
-
reload: false;
|
|
117
|
-
}): Promise<T>;
|
|
118
|
-
/**
|
|
119
|
-
* Recovers all given entities in the database.
|
|
120
|
-
*/
|
|
121
|
-
recover<T extends Entity>(entities: T[], options: SaveOptions & {
|
|
122
|
-
reload: false;
|
|
123
|
-
}): Promise<T[]>;
|
|
124
|
-
/**
|
|
125
|
-
* Recovers all given entities in the database.
|
|
126
|
-
*/
|
|
127
|
-
recover<T extends Entity>(entities: T[], options?: SaveOptions): Promise<(T & Entity)[]>;
|
|
128
|
-
/**
|
|
129
|
-
* Recovers a given entity in the database.
|
|
130
|
-
*/
|
|
131
|
-
recover<T extends Entity>(entity: T, options: SaveOptions & {
|
|
132
|
-
reload: false;
|
|
133
|
-
}): Promise<T>;
|
|
134
|
-
/**
|
|
135
|
-
* Inserts a given entity into the database.
|
|
136
|
-
* Unlike save method executes a primitive operation without cascades, relations and other operations included.
|
|
137
|
-
* Executes fast and efficient INSERT query.
|
|
138
|
-
* Does not check if entity exist in the database, so query will fail if duplicate entity is being inserted.
|
|
139
|
-
*/
|
|
140
|
-
insert(entity: QueryDeepPartialEntity<Entity> | QueryDeepPartialEntity<Entity>[]): Promise<InsertResult>;
|
|
141
|
-
update(item: Entity): Promise<Entity>;
|
|
142
|
-
private allowedTypesToUpdate;
|
|
143
|
-
updateById<ENTITY = Entity>(id: number | string, item: Entity): Promise<ENTITY>;
|
|
144
|
-
bulkUpdate(items: Entity[]): Promise<{
|
|
145
|
-
models: any[];
|
|
146
|
-
}>;
|
|
147
|
-
/**
|
|
148
|
-
* Inserts a given entity into the database, unless a unique constraint conflicts then updates the entity
|
|
149
|
-
* Unlike save method executes a primitive operation without cascades, relations and other operations included.
|
|
150
|
-
* Executes fast and efficient INSERT ... ON CONFLICT DO UPDATE/ON DUPLICATE KEY UPDATE query.
|
|
151
|
-
*/
|
|
152
|
-
upsert(entityOrEntities: QueryDeepPartialEntity<Entity> | QueryDeepPartialEntity<Entity>[], conflictPathsOrOptions: string[] | UpsertOptions<Entity>): Promise<InsertResult>;
|
|
153
|
-
/**
|
|
154
|
-
* Records the delete date of entities by a given criteria.
|
|
155
|
-
* Unlike save method executes a primitive operation without cascades, relations and other operations included.
|
|
156
|
-
* Executes fast and efficient SOFT-DELETE query.
|
|
157
|
-
* Does not check if entity exist in the database.
|
|
158
|
-
*/
|
|
159
|
-
softDelete(criteria: string | string[] | number | number[] | Date | Date[] | FindOptionsWhere<Entity>): Promise<UpdateResult>;
|
|
160
|
-
/**
|
|
161
|
-
* Restores entities by a given criteria.
|
|
162
|
-
* Unlike save method executes a primitive operation without cascades, relations and other operations included.
|
|
163
|
-
* Executes fast and efficient SOFT-DELETE query.
|
|
164
|
-
* Does not check if entity exist in the database.
|
|
165
|
-
*/
|
|
166
|
-
restore(criteria: string | string[] | number | number[] | Date | Date[] | FindOptionsWhere<Entity>): Promise<UpdateResult>;
|
|
167
|
-
/**
|
|
168
|
-
* Counts entities that match given options.
|
|
169
|
-
* Useful for pagination.
|
|
170
|
-
*/
|
|
171
|
-
count(options?: FindManyOptions<Entity>): Promise<number>;
|
|
172
|
-
/**
|
|
173
|
-
* Counts entities that match given conditions.
|
|
174
|
-
* Useful for pagination.
|
|
175
|
-
*/
|
|
176
|
-
countBy(where: FindOptionsWhere<Entity> | FindOptionsWhere<Entity>[]): Promise<number>;
|
|
177
|
-
/**
|
|
178
|
-
* Finds entities that match given find options.
|
|
179
|
-
*/
|
|
180
|
-
find(options?: FindManyOptions<Entity>): Promise<Entity[]>;
|
|
181
|
-
/**
|
|
182
|
-
* Finds entities that match given find options.
|
|
183
|
-
*/
|
|
184
|
-
findBy(where: FindOptionsWhere<Entity> | FindOptionsWhere<Entity>[]): Promise<Entity[]>;
|
|
185
|
-
/**
|
|
186
|
-
* Finds entities that match given find options.
|
|
187
|
-
* Also counts all entities that match given conditions,
|
|
188
|
-
* but ignores pagination settings (from and take options).
|
|
189
|
-
*/
|
|
190
|
-
findAndCount(options?: FindManyOptions<Entity>): Promise<[Entity[], number]>;
|
|
191
|
-
/**
|
|
192
|
-
* Finds entities that match given WHERE conditions.
|
|
193
|
-
* Also counts all entities that match given conditions,
|
|
194
|
-
* but ignores pagination settings (from and take options).
|
|
195
|
-
*/
|
|
196
|
-
findAndCountBy(where: FindOptionsWhere<Entity> | FindOptionsWhere<Entity>[]): Promise<[Entity[], number]>;
|
|
197
|
-
/**
|
|
198
|
-
* Finds entities with ids.
|
|
199
|
-
* Optionally find options or conditions can be applied.
|
|
200
|
-
*
|
|
201
|
-
* @deprecated use `findBy` method instead in conjunction with `In` operator, for example:
|
|
202
|
-
*
|
|
203
|
-
* .findBy({
|
|
204
|
-
* id: In([1, 2, 3])
|
|
205
|
-
* })
|
|
206
|
-
*/
|
|
207
|
-
findByIds(ids: any[]): Promise<Entity[]>;
|
|
208
|
-
/**
|
|
209
|
-
* Finds first entity by a given find options.
|
|
210
|
-
* If entity was not found in the database - returns null.
|
|
211
|
-
*/
|
|
212
|
-
findOne(options: FindOneOptions<Entity>): Promise<Entity | null>;
|
|
213
|
-
/**
|
|
214
|
-
* Finds first entity that matches given where condition.
|
|
215
|
-
* If entity was not found in the database - returns null.
|
|
216
|
-
*/
|
|
217
|
-
findOneBy(where: FindOptionsWhere<Entity> | FindOptionsWhere<Entity>[]): Promise<Entity | null>;
|
|
218
|
-
/**
|
|
219
|
-
* Finds first entity that matches given id.
|
|
220
|
-
* If entity was not found in the database - returns null.
|
|
221
|
-
*
|
|
222
|
-
* @deprecated use `findOneBy` method instead in conjunction with `In` operator, for example:
|
|
223
|
-
*
|
|
224
|
-
* .findOneBy({
|
|
225
|
-
* id: 1 // where "id" is your primary column name
|
|
226
|
-
* })
|
|
227
|
-
*/
|
|
228
|
-
findOneById(id: number | string | Date): Promise<Entity | null>;
|
|
229
|
-
/**
|
|
230
|
-
* Finds first entity by a given find options.
|
|
231
|
-
* If entity was not found in the database - rejects with error.
|
|
232
|
-
*/
|
|
233
|
-
findOneOrFail(options: FindOneOptions<Entity>): Promise<Entity>;
|
|
234
|
-
/**
|
|
235
|
-
* Finds first entity that matches given where condition.
|
|
236
|
-
* If entity was not found in the database - rejects with error.
|
|
237
|
-
*/
|
|
238
|
-
findOneByOrFail(where: FindOptionsWhere<Entity> | FindOptionsWhere<Entity>[]): Promise<Entity>;
|
|
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
|
-
query(query: string, parameters?: any[]): Promise<any>;
|
|
244
|
-
/**
|
|
245
|
-
* Executes a raw SQL query and returns a raw database results.
|
|
246
|
-
* Raw query execution is supported only by relational databases (MongoDB is not supported).
|
|
247
|
-
*/
|
|
248
|
-
createQueryBuilder(alias?: string, queryRunner?: QueryRunner): SelectQueryBuilder<Entity>;
|
|
249
|
-
/**
|
|
250
|
-
* Clears all the data from the given table/collection (truncates/drops it).
|
|
251
|
-
*
|
|
252
|
-
* Note: this method uses TRUNCATE and may not work as you expect in transactions on some platforms.
|
|
253
|
-
* @see https://stackoverflow.com/a/5972738/925151
|
|
254
|
-
*/
|
|
255
|
-
clear(): Promise<void>;
|
|
256
|
-
/**
|
|
257
|
-
* Increments some column by provided value of the entities matched given conditions.
|
|
258
|
-
*/
|
|
259
|
-
increment(conditions: FindOptionsWhere<Entity>, propertyPath: string, value: number | string): Promise<UpdateResult>;
|
|
260
|
-
/**
|
|
261
|
-
* Decrements some column by provided value of the entities matched given conditions.
|
|
262
|
-
*/
|
|
263
|
-
decrement(conditions: FindOptionsWhere<Entity>, propertyPath: string, value: number | string): Promise<UpdateResult>;
|
|
264
|
-
/**
|
|
265
|
-
* @deprecated use findAndCount instead
|
|
266
|
-
*/
|
|
267
|
-
getAll(): Promise<{
|
|
268
|
-
models: Entity[];
|
|
269
|
-
totalCount: number;
|
|
270
|
-
}>;
|
|
271
|
-
getBy(id: number | string): Promise<Entity>;
|
|
272
|
-
}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import { EntitySubscriberInterface, RecoverEvent, SoftRemoveEvent, InsertEvent, TransactionStartEvent, TransactionCommitEvent, TransactionRollbackEvent, RemoveEvent, UpdateEvent } from 'taon-typeorm/websql';
|
|
3
|
-
import { TaonBaseInjector } from './base-injector';
|
|
4
|
-
export declare abstract class TaonBaseSubscriberForEntity<Entity = any> extends TaonBaseInjector implements EntitySubscriberInterface {
|
|
5
|
-
abstract listenTo(): new (...args: any[]) => Entity;
|
|
6
|
-
/**
|
|
7
|
-
* Called after entity is loaded.
|
|
8
|
-
*/
|
|
9
|
-
afterLoad(entity: any): void;
|
|
10
|
-
/**
|
|
11
|
-
* Called before query execution.
|
|
12
|
-
*/
|
|
13
|
-
beforeQuery(event: any): void;
|
|
14
|
-
/**
|
|
15
|
-
* Called after query execution.
|
|
16
|
-
*/
|
|
17
|
-
afterQuery(event: any): void;
|
|
18
|
-
/**
|
|
19
|
-
* Called before entity insertion.
|
|
20
|
-
*/
|
|
21
|
-
beforeInsert(event: InsertEvent<any>): void;
|
|
22
|
-
/**
|
|
23
|
-
* Called after entity insertion.
|
|
24
|
-
*/
|
|
25
|
-
afterInsert(event: InsertEvent<any>): void;
|
|
26
|
-
/**
|
|
27
|
-
* Called before entity update.
|
|
28
|
-
*/
|
|
29
|
-
beforeUpdate(event: UpdateEvent<any>): void;
|
|
30
|
-
/**
|
|
31
|
-
* Called after entity update.
|
|
32
|
-
*/
|
|
33
|
-
afterUpdate(event: UpdateEvent<any>): void;
|
|
34
|
-
/**
|
|
35
|
-
* Called before entity removal.
|
|
36
|
-
*/
|
|
37
|
-
beforeRemove(event: RemoveEvent<any>): void;
|
|
38
|
-
/**
|
|
39
|
-
* Called after entity removal.
|
|
40
|
-
*/
|
|
41
|
-
afterRemove(event: RemoveEvent<any>): void;
|
|
42
|
-
/**
|
|
43
|
-
* Called before entity removal.
|
|
44
|
-
*/
|
|
45
|
-
beforeSoftRemove(event: SoftRemoveEvent<any>): void;
|
|
46
|
-
/**
|
|
47
|
-
* Called after entity removal.
|
|
48
|
-
*/
|
|
49
|
-
afterSoftRemove(event: SoftRemoveEvent<any>): void;
|
|
50
|
-
/**
|
|
51
|
-
* Called before entity recovery.
|
|
52
|
-
*/
|
|
53
|
-
beforeRecover(event: RecoverEvent<any>): void;
|
|
54
|
-
/**
|
|
55
|
-
* Called after entity recovery.
|
|
56
|
-
*/
|
|
57
|
-
afterRecover(event: RecoverEvent<any>): void;
|
|
58
|
-
/**
|
|
59
|
-
* Called before transaction start.
|
|
60
|
-
*/
|
|
61
|
-
beforeTransactionStart(event: TransactionStartEvent): void;
|
|
62
|
-
/**
|
|
63
|
-
* Called after transaction start.
|
|
64
|
-
*/
|
|
65
|
-
afterTransactionStart(event: TransactionStartEvent): void;
|
|
66
|
-
/**
|
|
67
|
-
* Called before transaction commit.
|
|
68
|
-
*/
|
|
69
|
-
beforeTransactionCommit(event: TransactionCommitEvent): void;
|
|
70
|
-
/**
|
|
71
|
-
* Called after transaction commit.
|
|
72
|
-
*/
|
|
73
|
-
afterTransactionCommit(event: TransactionCommitEvent): void;
|
|
74
|
-
/**
|
|
75
|
-
* Called before transaction rollback.
|
|
76
|
-
*/
|
|
77
|
-
beforeTransactionRollback(event: TransactionRollbackEvent): void;
|
|
78
|
-
/**
|
|
79
|
-
* Called after transaction rollback.
|
|
80
|
-
*/
|
|
81
|
-
afterTransactionRollback(event: TransactionRollbackEvent): void;
|
|
82
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
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';
|
|
5
|
-
import * as controller from './base-controller';
|
|
6
|
-
import * as crudController from './base-crud-controller';
|
|
7
|
-
import * as customRepository from './base-custom-repository';
|
|
8
|
-
import * as entity from './base-entity';
|
|
9
|
-
import * as baseMiddleware from './base-middleware';
|
|
10
|
-
import * as baseMigration from './base-migration';
|
|
11
|
-
import * as provider from './base-provider';
|
|
12
|
-
import * as repository from './base-repository';
|
|
13
|
-
import * as baseSubscriberEntity from './base-subscriber-for-entity';
|
|
14
|
-
export declare namespace Base {
|
|
15
|
-
export import Controller = controller.TaonBaseController;
|
|
16
|
-
export import CrudController = crudController.TaonBaseCrudController;
|
|
17
|
-
export import Entity = entity.TaonBaseEntity;
|
|
18
|
-
export import AbstractEntity = abstractEntity.TaonBaseAbstractEntity;
|
|
19
|
-
export import AbstractEntityOmitKeys = abstractEntity.AbstractEntityOmitKeys;
|
|
20
|
-
export import Provider = provider.TaonBaseProvider;
|
|
21
|
-
export import Class = baseClass.TaonBaseClass;
|
|
22
|
-
export import Repository = repository.TaonBaseRepository;
|
|
23
|
-
export import CustomRepository = customRepository.TaonBaseCustomRepository;
|
|
24
|
-
export import SubscriberForEntity = baseSubscriberEntity.TaonBaseSubscriberForEntity;
|
|
25
|
-
export import Migration = baseMigration.TaonBaseMigration;
|
|
26
|
-
export import Middleware = baseMiddleware.TaonBaseMiddleware;
|
|
27
|
-
export import AngularService = baseService.BaseAngularsService;
|
|
28
|
-
const Context: {
|
|
29
|
-
readonly contextName: string;
|
|
30
|
-
readonly appId: string;
|
|
31
|
-
cloneAsRemote: (cloneOpt?: {
|
|
32
|
-
overrideRemoteHost?: string;
|
|
33
|
-
}) => /*elided*/ any;
|
|
34
|
-
cloneAsNormal: (cloneOpt?: {
|
|
35
|
-
overrideHost?: string;
|
|
36
|
-
}) => /*elided*/ any;
|
|
37
|
-
__ref(): Promise<import("taon/websql").EndpointContext>;
|
|
38
|
-
readonly __refSync: import("taon/websql").EndpointContext;
|
|
39
|
-
getClassInstance<T>(ctor: new (...args: any[]) => T): T;
|
|
40
|
-
getClass<T>(ctor: new (...args: any[]) => T): new (...args: any[]) => T;
|
|
41
|
-
initialize: (overrideOptions?: import("taon/websql").Models.TaonInitializeParams) => Promise<import("taon/websql").EndpointContext>;
|
|
42
|
-
readonly realtime: {
|
|
43
|
-
readonly client: import("../realtime/realtime-client").RealtimeClient;
|
|
44
|
-
readonly server: import("../realtime/realtime-server").RealtimeServer;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import { TaonMiddlewareInheritanceObj } from '../decorators/http/http-methods-decorators';
|
|
3
|
-
import { TaonControllerOptions } from './controller-options';
|
|
4
|
-
import { MethodConfig } from './method-config';
|
|
5
|
-
export declare class ControllerConfig extends TaonControllerOptions {
|
|
6
|
-
methods: {
|
|
7
|
-
[methodName: string]: Partial<MethodConfig>;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Calculated path from parents controllers
|
|
11
|
-
*/
|
|
12
|
-
calculatedPath?: string;
|
|
13
|
-
/**
|
|
14
|
-
* a way to transform entity before sending to browser
|
|
15
|
-
*/
|
|
16
|
-
browserTransformFn?: (entity: any) => any;
|
|
17
|
-
/**
|
|
18
|
-
* Calculated middlewares object from parents controllers
|
|
19
|
-
*/
|
|
20
|
-
calculatedMiddlewaresControllerObj?: TaonMiddlewareInheritanceObj;
|
|
21
|
-
}
|
|
22
|
-
export declare const controllerConfigFrom: (partial: Partial<ControllerConfig>) => ControllerConfig;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import { DecoratorAbstractOpt } from '../decorators/decorator-abstract-opt';
|
|
3
|
-
import type { TaonMiddlewareFunction } from '../decorators/http/http-methods-decorators';
|
|
4
|
-
export declare class TaonControllerOptions<ControllerClass = any> extends DecoratorAbstractOpt {
|
|
5
|
-
/**
|
|
6
|
-
* typeorm realtime subscribtion // TODO disabled for now, does not make sense ?s
|
|
7
|
-
*/
|
|
8
|
-
realtime?: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* override default path for controller api
|
|
11
|
-
*/
|
|
12
|
-
path?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Middlewares to be applied to all methods in the controller
|
|
15
|
-
*/
|
|
16
|
-
middlewares?: TaonMiddlewareFunction;
|
|
17
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import { CoreModels } from 'tnp-core/websql';
|
|
3
|
-
import type { TaonBaseMiddleware } from '../base-classes/base-middleware';
|
|
4
|
-
import type { TaonHttpDecoratorOptions, TaonMiddlewareFunction, TaonMiddlewareInheritanceObj } from '../decorators/http/http-methods-decorators';
|
|
5
|
-
import { ParamConfig } from './param-config';
|
|
6
|
-
/**
|
|
7
|
-
* @link './decorators/http/http-methods-decorators.ts' TaonHttpDecoratorOptions
|
|
8
|
-
*/
|
|
9
|
-
export declare class MethodConfig implements Pick<TaonHttpDecoratorOptions, 'path' | 'middlewares'> {
|
|
10
|
-
methodName: string;
|
|
11
|
-
global?: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* override default content type
|
|
14
|
-
*/
|
|
15
|
-
contentType?: any;
|
|
16
|
-
/**
|
|
17
|
-
* override default axiso response type
|
|
18
|
-
*/
|
|
19
|
-
responseType?: any;
|
|
20
|
-
overrideExpressSendAsHtml?: boolean;
|
|
21
|
-
path: string;
|
|
22
|
-
descriptor: PropertyDescriptor;
|
|
23
|
-
type: CoreModels.HttpMethod;
|
|
24
|
-
parameters: {
|
|
25
|
-
[paramName: string]: Partial<ParamConfig>;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Middlewares from controller method options
|
|
29
|
-
*/
|
|
30
|
-
middlewares?: TaonMiddlewareFunction;
|
|
31
|
-
/**
|
|
32
|
-
* Calculated middlewares object from parents controllers
|
|
33
|
-
*/
|
|
34
|
-
calculatedMiddlewaresMethodObj?: TaonMiddlewareInheritanceObj;
|
|
35
|
-
/**
|
|
36
|
-
* Middlewares array in proper order and ready to be used in
|
|
37
|
-
* express or in axios interceptors.
|
|
38
|
-
*/
|
|
39
|
-
calculatedMiddlewares: (typeof TaonBaseMiddleware)[];
|
|
40
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
export type TaonEntityKeysToOmit = 'ctrl' | 'clone' | '__endpoint_context__' | 'ctx' | 'inject' | '_' | 'relation' | 'relations' | 'inject' | 'injectRepo' | 'injectCustomRepository' | 'injectCustomRepo' | 'injectController' | 'injectCtrl' | 'injectProvider' | 'injectMiddleware';
|
|
3
|
-
export declare const TaonEntityKeysToOmitArr: TaonEntityKeysToOmit[];
|
|
4
|
-
import { InjectionToken } from '@angular/core';
|
|
5
|
-
import type { TaonContext } from './create-context';
|
|
6
|
-
declare let TAON_CONTEXT: InjectionToken<TaonContext>;
|
|
7
|
-
declare let CURRENT_HOST_BACKEND_PORT: InjectionToken<number>;
|
|
8
|
-
declare let CURRENT_HOST_URL: InjectionToken<string>;
|
|
9
|
-
export { TAON_CONTEXT, CURRENT_HOST_BACKEND_PORT, CURRENT_HOST_URL };
|
|
10
|
-
export declare const apiPrefix = "api";
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import type { EndpointContext } from './endpoint-context';
|
|
3
|
-
import { Table } from 'taon-typeorm/websql';
|
|
4
|
-
export type MigrationStatus = 'completed' | 'pending';
|
|
5
|
-
export declare class ContextDbMigrations {
|
|
6
|
-
private ctx;
|
|
7
|
-
readonly DEFAULT_MIGRATION_TABLE_NAME = "TAON_MIGRATION_META";
|
|
8
|
-
readonly MIGRATION_STATUS_COMPLETED: MigrationStatus;
|
|
9
|
-
readonly MIGRATION_STATUS_PENDING: MigrationStatus;
|
|
10
|
-
readonly table: Table;
|
|
11
|
-
constructor(ctx: EndpointContext);
|
|
12
|
-
ensureMigrationTableExists(): Promise<void>;
|
|
13
|
-
private logSelectALl;
|
|
14
|
-
revertMigrationToTimestamp(timestamp: number): Promise<void>;
|
|
15
|
-
clearMigrationTable(): Promise<void>;
|
|
16
|
-
markAllMigrationsAsApplied(): Promise<void>;
|
|
17
|
-
runAllNotCompletedMigrations(): Promise<void>;
|
|
18
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import { EndpointContext } from './endpoint-context';
|
|
3
|
-
import { Models } from './models';
|
|
4
|
-
/**
|
|
5
|
-
* @returns function that returns context function.
|
|
6
|
-
* Context function can be used to dynamically
|
|
7
|
-
* create context with specific configuration.
|
|
8
|
-
*/
|
|
9
|
-
export declare 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.ContextOptions<CTX, CTRL, ENTITY, REPO, PROVIDER, SUBSCRIBER, MIGRATION, MIDDLEWARE>) => () => {
|
|
10
|
-
readonly contextName: string;
|
|
11
|
-
readonly appId: string;
|
|
12
|
-
cloneAsRemote: (cloneOpt?: {
|
|
13
|
-
overrideRemoteHost?: string;
|
|
14
|
-
}) => /*elided*/ any;
|
|
15
|
-
cloneAsNormal: (cloneOpt?: {
|
|
16
|
-
overrideHost?: string;
|
|
17
|
-
}) => /*elided*/ any;
|
|
18
|
-
/**
|
|
19
|
-
* @deprecated
|
|
20
|
-
* - get reference to internal context
|
|
21
|
-
*/
|
|
22
|
-
__ref(): Promise<EndpointContext>;
|
|
23
|
-
/**
|
|
24
|
-
* only for internal use
|
|
25
|
-
* @deprecated
|
|
26
|
-
*/
|
|
27
|
-
readonly __refSync: EndpointContext;
|
|
28
|
-
getClassInstance<T>(ctor: new (...args: any[]) => T): T;
|
|
29
|
-
getClass<T>(ctor: new (...args: any[]) => T): new (...args: any[]) => T;
|
|
30
|
-
/**
|
|
31
|
-
* - create controller instances for context
|
|
32
|
-
* - init database (if enable) + migation scripts
|
|
33
|
-
*/
|
|
34
|
-
initialize: (overrideOptions?: Models.TaonInitializeParams) => Promise<EndpointContext>;
|
|
35
|
-
/**
|
|
36
|
-
* realtime communication with server
|
|
37
|
-
* TCP(upgrade) socket.io (or ipc) based.
|
|
38
|
-
*/
|
|
39
|
-
readonly realtime: {
|
|
40
|
-
readonly client: import("./realtime/realtime-client").RealtimeClient;
|
|
41
|
-
readonly server: import("./realtime/realtime-server").RealtimeServer;
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
export declare 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.ContextOptions<CTX, CTRL, ENTITY, REPO, PROVIDER, SUBSCRIBER, MIGRATION, MIDDLEWARES>) => {
|
|
45
|
-
readonly contextName: string;
|
|
46
|
-
readonly appId: string;
|
|
47
|
-
cloneAsRemote: (cloneOpt?: {
|
|
48
|
-
overrideRemoteHost?: string;
|
|
49
|
-
}) => /*elided*/ any;
|
|
50
|
-
cloneAsNormal: (cloneOpt?: {
|
|
51
|
-
overrideHost?: string;
|
|
52
|
-
}) => /*elided*/ any;
|
|
53
|
-
/**
|
|
54
|
-
* @deprecated
|
|
55
|
-
* - get reference to internal context
|
|
56
|
-
*/
|
|
57
|
-
__ref(): Promise<EndpointContext>;
|
|
58
|
-
/**
|
|
59
|
-
* only for internal use
|
|
60
|
-
* @deprecated
|
|
61
|
-
*/
|
|
62
|
-
readonly __refSync: EndpointContext;
|
|
63
|
-
getClassInstance<T>(ctor: new (...args: any[]) => T): T;
|
|
64
|
-
getClass<T>(ctor: new (...args: any[]) => T): new (...args: any[]) => T;
|
|
65
|
-
/**
|
|
66
|
-
* - create controller instances for context
|
|
67
|
-
* - init database (if enable) + migation scripts
|
|
68
|
-
*/
|
|
69
|
-
initialize: (overrideOptions?: Models.TaonInitializeParams) => Promise<EndpointContext>;
|
|
70
|
-
/**
|
|
71
|
-
* realtime communication with server
|
|
72
|
-
* TCP(upgrade) socket.io (or ipc) based.
|
|
73
|
-
*/
|
|
74
|
-
readonly realtime: {
|
|
75
|
-
readonly client: import("./realtime/realtime-client").RealtimeClient;
|
|
76
|
-
readonly server: import("./realtime/realtime-server").RealtimeServer;
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
export type TaonContext = ReturnType<typeof createContext>;
|