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,261 +0,0 @@
1
- // @ts-nocheck
2
- import type { RequestHandler } from 'express';
3
- import { Response as ExpressResponse, Request as ExpressRequest } from 'express';
4
- import { Models as ModelsNg2Rest, RestResponseWrapper } from 'ng2-rest/websql';
5
- import { CoreModels } from 'tnp-core/websql';
6
- import type { EndpointContext } from './endpoint-context';
7
- export declare class TaonRestResponseWrapper extends RestResponseWrapper {
8
- }
9
- export declare const BaseTaonClassesNames: readonly ["BaseCrudController", "BaseController", "BaseAbstractEntity", "BaseEntity", "BaseContext", "BaseCustomRepository", "BaseFileUploadMiddleware", "BaseMiddleware", "BaseClass", "BaseInjector", "BaseMigration", "BaseProvider", "BaseRepository", "BaseSubscriberForEntity", "BaseCliWorkerController", "PortsController", "PortsContext"];
10
- export declare const TaonTempDatabasesFolder = "databases";
11
- export declare const TaonTempRoutesFolder = "routes";
12
- export declare namespace Models {
13
- const DatabasesFolder = "databases";
14
- type FrameworkMode = 'backend-frontend(tcp+udp)' | 'remote-backend(tcp+udp)' | 'backend-frontend(ipc-electron)' | 'backend-frontend(websql-electron)' | 'backend-frontend(websql)';
15
- enum ClassType {
16
- ENTITY = "ENTITY",
17
- CONTROLLER = "CONTROLLER",
18
- REPOSITORY = "REPOSITORY",
19
- PROVIDER = "PROVIDER",
20
- SUBSCRIBER = "SUBSCRIBER",
21
- MIGRATION = "MIGRATION",
22
- MIDDLEWARE = "MIDDLEWARE"
23
- }
24
- const ClassTypeKey: { [key in ClassType]: keyof ContextOptions<any, any, any, any, any, any, any, any>; };
25
- type MiddlewareType = [Function, any[]];
26
- /**
27
- * DROP_DB+MIGRATIONS (default for development)
28
- * Drop all tables + recreate them + run migrations
29
- * synchronize: true , dropSchema: true
30
- * use migrations: true
31
- *
32
- * MIGRATIONS (default for production)
33
- * Do not drop tables, only run migrations
34
- * synchronize: false, dropSchema: false
35
- * use migrations: true
36
- */
37
- type DBRecreateMode = 'DROP_DB+MIGRATIONS' | 'PRESERVE_DATA+MIGRATIONS';
38
- class DatabaseConfigTypeOrm {
39
- /**
40
- * database name
41
- */
42
- database?: string;
43
- /**
44
- * only for file base db: sqlite, sqljs
45
- */
46
- location?: string;
47
- synchronize: boolean;
48
- dropSchema: boolean;
49
- type?: CoreModels.DatabaseType;
50
- /**
51
- * Persists db on disk/local-storage if serverless db
52
- */
53
- autoSave?: boolean;
54
- /**
55
- * for websql db mode
56
- * true by default
57
- */
58
- useLocalForage?: boolean;
59
- logging: boolean;
60
- databasePort?: number;
61
- databaseHost?: string;
62
- databaseUsername?: string;
63
- databasePassword?: string;
64
- }
65
- class DatabaseConfig extends DatabaseConfigTypeOrm {
66
- /**
67
- * Default value 'DROP_ALL'.
68
- *
69
- * Tell framework what is happening with db
70
- * when context is starting.
71
- */
72
- recreateMode?: DBRecreateMode;
73
- static from(databasePartialConfig: Partial<Omit<DatabaseConfig, 'synchronize' | 'dropSchema' | 'databaseConfigTypeORM'>>): DatabaseConfig;
74
- get databaseConfigTypeORM(): DatabaseConfigTypeOrm;
75
- }
76
- type ISession = {
77
- secret?: string;
78
- saveUninitialized?: boolean;
79
- /**
80
- * max age of session
81
- */
82
- cookieMaxAge?: number;
83
- secure?: boolean;
84
- resave?: boolean;
85
- };
86
- type ConnectionOptionsLogs = {
87
- http?: boolean;
88
- realtime?: boolean;
89
- framework?: boolean;
90
- db?: boolean;
91
- migrations?: boolean;
92
- routes?: boolean;
93
- };
94
- interface ContextOptions<CONTEXTS, CONTROLLERS, ENTITIES, REPOSITORIES, PROVIDERS, SUBSCRIBERS, MIGRATIONS, MIDDLEWARES> {
95
- appId?: string;
96
- contextName: string;
97
- /**
98
- * if defined and different from contextName
99
- * - context will NOT be initialized
100
- */
101
- activeContext?: string | null;
102
- /**
103
- * IMPORTANT! provide full url that starts with http:// or https://
104
- * host/port for initing backend server
105
- */
106
- host?: string;
107
- /**
108
- * Needs to be specified in docker environment only
109
- */
110
- hostPortNumber?: number;
111
- /**
112
- * IMPORTANT! provide full url that starts with http:// or https://
113
- * frontend host only needed when we are
114
- * using withCredentials for axios
115
- * and session cookie
116
- * or realtime communication
117
- */
118
- frontendHost?: string;
119
- /**
120
- * Needs to be specified in docker environment only
121
- */
122
- frontendHostPortNumber?: number;
123
- /**
124
- * User ipc for communication between BE/FE
125
- * when electron is used as a platform
126
- * Default: true
127
- */
128
- useIpcWhenElectron?: boolean;
129
- /**
130
- * taon contexts here
131
- * (module like structure)
132
- */
133
- contexts?: CONTEXTS;
134
- /**
135
- * taon controller here
136
- * (glue between frontend and backend)
137
- */
138
- controllers?: CONTROLLERS;
139
- /**
140
- * taon entities
141
- * (entities are used to create tables in db)
142
- */
143
- entities?: ENTITIES;
144
- /**
145
- * taon repositories
146
- * (repositories are used to access data from db)
147
- */
148
- repositories?: REPOSITORIES;
149
- /**
150
- * taon providers
151
- * (context singletons)
152
- */
153
- providers?: PROVIDERS;
154
- /**
155
- * taon subscribers
156
- * (subscribers are used to listen to db events)
157
- */
158
- subscribers?: SUBSCRIBERS;
159
- /**
160
- * taon migrations
161
- * (migrations are used to update db schema and achieve proper CI/CD)
162
- */
163
- migrations?: MIGRATIONS;
164
- /**
165
- * taon middlewares
166
- * middlewares are used to intercept requests
167
- * and responses in the context
168
- */
169
- middlewares?: MIDDLEWARES;
170
- /**
171
- * Config for express session
172
- */
173
- session?: ISession;
174
- /**
175
- * taon is not going to write .rest files to cwd()
176
- */
177
- skipWritingServerRoutes?: boolean;
178
- /**
179
- * TODO - this is still in progress
180
- * @deprecated
181
- */
182
- productionMode?: boolean;
183
- /**
184
- * If you want your context to never be started as separated server
185
- * use abstract: true
186
- * @default: false
187
- */
188
- abstract?: boolean;
189
- logs?: boolean | ConnectionOptionsLogs;
190
- database?: boolean | Partial<DatabaseConfig>;
191
- /**
192
- * disable default realtime communication through TCP upgrade sockets
193
- */
194
- disabledRealtime?: boolean;
195
- /**
196
- * Will be removed soon - cloud will handle certs and https
197
- * @deprecated
198
- */
199
- https?: {
200
- key: string;
201
- cert: string;
202
- };
203
- /**
204
- * TODO - will be removed soon
205
- * @deprecated
206
- */
207
- publicAssets?: {
208
- serverPath: string;
209
- locationOnDisk: string;
210
- }[];
211
- /**
212
- * by default cwd === process.cwd()
213
- */
214
- cwd?: string;
215
- }
216
- namespace Http {
217
- export import Rest = ModelsNg2Rest;
218
- type ContextENDPOINT = {
219
- target: Function;
220
- initFN: Function;
221
- };
222
- type FormlyFromType = 'material' | 'bootstrap';
223
- type ExpressContext<T> = (req: ExpressRequest, res: ExpressResponse) => T;
224
- type SyncResponse<T> = string | T;
225
- type ResponseFuncOpt<T> = {
226
- limitSize?: (enties: Function | Function[], include: string[], exclude: string[]) => void;
227
- };
228
- type SyncResponseFunc<T> = (options?: ResponseFuncOpt<T>) => SyncResponse<T>;
229
- type MixResponse<T> = SyncResponse<T> | ExpressContext<T>;
230
- interface ClientAction<T> {
231
- /**
232
- * @deprecated use request() mehods instead
233
- */
234
- readonly received?: Rest.PromiseObservableMix<Rest.HttpResponse<T>>;
235
- request?(axiosConfig?: ModelsNg2Rest.Ng2RestAxiosRequestConfig): Rest.PromiseObservableMix<Rest.HttpResponse<T>>;
236
- }
237
- interface AsyncResponse<T> {
238
- (req?: ExpressRequest, res?: ExpressResponse): Promise<SyncResponse<T> | SyncResponseFunc<T>>;
239
- }
240
- type Response<T = string> = AsyncResponse<T> & ClientAction<T>;
241
- interface AuthCallBack {
242
- (methodReference: Function): RequestHandler;
243
- }
244
- }
245
- interface StartParams {
246
- port: number;
247
- args: string[];
248
- onlyMigrationRun?: boolean;
249
- onlyMigrationRevertToTimestamp?: number;
250
- }
251
- interface TaonInitializeParams {
252
- onlyMigrationRun?: boolean;
253
- onlyMigrationRevertToTimestamp?: number;
254
- }
255
- interface TaonCtxCloneParams {
256
- useAsRemoteContext?: boolean;
257
- overrideRemoteHost?: string;
258
- overrideHost?: string;
259
- sourceContext?: EndpointContext;
260
- }
261
- }
@@ -1,69 +0,0 @@
1
- // @ts-nocheck
2
- import * as tsorm from 'taon-typeorm/websql';
3
- export declare namespace Orm {
4
- const Repository: typeof tsorm.Repository;
5
- export import Connection = tsorm.Connection;
6
- namespace ListenEvent {
7
- export import AfterInsert = tsorm.AfterInsert;
8
- export import AfterLoad = tsorm.AfterLoad;
9
- export import AfterRecover = tsorm.AfterRecover;
10
- export import AfterRemove = tsorm.AfterRemove;
11
- export import AfterSoftRemove = tsorm.AfterSoftRemove;
12
- export import AfterUpdate = tsorm.AfterUpdate;
13
- export import BeforeInsert = tsorm.BeforeInsert;
14
- export import BeforeRecover = tsorm.BeforeRecover;
15
- export import BeforeRemove = tsorm.BeforeRemove;
16
- export import BeforeSoftRemove = tsorm.BeforeSoftRemove;
17
- export import BeforeUpdate = tsorm.BeforeUpdate;
18
- }
19
- namespace Tree {
20
- export import Children = tsorm.TreeChildren;
21
- export import Parent = tsorm.TreeParent;
22
- }
23
- namespace Column {
24
- export import Generated = tsorm.PrimaryGeneratedColumn;
25
- export import Primary = tsorm.PrimaryColumn;
26
- export import Index = tsorm.Index;
27
- export import CreateDate = tsorm.CreateDateColumn;
28
- export import UpdateDate = tsorm.UpdateDateColumn;
29
- export import DeleteDate = tsorm.DeleteDateColumn;
30
- export import Custom = tsorm.Column;
31
- /**
32
- * 100 default characters varchar
33
- */
34
- const String: <T = string>(defaultValue?: T, length?: number) => PropertyDecorator;
35
- /**
36
- * 100 characters varchar
37
- */
38
- const String100: <T = string>(defaultValue?: T) => PropertyDecorator;
39
- /**
40
- * 100 characters varchar
41
- */
42
- const String45: <T = string>(defaultValue?: T) => PropertyDecorator;
43
- /**
44
- * 500 characters varchar
45
- */
46
- const String500: <T = string>(defaultValue?: T) => PropertyDecorator;
47
- /**
48
- * 200 characters varchar
49
- */
50
- const String200: <T = string>(defaultValue?: T) => PropertyDecorator;
51
- const Number: () => PropertyDecorator;
52
- const DecimalNumber: () => PropertyDecorator;
53
- const SimpleJson: () => PropertyDecorator;
54
- const Boolean: (defaultValue: boolean | null) => PropertyDecorator;
55
- const DateTIme: (defaultValue?: boolean | null) => PropertyDecorator;
56
- export import Version = tsorm.VersionColumn;
57
- export import Virtual = tsorm.VirtualColumn;
58
- }
59
- namespace Join {
60
- export import Table = tsorm.JoinTable;
61
- export import Column = tsorm.JoinColumn;
62
- }
63
- namespace Relation {
64
- export import OneToMany = tsorm.OneToMany;
65
- export import OneToOne = tsorm.OneToOne;
66
- export import ManyToMany = tsorm.ManyToMany;
67
- export import ManyToOne = tsorm.ManyToOne;
68
- }
69
- }
@@ -1,42 +0,0 @@
1
- // @ts-nocheck
2
- import { Observable } from 'rxjs';
3
- import { RealtimeCore } from './realtime-core';
4
- import { RealtimeModels } from './realtime.models';
5
- /**
6
- * Client for realtime communication
7
- * you can listen to:
8
- * - entity changes (any property in table changed)
9
- * - entity custom property changes (specific property changed)
10
- * - entity table changes (new instance added, instance removed)
11
- * - custom events
12
- */
13
- export declare class RealtimeClient {
14
- private core;
15
- private subsManagers;
16
- constructor(core: RealtimeCore);
17
- private init;
18
- /**
19
- * Usage:
20
- * myContext.realtimeClient.listenChangesEntity(myEntityInstance);
21
- *
22
- *
23
- * Changes trigger on backend needs to be done manually.. example code:
24
- *
25
- * myContext.realtimeServer.triggerEntityChanges(myEntityInstance);
26
- * ...
27
- */
28
- listenChangesEntity<RESULT = any>(entityClassFnOrObj: Function | object, options?: RealtimeModels.ChangeOption): Observable<RESULT>;
29
- /**
30
- * Listen changes entity table
31
- * Example: for pagination, lists update ...
32
- */
33
- listenChangesEntityTable<RESULT = any>(entityClassFn: Function): Observable<RESULT>;
34
- listenChangesCustomEvent<RESULT = any>(customEvent: string): Observable<RESULT>;
35
- /**
36
- * Trigger custom event on backend
37
- * @param customEvent global event name
38
- * @param dataToPush
39
- */
40
- triggerCustomEvent(customEvent: string, dataToPush?: any): void;
41
- private getUniqueIdentifierForConnection;
42
- }
@@ -1,41 +0,0 @@
1
- // @ts-nocheck
2
- import { Server } from 'socket.io';
3
- import { DefaultEventsMap } from 'socket.io/dist/typed-events';
4
- import { Socket as SocketClient } from 'socket.io-client';
5
- import type { EndpointContext } from '../endpoint-context';
6
- import { RealtimeClient } from './realtime-client';
7
- import { RealtimeServer } from './realtime-server';
8
- import type { RealtimeStrategy } from './realtime-strategy';
9
- /**
10
- * Realtime class
11
- * - mock (when browser-browser)
12
- * - sockets (from socket io when backend-browser)
13
- * - ipc (when electron is used or between processes)
14
- * - webworker (when webworker is used in browser or nodejs)
15
- */
16
- export declare class RealtimeCore {
17
- ctx: EndpointContext;
18
- readonly allHttpMethods: string[];
19
- readonly client: RealtimeClient;
20
- readonly server: RealtimeServer;
21
- readonly strategy: RealtimeStrategy;
22
- /**
23
- * global FE socket - only for established connection
24
- */
25
- conectSocketFE: SocketClient<DefaultEventsMap, DefaultEventsMap>;
26
- /**
27
- * socket for namespaces and rooms
28
- */
29
- socketFE: SocketClient<DefaultEventsMap, DefaultEventsMap>;
30
- /**
31
- * global BE socket - only for established connection
32
- */
33
- connectSocketBE: Server<DefaultEventsMap, DefaultEventsMap, DefaultEventsMap, any>;
34
- /**
35
- * socket for namespaces and rooms
36
- */
37
- socketBE: Server<DefaultEventsMap, DefaultEventsMap, DefaultEventsMap, any>;
38
- constructor(ctx: EndpointContext);
39
- private resolveStrategy;
40
- pathFor(namespace?: string): URL;
41
- }
@@ -1,44 +0,0 @@
1
- // @ts-nocheck
2
- import { Observable } from 'rxjs';
3
- import { RealtimeCore } from './realtime-core';
4
- /**
5
- * Server for realtime communication
6
- * you can trigger:
7
- * - entity changes (any property in table changed)
8
- * - entity custom property changes (specific property changed)
9
- * - entity table changes (new instance added, instance removed)
10
- * - custom events
11
- *
12
- * and also listen to:
13
- * - custom events from yourself
14
- */
15
- export declare class RealtimeServer {
16
- private core;
17
- constructor(core: RealtimeCore);
18
- private init;
19
- private triggerChanges;
20
- triggerEntityChanges(entityObjOrClass: Function | object,
21
- /**
22
- * value of unique key property of entity instance
23
- * (this value is not needed if entityObjOrClass is instance of entity)
24
- */
25
- idToTrigger?: number | string): void;
26
- triggerEntityPropertyChanges(entityObjOrClass: Function | object,
27
- /**
28
- * property name or array of property names that changed
29
- * for entity instance
30
- */
31
- property: string | string[],
32
- /**
33
- * value of unique key property of entity instance
34
- * (this value is not needed if entityObjOrClass is instance of entity)
35
- */
36
- idToTrigger?: number | string): void;
37
- triggerEntityTableChanges(entityClassOrInstance: Function | object): void;
38
- triggerCustomEvent(customEvent: string, dataToPush: any): void;
39
- /**
40
- * Listen to custom events from users
41
- * @param customEvent global event name
42
- */
43
- listenChangesCustomEvent(customEvent: string): Observable<any>;
44
- }
@@ -1,5 +0,0 @@
1
- // @ts-nocheck
2
- export * from './realtime-strategy';
3
- export * from './realtime-strategy-ipc';
4
- export * from './realtime-strategy-mock';
5
- export * from './realtime-strategy-socket-io';
@@ -1,82 +0,0 @@
1
- // @ts-nocheck
2
- import type { ipcRenderer } from 'electron';
3
- import { ServerOptions } from 'socket.io';
4
- import { EndpointContext } from '../../endpoint-context';
5
- import { RealtimeModels } from '../realtime.models';
6
- import { RealtimeStrategy } from './realtime-strategy';
7
- export declare class MockServerIpc {
8
- contextName: string;
9
- static serverByContextName: Map<string, MockServerIpc>;
10
- static from(contextName: string): MockServerIpc;
11
- namespacesByName: Map<string, MockNamespaceIpc>;
12
- constructor(contextName: string);
13
- of(namespace: string): MockNamespaceIpc;
14
- }
15
- export declare class MockNamespaceIpc {
16
- /**
17
- * Namespace name
18
- */
19
- name: string;
20
- server: MockServerIpc;
21
- electronClients: Set<Electron.WebContents>;
22
- roomsByRoomName: {
23
- [roomName: string]: Set<Electron.WebContents>;
24
- };
25
- private namespaceEventHandlers;
26
- constructor(
27
- /**
28
- * Namespace name
29
- */
30
- name: string, server: MockServerIpc);
31
- on(eventName: string, callback: RealtimeModels.EventHandler): any;
32
- off(event: string, callback?: RealtimeModels.EventHandler): any;
33
- emit(eventName: string, ...args: any[]): any;
34
- to(roomName: string): RoomEmitterIpc;
35
- in(roomName: string): RoomEmitterIpc;
36
- join(webContents: Electron.WebContents, roomName: string): void;
37
- leave(webContents: Electron.WebContents, roomName: string): void;
38
- path(): string;
39
- get nsp(): {
40
- readonly name: string;
41
- };
42
- }
43
- declare class RoomEmitterIpc {
44
- private electronClients;
45
- /**
46
- * namespace name
47
- */
48
- private name;
49
- private includeSender;
50
- private sender;
51
- constructor(electronClients: Set<Electron.WebContents>,
52
- /**
53
- * namespace name
54
- */
55
- name: string, includeSender?: boolean, sender?: MockSocketIpc);
56
- emit(eventName: string, ...args: any[]): void;
57
- }
58
- export declare class MockSocketIpc {
59
- namespaceName: string;
60
- ipcRenderer: typeof ipcRenderer;
61
- private socketEventHandlers;
62
- get name(): string;
63
- /**
64
- * @param namespaceName instead url for ipc
65
- */
66
- constructor(namespaceName: string);
67
- on(eventName: string, callback: (event: any, ...args: any[]) => void): void;
68
- off(event: string, callback?: (event: any, ...args: any[]) => void): void;
69
- emit(event: string, ...args: any[]): void;
70
- }
71
- /**
72
- * Purpose:
73
- * - backend-browser communication between 2 processes in electron mode
74
- */
75
- export declare class RealtimeStrategyIpc extends RealtimeStrategy {
76
- protected ctx: EndpointContext;
77
- toString(): string;
78
- constructor(ctx: EndpointContext);
79
- ioServer(__: string, opt: ServerOptions): any;
80
- get ioClient(): any;
81
- }
82
- export {};
@@ -1,15 +0,0 @@
1
- // @ts-nocheck
2
- import type { EndpointContext } from '../../endpoint-context';
3
- import { RealtimeStrategy } from './realtime-strategy';
4
- import { ServerOptions } from 'socket.io';
5
- /**
6
- * Purpose:
7
- * - browser-browser communication mock (in websql mode)
8
- */
9
- export declare class RealtimeStrategyMock extends RealtimeStrategy {
10
- protected ctx: EndpointContext;
11
- toString(): string;
12
- constructor(ctx: EndpointContext);
13
- ioServer(url: string, opt: ServerOptions): any;
14
- get ioClient(): any;
15
- }
@@ -1,16 +0,0 @@
1
- // @ts-nocheck
2
- import { EndpointContext } from '../../endpoint-context';
3
- import { RealtimeStrategy } from './realtime-strategy';
4
- import { io } from 'socket.io-client';
5
- /**
6
- * Purpose:
7
- * - backend-browser communication
8
- * - backend-backend communication
9
- */
10
- export declare class RealtimeStrategySocketIO extends RealtimeStrategy {
11
- protected ctx: EndpointContext;
12
- toString(): string;
13
- constructor(ctx: EndpointContext);
14
- ioServer(...args: any[]): any;
15
- get ioClient(): typeof io;
16
- }
@@ -1,12 +0,0 @@
1
- // @ts-nocheck
2
- import { EndpointContext } from '../../endpoint-context';
3
- import type { Server, ServerOptions } from 'socket.io';
4
- import type { io } from 'socket.io-client';
5
- import { DefaultEventsMap } from 'socket.io/dist/typed-events';
6
- export declare abstract class RealtimeStrategy {
7
- protected ctx: EndpointContext;
8
- constructor(ctx: EndpointContext);
9
- get ioClient(): typeof io;
10
- ioServer(url: string, opt: ServerOptions): Server<DefaultEventsMap, DefaultEventsMap, DefaultEventsMap, any>;
11
- abstract toString(): string;
12
- }
@@ -1,15 +0,0 @@
1
- // @ts-nocheck
2
- import { Subscriber } from 'rxjs';
3
- import { Socket as SocketClient } from 'socket.io-client';
4
- import { DefaultEventsMap } from 'socket.io/dist/typed-events';
5
- import { RealtimeModels } from './realtime.models';
6
- export declare class RealtimeSubsManager {
7
- private options;
8
- private isListening;
9
- private observers;
10
- constructor(options: RealtimeModels.SubsManagerOpt);
11
- startListenIfNotStarted(realtime: SocketClient<DefaultEventsMap, DefaultEventsMap>): void;
12
- add(observer: Subscriber<any>): void;
13
- remove(observer: Subscriber<any>): void;
14
- private update;
15
- }
@@ -1,28 +0,0 @@
1
- // @ts-nocheck
2
- import type { RealtimeCore } from './realtime-core';
3
- export declare namespace RealtimeModels {
4
- type SubsManagerOpt = {
5
- core: RealtimeCore;
6
- customEvent: string;
7
- roomName: string;
8
- property: string;
9
- };
10
- interface ChangeOption {
11
- /**
12
- * Specify property name to listen changes on that property only;
13
- */
14
- property?: string;
15
- /**
16
- * Override custom event name to listen
17
- */
18
- customEvent?: string;
19
- /**
20
- * Value from entity object.
21
- * Key for this value is usually id or unique key
22
- * property defined in entity decorator.
23
- * TODO @LAST IMPLEMENT unique key support
24
- */
25
- idOrUniqValue?: any;
26
- }
27
- type EventHandler = (...args: any[]) => void;
28
- }