taon 21.0.3 → 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 (200) 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 +3 -3
  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/context-db-migrations.d.ts +2 -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 +3 -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 +1 -1
  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/decorators/classes/controller-config.d.ts +0 -20
  126. package/lib/decorators/classes/controller-config.js +0 -21
  127. package/lib/decorators/classes/controller-config.js.map +0 -1
  128. package/lib/decorators/classes/controller-options.d.ts +0 -16
  129. package/lib/decorators/classes/controller-options.js +0 -20
  130. package/lib/decorators/classes/controller-options.js.map +0 -1
  131. package/lib/formly/formly-group-wrapper-component.js +0 -51
  132. package/lib/formly/formly-group-wrapper-component.js.map +0 -1
  133. package/lib/formly/formly-repeat-component.js +0 -95
  134. package/lib/formly/formly-repeat-component.js.map +0 -1
  135. package/lib/orm.d.ts +0 -68
  136. package/lib/orm.js +0 -112
  137. package/lib/orm.js.map +0 -1
  138. package/websql/index.d.ts +0 -6
  139. package/websql/lib/base-classes/base-abstract-entity.d.ts +0 -8
  140. package/websql/lib/base-classes/base-angular-service.d.ts +0 -34
  141. package/websql/lib/base-classes/base-class.d.ts +0 -16
  142. package/websql/lib/base-classes/base-context.d.ts +0 -21
  143. package/websql/lib/base-classes/base-controller.d.ts +0 -83
  144. package/websql/lib/base-classes/base-crud-controller.d.ts +0 -29
  145. package/websql/lib/base-classes/base-custom-repository.d.ts +0 -4
  146. package/websql/lib/base-classes/base-entity.d.ts +0 -17
  147. package/websql/lib/base-classes/base-file-upload.middleware.d.ts +0 -15
  148. package/websql/lib/base-classes/base-injector.d.ts +0 -68
  149. package/websql/lib/base-classes/base-middleware.d.ts +0 -39
  150. package/websql/lib/base-classes/base-migration.d.ts +0 -12
  151. package/websql/lib/base-classes/base-provider.d.ts +0 -9
  152. package/websql/lib/base-classes/base-repository.d.ts +0 -272
  153. package/websql/lib/base-classes/base-subscriber-for-entity.d.ts +0 -82
  154. package/websql/lib/base-classes/base.d.ts +0 -47
  155. package/websql/lib/config/controller-config.d.ts +0 -22
  156. package/websql/lib/config/controller-options.d.ts +0 -17
  157. package/websql/lib/config/method-config.d.ts +0 -40
  158. package/websql/lib/config/param-config.d.ts +0 -9
  159. package/websql/lib/constants.d.ts +0 -10
  160. package/websql/lib/context-db-migrations.d.ts +0 -18
  161. package/websql/lib/create-context.d.ts +0 -79
  162. package/websql/lib/decorators/classes/controller-decorator.d.ts +0 -6
  163. package/websql/lib/decorators/classes/entity-decorator.d.ts +0 -20
  164. package/websql/lib/decorators/classes/middleware-decorator.d.ts +0 -8
  165. package/websql/lib/decorators/classes/migration-decorator.d.ts +0 -8
  166. package/websql/lib/decorators/classes/provider-decorator.d.ts +0 -8
  167. package/websql/lib/decorators/classes/repository-decorator.d.ts +0 -8
  168. package/websql/lib/decorators/classes/subscriber-decorator.d.ts +0 -9
  169. package/websql/lib/decorators/decorator-abstract-opt.d.ts +0 -4
  170. package/websql/lib/decorators/http/http-decorators.d.ts +0 -21
  171. package/websql/lib/decorators/http/http-methods-decorators.d.ts +0 -71
  172. package/websql/lib/decorators/http/http-params-decorators.d.ts +0 -9
  173. package/websql/lib/dependency-injection/di-container.d.ts +0 -6
  174. package/websql/lib/endpoint-context-storage.d.ts +0 -12
  175. package/websql/lib/endpoint-context.d.ts +0 -200
  176. package/websql/lib/entity-process.d.ts +0 -40
  177. package/websql/lib/get-response-value.d.ts +0 -7
  178. package/websql/lib/helpers/class-helpers.d.ts +0 -25
  179. package/websql/lib/helpers/clone-obj.d.ts +0 -2
  180. package/websql/lib/helpers/taon-helpers.d.ts +0 -19
  181. package/websql/lib/index.d.ts +0 -129
  182. package/websql/lib/inject.d.ts +0 -5
  183. package/websql/lib/models.d.ts +0 -261
  184. package/websql/lib/orm.d.ts +0 -69
  185. package/websql/lib/realtime/realtime-client.d.ts +0 -42
  186. package/websql/lib/realtime/realtime-core.d.ts +0 -41
  187. package/websql/lib/realtime/realtime-server.d.ts +0 -44
  188. package/websql/lib/realtime/realtime-strategy/index.d.ts +0 -5
  189. package/websql/lib/realtime/realtime-strategy/realtime-strategy-ipc.d.ts +0 -82
  190. package/websql/lib/realtime/realtime-strategy/realtime-strategy-mock.d.ts +0 -15
  191. package/websql/lib/realtime/realtime-strategy/realtime-strategy-socket-io.d.ts +0 -16
  192. package/websql/lib/realtime/realtime-strategy/realtime-strategy.d.ts +0 -12
  193. package/websql/lib/realtime/realtime-subs-manager.d.ts +0 -15
  194. package/websql/lib/realtime/realtime.models.d.ts +0 -28
  195. package/websql/lib/symbols.d.ts +0 -66
  196. package/websql/lib/ui/index.d.ts +0 -2
  197. package/websql/lib/ui/taon-admin-mode-configuration/index.d.ts +0 -2
  198. package/websql/lib/ui/taon-admin-mode-configuration/taon-admin.service.d.ts +0 -22
  199. package/websql/lib/validators.d.ts +0 -8
  200. package/websql/public-api.d.ts +0 -2
