taon 19.0.29 → 19.0.30

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.
Files changed (84) hide show
  1. package/README.md +5 -21
  2. package/browser/package.json +1 -1
  3. package/client/package.json +1 -1
  4. package/lib/build-info._auto-generated_.d.ts +1 -1
  5. package/lib/build-info._auto-generated_.js +1 -1
  6. package/lib/env/env.angular-node-app.d.ts +13 -0
  7. package/lib/env/env.angular-node-app.js +19 -0
  8. package/lib/env/env.angular-node-app.js.map +1 -0
  9. package/lib/env/env.electron-app.d.ts +13 -0
  10. package/lib/env/env.electron-app.js +19 -0
  11. package/lib/env/env.electron-app.js.map +1 -0
  12. package/lib/env/env.mobile-app.d.ts +13 -0
  13. package/lib/env/env.mobile-app.js +19 -0
  14. package/lib/env/env.mobile-app.js.map +1 -0
  15. package/lib/env/env.npm-lib-and-cli-tool.d.ts +13 -0
  16. package/lib/env/env.npm-lib-and-cli-tool.js +19 -0
  17. package/lib/env/env.npm-lib-and-cli-tool.js.map +1 -0
  18. package/lib/env/env.vscode-plugin.d.ts +13 -0
  19. package/lib/env/env.vscode-plugin.js +19 -0
  20. package/lib/env/env.vscode-plugin.js.map +1 -0
  21. package/lib/env/index.d.ts +5 -0
  22. package/lib/env/index.js +22 -0
  23. package/lib/env/index.js.map +1 -0
  24. package/lib/ui/index.js +2 -2
  25. package/lib/ui/taon-admin-mode-configuration/index.js +2 -2
  26. package/package.json +1 -1
  27. package/websql/package.json +1 -1
  28. package/client/README.md +0 -24
  29. package/client/fesm2022/taon.mjs +0 -6454
  30. package/client/fesm2022/taon.mjs.map +0 -1
  31. package/client/index.d.ts +0 -6
  32. package/client/lib/base-classes/base-abstract-entity.d.ts +0 -8
  33. package/client/lib/base-classes/base-angular-service.d.ts +0 -21
  34. package/client/lib/base-classes/base-class.d.ts +0 -9
  35. package/client/lib/base-classes/base-context.d.ts +0 -27
  36. package/client/lib/base-classes/base-controller.d.ts +0 -10
  37. package/client/lib/base-classes/base-crud-controller.d.ts +0 -28
  38. package/client/lib/base-classes/base-custom-repository.d.ts +0 -4
  39. package/client/lib/base-classes/base-entity.d.ts +0 -17
  40. package/client/lib/base-classes/base-injector.d.ts +0 -69
  41. package/client/lib/base-classes/base-migration.d.ts +0 -12
  42. package/client/lib/base-classes/base-provider.d.ts +0 -9
  43. package/client/lib/base-classes/base-repository.d.ts +0 -264
  44. package/client/lib/base-classes/base-subscriber-for-entity.d.ts +0 -82
  45. package/client/lib/base-classes/base.d.ts +0 -51
  46. package/client/lib/constants.d.ts +0 -8
  47. package/client/lib/context-db-migrations.d.ts +0 -18
  48. package/client/lib/create-context.d.ts +0 -86
  49. package/client/lib/decorators/classes/controller-decorator.d.ts +0 -16
  50. package/client/lib/decorators/classes/entity-decorator.d.ts +0 -20
  51. package/client/lib/decorators/classes/migration-decorator.d.ts +0 -8
  52. package/client/lib/decorators/classes/provider-decorator.d.ts +0 -8
  53. package/client/lib/decorators/classes/repository-decorator.d.ts +0 -8
  54. package/client/lib/decorators/classes/subscriber-decorator.d.ts +0 -9
  55. package/client/lib/decorators/http/http-decorators.d.ts +0 -20
  56. package/client/lib/decorators/http/http-methods-decorators.d.ts +0 -24
  57. package/client/lib/decorators/http/http-params-decorators.d.ts +0 -6
  58. package/client/lib/dependency-injection/di-container.d.ts +0 -6
  59. package/client/lib/endpoint-context.d.ts +0 -133
  60. package/client/lib/entity-process.d.ts +0 -40
  61. package/client/lib/env.d.ts +0 -3
  62. package/client/lib/get-response-value.d.ts +0 -7
  63. package/client/lib/helpers/class-helpers.d.ts +0 -19
  64. package/client/lib/helpers/taon-helpers.d.ts +0 -17
  65. package/client/lib/index.d.ts +0 -136
  66. package/client/lib/inject.d.ts +0 -5
  67. package/client/lib/models.d.ts +0 -212
  68. package/client/lib/orm.d.ts +0 -3
  69. package/client/lib/realtime/realtime-client.d.ts +0 -38
  70. package/client/lib/realtime/realtime-core.d.ts +0 -41
  71. package/client/lib/realtime/realtime-server.d.ts +0 -19
  72. package/client/lib/realtime/realtime-strategy/index.d.ts +0 -5
  73. package/client/lib/realtime/realtime-strategy/realtime-strategy-ipc.d.ts +0 -82
  74. package/client/lib/realtime/realtime-strategy/realtime-strategy-mock.d.ts +0 -15
  75. package/client/lib/realtime/realtime-strategy/realtime-strategy-socket-io.d.ts +0 -16
  76. package/client/lib/realtime/realtime-strategy/realtime-strategy.d.ts +0 -12
  77. package/client/lib/realtime/realtime-subs-manager.d.ts +0 -15
  78. package/client/lib/realtime/realtime.models.d.ts +0 -15
  79. package/client/lib/symbols.d.ts +0 -68
  80. package/client/lib/ui/index.d.ts +0 -2
  81. package/client/lib/ui/taon-admin-mode-configuration/index.d.ts +0 -2
  82. package/client/lib/ui/taon-admin-mode-configuration/taon-admin.service.d.ts +0 -22
  83. package/client/lib/validators.d.ts +0 -8
  84. package/client/public-api.d.ts +0 -2
