taon 21.0.28 → 21.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/fesm2022/taon-browser.mjs +2 -14
- package/browser/fesm2022/taon-browser.mjs.map +1 -1
- package/browser/package.json +1 -1
- package/browser/types/taon-browser.d.ts +73 -75
- package/browser-prod/fesm2022/taon-browser.mjs +770 -788
- package/browser-prod/fesm2022/taon-browser.mjs.map +1 -1
- package/browser-prod/package.json +23 -0
- package/browser-prod/types/taon-browser.d.ts +493 -513
- package/browser-prod.split-namespaces.json +186 -0
- package/icon-menu-taon.svg +15 -15
- package/lib/base-classes/base-controller.d.ts +2 -1
- package/lib/base-classes/base-controller.js.map +1 -1
- package/lib/build-info._auto-generated_.d.ts +1 -1
- package/lib/build-info._auto-generated_.js +1 -1
- package/lib/decorators/http/http-decorators.d.ts +2 -1
- package/lib/decorators/http/http-decorators.js.map +1 -1
- package/lib/decorators/http/http-methods-decorators.js.map +1 -1
- package/lib/decorators/http/http-params-decorators.js.map +1 -1
- package/lib/endpoint-context.d.ts +2 -1
- package/lib/endpoint-context.js.map +1 -1
- package/lib/index.d.ts +0 -2
- package/lib/index.js +2 -3
- package/lib/index.js.map +1 -1
- package/lib/models.d.ts +2 -3
- package/lib/models.js +0 -7
- package/lib/models.js.map +1 -1
- package/lib/package.json +4 -0
- package/lib/ui/index.js +2 -2
- package/lib/ui/taon-admin-mode-configuration/index.js +2 -2
- package/lib-prod/base-classes/base-class.js +1 -1
- package/lib-prod/base-classes/base-class.js.map +1 -1
- package/lib-prod/base-classes/base-context.d.ts +1 -1
- package/lib-prod/base-classes/base-controller.d.ts +5 -4
- package/lib-prod/base-classes/base-controller.js +2 -2
- package/lib-prod/base-classes/base-controller.js.map +1 -1
- package/lib-prod/base-classes/base-crud-controller.d.ts +13 -13
- package/lib-prod/base-classes/base-crud-controller.js +8 -9
- package/lib-prod/base-classes/base-crud-controller.js.map +1 -1
- package/lib-prod/base-classes/base-injector.js +11 -11
- package/lib-prod/base-classes/base-injector.js.map +1 -1
- package/lib-prod/base-classes/base-middleware.d.ts +2 -2
- package/lib-prod/base-classes/base-migration.js +3 -3
- package/lib-prod/base-classes/base-migration.js.map +1 -1
- package/lib-prod/base-classes/base-repository.js +4 -4
- package/lib-prod/base-classes/base-repository.js.map +1 -1
- package/lib-prod/build-info._auto-generated_.d.ts +1 -1
- package/lib-prod/build-info._auto-generated_.js +1 -1
- package/lib-prod/config/method-config.d.ts +2 -2
- package/lib-prod/config/param-config.d.ts +2 -2
- package/lib-prod/context-db-migrations.js +12 -12
- package/lib-prod/context-db-migrations.js.map +1 -1
- package/lib-prod/create-context.d.ts +5 -5
- package/lib-prod/create-context.js +3 -3
- package/lib-prod/create-context.js.map +1 -1
- package/lib-prod/decorators/classes/controller-decorator.js +3 -3
- package/lib-prod/decorators/classes/controller-decorator.js.map +1 -1
- package/lib-prod/decorators/classes/entity-decorator.d.ts +3 -3
- package/lib-prod/decorators/classes/entity-decorator.js +5 -5
- package/lib-prod/decorators/classes/entity-decorator.js.map +1 -1
- package/lib-prod/decorators/classes/middleware-decorator.js +3 -3
- package/lib-prod/decorators/classes/middleware-decorator.js.map +1 -1
- package/lib-prod/decorators/classes/migration-decorator.js +3 -3
- package/lib-prod/decorators/classes/migration-decorator.js.map +1 -1
- package/lib-prod/decorators/classes/provider-decorator.js +3 -3
- package/lib-prod/decorators/classes/provider-decorator.js.map +1 -1
- package/lib-prod/decorators/classes/repository-decorator.js +3 -3
- package/lib-prod/decorators/classes/repository-decorator.js.map +1 -1
- package/lib-prod/decorators/classes/subscriber-decorator.js +3 -3
- package/lib-prod/decorators/classes/subscriber-decorator.js.map +1 -1
- package/lib-prod/decorators/http/http-decorators.d.ts +3 -2
- package/lib-prod/decorators/http/http-decorators.js +2 -2
- package/lib-prod/decorators/http/http-decorators.js.map +1 -1
- package/lib-prod/decorators/http/http-methods-decorators.d.ts +5 -5
- package/lib-prod/decorators/http/http-methods-decorators.js +2 -2
- package/lib-prod/decorators/http/http-methods-decorators.js.map +1 -1
- package/lib-prod/decorators/http/http-params-decorators.js +1 -1
- package/lib-prod/decorators/http/http-params-decorators.js.map +1 -1
- package/lib-prod/endpoint-context-storage.js +1 -1
- package/lib-prod/endpoint-context-storage.js.map +1 -1
- package/lib-prod/endpoint-context.d.ts +14 -13
- package/lib-prod/endpoint-context.js +171 -171
- package/lib-prod/endpoint-context.js.map +1 -1
- package/lib-prod/entity-process.js +14 -14
- package/lib-prod/entity-process.js.map +1 -1
- package/lib-prod/formly/fromly.d.ts +2 -2
- package/lib-prod/formly/fromly.js +1 -1
- package/lib-prod/formly/fromly.js.map +1 -1
- package/lib-prod/formly/type-from-entity.js +2 -2
- package/lib-prod/formly/type-from-entity.js.map +1 -1
- package/lib-prod/get-response-value.d.ts +2 -2
- package/lib-prod/global-state/taon-global-state/taon-global-state.abstract.context.d.ts +1 -1
- package/lib-prod/global-state/taon-global-state/taon-global-state.controller.d.ts +3 -3
- package/lib-prod/global-state/taon-global-state/taon-global-state.controller.js +0 -1
- package/lib-prod/global-state/taon-global-state/taon-global-state.controller.js.map +1 -1
- package/lib-prod/global-state/taon-global-state/taon-global-state.repository.js +1 -1
- package/lib-prod/global-state/taon-global-state/taon-global-state.repository.js.map +1 -1
- package/lib-prod/global-state/taon-global-state/taon-global-state.utils.d.ts +1 -3
- package/lib-prod/global-state/taon-global-state/taon-global-state.utils.js +12 -12
- package/lib-prod/global-state/taon-global-state/taon-global-state.utils.js.map +1 -1
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.abstract.context.d.ts +1 -1
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.controller.d.ts +2 -2
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.controller.js +0 -1
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.controller.js.map +1 -1
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.utils.d.ts +1 -3
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.utils.js +6 -8
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.utils.js.map +1 -1
- package/lib-prod/helpers/class-helpers.d.ts +20 -22
- package/lib-prod/helpers/class-helpers.js +231 -218
- package/lib-prod/helpers/class-helpers.js.map +1 -1
- package/lib-prod/helpers/taon-helpers.d.ts +14 -16
- package/lib-prod/helpers/taon-helpers.js +148 -138
- package/lib-prod/helpers/taon-helpers.js.map +1 -1
- package/lib-prod/index.d.ts +80 -84
- package/lib-prod/index.js +71 -70
- package/lib-prod/index.js.map +1 -1
- package/lib-prod/inject.js +3 -3
- package/lib-prod/inject.js.map +1 -1
- package/lib-prod/models.d.ts +242 -247
- package/lib-prod/models.js +83 -91
- package/lib-prod/models.js.map +1 -1
- package/lib-prod/package.json +4 -0
- package/lib-prod/realtime/realtime-client.d.ts +2 -2
- package/lib-prod/realtime/realtime-client.js +9 -9
- package/lib-prod/realtime/realtime-client.js.map +1 -1
- package/lib-prod/realtime/realtime-server.js +17 -17
- package/lib-prod/realtime/realtime-server.js.map +1 -1
- package/lib-prod/realtime/realtime-strategy/realtime-strategy-ipc.d.ts +3 -3
- package/lib-prod/realtime/realtime-strategy/realtime-strategy-ipc.js +2 -2
- package/lib-prod/realtime/realtime-strategy/realtime-strategy-ipc.js.map +1 -1
- package/lib-prod/realtime/realtime-strategy/realtime-strategy-mock.js +2 -2
- package/lib-prod/realtime/realtime-strategy/realtime-strategy-mock.js.map +1 -1
- package/lib-prod/realtime/realtime-subs-manager.d.ts +2 -2
- package/lib-prod/realtime/realtime-subs-manager.js +6 -6
- package/lib-prod/realtime/realtime-subs-manager.js.map +1 -1
- package/lib-prod/realtime/realtime.models.d.ts +23 -25
- package/lib-prod/realtime/realtime.models.js +1 -0
- package/lib-prod/realtime/realtime.models.js.map +1 -1
- package/lib-prod/symbols.d.ts +39 -41
- package/lib-prod/symbols.js +44 -45
- package/lib-prod/symbols.js.map +1 -1
- package/lib-prod/ui/index.d.ts +1 -1
- package/lib-prod/ui/index.js +2 -2
- package/lib-prod/ui/taon-admin-mode-configuration/index.d.ts +1 -1
- package/lib-prod/ui/taon-admin-mode-configuration/index.js +2 -2
- package/lib-prod/validators.d.ts +4 -6
- package/lib-prod/validators.js +50 -47
- package/lib-prod/validators.js.map +1 -1
- package/lib-prod.split-namespaces.json +188 -0
- package/package.json +18 -12
- package/websql/fesm2022/taon-websql.mjs +2 -10
- package/websql/fesm2022/taon-websql.mjs.map +1 -1
- package/websql/package.json +1 -1
- package/websql/types/taon-websql.d.ts +73 -75
- package/websql-prod/fesm2022/taon-websql.mjs +855 -870
- package/websql-prod/fesm2022/taon-websql.mjs.map +1 -1
- package/websql-prod/package.json +23 -0
- package/websql-prod/types/taon-websql.d.ts +496 -516
- package/websql-prod.split-namespaces.json +188 -0
- package/migrations/index.d.ts +0 -1
- package/migrations/index.js +0 -19
- package/migrations/index.js.map +0 -1
- package/migrations/migrations_index._auto-generated_.d.ts +0 -0
- package/migrations/migrations_index._auto-generated_.js +0 -4
- package/migrations/migrations_index._auto-generated_.js.map +0 -1
|
@@ -2,25 +2,25 @@
|
|
|
2
2
|
import * as taon_websql from 'taon/websql';
|
|
3
3
|
import * as express from 'express';
|
|
4
4
|
import express__default, { Request, Response, RequestHandler, Application } from 'express';
|
|
5
|
-
import {
|
|
5
|
+
import { Models_PromiseObservableMix, Models_HttpResponse, Models_Ng2RestAxiosRequestConfig, RestResponseWrapper, TaonServerMiddlewareInterceptOptions, TaonClientMiddlewareInterceptOptions, Models_ResponseTypeAxios, HttpResponseError, RestErrorResponseWrapper, Mapping_ModelValue, Mapping_Mapping } from 'ng2-rest/websql-prod';
|
|
6
6
|
export { TaonClientMiddlewareInterceptOptions, TaonServerMiddlewareInterceptOptions } from 'ng2-rest/websql-prod';
|
|
7
7
|
import { Server } from 'http';
|
|
8
8
|
import { DataSource, Repository, SaveOptions, DeepPartial, QueryDeepPartialEntity, InsertResult, UpsertOptions, FindOptionsWhere, UpdateResult, FindManyOptions, FindOneOptions, QueryRunner, SelectQueryBuilder, Table, RelationPath, MigrationInterface, EntitySubscriberInterface, InsertEvent, UpdateEvent, RemoveEvent, SoftRemoveEvent, RecoverEvent, TransactionStartEvent, TransactionCommitEvent, TransactionRollbackEvent } from 'taon-typeorm/websql-prod';
|
|
9
9
|
export { AfterInsert, AfterLoad, AfterRecover, AfterRemove, AfterSoftRemove, AfterUpdate, BeforeInsert, BeforeRecover, BeforeRemove, BeforeSoftRemove, BeforeUpdate, Column, Connection, CreateDateColumn, Column as CustomColumn, DeleteDateColumn, Generated, Generated as GeneratedColumn, Index, JoinColumn, JoinTable, ManyToMany, ManyToOne, OneToMany, OneToOne, PrimaryColumn, PrimaryGeneratedColumn, Repository, TreeChildren, TreeParent, UpdateDateColumn, VersionColumn, VirtualColumn } from 'taon-typeorm/websql-prod';
|
|
10
|
+
import { CoreModels_DatabaseType, CoreModels_HttpMethod, CoreModels_ContentType, CoreModels_ParamType, CoreModels_UIFramework } from 'tnp-core/websql-prod';
|
|
10
11
|
import { MySqlQuerySource } from 'taon-type-sql/websql-prod';
|
|
11
|
-
import { CoreModels } from 'tnp-core/websql-prod';
|
|
12
12
|
import * as i0 from '@angular/core';
|
|
13
13
|
import { InjectionToken, ViewContainerRef } from '@angular/core';
|
|
14
14
|
import { AxiosResponse } from 'axios';
|
|
15
15
|
import * as rxjs from 'rxjs';
|
|
16
16
|
import { Observable, Subscriber } from 'rxjs';
|
|
17
|
-
import * as multer from 'multer';
|
|
18
17
|
import * as _ngx_formly_core from '@ngx-formly/core';
|
|
19
18
|
import { FieldWrapper, FieldArrayType, FormlyFormBuilder, FormlyFieldConfig } from '@ngx-formly/core';
|
|
20
|
-
import { ServerOptions, Server as Server$1, DefaultEventsMap } from 'socket.io';
|
|
21
|
-
import { io, Socket } from 'socket.io-client';
|
|
22
19
|
import * as Electron from 'electron';
|
|
23
20
|
import { ipcRenderer } from 'electron';
|
|
21
|
+
import { ServerOptions, Server as Server$1, DefaultEventsMap } from 'socket.io';
|
|
22
|
+
import { io, Socket } from 'socket.io-client';
|
|
23
|
+
import * as multer from 'multer';
|
|
24
24
|
|
|
25
25
|
declare abstract class TaonBaseCustomRepository extends TaonBaseInjector {
|
|
26
26
|
}
|
|
@@ -389,255 +389,250 @@ declare class TaonRestResponseWrapper extends RestResponseWrapper {
|
|
|
389
389
|
declare const BaseTaonClassesNames: readonly ["BaseCrudController", "BaseController", "BaseAbstractEntity", "BaseEntity", "BaseContext", "BaseCustomRepository", "BaseFileUploadMiddleware", "BaseMiddleware", "BaseClass", "BaseInjector", "BaseMigration", "BaseProvider", "BaseRepository", "BaseSubscriberForEntity", "BaseCliWorkerController", "PortsController", "PortsContext"];
|
|
390
390
|
declare const TaonTempDatabasesFolder = "databases";
|
|
391
391
|
declare const TaonTempRoutesFolder = "routes";
|
|
392
|
-
declare
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
392
|
+
declare const Models_DatabasesFolder = "databases";
|
|
393
|
+
type Models_FrameworkMode = 'backend-frontend(tcp+udp)' | 'remote-backend(tcp+udp)' | 'backend-frontend(ipc-electron)' | 'backend-frontend(websql-electron)' | 'backend-frontend(websql)';
|
|
394
|
+
declare enum Models_ClassType {
|
|
395
|
+
ENTITY = "ENTITY",
|
|
396
|
+
CONTROLLER = "CONTROLLER",
|
|
397
|
+
REPOSITORY = "REPOSITORY",
|
|
398
|
+
PROVIDER = "PROVIDER",
|
|
399
|
+
SUBSCRIBER = "SUBSCRIBER",
|
|
400
|
+
MIGRATION = "MIGRATION",
|
|
401
|
+
MIDDLEWARE = "MIDDLEWARE"
|
|
402
|
+
}
|
|
403
|
+
declare const Models_ClassTypeKey: { [key in Models_ClassType]: keyof Models_ContextOptions<any, any, any, any, any, any, any, any>; };
|
|
404
|
+
type Models_MiddlewareType = [Function, any[]];
|
|
405
|
+
/**
|
|
406
|
+
* DROP_DB+MIGRATIONS (default for development)
|
|
407
|
+
* Drop all tables + recreate them + run migrations
|
|
408
|
+
* synchronize: true , dropSchema: true
|
|
409
|
+
* use migrations: true
|
|
410
|
+
*
|
|
411
|
+
* MIGRATIONS (default for production)
|
|
412
|
+
* Do not drop tables, only run migrations
|
|
413
|
+
* synchronize: false, dropSchema: false
|
|
414
|
+
* use migrations: true
|
|
415
|
+
*/
|
|
416
|
+
type Models_DBRecreateMode = 'DROP_DB+MIGRATIONS' | 'PRESERVE_DATA+MIGRATIONS';
|
|
417
|
+
declare class Models_DatabaseConfigTypeOrm {
|
|
418
|
+
/**
|
|
419
|
+
* database name
|
|
420
|
+
*/
|
|
421
|
+
database?: string;
|
|
422
|
+
/**
|
|
423
|
+
* only for file base db: sqlite, sqljs
|
|
424
|
+
*/
|
|
425
|
+
location?: string;
|
|
426
|
+
synchronize: boolean;
|
|
427
|
+
dropSchema: boolean;
|
|
428
|
+
type?: CoreModels_DatabaseType;
|
|
429
|
+
/**
|
|
430
|
+
* Persists db on disk/local-storage if serverless db
|
|
431
|
+
*/
|
|
432
|
+
autoSave?: boolean;
|
|
433
|
+
/**
|
|
434
|
+
* for websql db mode
|
|
435
|
+
* true by default
|
|
436
|
+
*/
|
|
437
|
+
useLocalForage?: boolean;
|
|
438
|
+
logging: boolean;
|
|
439
|
+
databasePort?: number;
|
|
440
|
+
databaseHost?: string;
|
|
441
|
+
databaseUsername?: string;
|
|
442
|
+
databasePassword?: string;
|
|
443
|
+
}
|
|
444
|
+
declare class Models_DatabaseConfig extends Models_DatabaseConfigTypeOrm {
|
|
445
|
+
/**
|
|
446
|
+
* Default value 'DROP_ALL'.
|
|
411
447
|
*
|
|
412
|
-
*
|
|
413
|
-
*
|
|
414
|
-
* synchronize: false, dropSchema: false
|
|
415
|
-
* use migrations: true
|
|
448
|
+
* Tell framework what is happening with db
|
|
449
|
+
* when context is starting.
|
|
416
450
|
*/
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
451
|
+
recreateMode?: Models_DBRecreateMode;
|
|
452
|
+
static from(databasePartialConfig: Partial<Omit<Models_DatabaseConfig, 'synchronize' | 'dropSchema' | 'databaseConfigTypeORM'>>): Models_DatabaseConfig;
|
|
453
|
+
get databaseConfigTypeORM(): Models_DatabaseConfigTypeOrm;
|
|
454
|
+
}
|
|
455
|
+
type Models_ISession = {
|
|
456
|
+
secret?: string;
|
|
457
|
+
saveUninitialized?: boolean;
|
|
458
|
+
/**
|
|
459
|
+
* max age of session
|
|
460
|
+
*/
|
|
461
|
+
cookieMaxAge?: number;
|
|
462
|
+
secure?: boolean;
|
|
463
|
+
resave?: boolean;
|
|
464
|
+
};
|
|
465
|
+
type Models_ConnectionOptionsLogs = {
|
|
466
|
+
http?: boolean;
|
|
467
|
+
realtime?: boolean;
|
|
468
|
+
framework?: boolean;
|
|
469
|
+
db?: boolean;
|
|
470
|
+
migrations?: boolean;
|
|
471
|
+
routes?: boolean;
|
|
472
|
+
};
|
|
473
|
+
interface Models_ContextOptions<CONTEXTS, CONTROLLERS, ENTITIES, REPOSITORIES, PROVIDERS, SUBSCRIBERS, MIGRATIONS, MIDDLEWARES> {
|
|
474
|
+
appId?: string;
|
|
475
|
+
contextName: string;
|
|
476
|
+
/**
|
|
477
|
+
* if defined and different from contextName
|
|
478
|
+
* - context will NOT be initialized
|
|
479
|
+
*/
|
|
480
|
+
activeContext?: string | null;
|
|
481
|
+
/**
|
|
482
|
+
* IMPORTANT! provide full url that starts with http:// or https://
|
|
483
|
+
* host/port for initing backend server
|
|
484
|
+
*/
|
|
485
|
+
host?: string;
|
|
486
|
+
/**
|
|
487
|
+
* Needs to be specified in docker environment only
|
|
488
|
+
*/
|
|
489
|
+
hostPortNumber?: number;
|
|
490
|
+
/**
|
|
491
|
+
* IMPORTANT! provide full url that starts with http:// or https://
|
|
492
|
+
* frontend host only needed when we are
|
|
493
|
+
* using withCredentials for axios
|
|
494
|
+
* and session cookie
|
|
495
|
+
* or realtime communication
|
|
496
|
+
*/
|
|
497
|
+
frontendHost?: string;
|
|
498
|
+
/**
|
|
499
|
+
* Needs to be specified in docker environment only
|
|
500
|
+
*/
|
|
501
|
+
frontendHostPortNumber?: number;
|
|
502
|
+
/**
|
|
503
|
+
* User ipc for communication between BE/FE
|
|
504
|
+
* when electron is used as a platform
|
|
505
|
+
* Default: true
|
|
506
|
+
*/
|
|
507
|
+
useIpcWhenElectron?: boolean;
|
|
508
|
+
/**
|
|
509
|
+
* taon contexts here
|
|
510
|
+
* (module like structure)
|
|
511
|
+
*/
|
|
512
|
+
contexts?: CONTEXTS;
|
|
513
|
+
/**
|
|
514
|
+
* taon controller here
|
|
515
|
+
* (glue between frontend and backend)
|
|
516
|
+
*/
|
|
517
|
+
controllers?: CONTROLLERS;
|
|
518
|
+
/**
|
|
519
|
+
* taon entities
|
|
520
|
+
* (entities are used to create tables in db)
|
|
521
|
+
*/
|
|
522
|
+
entities?: ENTITIES;
|
|
523
|
+
/**
|
|
524
|
+
* taon repositories
|
|
525
|
+
* (repositories are used to access data from db)
|
|
526
|
+
*/
|
|
527
|
+
repositories?: REPOSITORIES;
|
|
528
|
+
/**
|
|
529
|
+
* taon providers
|
|
530
|
+
* (context singletons)
|
|
531
|
+
*/
|
|
532
|
+
providers?: PROVIDERS;
|
|
533
|
+
/**
|
|
534
|
+
* taon subscribers
|
|
535
|
+
* (subscribers are used to listen to db events)
|
|
536
|
+
*/
|
|
537
|
+
subscribers?: SUBSCRIBERS;
|
|
538
|
+
/**
|
|
539
|
+
* taon migrations
|
|
540
|
+
* (migrations are used to update db schema and achieve proper CI/CD)
|
|
541
|
+
*/
|
|
542
|
+
migrations?: MIGRATIONS;
|
|
543
|
+
/**
|
|
544
|
+
* taon middlewares
|
|
545
|
+
* middlewares are used to intercept requests
|
|
546
|
+
* and responses in the context
|
|
547
|
+
*/
|
|
548
|
+
middlewares?: MIDDLEWARES;
|
|
549
|
+
/**
|
|
550
|
+
* Config for express session
|
|
551
|
+
*/
|
|
552
|
+
session?: Models_ISession;
|
|
553
|
+
/**
|
|
554
|
+
* taon is not going to write .rest files to cwd()
|
|
555
|
+
*/
|
|
556
|
+
skipWritingServerRoutes?: boolean;
|
|
557
|
+
/**
|
|
558
|
+
* TODO - this is still in progress
|
|
559
|
+
* @deprecated
|
|
560
|
+
*/
|
|
561
|
+
productionMode?: boolean;
|
|
562
|
+
/**
|
|
563
|
+
* If you want your context to never be started as separated server
|
|
564
|
+
* use abstract: true
|
|
565
|
+
* @default: false
|
|
566
|
+
*/
|
|
567
|
+
abstract?: boolean;
|
|
568
|
+
logs?: boolean | Models_ConnectionOptionsLogs;
|
|
569
|
+
database?: boolean | Partial<Models_DatabaseConfig>;
|
|
570
|
+
/**
|
|
571
|
+
* disable default realtime communication through TCP upgrade sockets
|
|
572
|
+
*/
|
|
573
|
+
disabledRealtime?: boolean;
|
|
574
|
+
/**
|
|
575
|
+
* Will be removed soon - cloud will handle certs and https
|
|
576
|
+
* @deprecated
|
|
577
|
+
*/
|
|
578
|
+
https?: {
|
|
579
|
+
key: string;
|
|
580
|
+
cert: string;
|
|
473
581
|
};
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
repositories?: REPOSITORIES;
|
|
529
|
-
/**
|
|
530
|
-
* taon providers
|
|
531
|
-
* (context singletons)
|
|
532
|
-
*/
|
|
533
|
-
providers?: PROVIDERS;
|
|
534
|
-
/**
|
|
535
|
-
* taon subscribers
|
|
536
|
-
* (subscribers are used to listen to db events)
|
|
537
|
-
*/
|
|
538
|
-
subscribers?: SUBSCRIBERS;
|
|
539
|
-
/**
|
|
540
|
-
* taon migrations
|
|
541
|
-
* (migrations are used to update db schema and achieve proper CI/CD)
|
|
542
|
-
*/
|
|
543
|
-
migrations?: MIGRATIONS;
|
|
544
|
-
/**
|
|
545
|
-
* taon middlewares
|
|
546
|
-
* middlewares are used to intercept requests
|
|
547
|
-
* and responses in the context
|
|
548
|
-
*/
|
|
549
|
-
middlewares?: MIDDLEWARES;
|
|
550
|
-
/**
|
|
551
|
-
* Config for express session
|
|
552
|
-
*/
|
|
553
|
-
session?: ISession;
|
|
554
|
-
/**
|
|
555
|
-
* taon is not going to write .rest files to cwd()
|
|
556
|
-
*/
|
|
557
|
-
skipWritingServerRoutes?: boolean;
|
|
558
|
-
/**
|
|
559
|
-
* TODO - this is still in progress
|
|
560
|
-
* @deprecated
|
|
561
|
-
*/
|
|
562
|
-
productionMode?: boolean;
|
|
563
|
-
/**
|
|
564
|
-
* If you want your context to never be started as separated server
|
|
565
|
-
* use abstract: true
|
|
566
|
-
* @default: false
|
|
567
|
-
*/
|
|
568
|
-
abstract?: boolean;
|
|
569
|
-
logs?: boolean | ConnectionOptionsLogs;
|
|
570
|
-
database?: boolean | Partial<DatabaseConfig>;
|
|
571
|
-
/**
|
|
572
|
-
* disable default realtime communication through TCP upgrade sockets
|
|
573
|
-
*/
|
|
574
|
-
disabledRealtime?: boolean;
|
|
575
|
-
/**
|
|
576
|
-
* Will be removed soon - cloud will handle certs and https
|
|
577
|
-
* @deprecated
|
|
578
|
-
*/
|
|
579
|
-
https?: {
|
|
580
|
-
key: string;
|
|
581
|
-
cert: string;
|
|
582
|
-
};
|
|
583
|
-
/**
|
|
584
|
-
* TODO - will be removed soon
|
|
585
|
-
* @deprecated
|
|
586
|
-
*/
|
|
587
|
-
publicAssets?: {
|
|
588
|
-
serverPath: string;
|
|
589
|
-
locationOnDisk: string;
|
|
590
|
-
}[];
|
|
591
|
-
/**
|
|
592
|
-
* by default cwd === process.cwd()
|
|
593
|
-
*/
|
|
594
|
-
cwd?: string;
|
|
595
|
-
}
|
|
596
|
-
namespace Http {
|
|
597
|
-
export import Rest = Models$1;
|
|
598
|
-
type ContextENDPOINT = {
|
|
599
|
-
target: Function;
|
|
600
|
-
initFN: Function;
|
|
601
|
-
};
|
|
602
|
-
type FormlyFromType = 'material' | 'bootstrap';
|
|
603
|
-
type ExpressContext<T> = (req: Request<any>, res: Response<any>) => T;
|
|
604
|
-
type SyncResponse<T> = string | T;
|
|
605
|
-
type ResponseFuncOpt<T> = {
|
|
606
|
-
limitSize?: (enties: Function | Function[], include: string[], exclude: string[]) => void;
|
|
607
|
-
};
|
|
608
|
-
type SyncResponseFunc<T> = (options?: ResponseFuncOpt<T>) => SyncResponse<T>;
|
|
609
|
-
type MixResponse<T> = SyncResponse<T> | ExpressContext<T>;
|
|
610
|
-
interface ClientAction<T> {
|
|
611
|
-
/**
|
|
612
|
-
* @deprecated use request() mehods instead
|
|
613
|
-
*/
|
|
614
|
-
readonly received?: Rest.PromiseObservableMix<Rest.HttpResponse<T>>;
|
|
615
|
-
request?(axiosConfig?: Models$1.Ng2RestAxiosRequestConfig): Rest.PromiseObservableMix<Rest.HttpResponse<T>>;
|
|
616
|
-
}
|
|
617
|
-
interface AsyncResponse<T> {
|
|
618
|
-
(req?: Request<any>, res?: Response<any>): Promise<SyncResponse<T> | SyncResponseFunc<T>>;
|
|
619
|
-
}
|
|
620
|
-
type Response<T = string> = AsyncResponse<T> & ClientAction<T>;
|
|
621
|
-
interface AuthCallBack {
|
|
622
|
-
(methodReference: Function): RequestHandler;
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
interface StartParams {
|
|
626
|
-
port: number;
|
|
627
|
-
args: string[];
|
|
628
|
-
onlyMigrationRun?: boolean;
|
|
629
|
-
onlyMigrationRevertToTimestamp?: number;
|
|
630
|
-
}
|
|
631
|
-
interface TaonInitializeParams {
|
|
632
|
-
onlyMigrationRun?: boolean;
|
|
633
|
-
onlyMigrationRevertToTimestamp?: number;
|
|
634
|
-
}
|
|
635
|
-
interface TaonCtxCloneParams {
|
|
636
|
-
useAsRemoteContext?: boolean;
|
|
637
|
-
overrideRemoteHost?: string;
|
|
638
|
-
overrideHost?: string;
|
|
639
|
-
sourceContext?: EndpointContext;
|
|
640
|
-
}
|
|
582
|
+
/**
|
|
583
|
+
* TODO - will be removed soon
|
|
584
|
+
* @deprecated
|
|
585
|
+
*/
|
|
586
|
+
publicAssets?: {
|
|
587
|
+
serverPath: string;
|
|
588
|
+
locationOnDisk: string;
|
|
589
|
+
}[];
|
|
590
|
+
/**
|
|
591
|
+
* by default cwd === process.cwd()
|
|
592
|
+
*/
|
|
593
|
+
cwd?: string;
|
|
594
|
+
}
|
|
595
|
+
type Models_Http_ContextENDPOINT = {
|
|
596
|
+
target: Function;
|
|
597
|
+
initFN: Function;
|
|
598
|
+
};
|
|
599
|
+
type Models_Http_FormlyFromType = 'material' | 'bootstrap';
|
|
600
|
+
type Models_Http_ExpressContext<T> = (req: Request<any>, res: Response<any>) => T;
|
|
601
|
+
type Models_Http_SyncResponse<T> = string | T;
|
|
602
|
+
type Models_Http_ResponseFuncOpt<T> = {
|
|
603
|
+
limitSize?: (enties: Function | Function[], include: string[], exclude: string[]) => void;
|
|
604
|
+
};
|
|
605
|
+
type Models_Http_SyncResponseFunc<T> = (options?: Models_Http_ResponseFuncOpt<T>) => Models_Http_SyncResponse<T>;
|
|
606
|
+
type Models_Http_MixResponse<T> = Models_Http_SyncResponse<T> | Models_Http_ExpressContext<T>;
|
|
607
|
+
interface Models_Http_ClientAction<T> {
|
|
608
|
+
/**
|
|
609
|
+
* @deprecated use request() mehods instead
|
|
610
|
+
*/
|
|
611
|
+
readonly received?: Models_PromiseObservableMix<Models_HttpResponse<T>>;
|
|
612
|
+
request?(axiosConfig?: Models_Ng2RestAxiosRequestConfig): Models_PromiseObservableMix<Models_HttpResponse<T>>;
|
|
613
|
+
}
|
|
614
|
+
interface Models_Http_AsyncResponse<T> {
|
|
615
|
+
(req?: Request<any>, res?: Response<any>): Promise<Models_Http_SyncResponse<T> | Models_Http_SyncResponseFunc<T>>;
|
|
616
|
+
}
|
|
617
|
+
type Models_Http_Response<T = string> = Models_Http_AsyncResponse<T> & Models_Http_ClientAction<T>;
|
|
618
|
+
interface Models_Http_AuthCallBack {
|
|
619
|
+
(methodReference: Function): RequestHandler;
|
|
620
|
+
}
|
|
621
|
+
interface Models_StartParams {
|
|
622
|
+
port: number;
|
|
623
|
+
args: string[];
|
|
624
|
+
onlyMigrationRun?: boolean;
|
|
625
|
+
onlyMigrationRevertToTimestamp?: number;
|
|
626
|
+
}
|
|
627
|
+
interface Models_TaonInitializeParams {
|
|
628
|
+
onlyMigrationRun?: boolean;
|
|
629
|
+
onlyMigrationRevertToTimestamp?: number;
|
|
630
|
+
}
|
|
631
|
+
interface Models_TaonCtxCloneParams {
|
|
632
|
+
useAsRemoteContext?: boolean;
|
|
633
|
+
overrideRemoteHost?: string;
|
|
634
|
+
overrideHost?: string;
|
|
635
|
+
sourceContext?: EndpointContext;
|
|
641
636
|
}
|
|
642
637
|
|
|
643
638
|
declare class EndpointContext {
|
|
@@ -671,7 +666,7 @@ declare class EndpointContext {
|
|
|
671
666
|
private readonly objWithClassesInstancesArr;
|
|
672
667
|
readonly activeRoutes: {
|
|
673
668
|
expressPath: string;
|
|
674
|
-
method:
|
|
669
|
+
method: CoreModels_HttpMethod;
|
|
675
670
|
}[];
|
|
676
671
|
repos: Map<string, Repository<any>>;
|
|
677
672
|
get sourceContext(): EndpointContext | undefined;
|
|
@@ -680,12 +675,12 @@ declare class EndpointContext {
|
|
|
680
675
|
private allTypesfromContexts;
|
|
681
676
|
expressApp: Application;
|
|
682
677
|
serverTcpUdp: Server;
|
|
683
|
-
databaseConfig?:
|
|
684
|
-
mode:
|
|
678
|
+
databaseConfig?: Models_DatabaseConfigTypeOrm;
|
|
679
|
+
mode: Models_FrameworkMode;
|
|
685
680
|
readonly onlyMigrationRun?: boolean;
|
|
686
681
|
readonly onlyMigrationRevertToTimestamp?: number;
|
|
687
682
|
get isRunOrRevertOnlyMigrationAppStart(): boolean;
|
|
688
|
-
session?:
|
|
683
|
+
session?: Models_ISession;
|
|
689
684
|
connection: DataSource;
|
|
690
685
|
private entitiesTriggers;
|
|
691
686
|
private realtime;
|
|
@@ -694,7 +689,7 @@ declare class EndpointContext {
|
|
|
694
689
|
/**
|
|
695
690
|
* available after init()
|
|
696
691
|
*/
|
|
697
|
-
config:
|
|
692
|
+
config: Models_ContextOptions<any, any, any, any, any, any, any, any>;
|
|
698
693
|
get logHttp(): boolean;
|
|
699
694
|
get logRealtime(): boolean;
|
|
700
695
|
get logFramework(): boolean;
|
|
@@ -705,14 +700,14 @@ declare class EndpointContext {
|
|
|
705
700
|
* Inside docker there is not need for https secure server
|
|
706
701
|
*/
|
|
707
702
|
readonly isRunningInsideDocker: boolean;
|
|
708
|
-
constructor(originalConfig:
|
|
703
|
+
constructor(originalConfig: Models_ContextOptions<any, any, any, any, any, any, any, any>, configFn: (env: any) => Models_ContextOptions<any, any, any, any, any, any, any, any>,
|
|
709
704
|
/**
|
|
710
705
|
* (@default: false)
|
|
711
706
|
* If TRUE context is NOT going to create db/express server/http endpoints
|
|
712
707
|
* PURPOSE OF THIS PROPERTY
|
|
713
708
|
* -> ONLY remote access from backend or frontend to specific backend
|
|
714
709
|
*/
|
|
715
|
-
cloneOptions:
|
|
710
|
+
cloneOptions: Models_TaonCtxCloneParams);
|
|
716
711
|
init(options?: {
|
|
717
712
|
initFromRecrusiveContextResovle?: boolean;
|
|
718
713
|
onlyMigrationRun?: boolean;
|
|
@@ -726,7 +721,7 @@ declare class EndpointContext {
|
|
|
726
721
|
private cloneClassesObjWithNewMetadata;
|
|
727
722
|
private getRecrusiveClassesfromContextsObj;
|
|
728
723
|
private getRecrusiveClassesfromContexts;
|
|
729
|
-
getClassInstanceObjBy(classType:
|
|
724
|
+
getClassInstanceObjBy(classType: Models_ClassType): any;
|
|
730
725
|
private getClassesInstancesArrBy;
|
|
731
726
|
inject<T>(ctor: new (...args: any[]) => T, options: {
|
|
732
727
|
localInstance?: boolean;
|
|
@@ -739,15 +734,15 @@ declare class EndpointContext {
|
|
|
739
734
|
*/
|
|
740
735
|
getInstanceBy<T>(ctor: new (...args: any[]) => T): T;
|
|
741
736
|
checkIfContextInitialized(): void;
|
|
742
|
-
getClassFunBy(classType:
|
|
743
|
-
isCLassType(classType:
|
|
737
|
+
getClassFunBy(classType: Models_ClassType): any;
|
|
738
|
+
isCLassType(classType: Models_ClassType, classFn: Function): boolean;
|
|
744
739
|
/**
|
|
745
740
|
* Only for injectable types
|
|
746
741
|
* Only for classType: CONTROLLER, REPOSITORY, PROVIDER, MIDDLEWARES
|
|
747
742
|
*/
|
|
748
743
|
getClassFunByClassName(className: string): Function;
|
|
749
744
|
getClassFunByClass(classFunction: Function): Function;
|
|
750
|
-
getClassFunByArr(classType:
|
|
745
|
+
getClassFunByArr(classType: Models_ClassType): Function[];
|
|
751
746
|
private createInstances;
|
|
752
747
|
initClasses(): Promise<void>;
|
|
753
748
|
isActiveOn(classInstance: object): boolean;
|
|
@@ -815,7 +810,7 @@ declare class EndpointContext {
|
|
|
815
810
|
initControllersHook(ctxStorage: ContextsEndpointStorage): Promise<void>;
|
|
816
811
|
initControllers(): Promise<void>;
|
|
817
812
|
writeActiveRoutes(): void;
|
|
818
|
-
get middlewares():
|
|
813
|
+
get middlewares(): Models_MiddlewareType[];
|
|
819
814
|
private initCustomClientMiddlewares;
|
|
820
815
|
private initCustomBackendMiddlewares;
|
|
821
816
|
private initBackendMiddlewares;
|
|
@@ -827,77 +822,12 @@ declare class EndpointContext {
|
|
|
827
822
|
private initClient;
|
|
828
823
|
}
|
|
829
824
|
|
|
830
|
-
/**
|
|
831
|
-
* for backendSocket.in(ROOM_NAME).emit(EVENT)
|
|
832
|
-
*
|
|
833
|
-
* Room names are uniqe..
|
|
834
|
-
* here I am limiting number of event for clients.
|
|
835
|
-
*/
|
|
836
|
-
declare class Realtime {
|
|
837
|
-
NAMESPACE(contextName: string): string;
|
|
838
|
-
TABLE_CHANGE(contextName: string, tableName: string): string;
|
|
839
|
-
readonly KEYroomSubscribe = "roomSubscribe";
|
|
840
|
-
readonly KEYroomUnsubscribe = "roomUnsubscribe";
|
|
841
|
-
ROOM_NAME_CUSTOM(contextName: string, customEvent: string): string;
|
|
842
|
-
ROOM_SUBSCRIBE_CUSTOM(contextName: string): string;
|
|
843
|
-
ROOM_UNSUBSCRIBE_CUSTOM(contextName: string): string;
|
|
844
|
-
ROOM_NAME_UPDATE_ENTITY(contextName: string, className: string, entityId: number | string): string;
|
|
845
|
-
ROOM_SUBSCRIBE_ENTITY_UPDATE_EVENTS(contextName: string): string;
|
|
846
|
-
ROOM_UNSUBSCRIBE_ENTITY_UPDATE_EVENTS(contextName: string): string;
|
|
847
|
-
ROOM_NAME_UPDATE_ENTITY_PROPERTY(contextName: string, className: string, property: string, entityId: number | string): string;
|
|
848
|
-
ROOM_SUBSCRIBE_ENTITY_PROPERTY_UPDATE_EVENTS(contextName: string): string;
|
|
849
|
-
ROOM_UNSUBSCRIBE_ENTITY_PROPERTY_UPDATE_EVENTS(contextName: string): string;
|
|
850
|
-
}
|
|
851
|
-
declare namespace Symbols {
|
|
852
|
-
const ctxInClassOrClassObj: unique symbol;
|
|
853
|
-
const classNameStaticProperty: string;
|
|
854
|
-
const fullClassNameStaticProperty: string;
|
|
855
|
-
const orignalClass: string;
|
|
856
|
-
const orignalClassClonesObj: string;
|
|
857
|
-
const classMethodsNames: string;
|
|
858
|
-
const REALTIME: Realtime;
|
|
859
|
-
const metadata: {
|
|
860
|
-
className: string;
|
|
861
|
-
options: {
|
|
862
|
-
controller: string;
|
|
863
|
-
entity: string;
|
|
864
|
-
repository: string;
|
|
865
|
-
provider: string;
|
|
866
|
-
subscriber: string;
|
|
867
|
-
migration: string;
|
|
868
|
-
};
|
|
869
|
-
};
|
|
870
|
-
const old: {
|
|
871
|
-
HAS_TABLE_IN_DB: symbol;
|
|
872
|
-
MDC_KEY: string;
|
|
873
|
-
WEBSQL_REST_PROGRESS_FUN: symbol;
|
|
874
|
-
WEBSQL_REST_PROGRESS_FUN_START: symbol;
|
|
875
|
-
WEBSQL_REST_PROGRESS_FUN_DONE: symbol;
|
|
876
|
-
WEBSQL_REST_PROGRESS_TIMEOUT: symbol;
|
|
877
|
-
X_TOTAL_COUNT: string;
|
|
878
|
-
CIRCURAL_OBJECTS_MAP_BODY: string;
|
|
879
|
-
CIRCURAL_OBJECTS_MAP_QUERY_PARAM: string;
|
|
880
|
-
MAPPING_CONFIG_HEADER: string;
|
|
881
|
-
MAPPING_CONFIG_HEADER_BODY_PARAMS: string;
|
|
882
|
-
MAPPING_CONFIG_HEADER_QUERY_PARAMS: string;
|
|
883
|
-
ENDPOINT_META_CONFIG: string;
|
|
884
|
-
CLASS_DECORATOR_CONTEXT: string;
|
|
885
|
-
SOCKET_MSG: string;
|
|
886
|
-
ANGULAR: {
|
|
887
|
-
INPUT_NAMES: symbol;
|
|
888
|
-
};
|
|
889
|
-
ERROR_MESSAGES: {
|
|
890
|
-
CLASS_NAME_MATCH: string;
|
|
891
|
-
};
|
|
892
|
-
};
|
|
893
|
-
}
|
|
894
|
-
|
|
895
825
|
/**
|
|
896
826
|
* @returns function that returns context function.
|
|
897
827
|
* Context function can be used to dynamically
|
|
898
828
|
* create context with specific configuration.
|
|
899
829
|
*/
|
|
900
|
-
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) =>
|
|
830
|
+
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>) => () => {
|
|
901
831
|
readonly contextName: string;
|
|
902
832
|
readonly appId: string;
|
|
903
833
|
cloneAsRemote: (cloneOpt?: {
|
|
@@ -922,7 +852,7 @@ declare const createContextTemplate: <CTX extends Record<string, object>, CTRL e
|
|
|
922
852
|
* - create controller instances for context
|
|
923
853
|
* - init database (if enable) + migation scripts
|
|
924
854
|
*/
|
|
925
|
-
initialize: (overrideOptions?:
|
|
855
|
+
initialize: (overrideOptions?: Models_TaonInitializeParams) => Promise<EndpointContext>;
|
|
926
856
|
/**
|
|
927
857
|
* realtime communication with server
|
|
928
858
|
* TCP(upgrade) socket.io (or ipc) based.
|
|
@@ -932,7 +862,7 @@ declare const createContextTemplate: <CTX extends Record<string, object>, CTRL e
|
|
|
932
862
|
readonly server: taon_websql.RealtimeServer;
|
|
933
863
|
};
|
|
934
864
|
};
|
|
935
|
-
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) =>
|
|
865
|
+
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>) => {
|
|
936
866
|
readonly contextName: string;
|
|
937
867
|
readonly appId: string;
|
|
938
868
|
cloneAsRemote: (cloneOpt?: {
|
|
@@ -957,7 +887,7 @@ declare const createContext: <CTX extends Record<string, object>, CTRL extends R
|
|
|
957
887
|
* - create controller instances for context
|
|
958
888
|
* - init database (if enable) + migation scripts
|
|
959
889
|
*/
|
|
960
|
-
initialize: (overrideOptions?:
|
|
890
|
+
initialize: (overrideOptions?: Models_TaonInitializeParams) => Promise<EndpointContext>;
|
|
961
891
|
/**
|
|
962
892
|
* realtime communication with server
|
|
963
893
|
* TCP(upgrade) socket.io (or ipc) based.
|
|
@@ -1017,17 +947,80 @@ declare class EntityProcess {
|
|
|
1017
947
|
send(): void;
|
|
1018
948
|
}
|
|
1019
949
|
|
|
1020
|
-
declare const getResponseValue: <T>(response:
|
|
950
|
+
declare const getResponseValue: <T>(response: Models_Http_Response<T>, options?: {
|
|
1021
951
|
req: Request<any>;
|
|
1022
952
|
res: Response<any>;
|
|
1023
953
|
}) => Promise<T>;
|
|
1024
954
|
|
|
1025
955
|
declare const inject: <T>(entity: () => new (...args: any[]) => T) => T;
|
|
1026
956
|
|
|
957
|
+
/**
|
|
958
|
+
* for backendSocket.in(ROOM_NAME).emit(EVENT)
|
|
959
|
+
*
|
|
960
|
+
* Room names are uniqe..
|
|
961
|
+
* here I am limiting number of event for clients.
|
|
962
|
+
*/
|
|
963
|
+
declare class Realtime {
|
|
964
|
+
NAMESPACE(contextName: string): string;
|
|
965
|
+
TABLE_CHANGE(contextName: string, tableName: string): string;
|
|
966
|
+
readonly KEYroomSubscribe = "roomSubscribe";
|
|
967
|
+
readonly KEYroomUnsubscribe = "roomUnsubscribe";
|
|
968
|
+
ROOM_NAME_CUSTOM(contextName: string, customEvent: string): string;
|
|
969
|
+
ROOM_SUBSCRIBE_CUSTOM(contextName: string): string;
|
|
970
|
+
ROOM_UNSUBSCRIBE_CUSTOM(contextName: string): string;
|
|
971
|
+
ROOM_NAME_UPDATE_ENTITY(contextName: string, className: string, entityId: number | string): string;
|
|
972
|
+
ROOM_SUBSCRIBE_ENTITY_UPDATE_EVENTS(contextName: string): string;
|
|
973
|
+
ROOM_UNSUBSCRIBE_ENTITY_UPDATE_EVENTS(contextName: string): string;
|
|
974
|
+
ROOM_NAME_UPDATE_ENTITY_PROPERTY(contextName: string, className: string, property: string, entityId: number | string): string;
|
|
975
|
+
ROOM_SUBSCRIBE_ENTITY_PROPERTY_UPDATE_EVENTS(contextName: string): string;
|
|
976
|
+
ROOM_UNSUBSCRIBE_ENTITY_PROPERTY_UPDATE_EVENTS(contextName: string): string;
|
|
977
|
+
}
|
|
978
|
+
declare const Symbols_ctxInClassOrClassObj: unique symbol;
|
|
979
|
+
declare const Symbols_classNameStaticProperty: string;
|
|
980
|
+
declare const Symbols_fullClassNameStaticProperty: string;
|
|
981
|
+
declare const Symbols_orignalClass: string;
|
|
982
|
+
declare const Symbols_orignalClassClonesObj: string;
|
|
983
|
+
declare const Symbols_classMethodsNames: string;
|
|
984
|
+
declare const Symbols_REALTIME: Realtime;
|
|
985
|
+
declare const Symbols_metadata: {
|
|
986
|
+
className: string;
|
|
987
|
+
options: {
|
|
988
|
+
controller: string;
|
|
989
|
+
entity: string;
|
|
990
|
+
repository: string;
|
|
991
|
+
provider: string;
|
|
992
|
+
subscriber: string;
|
|
993
|
+
migration: string;
|
|
994
|
+
};
|
|
995
|
+
};
|
|
996
|
+
declare const Symbols_old: {
|
|
997
|
+
HAS_TABLE_IN_DB: symbol;
|
|
998
|
+
MDC_KEY: string;
|
|
999
|
+
WEBSQL_REST_PROGRESS_FUN: symbol;
|
|
1000
|
+
WEBSQL_REST_PROGRESS_FUN_START: symbol;
|
|
1001
|
+
WEBSQL_REST_PROGRESS_FUN_DONE: symbol;
|
|
1002
|
+
WEBSQL_REST_PROGRESS_TIMEOUT: symbol;
|
|
1003
|
+
X_TOTAL_COUNT: string;
|
|
1004
|
+
CIRCURAL_OBJECTS_MAP_BODY: string;
|
|
1005
|
+
CIRCURAL_OBJECTS_MAP_QUERY_PARAM: string;
|
|
1006
|
+
MAPPING_CONFIG_HEADER: string;
|
|
1007
|
+
MAPPING_CONFIG_HEADER_BODY_PARAMS: string;
|
|
1008
|
+
MAPPING_CONFIG_HEADER_QUERY_PARAMS: string;
|
|
1009
|
+
ENDPOINT_META_CONFIG: string;
|
|
1010
|
+
CLASS_DECORATOR_CONTEXT: string;
|
|
1011
|
+
SOCKET_MSG: string;
|
|
1012
|
+
ANGULAR: {
|
|
1013
|
+
INPUT_NAMES: symbol;
|
|
1014
|
+
};
|
|
1015
|
+
ERROR_MESSAGES: {
|
|
1016
|
+
CLASS_NAME_MATCH: string;
|
|
1017
|
+
};
|
|
1018
|
+
};
|
|
1019
|
+
|
|
1027
1020
|
interface TaonAdditionalMiddlewareMethodInfo {
|
|
1028
1021
|
methodName: string;
|
|
1029
1022
|
expressPath: string;
|
|
1030
|
-
httpRequestType:
|
|
1023
|
+
httpRequestType: CoreModels_HttpMethod;
|
|
1031
1024
|
}
|
|
1032
1025
|
/**
|
|
1033
1026
|
* TODO
|
|
@@ -1086,8 +1079,8 @@ interface TaonHttpDecoratorOptions {
|
|
|
1086
1079
|
* @deprecated don't use in production - keep stuff encapsulated
|
|
1087
1080
|
*/
|
|
1088
1081
|
pathIsGlobal?: boolean;
|
|
1089
|
-
overrideContentType?:
|
|
1090
|
-
overrideResponseType?:
|
|
1082
|
+
overrideContentType?: CoreModels_ContentType;
|
|
1083
|
+
overrideResponseType?: Models_ResponseTypeAxios;
|
|
1091
1084
|
/**
|
|
1092
1085
|
* Express will send response as HTML string with proper headers
|
|
1093
1086
|
*/
|
|
@@ -1103,7 +1096,7 @@ declare function GET(pathOrOptions?: string | TaonHttpDecoratorOptions, pathIsGl
|
|
|
1103
1096
|
* ...
|
|
1104
1097
|
* // in your taon controller
|
|
1105
1098
|
* ..Taon.Http.HTML()
|
|
1106
|
-
* sendHtmlDummyWebsite():
|
|
1099
|
+
* sendHtmlDummyWebsite(): Taon_ResponseHtml {
|
|
1107
1100
|
* return `
|
|
1108
1101
|
<html>
|
|
1109
1102
|
<head>
|
|
@@ -1128,7 +1121,7 @@ declare function DELETE(pathOrOptions?: string | TaonHttpDecoratorOptions, pathI
|
|
|
1128
1121
|
|
|
1129
1122
|
declare class ParamConfig {
|
|
1130
1123
|
paramName: string;
|
|
1131
|
-
paramType:
|
|
1124
|
+
paramType: CoreModels_ParamType;
|
|
1132
1125
|
index: number;
|
|
1133
1126
|
defaultType: any;
|
|
1134
1127
|
expireInSeconds?: number;
|
|
@@ -1151,7 +1144,7 @@ declare class MethodConfig implements Pick<TaonHttpDecoratorOptions, 'path' | 'm
|
|
|
1151
1144
|
overrideExpressSendAsHtml?: boolean;
|
|
1152
1145
|
path: string;
|
|
1153
1146
|
descriptor: PropertyDescriptor;
|
|
1154
|
-
type:
|
|
1147
|
+
type: CoreModels_HttpMethod;
|
|
1155
1148
|
parameters: {
|
|
1156
1149
|
[paramName: string]: Partial<ParamConfig>;
|
|
1157
1150
|
};
|
|
@@ -1170,12 +1163,10 @@ declare class MethodConfig implements Pick<TaonHttpDecoratorOptions, 'path' | 'm
|
|
|
1170
1163
|
calculatedMiddlewares: (typeof TaonBaseMiddleware)[];
|
|
1171
1164
|
}
|
|
1172
1165
|
|
|
1173
|
-
declare
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
const preventUndefinedModel: (model: any, id: any) => void;
|
|
1178
|
-
}
|
|
1166
|
+
declare const Validators_classNameVlidation: (className: any, target: Function) => any;
|
|
1167
|
+
declare const Validators_checkIfMethodsWithReponseTYpeAlowed: (methods: MethodConfig[], current: MethodConfig) => void;
|
|
1168
|
+
declare const Validators_validateClassFunctions: (controllers: any[], entities: any[], proviers: any[], repositories: any[]) => void;
|
|
1169
|
+
declare const Validators_preventUndefinedModel: (model: any, id: any) => void;
|
|
1179
1170
|
|
|
1180
1171
|
declare class TaonBaseClass<CloneT extends TaonBaseClass = any> {
|
|
1181
1172
|
/**
|
|
@@ -1268,7 +1259,7 @@ declare const TaonBaseContext: {
|
|
|
1268
1259
|
readonly __refSync: taon_websql.EndpointContext;
|
|
1269
1260
|
getClassInstance<T>(ctor: new (...args: any[]) => T): T;
|
|
1270
1261
|
getClass<T>(ctor: new (...args: any[]) => T): new (...args: any[]) => T;
|
|
1271
|
-
initialize: (overrideOptions?: taon_websql.
|
|
1262
|
+
initialize: (overrideOptions?: taon_websql.Models_TaonInitializeParams) => Promise<taon_websql.EndpointContext>;
|
|
1272
1263
|
readonly realtime: {
|
|
1273
1264
|
readonly client: taon_websql.RealtimeClient;
|
|
1274
1265
|
readonly server: taon_websql.RealtimeServer;
|
|
@@ -1294,13 +1285,13 @@ declare class TaonBaseController<UPLOAD_FILE_QUERY_PARAMS = {}> extends TaonBase
|
|
|
1294
1285
|
afterAllCtxInited(options: {
|
|
1295
1286
|
ctxStorage: ContextsEndpointStorage;
|
|
1296
1287
|
}): Promise<void>;
|
|
1297
|
-
uploadFormDataToServer(formData: FormData, queryParams?: UPLOAD_FILE_QUERY_PARAMS):
|
|
1288
|
+
uploadFormDataToServer(formData: FormData, queryParams?: UPLOAD_FILE_QUERY_PARAMS): Models_Http_Response<MulterFileUploadResponse[]>;
|
|
1298
1289
|
/**
|
|
1299
1290
|
* Hook after file is uploaded
|
|
1300
1291
|
* through `uploadFormDataToServer` or `uploadLocalFileToServer`
|
|
1301
1292
|
*/
|
|
1302
1293
|
protected afterFileUploadAction(file?: MulterFileUploadResponse, queryParams?: UPLOAD_FILE_QUERY_PARAMS): void | Promise<void>;
|
|
1303
|
-
uploadLocalFileToServer(absFilePath: string, options?: Pick<
|
|
1294
|
+
uploadLocalFileToServer(absFilePath: string, options?: Pick<Models_Ng2RestAxiosRequestConfig, 'onUploadProgress'>, queryParams?: UPLOAD_FILE_QUERY_PARAMS): Promise<MulterFileUploadResponse[]>;
|
|
1304
1295
|
/**
|
|
1305
1296
|
* Easy way to wait for status change with http (1s default) pooling.
|
|
1306
1297
|
*
|
|
@@ -1326,7 +1317,7 @@ declare class TaonBaseController<UPLOAD_FILE_QUERY_PARAMS = {}> extends TaonBase
|
|
|
1326
1317
|
*/
|
|
1327
1318
|
reqIndexNum?: number;
|
|
1328
1319
|
httpErrorsCount?: number;
|
|
1329
|
-
}) => ReturnType<
|
|
1320
|
+
}) => ReturnType<Models_Http_Response<T>['request']>;
|
|
1330
1321
|
poolingInterval?: number;
|
|
1331
1322
|
/**
|
|
1332
1323
|
* default infinite tries
|
|
@@ -1366,18 +1357,18 @@ declare abstract class TaonBaseCrudController<Entity, UPLOAD_FILE_QUERY_PARAMS =
|
|
|
1366
1357
|
*/
|
|
1367
1358
|
abstract entityClassResolveFn: () => any;
|
|
1368
1359
|
_(): Promise<void>;
|
|
1369
|
-
bufforedChanges(id: number | string, property: string, alreadyLength?: number):
|
|
1370
|
-
pagination(pageNumber?: number, pageSize?: number, search?: string):
|
|
1371
|
-
getAll():
|
|
1372
|
-
getBy(id: number | string):
|
|
1373
|
-
updateById(id: number | string, item: Entity):
|
|
1374
|
-
patchById(id: number | string, item: Entity):
|
|
1375
|
-
bulkUpdate(items: Entity[]):
|
|
1376
|
-
deleteById(id: number | string):
|
|
1377
|
-
bulkDelete(ids: (number | string)[]):
|
|
1378
|
-
clearTable():
|
|
1379
|
-
save(item: Entity):
|
|
1380
|
-
bulkCreate(items: Entity):
|
|
1360
|
+
bufforedChanges(id: number | string, property: string, alreadyLength?: number): Models_Http_Response<string | any[]>;
|
|
1361
|
+
pagination(pageNumber?: number, pageSize?: number, search?: string): Models_Http_Response<Entity[]>;
|
|
1362
|
+
getAll(): Models_Http_Response<Entity[]>;
|
|
1363
|
+
getBy(id: number | string): Models_Http_Response<Entity>;
|
|
1364
|
+
updateById(id: number | string, item: Entity): Models_Http_Response<Entity>;
|
|
1365
|
+
patchById(id: number | string, item: Entity): Models_Http_Response<Entity>;
|
|
1366
|
+
bulkUpdate(items: Entity[]): Models_Http_Response<Entity[]>;
|
|
1367
|
+
deleteById(id: number | string): Models_Http_Response<Entity>;
|
|
1368
|
+
bulkDelete(ids: (number | string)[]): Models_Http_Response<(number | string | Entity)[]>;
|
|
1369
|
+
clearTable(): Models_Http_Response<void>;
|
|
1370
|
+
save(item: Entity): Models_Http_Response<Entity>;
|
|
1371
|
+
bulkCreate(items: Entity): Models_Http_Response<Entity[]>;
|
|
1381
1372
|
}
|
|
1382
1373
|
|
|
1383
1374
|
/**
|
|
@@ -1549,7 +1540,7 @@ declare class RepeatTypeComponent extends FieldArrayType {
|
|
|
1549
1540
|
type FormlyInputType = 'input' | 'switch' | 'datepicker' | 'repeat' | 'group' | 'select';
|
|
1550
1541
|
|
|
1551
1542
|
declare function getFromlyConfigFor(target: Function, options?: {
|
|
1552
|
-
formType?:
|
|
1543
|
+
formType?: CoreModels_UIFramework;
|
|
1553
1544
|
keysPathesToInclude?: string[];
|
|
1554
1545
|
keysPathesToExclude?: string[];
|
|
1555
1546
|
parentModel?: string;
|
|
@@ -1584,47 +1575,43 @@ declare function RegisterComponentTypeForEntity(entity: Function | Function[]):
|
|
|
1584
1575
|
declare function RegisterComponentType(className: string, ...optionslNames: string[]): any;
|
|
1585
1576
|
declare function getRegisteredComponents(): FormlyEntityType[];
|
|
1586
1577
|
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
const getClassConfig: (constructor: Function) => Partial<ControllerConfig> | undefined;
|
|
1608
|
-
}
|
|
1578
|
+
/**
|
|
1579
|
+
* TODO - repalce in every place when getting class fn from object
|
|
1580
|
+
*/
|
|
1581
|
+
declare const ClassHelpers_getClassFnFromObject: (json: Object) => any;
|
|
1582
|
+
declare const ClassHelpers_getName: (classFnOrObject: any) => string;
|
|
1583
|
+
declare const ClassHelpers_getOrginalClass: (classFnOrObject: any) => any;
|
|
1584
|
+
declare const ClassHelpers_getFullInternalName: (classFnOrObject: any) => string;
|
|
1585
|
+
declare const ClassHelpers_getUniqueKey: (classFnOrObject: any) => string;
|
|
1586
|
+
declare const ClassHelpers_isContextClassObject: (obj: any) => boolean;
|
|
1587
|
+
declare const ClassHelpers_setName: (target: Function, className: string) => void;
|
|
1588
|
+
declare const ClassHelpers_hasParentClassWithName: (target: Function, className: string, targets?: any[]) => boolean;
|
|
1589
|
+
/**
|
|
1590
|
+
* Express async handler for middleware functions.
|
|
1591
|
+
*/
|
|
1592
|
+
declare const ClassHelpers_asyncHandler: (fn: any) => (req: any, res: any, next: any) => void;
|
|
1593
|
+
declare const ClassHelpers_getMethodsNames: (classOrClassInstance: any, allMethodsNames?: any[]) => string[];
|
|
1594
|
+
declare const ClassHelpers_getControllerConfigs: (target: Function, configs?: ControllerConfig[], callerTarget?: Function) => ControllerConfig[];
|
|
1595
|
+
declare const ClassHelpers_ensureClassConfig: (target: Function) => Partial<ControllerConfig>;
|
|
1596
|
+
declare const ClassHelpers_ensureMethodConfig: (target: any, propertyKey: string | symbol) => Partial<MethodConfig>;
|
|
1597
|
+
declare const ClassHelpers_getClassConfig: (constructor: Function) => Partial<ControllerConfig> | undefined;
|
|
1609
1598
|
|
|
1610
1599
|
declare const cloneObj: <CloneT>(override: Partial<CloneT>, classFn: Function) => CloneT;
|
|
1611
1600
|
|
|
1612
|
-
declare
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
};
|
|
1627
|
-
}
|
|
1601
|
+
declare const TaonHelpers_fillUpTo: (s: string, nCharacters: number) => string;
|
|
1602
|
+
declare const TaonHelpers_isGoodPath: (p: string) => boolean;
|
|
1603
|
+
declare const TaonHelpers_firstStringOrElemFromArray: (stringOrArrayOfString: string[] | string) => string;
|
|
1604
|
+
declare const TaonHelpers_tryTransformParam: (param: any) => any;
|
|
1605
|
+
declare const TaonHelpers_getExpressPath: (c: ControllerConfig, pathOrClassConfig: Partial<MethodConfig>) => string;
|
|
1606
|
+
declare const TaonHelpers_defaultType: (value: any) => {};
|
|
1607
|
+
declare const TaonHelpers_parseJSONwithStringJSONs: (object: Object, waring?: boolean) => Object;
|
|
1608
|
+
declare const TaonHelpers_isPlainFileOrFolder: (filePath: any) => boolean;
|
|
1609
|
+
declare const TaonHelpers_ipcKeyNameResponse: (target: Function, methodConfig: Partial<MethodConfig>, expressPath: string) => string;
|
|
1610
|
+
declare const TaonHelpers_ipcKeyNameRequest: (target: Function, methodConfig: Partial<MethodConfig>, expressPath: string) => string;
|
|
1611
|
+
declare const TaonHelpers_websqlMocks: (headers: any) => {
|
|
1612
|
+
request: Express.Request;
|
|
1613
|
+
response: Express.Response;
|
|
1614
|
+
};
|
|
1628
1615
|
|
|
1629
1616
|
/**
|
|
1630
1617
|
* 100 default characters varchar
|
|
@@ -1706,32 +1693,30 @@ declare abstract class RealtimeStrategy {
|
|
|
1706
1693
|
abstract toString(): string;
|
|
1707
1694
|
}
|
|
1708
1695
|
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
idOrUniqValue?: any;
|
|
1732
|
-
}
|
|
1733
|
-
type EventHandler = (...args: any[]) => void;
|
|
1696
|
+
type RealtimeModels_SubsManagerOpt = {
|
|
1697
|
+
core: RealtimeCore;
|
|
1698
|
+
customEvent: string;
|
|
1699
|
+
roomName: string;
|
|
1700
|
+
property: string;
|
|
1701
|
+
};
|
|
1702
|
+
interface RealtimeModels_ChangeOption {
|
|
1703
|
+
/**
|
|
1704
|
+
* Specify property name to listen changes on that property only;
|
|
1705
|
+
*/
|
|
1706
|
+
property?: string;
|
|
1707
|
+
/**
|
|
1708
|
+
* Override custom event name to listen
|
|
1709
|
+
*/
|
|
1710
|
+
customEvent?: string;
|
|
1711
|
+
/**
|
|
1712
|
+
* Value from entity object.
|
|
1713
|
+
* Key for this value is usually id or unique key
|
|
1714
|
+
* property defined in entity decorator.
|
|
1715
|
+
* TODO @LAST IMPLEMENT unique key support
|
|
1716
|
+
*/
|
|
1717
|
+
idOrUniqValue?: any;
|
|
1734
1718
|
}
|
|
1719
|
+
type RealtimeModels_EventHandler = (...args: any[]) => void;
|
|
1735
1720
|
|
|
1736
1721
|
declare class MockServerIpc {
|
|
1737
1722
|
contextName: string;
|
|
@@ -1757,8 +1742,8 @@ declare class MockNamespaceIpc {
|
|
|
1757
1742
|
* Namespace name
|
|
1758
1743
|
*/
|
|
1759
1744
|
name: string, server: MockServerIpc);
|
|
1760
|
-
on(eventName: string, callback:
|
|
1761
|
-
off(event: string, callback?:
|
|
1745
|
+
on(eventName: string, callback: RealtimeModels_EventHandler): any;
|
|
1746
|
+
off(event: string, callback?: RealtimeModels_EventHandler): any;
|
|
1762
1747
|
emit(eventName: string, ...args: any[]): any;
|
|
1763
1748
|
to(roomName: string): RoomEmitterIpc;
|
|
1764
1749
|
in(roomName: string): RoomEmitterIpc;
|
|
@@ -1891,7 +1876,7 @@ declare class RealtimeClient {
|
|
|
1891
1876
|
* myContext.realtimeServer.triggerEntityChanges(myEntityInstance);
|
|
1892
1877
|
* ...
|
|
1893
1878
|
*/
|
|
1894
|
-
listenChangesEntity<RESULT = any>(entityClassFnOrObj: Function | object, options?:
|
|
1879
|
+
listenChangesEntity<RESULT = any>(entityClassFnOrObj: Function | object, options?: RealtimeModels_ChangeOption): Observable<RESULT>;
|
|
1895
1880
|
/**
|
|
1896
1881
|
* Listen changes entity table
|
|
1897
1882
|
* Example: for pagination, lists update ...
|
|
@@ -1911,7 +1896,7 @@ declare class RealtimeSubsManager {
|
|
|
1911
1896
|
private options;
|
|
1912
1897
|
private isListening;
|
|
1913
1898
|
private observers;
|
|
1914
|
-
constructor(options:
|
|
1899
|
+
constructor(options: RealtimeModels_SubsManagerOpt);
|
|
1915
1900
|
startListenIfNotStarted(realtime: Socket<DefaultEventsMap, DefaultEventsMap>): void;
|
|
1916
1901
|
add(observer: Subscriber<any>): void;
|
|
1917
1902
|
remove(observer: Subscriber<any>): void;
|
|
@@ -1934,8 +1919,8 @@ declare class TaonEntityOptions<T = any> extends DecoratorAbstractOpt {
|
|
|
1934
1919
|
*/
|
|
1935
1920
|
uniqueKeyProp?: string;
|
|
1936
1921
|
createTable?: boolean;
|
|
1937
|
-
defaultModelValues?:
|
|
1938
|
-
defaultModelMapping?:
|
|
1922
|
+
defaultModelValues?: Mapping_ModelValue<T>;
|
|
1923
|
+
defaultModelMapping?: Mapping_Mapping<T>;
|
|
1939
1924
|
defaultModelMappingDeep?: {
|
|
1940
1925
|
[lodashPathes: string]: string | [string];
|
|
1941
1926
|
};
|
|
@@ -2008,91 +1993,86 @@ declare class TaonAdminService {
|
|
|
2008
1993
|
logout(): void;
|
|
2009
1994
|
}
|
|
2010
1995
|
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
1996
|
+
/**
|
|
1997
|
+
* Remove global taon loader from env.ts [loading.preAngularBootstrap]
|
|
1998
|
+
*/
|
|
1999
|
+
declare const Taon_removeLoader: (afterMS?: number) => Promise<void>;
|
|
2000
|
+
declare const Taon_error: (opt: Pick<RestErrorResponseWrapper, "message" | "status" | "details" | "code"> | string) => void;
|
|
2001
|
+
type Taon_ResponseHtml = Models_Http_Response<string>;
|
|
2002
|
+
declare const Taon_getResponseValue: <T>(response: Models_Http_Response<T>, options?: {
|
|
2003
|
+
req: express.Request<any>;
|
|
2004
|
+
res: express.Response<any>;
|
|
2005
|
+
}) => Promise<T>;
|
|
2006
|
+
declare const Taon_isBrowser: boolean;
|
|
2007
|
+
declare const Taon_isNode: boolean;
|
|
2008
|
+
declare const Taon_isWebSQL: boolean;
|
|
2009
|
+
declare const Taon_isElectron: boolean;
|
|
2010
|
+
declare const Taon_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>) => {
|
|
2011
|
+
readonly contextName: string;
|
|
2012
|
+
readonly appId: string;
|
|
2013
|
+
cloneAsRemote: (cloneOpt?: {
|
|
2014
|
+
overrideRemoteHost?: string;
|
|
2015
|
+
}) => /*elided*/ any;
|
|
2016
|
+
cloneAsNormal: (cloneOpt?: {
|
|
2017
|
+
overrideHost?: string;
|
|
2018
|
+
}) => /*elided*/ any;
|
|
2019
|
+
__ref(): Promise<EndpointContext>;
|
|
2020
|
+
readonly __refSync: EndpointContext;
|
|
2021
|
+
getClassInstance<T>(ctor: new (...args: any[]) => T): T;
|
|
2022
|
+
getClass<T>(ctor: new (...args: any[]) => T): new (...args: any[]) => T;
|
|
2023
|
+
initialize: (overrideOptions?: Models_TaonInitializeParams) => Promise<EndpointContext>;
|
|
2024
|
+
readonly realtime: {
|
|
2025
|
+
readonly client: taon_websql.RealtimeClient;
|
|
2026
|
+
readonly server: taon_websql.RealtimeServer;
|
|
2027
|
+
};
|
|
2028
|
+
};
|
|
2029
|
+
declare const Taon_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>) => () => {
|
|
2030
|
+
readonly contextName: string;
|
|
2031
|
+
readonly appId: string;
|
|
2032
|
+
cloneAsRemote: (cloneOpt?: {
|
|
2033
|
+
overrideRemoteHost?: string;
|
|
2034
|
+
}) => /*elided*/ any;
|
|
2035
|
+
cloneAsNormal: (cloneOpt?: {
|
|
2036
|
+
overrideHost?: string;
|
|
2037
|
+
}) => /*elided*/ any;
|
|
2038
|
+
__ref(): Promise<EndpointContext>;
|
|
2039
|
+
readonly __refSync: EndpointContext;
|
|
2040
|
+
getClassInstance<T>(ctor: new (...args: any[]) => T): T;
|
|
2041
|
+
getClass<T>(ctor: new (...args: any[]) => T): new (...args: any[]) => T;
|
|
2042
|
+
initialize: (overrideOptions?: Models_TaonInitializeParams) => Promise<EndpointContext>;
|
|
2043
|
+
readonly realtime: {
|
|
2044
|
+
readonly client: taon_websql.RealtimeClient;
|
|
2045
|
+
readonly server: taon_websql.RealtimeServer;
|
|
2046
2046
|
};
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2047
|
+
};
|
|
2048
|
+
declare const Taon_inject: <T>(entity: () => new (...args: any[]) => T) => T;
|
|
2049
|
+
/**
|
|
2050
|
+
* @deprecated
|
|
2051
|
+
* use createContext instead
|
|
2052
|
+
*/
|
|
2053
|
+
declare const Taon_init: (options: {
|
|
2054
|
+
host: string;
|
|
2055
|
+
entities: Function[];
|
|
2056
|
+
controllers: Function[];
|
|
2057
|
+
}) => Promise<{
|
|
2058
|
+
readonly contextName: string;
|
|
2059
|
+
readonly appId: string;
|
|
2060
|
+
cloneAsRemote: (cloneOpt?: {
|
|
2061
|
+
overrideRemoteHost?: string;
|
|
2062
|
+
}) => /*elided*/ any;
|
|
2063
|
+
cloneAsNormal: (cloneOpt?: {
|
|
2064
|
+
overrideHost?: string;
|
|
2065
|
+
}) => /*elided*/ any;
|
|
2066
|
+
__ref(): Promise<EndpointContext>;
|
|
2067
|
+
readonly __refSync: EndpointContext;
|
|
2068
|
+
getClassInstance<T>(ctor: new (...args: any[]) => T): T;
|
|
2069
|
+
getClass<T>(ctor: new (...args: any[]) => T): new (...args: any[]) => T;
|
|
2070
|
+
initialize: (overrideOptions?: Models_TaonInitializeParams) => Promise<EndpointContext>;
|
|
2071
|
+
readonly realtime: {
|
|
2072
|
+
readonly client: taon_websql.RealtimeClient;
|
|
2073
|
+
readonly server: taon_websql.RealtimeServer;
|
|
2065
2074
|
};
|
|
2066
|
-
|
|
2067
|
-
const symbols: typeof Symbols;
|
|
2068
|
-
/**
|
|
2069
|
-
* @deprecated
|
|
2070
|
-
* use createContext instead
|
|
2071
|
-
*/
|
|
2072
|
-
const init: (options: {
|
|
2073
|
-
host: string;
|
|
2074
|
-
entities: Function[];
|
|
2075
|
-
controllers: Function[];
|
|
2076
|
-
}) => Promise<{
|
|
2077
|
-
readonly contextName: string;
|
|
2078
|
-
readonly appId: string;
|
|
2079
|
-
cloneAsRemote: (cloneOpt?: {
|
|
2080
|
-
overrideRemoteHost?: string;
|
|
2081
|
-
}) => /*elided*/ any;
|
|
2082
|
-
cloneAsNormal: (cloneOpt?: {
|
|
2083
|
-
overrideHost?: string;
|
|
2084
|
-
}) => /*elided*/ any;
|
|
2085
|
-
__ref(): Promise<EndpointContext>;
|
|
2086
|
-
readonly __refSync: EndpointContext;
|
|
2087
|
-
getClassInstance<T>(ctor: new (...args: any[]) => T): T;
|
|
2088
|
-
getClass<T>(ctor: new (...args: any[]) => T): new (...args: any[]) => T;
|
|
2089
|
-
initialize: (overrideOptions?: Models.TaonInitializeParams) => Promise<EndpointContext>;
|
|
2090
|
-
readonly realtime: {
|
|
2091
|
-
readonly client: taon_websql.RealtimeClient;
|
|
2092
|
-
readonly server: taon_websql.RealtimeServer;
|
|
2093
|
-
};
|
|
2094
|
-
}>;
|
|
2095
|
-
}
|
|
2075
|
+
}>;
|
|
2096
2076
|
declare const TAON_FLATTEN_MAPPING: {
|
|
2097
2077
|
'taon/src': {
|
|
2098
2078
|
'Taon.Http.GET': string;
|
|
@@ -2183,5 +2163,5 @@ declare const TAON_FLATTEN_MAPPING: {
|
|
|
2183
2163
|
};
|
|
2184
2164
|
};
|
|
2185
2165
|
|
|
2186
|
-
export { BaseTaonClassesNames, Body, BooleanColumn, CURRENT_HOST_BACKEND_PORT, CURRENT_HOST_URL,
|
|
2187
|
-
export type { AbstractEntityOmitKeys, FormlyArrayTransformFn, FormlyEntityType, FormlyInputType, MigrationStatus, MulterFileUploadResponse, TaonAdditionalMiddlewareMethodInfo, TaonContext, TaonEntityKeysToOmit, TaonHttpDecoratorOptions, TaonMiddlewareFunction, TaonMiddlewareInheritanceObj };
|
|
2166
|
+
export { BaseTaonClassesNames, Body, BooleanColumn, CURRENT_HOST_BACKEND_PORT, CURRENT_HOST_URL, ClassHelpers_asyncHandler, ClassHelpers_ensureClassConfig, ClassHelpers_ensureMethodConfig, ClassHelpers_getClassConfig, ClassHelpers_getClassFnFromObject, ClassHelpers_getControllerConfigs, ClassHelpers_getFullInternalName, ClassHelpers_getMethodsNames, ClassHelpers_getName, ClassHelpers_getOrginalClass, ClassHelpers_getUniqueKey, ClassHelpers_hasParentClassWithName, ClassHelpers_isContextClassObject, ClassHelpers_setName, ContextDbMigrations, ContextsEndpointStorage, ControllerConfig, Cookie, DELETE, DITaonContainer, DateTimeColumn, DecimalNumberColumn, DecoratorAbstractOpt, EndpointContext, EntityProcess, FormlyHorizontalWrapper, GET, HEAD, HTML, Header, MethodConfig, MockNamespaceIpc, MockServerIpc, MockSocketIpc, Models_ClassType, Models_ClassTypeKey, Models_DatabaseConfig, Models_DatabaseConfigTypeOrm, Models_DatabasesFolder, NumberColumn, PATCH, POST, PUT, ParamConfig, Path, Query, RealtimeClient, RealtimeCore, RealtimeServer, RealtimeStrategy, RealtimeStrategyIpc, RealtimeStrategyMock, RealtimeStrategySocketIO, RealtimeSubsManager, RegisterComponentType, RegisterComponentTypeForEntity, RepeatTypeComponent, SimpleJsonColumn, String100Column, String200Column, String20Column, String45Column, String500Column, StringColumn, Symbols_REALTIME, Symbols_classMethodsNames, Symbols_classNameStaticProperty, Symbols_ctxInClassOrClassObj, Symbols_fullClassNameStaticProperty, Symbols_metadata, Symbols_old, Symbols_orignalClass, Symbols_orignalClassClonesObj, TAON_CONTEXT, TAON_FLATTEN_MAPPING, TaonAdminService, TaonBaseAbstractEntity, TaonBaseAngularService, TaonBaseClass, TaonBaseContext, TaonBaseController, TaonBaseCrudController, TaonBaseCustomRepository, TaonBaseEntity, TaonBaseFileUploadMiddleware, TaonBaseInjector, TaonBaseMiddleware, TaonBaseMigration, TaonBaseProvider, TaonBaseRepository, TaonBaseSubscriberForEntity, TaonController, TaonControllerOptions, TaonEntity, TaonEntityKeysToOmitArr, TaonEntityOptions, TaonHelpers_defaultType, TaonHelpers_fillUpTo, TaonHelpers_firstStringOrElemFromArray, TaonHelpers_getExpressPath, TaonHelpers_ipcKeyNameRequest, TaonHelpers_ipcKeyNameResponse, TaonHelpers_isGoodPath, TaonHelpers_isPlainFileOrFolder, TaonHelpers_parseJSONwithStringJSONs, TaonHelpers_tryTransformParam, TaonHelpers_websqlMocks, TaonMiddleware, TaonMiddlewareOptions, TaonMigration, TaonMigrationOptions, TaonProvider, TaonProviderOptions, TaonRepository, TaonRepositoryOptions, TaonRestResponseWrapper, TaonSubscriber, TaonSubscriberOptions, TaonTempDatabasesFolder, TaonTempRoutesFolder, Taon_createContext, Taon_createContextTemplate, Taon_error, Taon_getResponseValue, Taon_init, Taon_inject, Taon_isBrowser, Taon_isElectron, Taon_isNode, Taon_isWebSQL, Taon_removeLoader, Validators_checkIfMethodsWithReponseTYpeAlowed, Validators_classNameVlidation, Validators_preventUndefinedModel, Validators_validateClassFunctions, apiPrefix, cloneObj, controllerConfigFrom, createContext, createContextTemplate, findTypeForEntity, getFromlyConfigFor, getRegisteredComponents, getResponseValue, getTransformFunction, inject, singleTransform, typeFromEntity, typeFromName };
|
|
2167
|
+
export type { AbstractEntityOmitKeys, FormlyArrayTransformFn, FormlyEntityType, FormlyInputType, MigrationStatus, Models_ConnectionOptionsLogs, Models_ContextOptions, Models_DBRecreateMode, Models_FrameworkMode, Models_Http_AsyncResponse, Models_Http_AuthCallBack, Models_Http_ClientAction, Models_Http_ContextENDPOINT, Models_Http_ExpressContext, Models_Http_FormlyFromType, Models_Http_MixResponse, Models_Http_Response, Models_Http_ResponseFuncOpt, Models_Http_SyncResponse, Models_Http_SyncResponseFunc, Models_ISession, Models_MiddlewareType, Models_StartParams, Models_TaonCtxCloneParams, Models_TaonInitializeParams, MulterFileUploadResponse, RealtimeModels_ChangeOption, RealtimeModels_EventHandler, RealtimeModels_SubsManagerOpt, TaonAdditionalMiddlewareMethodInfo, TaonContext, TaonEntityKeysToOmit, TaonHttpDecoratorOptions, TaonMiddlewareFunction, TaonMiddlewareInheritanceObj, Taon_ResponseHtml };
|