@@ -1,82 +0,0 @@
1
- // @ts-nocheck
2
- import { EntitySubscriberInterface, RecoverEvent, SoftRemoveEvent, InsertEvent, TransactionStartEvent, TransactionCommitEvent, TransactionRollbackEvent, RemoveEvent, UpdateEvent } from 'taon-typeorm/browser';
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/browser").EndpointContext>;
38
- readonly __refSync: import("taon/browser").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/browser").Models.TaonInitializeParams) => Promise<import("taon/browser").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/browser';
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/browser';
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/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<void>;
13
- private logSelectALl;
14
- revertMigrationToTimestamp(timestamp: number): Promise<any>;
15
- clearMigrationTable(): Promise<any>;
16
- markAllMigrationsAsApplied(): Promise<any>;
17
- runAllNotCompletedMigrations(): Promise<any>;
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>;
@@ -1,6 +0,0 @@
1
- // @ts-nocheck
2
- import type { TaonControllerOptions } from '../../config/controller-options';
3
- /**
4
- * Controller decorator
5
- */
6
- export declare function TaonController<ControllerClass = any>(options?: TaonControllerOptions<ControllerClass>): (constructor: Function) => void;
@@ -1,20 +0,0 @@
1
- // @ts-nocheck
2
- import { Mapping } from 'ng2-rest/browser';
3
- import { DecoratorAbstractOpt } from '../decorator-abstract-opt';
4
- /**
5
- * Entity decorator
6
- */
7
- export declare function TaonEntity<T = any>(options?: TaonEntityOptions<T>): (constructor: Function) => void;
8
- export declare class TaonEntityOptions<T = any> extends DecoratorAbstractOpt {
9
- /**
10
- * default unique property is "id"
11
- * for your entity it may be something else
12
- */
13
- uniqueKeyProp?: string;
14
- createTable?: boolean;
15
- defaultModelValues?: Mapping.ModelValue<T>;
16
- defaultModelMapping?: Mapping.Mapping<T>;
17
- defaultModelMappingDeep?: {
18
- [lodashPathes: string]: string | [string];
19
- };
20
- }
@@ -1,8 +0,0 @@
1
- // @ts-nocheck
2
- import { DecoratorAbstractOpt } from '../decorator-abstract-opt';
3
- /**
4
- * Provider decorator
5
- */
6
- export declare function TaonMiddleware<T = any>(options?: TaonMiddlewareOptions<T>): (constructor: Function) => void;
7
- export declare class TaonMiddlewareOptions<T = any> extends DecoratorAbstractOpt {
8
- }
@@ -1,8 +0,0 @@
1
- // @ts-nocheck
2
- import { DecoratorAbstractOpt } from '../decorator-abstract-opt';
3
- /**
4
- * Migration decorator
5
- */
6
- export declare function TaonMigration(options: TaonMigrationOptions): any;
7
- export declare class TaonMigrationOptions<T = any> extends DecoratorAbstractOpt {
8
- }
@@ -1,8 +0,0 @@
1
- // @ts-nocheck
2
- import { DecoratorAbstractOpt } from '../decorator-abstract-opt';
3
- /**
4
- * Provider decorator
5
- */
6
- export declare function TaonProvider<T = any>(options?: TaonProviderOptions<T>): (constructor: Function) => void;
7
- export declare class TaonProviderOptions<T = any> extends DecoratorAbstractOpt {
8
- }
@@ -1,8 +0,0 @@
1
- // @ts-nocheck
2
- import { DecoratorAbstractOpt } from '../decorator-abstract-opt';
3
- /**
4
- * Repository decorator
5
- */
6
- export declare function TaonRepository(options: TaonRepositoryOptions): (constructor: Function) => void;
7
- export declare class TaonRepositoryOptions<T = any> extends DecoratorAbstractOpt {
8
- }
@@ -1,9 +0,0 @@
1
- // @ts-nocheck
2
- import { DecoratorAbstractOpt } from '../decorator-abstract-opt';
3
- /**
4
- * Subscriber decorator
5
- */
6
- export declare function TaonSubscriber(options: TaonSubscriberOptions): any;
7
- export declare class TaonSubscriberOptions<T = any> extends DecoratorAbstractOpt {
8
- allowedEvents?: (keyof T)[];
9
- }
@@ -1,4 +0,0 @@
1
- // @ts-nocheck
2
- export declare class DecoratorAbstractOpt {
3
- className: string;
4
- }
@@ -1,21 +0,0 @@
1
- // @ts-nocheck
2
- import { Models } from 'ng2-rest/browser';
3
- import * as methods from './http-methods-decorators';
4
- import * as params from './http-params-decorators';
5
- export declare namespace Http {
6
- export import GET = methods.GET;
7
- export import POST = methods.POST;
8
- export import PUT = methods.PUT;
9
- export import DELETE = methods.DELETE;
10
- export import PATCH = methods.PATCH;
11
- export import HEAD = methods.HEAD;
12
- export import HTML = methods.HTML;
13
- export import Response = Models.HttpResponse;
14
- namespace Param {
15
- export import Query = params.Query;
16
- export import Path = params.Path;
17
- export import Body = params.Body;
18
- export import Cookie = params.Cookie;
19
- export import Header = params.Header;
20
- }
21
- }
@@ -1,71 +0,0 @@
1
- // @ts-nocheck
2
- import { Models as ModelsNg2Rest } from 'ng2-rest/browser';
3
- import { CoreModels } from 'tnp-core/browser';
4
- import { TaonBaseMiddleware } from '../../base-classes/base-middleware';
5
- export type TaonMiddlewareInheritanceObj = {
6
- [parentMiddlewaresName: string]: typeof TaonBaseMiddleware;
7
- };
8
- export type TaonMiddlewareFunction = (options: {
9
- /**
10
- * middlewares inherited from parent class
11
- */
12
- parentMiddlewares: TaonMiddlewareInheritanceObj;
13
- /**
14
- * Get real class name - needed when code is minified
15
- */
16
- className: (middlewareClass: Function) => string;
17
- }) => TaonMiddlewareInheritanceObj;
18
- export interface TaonHttpDecoratorOptions {
19
- /**
20
- * @deprecated don't use in production - keep stuff encapsulated
21
- * normally path is generated from method name and its params
22
- */
23
- path?: string;
24
- /**
25
- * If true, the path will be global
26
- *
27
- * ! BE CAREFUL ! global path IS NOT GLOBAL inside dockerized app
28
- * (/api/contextName is automatically added to global path in docker)
29
- *
30
- * @deprecated don't use in production - keep stuff encapsulated
31
- */
32
- pathIsGlobal?: boolean;
33
- overrideContentType?: CoreModels.ContentType;
34
- overrideResponseType?: ModelsNg2Rest.ResponseTypeAxios;
35
- /**
36
- * Express will send response as HTML string with proper headers
37
- */
38
- overrideExpressSendAsHtml?: boolean;
39
- middlewares?: TaonMiddlewareFunction;
40
- }
41
- export declare function GET(pathOrOptions?: string | TaonHttpDecoratorOptions, pathIsGlobal?: boolean): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
42
- /**
43
- * Method for sending html website from text
44
- * Example
45
- *
46
- * ```ts
47
- * ...
48
- * // in your taon controller
49
- * ..Taon.Http.HTML()
50
- * sendHtmlDummyWebsite(): Taon.ResponseHtml {
51
- * return `
52
- <html>
53
- <head>
54
- <title>Dummy website</title>
55
- </head>
56
- <body>
57
- <h1>This is dummy website</h1>
58
- <p>Served as HTML string from Taon controller method</p>
59
- </body>
60
- </html>
61
- * `; *
62
- * }
63
- * ...
64
- * ```
65
- */
66
- export declare function HTML(pathOrOptions?: Pick<TaonHttpDecoratorOptions, 'path' | 'pathIsGlobal'>): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
67
- export declare function HEAD(pathOrOptions?: string | TaonHttpDecoratorOptions, pathIsGlobal?: boolean): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
68
- export declare function POST(pathOrOptions?: string | TaonHttpDecoratorOptions, pathIsGlobal?: boolean): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
69
- export declare function PUT(pathOrOptions?: string | TaonHttpDecoratorOptions, pathIsGlobal?: boolean): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
70
- export declare function PATCH(pathOrOptions?: string | TaonHttpDecoratorOptions, pathIsGlobal?: boolean): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
71
- export declare function DELETE(pathOrOptions?: string | TaonHttpDecoratorOptions, pathIsGlobal?: boolean): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
@@ -1,9 +0,0 @@
1
- // @ts-nocheck
2
- /**
3
- * @deprecated use Taon.Http.Param.Path (is more safe and cleaner)
4
- */
5
- export declare function Path(name: string): (target: any, propertyKey: string | symbol, parameterIndex: number) => void;
6
- export declare function Query(name?: string): (target: any, propertyKey: string | symbol, parameterIndex: number) => void;
7
- export declare function Cookie(name: string, expireInSecond?: number): (target: any, propertyKey: string | symbol, parameterIndex: number) => void;
8
- export declare function Header(name?: string): (target: any, propertyKey: string | symbol, parameterIndex: number) => void;
9
- export declare function Body(name?: string): (target: any, propertyKey: string | symbol, parameterIndex: number) => void;
@@ -1,6 +0,0 @@
1
- // @ts-nocheck
2
- export declare class DITaonContainer {
3
- private static instances;
4
- static resolve<T>(target: Function): T;
5
- static inject<T>(target: new (...args: any[]) => T): T;
6
- }
@@ -1,12 +0,0 @@
1
- // @ts-nocheck
2
- import type { EndpointContext } from './endpoint-context';
3
- export declare class ContextsEndpointStorage {
4
- SPECIAL_APP_READY_MESSAGE: string;
5
- private taonEndpointContexts;
6
- private static instance;
7
- private constructor();
8
- static get Instance(): ContextsEndpointStorage;
9
- set(context: EndpointContext): void;
10
- get arr(): EndpointContext[];
11
- getBy(context: Partial<EndpointContext> | string): EndpointContext | undefined;
12
- }