taon 21.0.3 → 21.0.9
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.mjs → taon-browser.mjs} +1954 -1239
- package/browser/fesm2022/taon-browser.mjs.map +1 -0
- package/browser/package.json +1 -1
- package/browser/types/taon-browser.d.ts +2152 -0
- package/icon-menu-taon.svg +15 -15
- package/lib/base-classes/base-abstract-entity.d.ts +1 -1
- package/lib/base-classes/base-abstract-entity.js +12 -12
- package/lib/base-classes/base-abstract-entity.js.map +1 -1
- package/lib/base-classes/base-angular-service.d.ts +1 -1
- package/lib/base-classes/base-angular-service.js +6 -3
- package/lib/base-classes/base-angular-service.js.map +1 -1
- package/lib/base-classes/base-context.d.ts +2 -2
- package/lib/base-classes/base-controller.js +7 -1
- package/lib/base-classes/base-controller.js.map +1 -1
- package/lib/base-classes/base-crud-controller.js +52 -12
- package/lib/base-classes/base-crud-controller.js.map +1 -1
- package/lib/base-classes/base-entity.js +2 -6
- package/lib/base-classes/base-entity.js.map +1 -1
- package/lib/base-classes/base-repository.d.ts +3 -3
- package/lib/base-classes/base-repository.js +15 -10
- package/lib/base-classes/base-repository.js.map +1 -1
- package/lib/base-classes/base.d.ts +1 -46
- package/lib/base-classes/base.js +17 -30
- package/lib/base-classes/base.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/context-db-migrations.d.ts +2 -1
- package/lib/create-context.d.ts +4 -4
- package/lib/decorators/classes/entity-decorator.js +1 -1
- package/lib/decorators/classes/entity-decorator.js.map +1 -1
- package/lib/decorators/http/http-decorators.d.ts +1 -19
- package/lib/decorators/http/http-decorators.js +20 -22
- package/lib/decorators/http/http-decorators.js.map +1 -1
- package/lib/endpoint-context.d.ts +3 -2
- package/lib/express-types.d.ts +1 -0
- package/lib/express-types.js +3 -0
- package/lib/express-types.js.map +1 -0
- package/lib/formly/{formly-group-wrapper-component.d.ts → formly-group-wrapper.component.d.ts} +1 -1
- package/lib/formly/{formly-repeat-component.d.ts → formly-repeat.component.d.ts} +1 -1
- package/lib/formly/fromly.js +24 -24
- package/lib/formly/fromly.js.map +1 -1
- package/lib/get-response-value.d.ts +3 -3
- package/lib/get-response-value.js.map +1 -1
- package/lib/index.d.ts +148 -47
- package/lib/index.js +166 -55
- package/lib/index.js.map +1 -1
- package/lib/models.d.ts +3 -3
- package/lib/models.js.map +1 -1
- package/lib/orm/columns.d.ts +28 -0
- package/lib/orm/columns.js +102 -0
- package/lib/orm/columns.js.map +1 -0
- package/lib/orm/index.d.ts +1 -0
- package/lib/orm/index.js +73 -0
- package/lib/orm/index.js.map +1 -0
- package/lib/realtime/realtime-core.d.ts +1 -1
- package/lib/realtime/realtime-strategy/realtime-strategy-socket-io.d.ts +1 -2
- package/lib/realtime/realtime-strategy/realtime-strategy-socket-io.js.map +1 -1
- package/lib/realtime/realtime-strategy/realtime-strategy.d.ts +1 -1
- package/lib/realtime/realtime-subs-manager.d.ts +1 -1
- package/lib/symbols.d.ts +31 -31
- package/lib/symbols.js +59 -59
- package/lib/symbols.js.map +1 -1
- package/lib/ui/index.js +2 -2
- package/lib/ui/taon-admin-mode-configuration/index.js +2 -2
- package/package.json +1 -1
- package/websql/fesm2022/{taon.mjs → taon-websql.mjs} +1317 -649
- package/websql/fesm2022/taon-websql.mjs.map +1 -0
- package/websql/package.json +1 -1
- package/websql/types/taon-websql.d.ts +2161 -0
- package/browser/fesm2022/taon.mjs.map +0 -1
- package/browser/index.d.ts +0 -6
- package/browser/lib/base-classes/base-abstract-entity.d.ts +0 -8
- package/browser/lib/base-classes/base-angular-service.d.ts +0 -34
- package/browser/lib/base-classes/base-class.d.ts +0 -16
- package/browser/lib/base-classes/base-context.d.ts +0 -21
- package/browser/lib/base-classes/base-controller.d.ts +0 -83
- package/browser/lib/base-classes/base-crud-controller.d.ts +0 -29
- package/browser/lib/base-classes/base-custom-repository.d.ts +0 -4
- package/browser/lib/base-classes/base-entity.d.ts +0 -17
- package/browser/lib/base-classes/base-file-upload.middleware.d.ts +0 -15
- package/browser/lib/base-classes/base-injector.d.ts +0 -68
- package/browser/lib/base-classes/base-middleware.d.ts +0 -39
- package/browser/lib/base-classes/base-migration.d.ts +0 -12
- package/browser/lib/base-classes/base-provider.d.ts +0 -9
- package/browser/lib/base-classes/base-repository.d.ts +0 -267
- package/browser/lib/base-classes/base-subscriber-for-entity.d.ts +0 -82
- package/browser/lib/base-classes/base.d.ts +0 -47
- package/browser/lib/config/controller-config.d.ts +0 -22
- package/browser/lib/config/controller-options.d.ts +0 -17
- package/browser/lib/config/method-config.d.ts +0 -40
- package/browser/lib/config/param-config.d.ts +0 -9
- package/browser/lib/constants.d.ts +0 -10
- package/browser/lib/context-db-migrations.d.ts +0 -18
- package/browser/lib/create-context.d.ts +0 -79
- package/browser/lib/decorators/classes/controller-decorator.d.ts +0 -6
- package/browser/lib/decorators/classes/entity-decorator.d.ts +0 -20
- package/browser/lib/decorators/classes/middleware-decorator.d.ts +0 -8
- package/browser/lib/decorators/classes/migration-decorator.d.ts +0 -8
- package/browser/lib/decorators/classes/provider-decorator.d.ts +0 -8
- package/browser/lib/decorators/classes/repository-decorator.d.ts +0 -8
- package/browser/lib/decorators/classes/subscriber-decorator.d.ts +0 -9
- package/browser/lib/decorators/decorator-abstract-opt.d.ts +0 -4
- package/browser/lib/decorators/http/http-decorators.d.ts +0 -21
- package/browser/lib/decorators/http/http-methods-decorators.d.ts +0 -71
- package/browser/lib/decorators/http/http-params-decorators.d.ts +0 -9
- package/browser/lib/dependency-injection/di-container.d.ts +0 -6
- package/browser/lib/endpoint-context-storage.d.ts +0 -12
- package/browser/lib/endpoint-context.d.ts +0 -198
- package/browser/lib/entity-process.d.ts +0 -40
- package/browser/lib/get-response-value.d.ts +0 -7
- package/browser/lib/helpers/class-helpers.d.ts +0 -25
- package/browser/lib/helpers/clone-obj.d.ts +0 -2
- package/browser/lib/helpers/taon-helpers.d.ts +0 -19
- package/browser/lib/index.d.ts +0 -129
- package/browser/lib/inject.d.ts +0 -5
- package/browser/lib/models.d.ts +0 -257
- package/browser/lib/orm.d.ts +0 -3
- package/browser/lib/realtime/realtime-client.d.ts +0 -42
- package/browser/lib/realtime/realtime-core.d.ts +0 -41
- package/browser/lib/realtime/realtime-server.d.ts +0 -44
- package/browser/lib/realtime/realtime-strategy/index.d.ts +0 -5
- package/browser/lib/realtime/realtime-strategy/realtime-strategy-ipc.d.ts +0 -82
- package/browser/lib/realtime/realtime-strategy/realtime-strategy-mock.d.ts +0 -15
- package/browser/lib/realtime/realtime-strategy/realtime-strategy-socket-io.d.ts +0 -16
- package/browser/lib/realtime/realtime-strategy/realtime-strategy.d.ts +0 -12
- package/browser/lib/realtime/realtime-subs-manager.d.ts +0 -15
- package/browser/lib/realtime/realtime.models.d.ts +0 -28
- package/browser/lib/symbols.d.ts +0 -66
- package/browser/lib/ui/index.d.ts +0 -2
- package/browser/lib/ui/taon-admin-mode-configuration/index.d.ts +0 -2
- package/browser/lib/ui/taon-admin-mode-configuration/taon-admin.service.d.ts +0 -22
- package/browser/lib/validators.d.ts +0 -8
- package/browser/public-api.d.ts +0 -2
- package/lib/decorators/classes/controller-config.d.ts +0 -20
- package/lib/decorators/classes/controller-config.js +0 -21
- package/lib/decorators/classes/controller-config.js.map +0 -1
- package/lib/decorators/classes/controller-options.d.ts +0 -16
- package/lib/decorators/classes/controller-options.js +0 -20
- package/lib/decorators/classes/controller-options.js.map +0 -1
- package/lib/formly/formly-group-wrapper-component.js +0 -51
- package/lib/formly/formly-group-wrapper-component.js.map +0 -1
- package/lib/formly/formly-repeat-component.js +0 -95
- package/lib/formly/formly-repeat-component.js.map +0 -1
- package/lib/orm.d.ts +0 -68
- package/lib/orm.js +0 -112
- package/lib/orm.js.map +0 -1
- package/websql/fesm2022/taon.mjs.map +0 -1
- package/websql/index.d.ts +0 -6
- package/websql/lib/base-classes/base-abstract-entity.d.ts +0 -8
- package/websql/lib/base-classes/base-angular-service.d.ts +0 -34
- package/websql/lib/base-classes/base-class.d.ts +0 -16
- package/websql/lib/base-classes/base-context.d.ts +0 -21
- package/websql/lib/base-classes/base-controller.d.ts +0 -83
- package/websql/lib/base-classes/base-crud-controller.d.ts +0 -29
- package/websql/lib/base-classes/base-custom-repository.d.ts +0 -4
- package/websql/lib/base-classes/base-entity.d.ts +0 -17
- package/websql/lib/base-classes/base-file-upload.middleware.d.ts +0 -15
- package/websql/lib/base-classes/base-injector.d.ts +0 -68
- package/websql/lib/base-classes/base-middleware.d.ts +0 -39
- package/websql/lib/base-classes/base-migration.d.ts +0 -12
- package/websql/lib/base-classes/base-provider.d.ts +0 -9
- package/websql/lib/base-classes/base-repository.d.ts +0 -272
- package/websql/lib/base-classes/base-subscriber-for-entity.d.ts +0 -82
- package/websql/lib/base-classes/base.d.ts +0 -47
- package/websql/lib/config/controller-config.d.ts +0 -22
- package/websql/lib/config/controller-options.d.ts +0 -17
- package/websql/lib/config/method-config.d.ts +0 -40
- package/websql/lib/config/param-config.d.ts +0 -9
- package/websql/lib/constants.d.ts +0 -10
- package/websql/lib/context-db-migrations.d.ts +0 -18
- package/websql/lib/create-context.d.ts +0 -79
- package/websql/lib/decorators/classes/controller-decorator.d.ts +0 -6
- package/websql/lib/decorators/classes/entity-decorator.d.ts +0 -20
- package/websql/lib/decorators/classes/middleware-decorator.d.ts +0 -8
- package/websql/lib/decorators/classes/migration-decorator.d.ts +0 -8
- package/websql/lib/decorators/classes/provider-decorator.d.ts +0 -8
- package/websql/lib/decorators/classes/repository-decorator.d.ts +0 -8
- package/websql/lib/decorators/classes/subscriber-decorator.d.ts +0 -9
- package/websql/lib/decorators/decorator-abstract-opt.d.ts +0 -4
- package/websql/lib/decorators/http/http-decorators.d.ts +0 -21
- package/websql/lib/decorators/http/http-methods-decorators.d.ts +0 -71
- package/websql/lib/decorators/http/http-params-decorators.d.ts +0 -9
- package/websql/lib/dependency-injection/di-container.d.ts +0 -6
- package/websql/lib/endpoint-context-storage.d.ts +0 -12
- package/websql/lib/endpoint-context.d.ts +0 -200
- package/websql/lib/entity-process.d.ts +0 -40
- package/websql/lib/get-response-value.d.ts +0 -7
- package/websql/lib/helpers/class-helpers.d.ts +0 -25
- package/websql/lib/helpers/clone-obj.d.ts +0 -2
- package/websql/lib/helpers/taon-helpers.d.ts +0 -19
- package/websql/lib/index.d.ts +0 -129
- package/websql/lib/inject.d.ts +0 -5
- package/websql/lib/models.d.ts +0 -261
- package/websql/lib/orm.d.ts +0 -69
- package/websql/lib/realtime/realtime-client.d.ts +0 -42
- package/websql/lib/realtime/realtime-core.d.ts +0 -41
- package/websql/lib/realtime/realtime-server.d.ts +0 -44
- package/websql/lib/realtime/realtime-strategy/index.d.ts +0 -5
- package/websql/lib/realtime/realtime-strategy/realtime-strategy-ipc.d.ts +0 -82
- package/websql/lib/realtime/realtime-strategy/realtime-strategy-mock.d.ts +0 -15
- package/websql/lib/realtime/realtime-strategy/realtime-strategy-socket-io.d.ts +0 -16
- package/websql/lib/realtime/realtime-strategy/realtime-strategy.d.ts +0 -12
- package/websql/lib/realtime/realtime-subs-manager.d.ts +0 -15
- package/websql/lib/realtime/realtime.models.d.ts +0 -28
- package/websql/lib/symbols.d.ts +0 -66
- package/websql/lib/ui/index.d.ts +0 -2
- package/websql/lib/ui/taon-admin-mode-configuration/index.d.ts +0 -2
- package/websql/lib/ui/taon-admin-mode-configuration/taon-admin.service.d.ts +0 -22
- package/websql/lib/validators.d.ts +0 -8
- package/websql/public-api.d.ts +0 -2
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import { EntitySubscriberInterface, RecoverEvent, SoftRemoveEvent, InsertEvent, TransactionStartEvent, TransactionCommitEvent, TransactionRollbackEvent, RemoveEvent, UpdateEvent } from 'taon-typeorm/browser';
|
|
3
|
-
import { TaonBaseInjector } from './base-injector';
|
|
4
|
-
export declare abstract class TaonBaseSubscriberForEntity<Entity = any> extends TaonBaseInjector implements EntitySubscriberInterface {
|
|
5
|
-
abstract listenTo(): new (...args: any[]) => Entity;
|
|
6
|
-
/**
|
|
7
|
-
* Called after entity is loaded.
|
|
8
|
-
*/
|
|
9
|
-
afterLoad(entity: any): void;
|
|
10
|
-
/**
|
|
11
|
-
* Called before query execution.
|
|
12
|
-
*/
|
|
13
|
-
beforeQuery(event: any): void;
|
|
14
|
-
/**
|
|
15
|
-
* Called after query execution.
|
|
16
|
-
*/
|
|
17
|
-
afterQuery(event: any): void;
|
|
18
|
-
/**
|
|
19
|
-
* Called before entity insertion.
|
|
20
|
-
*/
|
|
21
|
-
beforeInsert(event: InsertEvent<any>): void;
|
|
22
|
-
/**
|
|
23
|
-
* Called after entity insertion.
|
|
24
|
-
*/
|
|
25
|
-
afterInsert(event: InsertEvent<any>): void;
|
|
26
|
-
/**
|
|
27
|
-
* Called before entity update.
|
|
28
|
-
*/
|
|
29
|
-
beforeUpdate(event: UpdateEvent<any>): void;
|
|
30
|
-
/**
|
|
31
|
-
* Called after entity update.
|
|
32
|
-
*/
|
|
33
|
-
afterUpdate(event: UpdateEvent<any>): void;
|
|
34
|
-
/**
|
|
35
|
-
* Called before entity removal.
|
|
36
|
-
*/
|
|
37
|
-
beforeRemove(event: RemoveEvent<any>): void;
|
|
38
|
-
/**
|
|
39
|
-
* Called after entity removal.
|
|
40
|
-
*/
|
|
41
|
-
afterRemove(event: RemoveEvent<any>): void;
|
|
42
|
-
/**
|
|
43
|
-
* Called before entity removal.
|
|
44
|
-
*/
|
|
45
|
-
beforeSoftRemove(event: SoftRemoveEvent<any>): void;
|
|
46
|
-
/**
|
|
47
|
-
* Called after entity removal.
|
|
48
|
-
*/
|
|
49
|
-
afterSoftRemove(event: SoftRemoveEvent<any>): void;
|
|
50
|
-
/**
|
|
51
|
-
* Called before entity recovery.
|
|
52
|
-
*/
|
|
53
|
-
beforeRecover(event: RecoverEvent<any>): void;
|
|
54
|
-
/**
|
|
55
|
-
* Called after entity recovery.
|
|
56
|
-
*/
|
|
57
|
-
afterRecover(event: RecoverEvent<any>): void;
|
|
58
|
-
/**
|
|
59
|
-
* Called before transaction start.
|
|
60
|
-
*/
|
|
61
|
-
beforeTransactionStart(event: TransactionStartEvent): void;
|
|
62
|
-
/**
|
|
63
|
-
* Called after transaction start.
|
|
64
|
-
*/
|
|
65
|
-
afterTransactionStart(event: TransactionStartEvent): void;
|
|
66
|
-
/**
|
|
67
|
-
* Called before transaction commit.
|
|
68
|
-
*/
|
|
69
|
-
beforeTransactionCommit(event: TransactionCommitEvent): void;
|
|
70
|
-
/**
|
|
71
|
-
* Called after transaction commit.
|
|
72
|
-
*/
|
|
73
|
-
afterTransactionCommit(event: TransactionCommitEvent): void;
|
|
74
|
-
/**
|
|
75
|
-
* Called before transaction rollback.
|
|
76
|
-
*/
|
|
77
|
-
beforeTransactionRollback(event: TransactionRollbackEvent): void;
|
|
78
|
-
/**
|
|
79
|
-
* Called after transaction rollback.
|
|
80
|
-
*/
|
|
81
|
-
afterTransactionRollback(event: TransactionRollbackEvent): void;
|
|
82
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import * as abstractEntity from './base-abstract-entity';
|
|
3
|
-
import * as baseService from './base-angular-service';
|
|
4
|
-
import * as baseClass from './base-class';
|
|
5
|
-
import * as controller from './base-controller';
|
|
6
|
-
import * as crudController from './base-crud-controller';
|
|
7
|
-
import * as customRepository from './base-custom-repository';
|
|
8
|
-
import * as entity from './base-entity';
|
|
9
|
-
import * as baseMiddleware from './base-middleware';
|
|
10
|
-
import * as baseMigration from './base-migration';
|
|
11
|
-
import * as provider from './base-provider';
|
|
12
|
-
import * as repository from './base-repository';
|
|
13
|
-
import * as baseSubscriberEntity from './base-subscriber-for-entity';
|
|
14
|
-
export declare namespace Base {
|
|
15
|
-
export import Controller = controller.TaonBaseController;
|
|
16
|
-
export import CrudController = crudController.TaonBaseCrudController;
|
|
17
|
-
export import Entity = entity.TaonBaseEntity;
|
|
18
|
-
export import AbstractEntity = abstractEntity.TaonBaseAbstractEntity;
|
|
19
|
-
export import AbstractEntityOmitKeys = abstractEntity.AbstractEntityOmitKeys;
|
|
20
|
-
export import Provider = provider.TaonBaseProvider;
|
|
21
|
-
export import Class = baseClass.TaonBaseClass;
|
|
22
|
-
export import Repository = repository.TaonBaseRepository;
|
|
23
|
-
export import CustomRepository = customRepository.TaonBaseCustomRepository;
|
|
24
|
-
export import SubscriberForEntity = baseSubscriberEntity.TaonBaseSubscriberForEntity;
|
|
25
|
-
export import Migration = baseMigration.TaonBaseMigration;
|
|
26
|
-
export import Middleware = baseMiddleware.TaonBaseMiddleware;
|
|
27
|
-
export import AngularService = baseService.BaseAngularsService;
|
|
28
|
-
const Context: {
|
|
29
|
-
readonly contextName: string;
|
|
30
|
-
readonly appId: string;
|
|
31
|
-
cloneAsRemote: (cloneOpt?: {
|
|
32
|
-
overrideRemoteHost?: string;
|
|
33
|
-
}) => /*elided*/ any;
|
|
34
|
-
cloneAsNormal: (cloneOpt?: {
|
|
35
|
-
overrideHost?: string;
|
|
36
|
-
}) => /*elided*/ any;
|
|
37
|
-
__ref(): Promise<import("taon/browser").EndpointContext>;
|
|
38
|
-
readonly __refSync: import("taon/browser").EndpointContext;
|
|
39
|
-
getClassInstance<T>(ctor: new (...args: any[]) => T): T;
|
|
40
|
-
getClass<T>(ctor: new (...args: any[]) => T): new (...args: any[]) => T;
|
|
41
|
-
initialize: (overrideOptions?: import("taon/browser").Models.TaonInitializeParams) => Promise<import("taon/browser").EndpointContext>;
|
|
42
|
-
readonly realtime: {
|
|
43
|
-
readonly client: import("../realtime/realtime-client").RealtimeClient;
|
|
44
|
-
readonly server: import("../realtime/realtime-server").RealtimeServer;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import { TaonMiddlewareInheritanceObj } from '../decorators/http/http-methods-decorators';
|
|
3
|
-
import { TaonControllerOptions } from './controller-options';
|
|
4
|
-
import { MethodConfig } from './method-config';
|
|
5
|
-
export declare class ControllerConfig extends TaonControllerOptions {
|
|
6
|
-
methods: {
|
|
7
|
-
[methodName: string]: Partial<MethodConfig>;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Calculated path from parents controllers
|
|
11
|
-
*/
|
|
12
|
-
calculatedPath?: string;
|
|
13
|
-
/**
|
|
14
|
-
* a way to transform entity before sending to browser
|
|
15
|
-
*/
|
|
16
|
-
browserTransformFn?: (entity: any) => any;
|
|
17
|
-
/**
|
|
18
|
-
* Calculated middlewares object from parents controllers
|
|
19
|
-
*/
|
|
20
|
-
calculatedMiddlewaresControllerObj?: TaonMiddlewareInheritanceObj;
|
|
21
|
-
}
|
|
22
|
-
export declare const controllerConfigFrom: (partial: Partial<ControllerConfig>) => ControllerConfig;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import { DecoratorAbstractOpt } from '../decorators/decorator-abstract-opt';
|
|
3
|
-
import type { TaonMiddlewareFunction } from '../decorators/http/http-methods-decorators';
|
|
4
|
-
export declare class TaonControllerOptions<ControllerClass = any> extends DecoratorAbstractOpt {
|
|
5
|
-
/**
|
|
6
|
-
* typeorm realtime subscribtion // TODO disabled for now, does not make sense ?s
|
|
7
|
-
*/
|
|
8
|
-
realtime?: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* override default path for controller api
|
|
11
|
-
*/
|
|
12
|
-
path?: string;
|
|
13
|
-
/**
|
|
14
|
-
* Middlewares to be applied to all methods in the controller
|
|
15
|
-
*/
|
|
16
|
-
middlewares?: TaonMiddlewareFunction;
|
|
17
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import { CoreModels } from 'tnp-core/browser';
|
|
3
|
-
import type { TaonBaseMiddleware } from '../base-classes/base-middleware';
|
|
4
|
-
import type { TaonHttpDecoratorOptions, TaonMiddlewareFunction, TaonMiddlewareInheritanceObj } from '../decorators/http/http-methods-decorators';
|
|
5
|
-
import { ParamConfig } from './param-config';
|
|
6
|
-
/**
|
|
7
|
-
* @link './decorators/http/http-methods-decorators.ts' TaonHttpDecoratorOptions
|
|
8
|
-
*/
|
|
9
|
-
export declare class MethodConfig implements Pick<TaonHttpDecoratorOptions, 'path' | 'middlewares'> {
|
|
10
|
-
methodName: string;
|
|
11
|
-
global?: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* override default content type
|
|
14
|
-
*/
|
|
15
|
-
contentType?: any;
|
|
16
|
-
/**
|
|
17
|
-
* override default axiso response type
|
|
18
|
-
*/
|
|
19
|
-
responseType?: any;
|
|
20
|
-
overrideExpressSendAsHtml?: boolean;
|
|
21
|
-
path: string;
|
|
22
|
-
descriptor: PropertyDescriptor;
|
|
23
|
-
type: CoreModels.HttpMethod;
|
|
24
|
-
parameters: {
|
|
25
|
-
[paramName: string]: Partial<ParamConfig>;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Middlewares from controller method options
|
|
29
|
-
*/
|
|
30
|
-
middlewares?: TaonMiddlewareFunction;
|
|
31
|
-
/**
|
|
32
|
-
* Calculated middlewares object from parents controllers
|
|
33
|
-
*/
|
|
34
|
-
calculatedMiddlewaresMethodObj?: TaonMiddlewareInheritanceObj;
|
|
35
|
-
/**
|
|
36
|
-
* Middlewares array in proper order and ready to be used in
|
|
37
|
-
* express or in axios interceptors.
|
|
38
|
-
*/
|
|
39
|
-
calculatedMiddlewares: (typeof TaonBaseMiddleware)[];
|
|
40
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
export type TaonEntityKeysToOmit = 'ctrl' | 'clone' | '__endpoint_context__' | 'ctx' | 'inject' | '_' | 'relation' | 'relations' | 'inject' | 'injectRepo' | 'injectCustomRepository' | 'injectCustomRepo' | 'injectController' | 'injectCtrl' | 'injectProvider' | 'injectMiddleware';
|
|
3
|
-
export declare const TaonEntityKeysToOmitArr: TaonEntityKeysToOmit[];
|
|
4
|
-
import { InjectionToken } from '@angular/core';
|
|
5
|
-
import type { TaonContext } from './create-context';
|
|
6
|
-
declare let TAON_CONTEXT: InjectionToken<TaonContext>;
|
|
7
|
-
declare let CURRENT_HOST_BACKEND_PORT: InjectionToken<number>;
|
|
8
|
-
declare let CURRENT_HOST_URL: InjectionToken<string>;
|
|
9
|
-
export { TAON_CONTEXT, CURRENT_HOST_BACKEND_PORT, CURRENT_HOST_URL };
|
|
10
|
-
export declare const apiPrefix = "api";
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import type { EndpointContext } from './endpoint-context';
|
|
3
|
-
import { Table } from 'taon-typeorm/browser';
|
|
4
|
-
export type MigrationStatus = 'completed' | 'pending';
|
|
5
|
-
export declare class ContextDbMigrations {
|
|
6
|
-
private ctx;
|
|
7
|
-
readonly DEFAULT_MIGRATION_TABLE_NAME = "TAON_MIGRATION_META";
|
|
8
|
-
readonly MIGRATION_STATUS_COMPLETED: MigrationStatus;
|
|
9
|
-
readonly MIGRATION_STATUS_PENDING: MigrationStatus;
|
|
10
|
-
readonly table: Table;
|
|
11
|
-
constructor(ctx: EndpointContext);
|
|
12
|
-
ensureMigrationTableExists(): Promise<void>;
|
|
13
|
-
private logSelectALl;
|
|
14
|
-
revertMigrationToTimestamp(timestamp: number): Promise<any>;
|
|
15
|
-
clearMigrationTable(): Promise<any>;
|
|
16
|
-
markAllMigrationsAsApplied(): Promise<any>;
|
|
17
|
-
runAllNotCompletedMigrations(): Promise<any>;
|
|
18
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import { EndpointContext } from './endpoint-context';
|
|
3
|
-
import { Models } from './models';
|
|
4
|
-
/**
|
|
5
|
-
* @returns function that returns context function.
|
|
6
|
-
* Context function can be used to dynamically
|
|
7
|
-
* create context with specific configuration.
|
|
8
|
-
*/
|
|
9
|
-
export declare const createContextTemplate: <CTX extends Record<string, object>, CTRL extends Record<string, new (...args: any[]) => any>, ENTITY extends Record<string, new (...args: any[]) => any>, REPO extends Record<string, new (...args: any[]) => any>, PROVIDER extends Record<string, new (...args: any[]) => any>, SUBSCRIBER extends Record<string, new (...args: any[]) => any>, MIGRATION extends Record<string, new (...args: any[]) => any>, MIDDLEWARE extends Record<string, new (...args: any[]) => any>>(configFn: (env: any) => Models.ContextOptions<CTX, CTRL, ENTITY, REPO, PROVIDER, SUBSCRIBER, MIGRATION, MIDDLEWARE>) => () => {
|
|
10
|
-
readonly contextName: string;
|
|
11
|
-
readonly appId: string;
|
|
12
|
-
cloneAsRemote: (cloneOpt?: {
|
|
13
|
-
overrideRemoteHost?: string;
|
|
14
|
-
}) => /*elided*/ any;
|
|
15
|
-
cloneAsNormal: (cloneOpt?: {
|
|
16
|
-
overrideHost?: string;
|
|
17
|
-
}) => /*elided*/ any;
|
|
18
|
-
/**
|
|
19
|
-
* @deprecated
|
|
20
|
-
* - get reference to internal context
|
|
21
|
-
*/
|
|
22
|
-
__ref(): Promise<EndpointContext>;
|
|
23
|
-
/**
|
|
24
|
-
* only for internal use
|
|
25
|
-
* @deprecated
|
|
26
|
-
*/
|
|
27
|
-
readonly __refSync: EndpointContext;
|
|
28
|
-
getClassInstance<T>(ctor: new (...args: any[]) => T): T;
|
|
29
|
-
getClass<T>(ctor: new (...args: any[]) => T): new (...args: any[]) => T;
|
|
30
|
-
/**
|
|
31
|
-
* - create controller instances for context
|
|
32
|
-
* - init database (if enable) + migation scripts
|
|
33
|
-
*/
|
|
34
|
-
initialize: (overrideOptions?: Models.TaonInitializeParams) => Promise<EndpointContext>;
|
|
35
|
-
/**
|
|
36
|
-
* realtime communication with server
|
|
37
|
-
* TCP(upgrade) socket.io (or ipc) based.
|
|
38
|
-
*/
|
|
39
|
-
readonly realtime: {
|
|
40
|
-
readonly client: import("./realtime/realtime-client").RealtimeClient;
|
|
41
|
-
readonly server: import("./realtime/realtime-server").RealtimeServer;
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
export declare const createContext: <CTX extends Record<string, object>, CTRL extends Record<string, new (...args: any[]) => any>, ENTITY extends Record<string, new (...args: any[]) => any>, REPO extends Record<string, new (...args: any[]) => any>, PROVIDER extends Record<string, new (...args: any[]) => any>, SUBSCRIBER extends Record<string, new (...args: any[]) => any>, MIGRATION extends Record<string, new (...args: any[]) => any>, MIDDLEWARES extends Record<string, new (...args: any[]) => any>>(configFn: (env: any) => Models.ContextOptions<CTX, CTRL, ENTITY, REPO, PROVIDER, SUBSCRIBER, MIGRATION, MIDDLEWARES>) => {
|
|
45
|
-
readonly contextName: string;
|
|
46
|
-
readonly appId: string;
|
|
47
|
-
cloneAsRemote: (cloneOpt?: {
|
|
48
|
-
overrideRemoteHost?: string;
|
|
49
|
-
}) => /*elided*/ any;
|
|
50
|
-
cloneAsNormal: (cloneOpt?: {
|
|
51
|
-
overrideHost?: string;
|
|
52
|
-
}) => /*elided*/ any;
|
|
53
|
-
/**
|
|
54
|
-
* @deprecated
|
|
55
|
-
* - get reference to internal context
|
|
56
|
-
*/
|
|
57
|
-
__ref(): Promise<EndpointContext>;
|
|
58
|
-
/**
|
|
59
|
-
* only for internal use
|
|
60
|
-
* @deprecated
|
|
61
|
-
*/
|
|
62
|
-
readonly __refSync: EndpointContext;
|
|
63
|
-
getClassInstance<T>(ctor: new (...args: any[]) => T): T;
|
|
64
|
-
getClass<T>(ctor: new (...args: any[]) => T): new (...args: any[]) => T;
|
|
65
|
-
/**
|
|
66
|
-
* - create controller instances for context
|
|
67
|
-
* - init database (if enable) + migation scripts
|
|
68
|
-
*/
|
|
69
|
-
initialize: (overrideOptions?: Models.TaonInitializeParams) => Promise<EndpointContext>;
|
|
70
|
-
/**
|
|
71
|
-
* realtime communication with server
|
|
72
|
-
* TCP(upgrade) socket.io (or ipc) based.
|
|
73
|
-
*/
|
|
74
|
-
readonly realtime: {
|
|
75
|
-
readonly client: import("./realtime/realtime-client").RealtimeClient;
|
|
76
|
-
readonly server: import("./realtime/realtime-server").RealtimeServer;
|
|
77
|
-
};
|
|
78
|
-
};
|
|
79
|
-
export type TaonContext = ReturnType<typeof createContext>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import type { TaonControllerOptions } from '../../config/controller-options';
|
|
3
|
-
/**
|
|
4
|
-
* Controller decorator
|
|
5
|
-
*/
|
|
6
|
-
export declare function TaonController<ControllerClass = any>(options?: TaonControllerOptions<ControllerClass>): (constructor: Function) => void;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import { Mapping } from 'ng2-rest/browser';
|
|
3
|
-
import { DecoratorAbstractOpt } from '../decorator-abstract-opt';
|
|
4
|
-
/**
|
|
5
|
-
* Entity decorator
|
|
6
|
-
*/
|
|
7
|
-
export declare function TaonEntity<T = any>(options?: TaonEntityOptions<T>): (constructor: Function) => void;
|
|
8
|
-
export declare class TaonEntityOptions<T = any> extends DecoratorAbstractOpt {
|
|
9
|
-
/**
|
|
10
|
-
* default unique property is "id"
|
|
11
|
-
* for your entity it may be something else
|
|
12
|
-
*/
|
|
13
|
-
uniqueKeyProp?: string;
|
|
14
|
-
createTable?: boolean;
|
|
15
|
-
defaultModelValues?: Mapping.ModelValue<T>;
|
|
16
|
-
defaultModelMapping?: Mapping.Mapping<T>;
|
|
17
|
-
defaultModelMappingDeep?: {
|
|
18
|
-
[lodashPathes: string]: string | [string];
|
|
19
|
-
};
|
|
20
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import { DecoratorAbstractOpt } from '../decorator-abstract-opt';
|
|
3
|
-
/**
|
|
4
|
-
* Provider decorator
|
|
5
|
-
*/
|
|
6
|
-
export declare function TaonMiddleware<T = any>(options?: TaonMiddlewareOptions<T>): (constructor: Function) => void;
|
|
7
|
-
export declare class TaonMiddlewareOptions<T = any> extends DecoratorAbstractOpt {
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import { DecoratorAbstractOpt } from '../decorator-abstract-opt';
|
|
3
|
-
/**
|
|
4
|
-
* Migration decorator
|
|
5
|
-
*/
|
|
6
|
-
export declare function TaonMigration(options: TaonMigrationOptions): any;
|
|
7
|
-
export declare class TaonMigrationOptions<T = any> extends DecoratorAbstractOpt {
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import { DecoratorAbstractOpt } from '../decorator-abstract-opt';
|
|
3
|
-
/**
|
|
4
|
-
* Provider decorator
|
|
5
|
-
*/
|
|
6
|
-
export declare function TaonProvider<T = any>(options?: TaonProviderOptions<T>): (constructor: Function) => void;
|
|
7
|
-
export declare class TaonProviderOptions<T = any> extends DecoratorAbstractOpt {
|
|
8
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import { DecoratorAbstractOpt } from '../decorator-abstract-opt';
|
|
3
|
-
/**
|
|
4
|
-
* Repository decorator
|
|
5
|
-
*/
|
|
6
|
-
export declare function TaonRepository(options: TaonRepositoryOptions): (constructor: Function) => void;
|
|
7
|
-
export declare class TaonRepositoryOptions<T = any> extends DecoratorAbstractOpt {
|
|
8
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import { DecoratorAbstractOpt } from '../decorator-abstract-opt';
|
|
3
|
-
/**
|
|
4
|
-
* Subscriber decorator
|
|
5
|
-
*/
|
|
6
|
-
export declare function TaonSubscriber(options: TaonSubscriberOptions): any;
|
|
7
|
-
export declare class TaonSubscriberOptions<T = any> extends DecoratorAbstractOpt {
|
|
8
|
-
allowedEvents?: (keyof T)[];
|
|
9
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import { Models } from 'ng2-rest/browser';
|
|
3
|
-
import * as methods from './http-methods-decorators';
|
|
4
|
-
import * as params from './http-params-decorators';
|
|
5
|
-
export declare namespace Http {
|
|
6
|
-
export import GET = methods.GET;
|
|
7
|
-
export import POST = methods.POST;
|
|
8
|
-
export import PUT = methods.PUT;
|
|
9
|
-
export import DELETE = methods.DELETE;
|
|
10
|
-
export import PATCH = methods.PATCH;
|
|
11
|
-
export import HEAD = methods.HEAD;
|
|
12
|
-
export import HTML = methods.HTML;
|
|
13
|
-
export import Response = Models.HttpResponse;
|
|
14
|
-
namespace Param {
|
|
15
|
-
export import Query = params.Query;
|
|
16
|
-
export import Path = params.Path;
|
|
17
|
-
export import Body = params.Body;
|
|
18
|
-
export import Cookie = params.Cookie;
|
|
19
|
-
export import Header = params.Header;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import { Models as ModelsNg2Rest } from 'ng2-rest/browser';
|
|
3
|
-
import { CoreModels } from 'tnp-core/browser';
|
|
4
|
-
import { TaonBaseMiddleware } from '../../base-classes/base-middleware';
|
|
5
|
-
export type TaonMiddlewareInheritanceObj = {
|
|
6
|
-
[parentMiddlewaresName: string]: typeof TaonBaseMiddleware;
|
|
7
|
-
};
|
|
8
|
-
export type TaonMiddlewareFunction = (options: {
|
|
9
|
-
/**
|
|
10
|
-
* middlewares inherited from parent class
|
|
11
|
-
*/
|
|
12
|
-
parentMiddlewares: TaonMiddlewareInheritanceObj;
|
|
13
|
-
/**
|
|
14
|
-
* Get real class name - needed when code is minified
|
|
15
|
-
*/
|
|
16
|
-
className: (middlewareClass: Function) => string;
|
|
17
|
-
}) => TaonMiddlewareInheritanceObj;
|
|
18
|
-
export interface TaonHttpDecoratorOptions {
|
|
19
|
-
/**
|
|
20
|
-
* @deprecated don't use in production - keep stuff encapsulated
|
|
21
|
-
* normally path is generated from method name and its params
|
|
22
|
-
*/
|
|
23
|
-
path?: string;
|
|
24
|
-
/**
|
|
25
|
-
* If true, the path will be global
|
|
26
|
-
*
|
|
27
|
-
* ! BE CAREFUL ! global path IS NOT GLOBAL inside dockerized app
|
|
28
|
-
* (/api/contextName is automatically added to global path in docker)
|
|
29
|
-
*
|
|
30
|
-
* @deprecated don't use in production - keep stuff encapsulated
|
|
31
|
-
*/
|
|
32
|
-
pathIsGlobal?: boolean;
|
|
33
|
-
overrideContentType?: CoreModels.ContentType;
|
|
34
|
-
overrideResponseType?: ModelsNg2Rest.ResponseTypeAxios;
|
|
35
|
-
/**
|
|
36
|
-
* Express will send response as HTML string with proper headers
|
|
37
|
-
*/
|
|
38
|
-
overrideExpressSendAsHtml?: boolean;
|
|
39
|
-
middlewares?: TaonMiddlewareFunction;
|
|
40
|
-
}
|
|
41
|
-
export declare function GET(pathOrOptions?: string | TaonHttpDecoratorOptions, pathIsGlobal?: boolean): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
|
|
42
|
-
/**
|
|
43
|
-
* Method for sending html website from text
|
|
44
|
-
* Example
|
|
45
|
-
*
|
|
46
|
-
* ```ts
|
|
47
|
-
* ...
|
|
48
|
-
* // in your taon controller
|
|
49
|
-
* ..Taon.Http.HTML()
|
|
50
|
-
* sendHtmlDummyWebsite(): Taon.ResponseHtml {
|
|
51
|
-
* return `
|
|
52
|
-
<html>
|
|
53
|
-
<head>
|
|
54
|
-
<title>Dummy website</title>
|
|
55
|
-
</head>
|
|
56
|
-
<body>
|
|
57
|
-
<h1>This is dummy website</h1>
|
|
58
|
-
<p>Served as HTML string from Taon controller method</p>
|
|
59
|
-
</body>
|
|
60
|
-
</html>
|
|
61
|
-
* `; *
|
|
62
|
-
* }
|
|
63
|
-
* ...
|
|
64
|
-
* ```
|
|
65
|
-
*/
|
|
66
|
-
export declare function HTML(pathOrOptions?: Pick<TaonHttpDecoratorOptions, 'path' | 'pathIsGlobal'>): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
|
|
67
|
-
export declare function HEAD(pathOrOptions?: string | TaonHttpDecoratorOptions, pathIsGlobal?: boolean): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
|
|
68
|
-
export declare function POST(pathOrOptions?: string | TaonHttpDecoratorOptions, pathIsGlobal?: boolean): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
|
|
69
|
-
export declare function PUT(pathOrOptions?: string | TaonHttpDecoratorOptions, pathIsGlobal?: boolean): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
|
|
70
|
-
export declare function PATCH(pathOrOptions?: string | TaonHttpDecoratorOptions, pathIsGlobal?: boolean): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
|
|
71
|
-
export declare function DELETE(pathOrOptions?: string | TaonHttpDecoratorOptions, pathIsGlobal?: boolean): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated use Taon.Http.Param.Path (is more safe and cleaner)
|
|
4
|
-
*/
|
|
5
|
-
export declare function Path(name: string): (target: any, propertyKey: string | symbol, parameterIndex: number) => void;
|
|
6
|
-
export declare function Query(name?: string): (target: any, propertyKey: string | symbol, parameterIndex: number) => void;
|
|
7
|
-
export declare function Cookie(name: string, expireInSecond?: number): (target: any, propertyKey: string | symbol, parameterIndex: number) => void;
|
|
8
|
-
export declare function Header(name?: string): (target: any, propertyKey: string | symbol, parameterIndex: number) => void;
|
|
9
|
-
export declare function Body(name?: string): (target: any, propertyKey: string | symbol, parameterIndex: number) => void;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import type { EndpointContext } from './endpoint-context';
|
|
3
|
-
export declare class ContextsEndpointStorage {
|
|
4
|
-
SPECIAL_APP_READY_MESSAGE: string;
|
|
5
|
-
private taonEndpointContexts;
|
|
6
|
-
private static instance;
|
|
7
|
-
private constructor();
|
|
8
|
-
static get Instance(): ContextsEndpointStorage;
|
|
9
|
-
set(context: EndpointContext): void;
|
|
10
|
-
get arr(): EndpointContext[];
|
|
11
|
-
getBy(context: Partial<EndpointContext> | string): EndpointContext | undefined;
|
|
12
|
-
}
|