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.
Files changed (194) hide show
  1. package/browser/fesm2022/taon.mjs +1953 -1238
  2. package/browser/fesm2022/taon.mjs.map +1 -1
  3. package/browser/package.json +1 -1
  4. package/browser/types/taon.d.ts +2152 -0
  5. package/lib/base-classes/base-abstract-entity.d.ts +1 -1
  6. package/lib/base-classes/base-abstract-entity.js +12 -12
  7. package/lib/base-classes/base-abstract-entity.js.map +1 -1
  8. package/lib/base-classes/base-angular-service.d.ts +1 -1
  9. package/lib/base-classes/base-angular-service.js +6 -3
  10. package/lib/base-classes/base-angular-service.js.map +1 -1
  11. package/lib/base-classes/base-context.d.ts +2 -2
  12. package/lib/base-classes/base-controller.js +7 -1
  13. package/lib/base-classes/base-controller.js.map +1 -1
  14. package/lib/base-classes/base-crud-controller.js +52 -12
  15. package/lib/base-classes/base-crud-controller.js.map +1 -1
  16. package/lib/base-classes/base-entity.js +2 -6
  17. package/lib/base-classes/base-entity.js.map +1 -1
  18. package/lib/base-classes/base-repository.d.ts +1 -1
  19. package/lib/base-classes/base-repository.js +15 -10
  20. package/lib/base-classes/base-repository.js.map +1 -1
  21. package/lib/base-classes/base.d.ts +1 -46
  22. package/lib/base-classes/base.js +17 -30
  23. package/lib/base-classes/base.js.map +1 -1
  24. package/lib/build-info._auto-generated_.d.ts +1 -1
  25. package/lib/build-info._auto-generated_.js +1 -1
  26. package/lib/build-info._auto-generated_.js.map +1 -1
  27. package/lib/create-context.d.ts +4 -4
  28. package/lib/decorators/classes/entity-decorator.js +1 -1
  29. package/lib/decorators/classes/entity-decorator.js.map +1 -1
  30. package/lib/decorators/http/http-decorators.d.ts +1 -19
  31. package/lib/decorators/http/http-decorators.js +20 -22
  32. package/lib/decorators/http/http-decorators.js.map +1 -1
  33. package/lib/endpoint-context.d.ts +2 -2
  34. package/lib/formly/{formly-group-wrapper-component.d.ts → formly-group-wrapper.component.d.ts} +1 -1
  35. package/lib/formly/{formly-repeat-component.d.ts → formly-repeat.component.d.ts} +1 -1
  36. package/lib/formly/fromly.js +24 -24
  37. package/lib/formly/fromly.js.map +1 -1
  38. package/lib/index.d.ts +146 -45
  39. package/lib/index.js +166 -55
  40. package/lib/index.js.map +1 -1
  41. package/lib/orm/columns.d.ts +28 -0
  42. package/lib/orm/columns.js +102 -0
  43. package/lib/orm/columns.js.map +1 -0
  44. package/lib/orm/index.d.ts +1 -0
  45. package/lib/orm/index.js +73 -0
  46. package/lib/orm/index.js.map +1 -0
  47. package/lib/realtime/realtime-core.d.ts +1 -1
  48. package/lib/realtime/realtime-strategy/realtime-strategy-socket-io.d.ts +1 -2
  49. package/lib/realtime/realtime-strategy/realtime-strategy-socket-io.js.map +1 -1
  50. package/lib/realtime/realtime-strategy/realtime-strategy.d.ts +1 -1
  51. package/lib/realtime/realtime-subs-manager.d.ts +1 -1
  52. package/lib/symbols.d.ts +31 -31
  53. package/lib/symbols.js +59 -59
  54. package/lib/symbols.js.map +1 -1
  55. package/lib/ui/index.js +2 -2
  56. package/lib/ui/taon-admin-mode-configuration/index.js +2 -2
  57. package/package.json +6 -6
  58. package/websql/fesm2022/taon.mjs +1316 -648
  59. package/websql/fesm2022/taon.mjs.map +1 -1
  60. package/websql/package.json +1 -1
  61. package/websql/types/taon.d.ts +2161 -0
  62. package/browser/index.d.ts +0 -6
  63. package/browser/lib/base-classes/base-abstract-entity.d.ts +0 -8
  64. package/browser/lib/base-classes/base-angular-service.d.ts +0 -34
  65. package/browser/lib/base-classes/base-class.d.ts +0 -16
  66. package/browser/lib/base-classes/base-context.d.ts +0 -21
  67. package/browser/lib/base-classes/base-controller.d.ts +0 -83
  68. package/browser/lib/base-classes/base-crud-controller.d.ts +0 -29
  69. package/browser/lib/base-classes/base-custom-repository.d.ts +0 -4
  70. package/browser/lib/base-classes/base-entity.d.ts +0 -17
  71. package/browser/lib/base-classes/base-file-upload.middleware.d.ts +0 -15
  72. package/browser/lib/base-classes/base-injector.d.ts +0 -68
  73. package/browser/lib/base-classes/base-middleware.d.ts +0 -39
  74. package/browser/lib/base-classes/base-migration.d.ts +0 -12
  75. package/browser/lib/base-classes/base-provider.d.ts +0 -9
  76. package/browser/lib/base-classes/base-repository.d.ts +0 -267
  77. package/browser/lib/base-classes/base-subscriber-for-entity.d.ts +0 -82
  78. package/browser/lib/base-classes/base.d.ts +0 -47
  79. package/browser/lib/config/controller-config.d.ts +0 -22
  80. package/browser/lib/config/controller-options.d.ts +0 -17
  81. package/browser/lib/config/method-config.d.ts +0 -40
  82. package/browser/lib/config/param-config.d.ts +0 -9
  83. package/browser/lib/constants.d.ts +0 -10
  84. package/browser/lib/context-db-migrations.d.ts +0 -18
  85. package/browser/lib/create-context.d.ts +0 -79
  86. package/browser/lib/decorators/classes/controller-decorator.d.ts +0 -6
  87. package/browser/lib/decorators/classes/entity-decorator.d.ts +0 -20
  88. package/browser/lib/decorators/classes/middleware-decorator.d.ts +0 -8
  89. package/browser/lib/decorators/classes/migration-decorator.d.ts +0 -8
  90. package/browser/lib/decorators/classes/provider-decorator.d.ts +0 -8
  91. package/browser/lib/decorators/classes/repository-decorator.d.ts +0 -8
  92. package/browser/lib/decorators/classes/subscriber-decorator.d.ts +0 -9
  93. package/browser/lib/decorators/decorator-abstract-opt.d.ts +0 -4
  94. package/browser/lib/decorators/http/http-decorators.d.ts +0 -21
  95. package/browser/lib/decorators/http/http-methods-decorators.d.ts +0 -71
  96. package/browser/lib/decorators/http/http-params-decorators.d.ts +0 -9
  97. package/browser/lib/dependency-injection/di-container.d.ts +0 -6
  98. package/browser/lib/endpoint-context-storage.d.ts +0 -12
  99. package/browser/lib/endpoint-context.d.ts +0 -198
  100. package/browser/lib/entity-process.d.ts +0 -40
  101. package/browser/lib/get-response-value.d.ts +0 -7
  102. package/browser/lib/helpers/class-helpers.d.ts +0 -25
  103. package/browser/lib/helpers/clone-obj.d.ts +0 -2
  104. package/browser/lib/helpers/taon-helpers.d.ts +0 -19
  105. package/browser/lib/index.d.ts +0 -129
  106. package/browser/lib/inject.d.ts +0 -5
  107. package/browser/lib/models.d.ts +0 -257
  108. package/browser/lib/orm.d.ts +0 -3
  109. package/browser/lib/realtime/realtime-client.d.ts +0 -42
  110. package/browser/lib/realtime/realtime-core.d.ts +0 -41
  111. package/browser/lib/realtime/realtime-server.d.ts +0 -44
  112. package/browser/lib/realtime/realtime-strategy/index.d.ts +0 -5
  113. package/browser/lib/realtime/realtime-strategy/realtime-strategy-ipc.d.ts +0 -82
  114. package/browser/lib/realtime/realtime-strategy/realtime-strategy-mock.d.ts +0 -15
  115. package/browser/lib/realtime/realtime-strategy/realtime-strategy-socket-io.d.ts +0 -16
  116. package/browser/lib/realtime/realtime-strategy/realtime-strategy.d.ts +0 -12
  117. package/browser/lib/realtime/realtime-subs-manager.d.ts +0 -15
  118. package/browser/lib/realtime/realtime.models.d.ts +0 -28
  119. package/browser/lib/symbols.d.ts +0 -66
  120. package/browser/lib/ui/index.d.ts +0 -2
  121. package/browser/lib/ui/taon-admin-mode-configuration/index.d.ts +0 -2
  122. package/browser/lib/ui/taon-admin-mode-configuration/taon-admin.service.d.ts +0 -22
  123. package/browser/lib/validators.d.ts +0 -8
  124. package/browser/public-api.d.ts +0 -2
  125. package/lib/formly/formly-group-wrapper-component.js +0 -51
  126. package/lib/formly/formly-group-wrapper-component.js.map +0 -1
  127. package/lib/formly/formly-repeat-component.js +0 -95
  128. package/lib/formly/formly-repeat-component.js.map +0 -1
  129. package/lib/orm.d.ts +0 -68
  130. package/lib/orm.js +0 -112
  131. package/lib/orm.js.map +0 -1
  132. package/websql/index.d.ts +0 -6
  133. package/websql/lib/base-classes/base-abstract-entity.d.ts +0 -8
  134. package/websql/lib/base-classes/base-angular-service.d.ts +0 -34
  135. package/websql/lib/base-classes/base-class.d.ts +0 -16
  136. package/websql/lib/base-classes/base-context.d.ts +0 -21
  137. package/websql/lib/base-classes/base-controller.d.ts +0 -83
  138. package/websql/lib/base-classes/base-crud-controller.d.ts +0 -29
  139. package/websql/lib/base-classes/base-custom-repository.d.ts +0 -4
  140. package/websql/lib/base-classes/base-entity.d.ts +0 -17
  141. package/websql/lib/base-classes/base-file-upload.middleware.d.ts +0 -15
  142. package/websql/lib/base-classes/base-injector.d.ts +0 -68
  143. package/websql/lib/base-classes/base-middleware.d.ts +0 -39
  144. package/websql/lib/base-classes/base-migration.d.ts +0 -12
  145. package/websql/lib/base-classes/base-provider.d.ts +0 -9
  146. package/websql/lib/base-classes/base-repository.d.ts +0 -272
  147. package/websql/lib/base-classes/base-subscriber-for-entity.d.ts +0 -82
  148. package/websql/lib/base-classes/base.d.ts +0 -47
  149. package/websql/lib/config/controller-config.d.ts +0 -22
  150. package/websql/lib/config/controller-options.d.ts +0 -17
  151. package/websql/lib/config/method-config.d.ts +0 -40
  152. package/websql/lib/config/param-config.d.ts +0 -9
  153. package/websql/lib/constants.d.ts +0 -10
  154. package/websql/lib/context-db-migrations.d.ts +0 -18
  155. package/websql/lib/create-context.d.ts +0 -79
  156. package/websql/lib/decorators/classes/controller-decorator.d.ts +0 -6
  157. package/websql/lib/decorators/classes/entity-decorator.d.ts +0 -20
  158. package/websql/lib/decorators/classes/middleware-decorator.d.ts +0 -8
  159. package/websql/lib/decorators/classes/migration-decorator.d.ts +0 -8
  160. package/websql/lib/decorators/classes/provider-decorator.d.ts +0 -8
  161. package/websql/lib/decorators/classes/repository-decorator.d.ts +0 -8
  162. package/websql/lib/decorators/classes/subscriber-decorator.d.ts +0 -9
  163. package/websql/lib/decorators/decorator-abstract-opt.d.ts +0 -4
  164. package/websql/lib/decorators/http/http-decorators.d.ts +0 -21
  165. package/websql/lib/decorators/http/http-methods-decorators.d.ts +0 -71
  166. package/websql/lib/decorators/http/http-params-decorators.d.ts +0 -9
  167. package/websql/lib/dependency-injection/di-container.d.ts +0 -6
  168. package/websql/lib/endpoint-context-storage.d.ts +0 -12
  169. package/websql/lib/endpoint-context.d.ts +0 -200
  170. package/websql/lib/entity-process.d.ts +0 -40
  171. package/websql/lib/get-response-value.d.ts +0 -7
  172. package/websql/lib/helpers/class-helpers.d.ts +0 -25
  173. package/websql/lib/helpers/clone-obj.d.ts +0 -2
  174. package/websql/lib/helpers/taon-helpers.d.ts +0 -19
  175. package/websql/lib/index.d.ts +0 -129
  176. package/websql/lib/inject.d.ts +0 -5
  177. package/websql/lib/models.d.ts +0 -261
  178. package/websql/lib/orm.d.ts +0 -69
  179. package/websql/lib/realtime/realtime-client.d.ts +0 -42
  180. package/websql/lib/realtime/realtime-core.d.ts +0 -41
  181. package/websql/lib/realtime/realtime-server.d.ts +0 -44
  182. package/websql/lib/realtime/realtime-strategy/index.d.ts +0 -5
  183. package/websql/lib/realtime/realtime-strategy/realtime-strategy-ipc.d.ts +0 -82
  184. package/websql/lib/realtime/realtime-strategy/realtime-strategy-mock.d.ts +0 -15
  185. package/websql/lib/realtime/realtime-strategy/realtime-strategy-socket-io.d.ts +0 -16
  186. package/websql/lib/realtime/realtime-strategy/realtime-strategy.d.ts +0 -12
  187. package/websql/lib/realtime/realtime-subs-manager.d.ts +0 -15
  188. package/websql/lib/realtime/realtime.models.d.ts +0 -28
  189. package/websql/lib/symbols.d.ts +0 -66
  190. package/websql/lib/ui/index.d.ts +0 -2
  191. package/websql/lib/ui/taon-admin-mode-configuration/index.d.ts +0 -2
  192. package/websql/lib/ui/taon-admin-mode-configuration/taon-admin.service.d.ts +0 -22
  193. package/websql/lib/validators.d.ts +0 -8
  194. 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,9 +0,0 @@
1
- // @ts-nocheck
2
- import { TaonBaseInjector } from './base-injector';
3
- /**
4
- * TODO
5
- * - global provider available in all contexts
6
- * - provider available in own context
7
- */
8
- export declare class TaonBaseProvider extends TaonBaseInjector {
9
- }
@@ -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,9 +0,0 @@
1
- // @ts-nocheck
2
- import { CoreModels } from 'tnp-core/websql';
3
- export declare class ParamConfig {
4
- paramName: string;
5
- paramType: CoreModels.ParamType;
6
- index: number;
7
- defaultType: any;
8
- expireInSeconds?: number;
9
- }
@@ -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>;