package/client/index.d.ts DELETED
@@ -1,6 +0,0 @@
1
- // @ts-nocheck
2
- /**
3
- * Generated bundle index. Do not edit.
4
- */
5
- /// <amd-module name="taon" />
6
- export * from './public-api';
@@ -1,8 +0,0 @@
1
- // @ts-nocheck
2
- import { BaseEntity } from './base-entity';
3
- import type { BaseClass } from './base-class';
4
- export declare abstract class BaseAbstractEntity<CloneT extends BaseClass = any> extends BaseEntity<CloneT> {
5
- id: string;
6
- version: number;
7
- }
8
- export type AbstractEntityOmitKeys<ENTITY> = Omit<ENTITY, 'id' | 'version' | '_' | 'clone'>;
@@ -1,21 +0,0 @@
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 readonly currentContext: TaonContext;
10
- protected readonly CURRENT_HOST_BACKEND_PORT: number | undefined;
11
- constructor();
12
- /**
13
- * @deprecated
14
- * Returns the host URL for the backend service
15
- * that is running on localhost (normal NodeJS/ExpressJS mode).
16
- */
17
- get host(): string;
18
- injectController<T>(ctor: new (...args: any[]) => T): T;
19
- static ɵfac: i0.ɵɵFactoryDeclaration<BaseAngularsService, never>;
20
- static ɵprov: i0.ɵɵInjectableDeclaration<BaseAngularsService>;
21
- }
@@ -1,9 +0,0 @@
1
- // @ts-nocheck
2
- export declare class BaseClass<CloneT extends BaseClass = any> {
3
- /**
4
- * class initialization hook
5
- * taon after class instance creation
6
- */
7
- _(): Promise<void>;
8
- clone(override?: Partial<CloneT>): CloneT;
9
- }
@@ -1,27 +0,0 @@
1
- // @ts-nocheck
2
- declare const BaseContext: {
3
- types: {
4
- readonly controllers: any;
5
- readonly repositories: any;
6
- readonly providers: any;
7
- readonly subscribers: any;
8
- readonly migrations: any;
9
- };
10
- readonly contexts: any;
11
- readonly contextName: string;
12
- __ref(): Promise<import("taon/browser").EndpointContext>;
13
- readonly __refSync: import("taon/browser").EndpointContext;
14
- getClassInstance<T>(ctor: new (...args: any[]) => T): T;
15
- getClass<T>(ctor: new (...args: any[]) => T): new (...args: any[]) => T;
16
- initialize: (overrideOptions?: {
17
- overrideHost?: string;
18
- overrideRemoteHost?: string;
19
- onlyMigrationRun?: boolean;
20
- onlyMigrationRevertToTimestamp?: number;
21
- }) => Promise<import("taon/browser").EndpointContext>;
22
- readonly realtime: {
23
- readonly client: import("../realtime/realtime-client").RealtimeClient;
24
- readonly server: import("../realtime/realtime-server").RealtimeServer;
25
- };
26
- };
27
- export { BaseContext };
@@ -1,10 +0,0 @@
1
- // @ts-nocheck
2
- import { BaseInjector } from './base-injector';
3
- export declare class BaseController extends BaseInjector {
4
- /**
5
- * @deprecated use migration instead
6
- * THIS ONLY WORKS IF NO MIGRATIONS PROVIDED IN CONFIG
7
- * Purpose: init example data for db.
8
- */
9
- initExampleDbData(): Promise<any>;
10
- }
@@ -1,28 +0,0 @@
1
- // @ts-nocheck
2
- import { Models } from '../models';
3
- import { BaseController } from './base-controller';
4
- import { BaseRepository } from './base-repository';
5
- /**
6
- * Please override property entityClassFn with entity class.
7
- */
8
- export declare abstract class BaseCrudController<Entity> extends BaseController {
9
- protected db: BaseRepository<Entity>;
10
- /**
11
- * Please provide entity as class propery entityClassFn:
12
- * @returns class function
13
- *
14
- */
15
- abstract entityClassResolveFn: () => any;
16
- _(): Promise<void>;
17
- bufforedChanges(id: number | string, property: string, alreadyLength?: number): Models.Http.Response<string | any[]>;
18
- pagination(pageNumber?: number, pageSize?: number, search?: string): Models.Http.Response<Entity[]>;
19
- getAll(): Models.Http.Response<Entity[]>;
20
- getBy(id: number | string): Models.Http.Response<Entity>;
21
- updateById(id: number | string, item: Entity): Models.Http.Response<Entity>;
22
- patchById(id: number | string, item: Entity): Models.Http.Response<Entity>;
23
- bulkUpdate(items: Entity[]): Models.Http.Response<Entity[]>;
24
- deleteById(id: number): Models.Http.Response<Entity>;
25
- bulkDelete(ids: (number | string)[]): Models.Http.Response<(number | string | Entity)[]>;
26
- create(item: Entity): Models.Http.Response<Entity>;
27
- bulkCreate(items: Entity): Models.Http.Response<Entity[]>;
28
- }
@@ -1,4 +0,0 @@
1
- // @ts-nocheck
2
- import { BaseInjector } from './base-injector';
3
- export declare abstract class BaseCustomRepository extends BaseInjector {
4
- }
@@ -1,17 +0,0 @@
1
- // @ts-nocheck
2
- import { RelationPath } from 'taon-typeorm/browser';
3
- import { BaseClass } from './base-class';
4
- export declare abstract class BaseEntity<
5
- /**
6
- * type for cloning
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[];
17
- }
@@ -1,69 +0,0 @@
1
- // @ts-nocheck
2
- import { EndpointContext } from '../endpoint-context';
3
- import { BaseCustomRepository } from './base-custom-repository';
4
- import type { BaseRepository } from './base-repository';
5
- export declare class BaseInjector {
6
- /**
7
- * for proxy purposes
8
- */
9
- getOriginalPrototype: () => any;
10
- /**
11
- * for proxy purposes
12
- */
13
- getOriginalConstructor: () => any;
14
- /**
15
- * class initialization hook
16
- * taon after class instace creation
17
- */
18
- _(): Promise<void>;
19
- /**
20
- * @deprecated use ctx instead
21
- * Current endpoint context
22
- */
23
- get __endpoint_context__(): EndpointContext;
24
- /**
25
- * get current endpoint context
26
- */
27
- get ctx(): EndpointContext;
28
- /**
29
- * inject crud repo for entity
30
- */
31
- injectRepo<T>(entityForCrud: new (...args: any[]) => T): BaseRepository<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;
37
- /**
38
- * example usage:
39
- * ...
40
- * exampleController = this.injectController(ExampleController);
41
- * ...
42
- */
43
- injectController<T>(ctor: new (...args: any[]) => T): T;
44
- /**
45
- * example usage:
46
- * ...
47
- * exampleSubscriber = this.injectSubscriber(ExampleSubscriber)
48
- * ...
49
- */
50
- injectSubscriber<T>(ctor: new (...args: any[]) => T): T;
51
- /**
52
- * aliast to .injectController()
53
- */
54
- injectCtrl<T>(ctor: new (...args: any[]) => T): T;
55
- /**
56
- * global provider available in every context
57
- */
58
- injectGlobalProvider<T>(ctor: new (...args: any[]) => T): T;
59
- /**
60
- * context scoped provider
61
- * TODO
62
- */
63
- injectContextProvider<T>(ctor: new (...args: any[]) => T): T;
64
- /**
65
- * Inject: Controllers, Providers, Repositories, Services, etc.
66
- * TODO addd nest js injecting
67
- */
68
- private __inject;
69
- }
@@ -1,12 +0,0 @@
1
- // @ts-nocheck
2
- import { MigrationInterface, QueryRunner } from 'taon-typeorm/browser';
3
- import { BaseInjector } from './base-injector';
4
- export declare class BaseMigration extends BaseInjector 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,9 +0,0 @@
1
- // @ts-nocheck
2
- import { BaseInjector } from './base-injector';
3
- /**
4
- * TODO
5
- * - global provider available in all contexts
6
- * - provider available in own context
7
- */
8
- export declare class BaseProvider extends BaseInjector {
9
- }
@@ -1,264 +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/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
- import { MySqlQuerySource } from 'taon-type-sql/browser';
7
- import { BaseCustomRepository } from './base-custom-repository';
8
- export declare abstract class BaseRepository<Entity extends {
9
- id?: any;
10
- }> extends BaseCustomRepository {
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
- bulkCreate(items: Entity[], options?: SaveOptions & {
65
- reload: false;
66
- }): Promise<Entity[]>;
67
- /**
68
- * Saves all given entities in the database.
69
- * If entities do not exist in the database then inserts, otherwise updates.
70
- */
71
- /**
72
- * Merges multiple entities (or entity-like objects) into a given entity.
73
- */
74
- merge(mergeIntoEntity: Entity, ...entityLikes: Entity[]): Entity;
75
- /**
76
- * Creates a new entity from the given plain javascript object. If entity already exist in the database, then
77
- * it loads it (and everything related to it), replaces all values with the new ones from the given object
78
- * and returns this new entity. This new entity is actually a loaded from the db entity with all properties
79
- * replaced from the new object.
80
- *
81
- * Note that given entity-like object must have an entity id / primary key to find entity by.
82
- * Returns undefined if entity with given id was not found.
83
- */
84
- preload(entityLike: Entity): Promise<Entity | undefined>;
85
- /**
86
- * Removes a given entities from the database.
87
- */
88
- remove(idOrEntity: number | string | Entity): Promise<Entity>;
89
- /**
90
- * alias to remove
91
- */
92
- delete(idOrEntity: number | string | Entity): Promise<Entity>;
93
- /**
94
- * alias to removeById
95
- */
96
- deleteById(id: number | string): Promise<Entity>;
97
- bulkRemove(idsOrEntities: (number | string | Entity)[]): Promise<Entity[]>;
98
- bulkDelete(ids: (number | string | Entity)[]): Promise<Entity[]>;
99
- /**
100
- * Records the delete date of all given entities.
101
- */
102
- softRemove<T extends Entity>(entities: T[], options: SaveOptions & {
103
- reload: false;
104
- }): Promise<T[]>;
105
- /**
106
- * Records the delete date of all given entities.
107
- */
108
- softRemove<T extends Entity>(entities: T[], options?: SaveOptions): Promise<(T & Entity)[]>;
109
- /**
110
- * Records the delete date of a given entity.
111
- */
112
- softRemove<T extends Entity>(entity: T, options: SaveOptions & {
113
- reload: false;
114
- }): Promise<T>;
115
- /**
116
- * Recovers all given entities in the database.
117
- */
118
- recover<T extends Entity>(entities: T[], options: SaveOptions & {
119
- reload: false;
120
- }): Promise<T[]>;
121
- /**
122
- * Recovers all given entities in the database.
123
- */
124
- recover<T extends Entity>(entities: T[], options?: SaveOptions): Promise<(T & Entity)[]>;
125
- /**
126
- * Recovers a given entity in the database.
127
- */
128
- recover<T extends Entity>(entity: T, options: SaveOptions & {
129
- reload: false;
130
- }): Promise<T>;
131
- /**
132
- * Inserts a given entity into the database.
133
- * Unlike save method executes a primitive operation without cascades, relations and other operations included.
134
- * Executes fast and efficient INSERT query.
135
- * Does not check if entity exist in the database, so query will fail if duplicate entity is being inserted.
136
- */
137
- insert(entity: QueryDeepPartialEntity<Entity> | QueryDeepPartialEntity<Entity>[]): Promise<InsertResult>;
138
- update(item: Entity): Promise<any>;
139
- private allowedTypesToUpdate;
140
- updateById<ENTITY = Entity>(id: number | string, item: Entity): Promise<ENTITY>;
141
- bulkUpdate(items: Entity[]): Promise<any>;
142
- /**
143
- * Inserts a given entity into the database, unless a unique constraint conflicts then updates the entity
144
- * Unlike save method executes a primitive operation without cascades, relations and other operations included.
145
- * Executes fast and efficient INSERT ... ON CONFLICT DO UPDATE/ON DUPLICATE KEY UPDATE query.
146
- */
147
- upsert(entityOrEntities: QueryDeepPartialEntity<Entity> | QueryDeepPartialEntity<Entity>[], conflictPathsOrOptions: string[] | UpsertOptions<Entity>): Promise<InsertResult>;
148
- /**
149
- * Records the delete date of entities by a given criteria.
150
- * Unlike save method executes a primitive operation without cascades, relations and other operations included.
151
- * Executes fast and efficient SOFT-DELETE query.
152
- * Does not check if entity exist in the database.
153
- */
154
- softDelete(criteria: string | string[] | number | number[] | Date | Date[] | FindOptionsWhere<Entity>): Promise<UpdateResult>;
155
- /**
156
- * Restores entities by a given criteria.
157
- * Unlike save method executes a primitive operation without cascades, relations and other operations included.
158
- * Executes fast and efficient SOFT-DELETE query.
159
- * Does not check if entity exist in the database.
160
- */
161
- restore(criteria: string | string[] | number | number[] | Date | Date[] | FindOptionsWhere<Entity>): Promise<UpdateResult>;
162
- /**
163
- * Counts entities that match given options.
164
- * Useful for pagination.
165
- */
166
- count(options?: FindManyOptions<Entity>): Promise<number>;
167
- /**
168
- * Counts entities that match given conditions.
169
- * Useful for pagination.
170
- */
171
- countBy(where: FindOptionsWhere<Entity> | FindOptionsWhere<Entity>[]): Promise<number>;
172
- /**
173
- * Finds entities that match given find options.
174
- */
175
- find(options?: FindManyOptions<Entity>): Promise<Entity[]>;
176
- /**
177
- * Finds entities that match given find options.
178
- */
179
- findBy(where: FindOptionsWhere<Entity> | FindOptionsWhere<Entity>[]): Promise<Entity[]>;
180
- /**
181
- * Finds entities that match given find options.
182
- * Also counts all entities that match given conditions,
183
- * but ignores pagination settings (from and take options).
184
- */
185
- findAndCount(options?: FindManyOptions<Entity>): Promise<[Entity[], number]>;
186
- /**
187
- * Finds entities that match given WHERE conditions.
188
- * Also counts all entities that match given conditions,
189
- * but ignores pagination settings (from and take options).
190
- */
191
- findAndCountBy(where: FindOptionsWhere<Entity> | FindOptionsWhere<Entity>[]): Promise<[Entity[], number]>;
192
- /**
193
- * Finds entities with ids.
194
- * Optionally find options or conditions can be applied.
195
- *
196
- * @deprecated use `findBy` method instead in conjunction with `In` operator, for example:
197
- *
198
- * .findBy({
199
- * id: In([1, 2, 3])
200
- * })
201
- */
202
- findByIds(ids: any[]): Promise<Entity[]>;
203
- /**
204
- * Finds first entity by a given find options.
205
- * If entity was not found in the database - returns null.
206
- */
207
- findOne(options: FindOneOptions<Entity>): Promise<Entity | null>;
208
- /**
209
- * Finds first entity that matches given where condition.
210
- * If entity was not found in the database - returns null.
211
- */
212
- findOneBy(where: FindOptionsWhere<Entity> | FindOptionsWhere<Entity>[]): Promise<Entity | null>;
213
- /**
214
- * Finds first entity that matches given id.
215
- * If entity was not found in the database - returns null.
216
- *
217
- * @deprecated use `findOneBy` method instead in conjunction with `In` operator, for example:
218
- *
219
- * .findOneBy({
220
- * id: 1 // where "id" is your primary column name
221
- * })
222
- */
223
- findOneById(id: number | string | Date): Promise<Entity | null>;
224
- /**
225
- * Finds first entity by a given find options.
226
- * If entity was not found in the database - rejects with error.
227
- */
228
- findOneOrFail(options: FindOneOptions<Entity>): Promise<Entity>;
229
- /**
230
- * Finds first entity that matches given where condition.
231
- * If entity was not found in the database - rejects with error.
232
- */
233
- findOneByOrFail(where: FindOptionsWhere<Entity> | FindOptionsWhere<Entity>[]): Promise<Entity>;
234
- /**
235
- * Executes a raw SQL query and returns a raw database results.
236
- * Raw query execution is supported only by relational databases (MongoDB is not supported).
237
- */
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>;
244
- /**
245
- * Clears all the data from the given table/collection (truncates/drops it).
246
- *
247
- * Note: this method uses TRUNCATE and may not work as you expect in transactions on some platforms.
248
- * @see https://stackoverflow.com/a/5972738/925151
249
- */
250
- clear(): Promise<void>;
251
- /**
252
- * Increments some column by provided value of the entities matched given conditions.
253
- */
254
- increment(conditions: FindOptionsWhere<Entity>, propertyPath: string, value: number | string): Promise<UpdateResult>;
255
- /**
256
- * Decrements some column by provided value of the entities matched given conditions.
257
- */
258
- decrement(conditions: FindOptionsWhere<Entity>, propertyPath: string, value: number | string): Promise<UpdateResult>;
259
- /**
260
- * @deprecated use findAndCount instead
261
- */
262
- getAll(): Promise<any>;
263
- getBy(id: number | string): Promise<Entity>;
264
- }
@@ -1,82 +0,0 @@
1
- // @ts-nocheck
2
- import { EntitySubscriberInterface, RecoverEvent, SoftRemoveEvent, InsertEvent, TransactionStartEvent, TransactionCommitEvent, TransactionRollbackEvent, RemoveEvent, UpdateEvent } from 'taon-typeorm/browser';
3
- import { BaseInjector } from './base-injector';
4
- export declare abstract class BaseSubscriberForEntity<Entity = any> extends BaseInjector 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,51 +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 baseMigration from './base-migration';
10
- import * as provider from './base-provider';
11
- import * as repository from './base-repository';
12
- import * as baseSubscriberEntity from './base-subscriber-for-entity';
13
- export declare namespace Base {
14
- export import Controller = controller.BaseController;
15
- export import CrudController = crudController.BaseCrudController;
16
- export import Entity = entity.BaseEntity;
17
- export import AbstractEntity = abstractEntity.BaseAbstractEntity;
18
- export import AbstractEntityOmitKeys = abstractEntity.AbstractEntityOmitKeys;
19
- export import Provider = provider.BaseProvider;
20
- export import Class = baseClass.BaseClass;
21
- export import Repository = repository.BaseRepository;
22
- export import CustomRepository = customRepository.BaseCustomRepository;
23
- export import SubscriberForEntity = baseSubscriberEntity.BaseSubscriberForEntity;
24
- export import Migration = baseMigration.BaseMigration;
25
- export import AngularService = baseService.BaseAngularsService;
26
- const Context: {
27
- types: {
28
- readonly controllers: any;
29
- readonly repositories: any;
30
- readonly providers: any;
31
- readonly subscribers: any;
32
- readonly migrations: any;
33
- };
34
- readonly contexts: any;
35
- readonly contextName: string;
36
- __ref(): Promise<import("taon/browser").EndpointContext>;
37
- readonly __refSync: import("taon/browser").EndpointContext;
38
- getClassInstance<T>(ctor: new (...args: any[]) => T): T;
39
- getClass<T>(ctor: new (...args: any[]) => T): new (...args: any[]) => T;
40
- initialize: (overrideOptions?: {
41
- overrideHost?: string;
42
- overrideRemoteHost?: string;
43
- onlyMigrationRun?: boolean;
44
- onlyMigrationRevertToTimestamp?: number;
45
- }) => Promise<import("taon/browser").EndpointContext>;
46
- readonly realtime: {
47
- readonly client: import("../realtime/realtime-client").RealtimeClient;
48
- readonly server: import("../realtime/realtime-server").RealtimeServer;
49
- };
50
- };
51
- }
@@ -1,8 +0,0 @@
1
- // @ts-nocheck
2
- export type TaonEntityKeysToOmit = 'ctrl' | 'clone' | '__endpoint_context__' | 'ctx' | 'inject' | '_' | 'relation' | 'relations' | 'inject' | 'injectRepo' | 'injectCustomRepository' | 'injectCustomRepo' | 'injectController' | 'injectCtrl' | 'injectGlobalProvider' | 'injectLocalProvider' | 'injectContextProvider';
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
- export { TAON_CONTEXT, CURRENT_HOST_BACKEND_PORT };
@@ -1,18 +0,0 @@
1
- // @ts-nocheck
2
- import type { EndpointContext } from './endpoint-context';
3
- import { Table } from 'taon-typeorm/browser';
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<any>;
13
- private logSelectALl;
14
- revertMigrationToTimestamp(timestamp: number): Promise<any>;
15
- clearMigrationTable(): Promise<any>;
16
- markAllMigrationsAsApplied(): Promise<any>;
17
- runAllNotCompletedMigrations(): Promise<any>;
18
- }