@adaas/a-server 0.0.29 → 0.0.31
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/dist/browser/index.d.mts +123 -69
- package/dist/browser/index.mjs +211 -69
- package/dist/browser/index.mjs.map +1 -1
- package/dist/node/controllers/A-EntityController/A-EntityController.component.d.mts +2 -5
- package/dist/node/controllers/A-EntityController/A-EntityController.component.d.ts +2 -5
- package/dist/node/controllers/A-EntityController/A-EntityController.component.js +66 -88
- package/dist/node/controllers/A-EntityController/A-EntityController.component.js.map +1 -1
- package/dist/node/controllers/A-EntityController/A-EntityController.component.mjs +67 -89
- package/dist/node/controllers/A-EntityController/A-EntityController.component.mjs.map +1 -1
- package/dist/node/controllers/A-ListingController/A-ListingController.component.js +20 -18
- package/dist/node/controllers/A-ListingController/A-ListingController.component.js.map +1 -1
- package/dist/node/controllers/A-ListingController/A-ListingController.component.mjs +20 -18
- package/dist/node/controllers/A-ListingController/A-ListingController.component.mjs.map +1 -1
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.d.mts +0 -2
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.d.ts +0 -2
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.js +10 -1
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.js.map +1 -1
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.mjs +10 -1
- package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.mjs.map +1 -1
- package/dist/node/index.d.mts +3 -1
- package/dist/node/index.d.ts +3 -1
- package/dist/node/index.js +14 -0
- package/dist/node/index.mjs +2 -0
- package/dist/node/lib/A-Server/A-HttpServer.container.d.mts +4 -6
- package/dist/node/lib/A-Server/A-HttpServer.container.d.ts +4 -6
- package/dist/node/lib/A-ServerController/A-ServerController.component.js +17 -4
- package/dist/node/lib/A-ServerController/A-ServerController.component.js.map +1 -1
- package/dist/node/lib/A-ServerController/A-ServerController.component.mjs +17 -4
- package/dist/node/lib/A-ServerController/A-ServerController.component.mjs.map +1 -1
- package/dist/node/lib/A-ServerEntityList/A-EntityList.entity.d.mts +52 -28
- package/dist/node/lib/A-ServerEntityList/A-EntityList.entity.d.ts +52 -28
- package/dist/node/lib/A-ServerEntityList/A-EntityList.entity.js +117 -44
- package/dist/node/lib/A-ServerEntityList/A-EntityList.entity.js.map +1 -1
- package/dist/node/lib/A-ServerEntityList/A-EntityList.entity.mjs +118 -45
- package/dist/node/lib/A-ServerEntityList/A-EntityList.entity.mjs.map +1 -1
- package/dist/node/lib/A-ServerEntityList/A-EntityList.types.d.mts +14 -6
- package/dist/node/lib/A-ServerEntityList/A-EntityList.types.d.ts +14 -6
- package/dist/node/lib/A-ServerEntityList/A-EntityList.types.js.map +1 -1
- package/dist/node/lib/A-ServerEntityList/A-EntityList.types.mjs.map +1 -1
- package/dist/node/lib/A-ServerEntityList/A-EntityListCacheState.context.d.mts +12 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityListCacheState.context.d.ts +12 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityListCacheState.context.js +25 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityListCacheState.context.js.map +1 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityListCacheState.context.mjs +24 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityListCacheState.context.mjs.map +1 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityListPagination.context.d.mts +18 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityListPagination.context.d.ts +18 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityListPagination.context.js +48 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityListPagination.context.js.map +1 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityListPagination.context.mjs +47 -0
- package/dist/node/lib/A-ServerEntityList/A-EntityListPagination.context.mjs.map +1 -0
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.component.d.mts +6 -8
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.component.d.ts +6 -8
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.component.js +3 -4
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.component.js.map +1 -1
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.component.mjs +4 -5
- package/dist/node/lib/A-ServerLogger/A-ServerLogger.component.mjs.map +1 -1
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.component.d.mts +0 -2
- package/dist/node/lib/A-ServerRouter/A-ServerRouter.component.d.ts +0 -2
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.component.js +1 -1
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.component.js.map +1 -1
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.component.mjs +1 -1
- package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.component.mjs.map +1 -1
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.component.d.mts +1 -0
- package/dist/node/repositories/A-EntityRepository/A-EntityRepository.component.d.ts +1 -0
- package/examples/simple-server/components/Users.repository.ts +2 -2
- package/jest.config.ts +1 -0
- package/package.json +5 -5
- package/src/controllers/A-EntityController/A-EntityController.component.ts +69 -109
- package/src/controllers/A-ListingController/A-ListingController.component.ts +22 -20
- package/src/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.ts +11 -1
- package/src/index.ts +2 -0
- package/src/lib/A-ServerController/A-ServerController.component.ts +17 -8
- package/src/lib/A-ServerEntityList/A-EntityList.entity.ts +159 -55
- package/src/lib/A-ServerEntityList/A-EntityList.types.ts +17 -7
- package/src/lib/A-ServerEntityList/A-EntityListCacheState.context.ts +27 -0
- package/src/lib/A-ServerEntityList/A-EntityListPagination.context.ts +48 -0
- package/src/lib/A-ServerLogger/A-ServerLogger.component.ts +3 -4
- package/src/middlewares/A-ServerCORS/A_ServerCORS.component.ts +1 -1
- package/tests/A-Server-CORS.test.ts +542 -0
- package/tests/A-Server-Entity.test.ts +205 -0
- package/tests/A-Server-Health.test.ts +89 -0
- package/tests/A-Server-Routes.test.ts +113 -0
- package/tests/A-ServerEntityList.test.ts +416 -0
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A_Entity, A_TYPES__Entity_Constructor, A_TYPES__Entity_Serialized } from '@adaas/a-concept';
|
|
2
2
|
|
|
3
|
-
type A_SERVER_TYPES__A_EntityListConstructor = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
type A_SERVER_TYPES__A_EntityListConstructor<T extends A_Entity = A_Entity> = {
|
|
4
|
+
/** User-facing: the entity class (e.g. `User`). Name and scope are derived from its statics. */
|
|
5
|
+
entity: A_TYPES__Entity_Constructor<T>;
|
|
6
|
+
/** Initial pagination request parameters. Defaults to page 1, pageSize 10. */
|
|
7
|
+
pagination?: {
|
|
8
|
+
page?: number;
|
|
9
|
+
pageSize?: number;
|
|
10
|
+
};
|
|
7
11
|
};
|
|
8
12
|
declare enum A_SERVER_TYPES__A_EntityListEvent {
|
|
9
13
|
Load = "load"
|
|
@@ -18,5 +22,9 @@ type A_SERVER_TYPES__A_EntityListPagination = {
|
|
|
18
22
|
page: number;
|
|
19
23
|
pageSize: number;
|
|
20
24
|
};
|
|
25
|
+
type A_SERVER_TYPES__A_EntityListCacheEntry = {
|
|
26
|
+
timestamp: number;
|
|
27
|
+
ttl: number;
|
|
28
|
+
};
|
|
21
29
|
|
|
22
|
-
export { type A_SERVER_TYPES__A_EntityListConstructor, A_SERVER_TYPES__A_EntityListEvent, type A_SERVER_TYPES__A_EntityListPagination, type A_SERVER_TYPES__A_EntityListSerialized };
|
|
30
|
+
export { type A_SERVER_TYPES__A_EntityListCacheEntry, type A_SERVER_TYPES__A_EntityListConstructor, A_SERVER_TYPES__A_EntityListEvent, type A_SERVER_TYPES__A_EntityListPagination, type A_SERVER_TYPES__A_EntityListSerialized };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/A-ServerEntityList/A-EntityList.types.ts"],"names":["A_SERVER_TYPES__A_EntityListEvent"],"mappings":";;
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/A-ServerEntityList/A-EntityList.types.ts"],"names":["A_SERVER_TYPES__A_EntityListEvent"],"mappings":";;AAeO,IAAK,iCAAA,qBAAAA,kCAAAA,KAAL;AACH,EAAAA,mCAAA,MAAA,CAAA,GAAO,MAAA;AADC,EAAA,OAAAA,kCAAAA;AAAA,CAAA,EAAA,iCAAA,IAAA,EAAA","file":"A-EntityList.types.js","sourcesContent":["import { A_Entity, A_TYPES__Entity_Constructor, A_TYPES__Entity_Serialized } from \"@adaas/a-concept\";\n\n\nexport type A_SERVER_TYPES__A_EntityListConstructor<\n T extends A_Entity = A_Entity\n> = {\n /** User-facing: the entity class (e.g. `User`). Name and scope are derived from its statics. */\n entity: A_TYPES__Entity_Constructor<T>;\n /** Initial pagination request parameters. Defaults to page 1, pageSize 10. */\n pagination?: {\n page?: number;\n pageSize?: number;\n };\n};\n\nexport enum A_SERVER_TYPES__A_EntityListEvent {\n Load = 'load',\n}\n\nexport type A_SERVER_TYPES__A_EntityListSerialized<EntityTypes extends A_Entity = A_Entity> = {\n items: Array<ReturnType<EntityTypes['toJSON']>>,\n type: string,\n pagination: A_SERVER_TYPES__A_EntityListPagination\n} & A_TYPES__Entity_Serialized;\n\n\nexport type A_SERVER_TYPES__A_EntityListPagination = {\n total: number,\n page: number,\n pageSize: number,\n};\n\nexport type A_SERVER_TYPES__A_EntityListCacheEntry = {\n timestamp: number;\n ttl: number;\n};\n\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/A-ServerEntityList/A-EntityList.types.ts"],"names":["A_SERVER_TYPES__A_EntityListEvent"],"mappings":";;
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/A-ServerEntityList/A-EntityList.types.ts"],"names":["A_SERVER_TYPES__A_EntityListEvent"],"mappings":";;AAeO,IAAK,iCAAA,qBAAAA,kCAAAA,KAAL;AACH,EAAAA,mCAAA,MAAA,CAAA,GAAO,MAAA;AADC,EAAA,OAAAA,kCAAAA;AAAA,CAAA,EAAA,iCAAA,IAAA,EAAA","file":"A-EntityList.types.mjs","sourcesContent":["import { A_Entity, A_TYPES__Entity_Constructor, A_TYPES__Entity_Serialized } from \"@adaas/a-concept\";\n\n\nexport type A_SERVER_TYPES__A_EntityListConstructor<\n T extends A_Entity = A_Entity\n> = {\n /** User-facing: the entity class (e.g. `User`). Name and scope are derived from its statics. */\n entity: A_TYPES__Entity_Constructor<T>;\n /** Initial pagination request parameters. Defaults to page 1, pageSize 10. */\n pagination?: {\n page?: number;\n pageSize?: number;\n };\n};\n\nexport enum A_SERVER_TYPES__A_EntityListEvent {\n Load = 'load',\n}\n\nexport type A_SERVER_TYPES__A_EntityListSerialized<EntityTypes extends A_Entity = A_Entity> = {\n items: Array<ReturnType<EntityTypes['toJSON']>>,\n type: string,\n pagination: A_SERVER_TYPES__A_EntityListPagination\n} & A_TYPES__Entity_Serialized;\n\n\nexport type A_SERVER_TYPES__A_EntityListPagination = {\n total: number,\n page: number,\n pageSize: number,\n};\n\nexport type A_SERVER_TYPES__A_EntityListCacheEntry = {\n timestamp: number;\n ttl: number;\n};\n\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { A_Fragment, A_TYPES__Fragment_Serialized } from '@adaas/a-concept';
|
|
2
|
+
|
|
3
|
+
declare class A_ServerEntityListCacheState extends A_Fragment<A_TYPES__Fragment_Serialized> {
|
|
4
|
+
protected _timestamp?: number;
|
|
5
|
+
protected _ttl?: number;
|
|
6
|
+
set(ttlMs: number): void;
|
|
7
|
+
invalidate(): void;
|
|
8
|
+
isValid(): boolean;
|
|
9
|
+
toJSON(): A_TYPES__Fragment_Serialized;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { A_ServerEntityListCacheState };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { A_Fragment, A_TYPES__Fragment_Serialized } from '@adaas/a-concept';
|
|
2
|
+
|
|
3
|
+
declare class A_ServerEntityListCacheState extends A_Fragment<A_TYPES__Fragment_Serialized> {
|
|
4
|
+
protected _timestamp?: number;
|
|
5
|
+
protected _ttl?: number;
|
|
6
|
+
set(ttlMs: number): void;
|
|
7
|
+
invalidate(): void;
|
|
8
|
+
isValid(): boolean;
|
|
9
|
+
toJSON(): A_TYPES__Fragment_Serialized;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { A_ServerEntityListCacheState };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var aConcept = require('@adaas/a-concept');
|
|
4
|
+
|
|
5
|
+
class A_ServerEntityListCacheState extends aConcept.A_Fragment {
|
|
6
|
+
set(ttlMs) {
|
|
7
|
+
this._timestamp = Date.now();
|
|
8
|
+
this._ttl = ttlMs;
|
|
9
|
+
}
|
|
10
|
+
invalidate() {
|
|
11
|
+
this._timestamp = void 0;
|
|
12
|
+
this._ttl = void 0;
|
|
13
|
+
}
|
|
14
|
+
isValid() {
|
|
15
|
+
if (this._timestamp === void 0 || this._ttl === void 0) return false;
|
|
16
|
+
return Date.now() - this._timestamp < this._ttl;
|
|
17
|
+
}
|
|
18
|
+
toJSON() {
|
|
19
|
+
return { name: this.name };
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
exports.A_ServerEntityListCacheState = A_ServerEntityListCacheState;
|
|
24
|
+
//# sourceMappingURL=A-EntityListCacheState.context.js.map
|
|
25
|
+
//# sourceMappingURL=A-EntityListCacheState.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/A-ServerEntityList/A-EntityListCacheState.context.ts"],"names":["A_Fragment"],"mappings":";;;;AAGO,MAAM,qCAAqCA,mBAAA,CAAyC;AAAA,EAKvF,IAAI,KAAA,EAAqB;AACrB,IAAA,IAAA,CAAK,UAAA,GAAa,KAAK,GAAA,EAAI;AAC3B,IAAA,IAAA,CAAK,IAAA,GAAO,KAAA;AAAA,EAChB;AAAA,EAEA,UAAA,GAAmB;AACf,IAAA,IAAA,CAAK,UAAA,GAAa,MAAA;AAClB,IAAA,IAAA,CAAK,IAAA,GAAO,MAAA;AAAA,EAChB;AAAA,EAEA,OAAA,GAAmB;AACf,IAAA,IAAI,KAAK,UAAA,KAAe,MAAA,IAAa,IAAA,CAAK,IAAA,KAAS,QAAW,OAAO,KAAA;AACrE,IAAA,OAAQ,IAAA,CAAK,GAAA,EAAI,GAAI,IAAA,CAAK,aAAc,IAAA,CAAK,IAAA;AAAA,EACjD;AAAA,EAEA,MAAA,GAAuC;AACnC,IAAA,OAAO,EAAE,IAAA,EAAM,IAAA,CAAK,IAAA,EAAK;AAAA,EAC7B;AACJ","file":"A-EntityListCacheState.context.js","sourcesContent":["import { A_Fragment, A_TYPES__Fragment_Serialized } from \"@adaas/a-concept\";\n\n\nexport class A_ServerEntityListCacheState extends A_Fragment<A_TYPES__Fragment_Serialized> {\n\n protected _timestamp?: number;\n protected _ttl?: number;\n\n set(ttlMs: number): void {\n this._timestamp = Date.now();\n this._ttl = ttlMs;\n }\n\n invalidate(): void {\n this._timestamp = undefined;\n this._ttl = undefined;\n }\n\n isValid(): boolean {\n if (this._timestamp === undefined || this._ttl === undefined) return false;\n return (Date.now() - this._timestamp) < this._ttl;\n }\n\n toJSON(): A_TYPES__Fragment_Serialized {\n return { name: this.name };\n }\n}\n"]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import '../../chunk-EQQGB2QZ.mjs';
|
|
2
|
+
import { A_Fragment } from '@adaas/a-concept';
|
|
3
|
+
|
|
4
|
+
class A_ServerEntityListCacheState extends A_Fragment {
|
|
5
|
+
set(ttlMs) {
|
|
6
|
+
this._timestamp = Date.now();
|
|
7
|
+
this._ttl = ttlMs;
|
|
8
|
+
}
|
|
9
|
+
invalidate() {
|
|
10
|
+
this._timestamp = void 0;
|
|
11
|
+
this._ttl = void 0;
|
|
12
|
+
}
|
|
13
|
+
isValid() {
|
|
14
|
+
if (this._timestamp === void 0 || this._ttl === void 0) return false;
|
|
15
|
+
return Date.now() - this._timestamp < this._ttl;
|
|
16
|
+
}
|
|
17
|
+
toJSON() {
|
|
18
|
+
return { name: this.name };
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { A_ServerEntityListCacheState };
|
|
23
|
+
//# sourceMappingURL=A-EntityListCacheState.context.mjs.map
|
|
24
|
+
//# sourceMappingURL=A-EntityListCacheState.context.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/A-ServerEntityList/A-EntityListCacheState.context.ts"],"names":[],"mappings":";;;AAGO,MAAM,qCAAqC,UAAA,CAAyC;AAAA,EAKvF,IAAI,KAAA,EAAqB;AACrB,IAAA,IAAA,CAAK,UAAA,GAAa,KAAK,GAAA,EAAI;AAC3B,IAAA,IAAA,CAAK,IAAA,GAAO,KAAA;AAAA,EAChB;AAAA,EAEA,UAAA,GAAmB;AACf,IAAA,IAAA,CAAK,UAAA,GAAa,MAAA;AAClB,IAAA,IAAA,CAAK,IAAA,GAAO,MAAA;AAAA,EAChB;AAAA,EAEA,OAAA,GAAmB;AACf,IAAA,IAAI,KAAK,UAAA,KAAe,MAAA,IAAa,IAAA,CAAK,IAAA,KAAS,QAAW,OAAO,KAAA;AACrE,IAAA,OAAQ,IAAA,CAAK,GAAA,EAAI,GAAI,IAAA,CAAK,aAAc,IAAA,CAAK,IAAA;AAAA,EACjD;AAAA,EAEA,MAAA,GAAuC;AACnC,IAAA,OAAO,EAAE,IAAA,EAAM,IAAA,CAAK,IAAA,EAAK;AAAA,EAC7B;AACJ","file":"A-EntityListCacheState.context.mjs","sourcesContent":["import { A_Fragment, A_TYPES__Fragment_Serialized } from \"@adaas/a-concept\";\n\n\nexport class A_ServerEntityListCacheState extends A_Fragment<A_TYPES__Fragment_Serialized> {\n\n protected _timestamp?: number;\n protected _ttl?: number;\n\n set(ttlMs: number): void {\n this._timestamp = Date.now();\n this._ttl = ttlMs;\n }\n\n invalidate(): void {\n this._timestamp = undefined;\n this._ttl = undefined;\n }\n\n isValid(): boolean {\n if (this._timestamp === undefined || this._ttl === undefined) return false;\n return (Date.now() - this._timestamp) < this._ttl;\n }\n\n toJSON(): A_TYPES__Fragment_Serialized {\n return { name: this.name };\n }\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { A_TYPES__Fragment_Serialized, A_Fragment } from '@adaas/a-concept';
|
|
2
|
+
import { A_SERVER_TYPES__A_EntityListPagination } from './A-EntityList.types.mjs';
|
|
3
|
+
|
|
4
|
+
type A_SERVER_TYPES__A_EntityListPaginationSerialized = A_SERVER_TYPES__A_EntityListPagination & A_TYPES__Fragment_Serialized;
|
|
5
|
+
declare class A_ServerEntityListPagination extends A_Fragment<A_SERVER_TYPES__A_EntityListPaginationSerialized> {
|
|
6
|
+
protected _total: number;
|
|
7
|
+
protected _page: number;
|
|
8
|
+
protected _pageSize: number;
|
|
9
|
+
constructor(init?: Partial<A_SERVER_TYPES__A_EntityListPagination>);
|
|
10
|
+
get total(): number;
|
|
11
|
+
get page(): number;
|
|
12
|
+
get pageSize(): number;
|
|
13
|
+
update(data: Partial<A_SERVER_TYPES__A_EntityListPagination>): void;
|
|
14
|
+
fromJSON(serialized: A_SERVER_TYPES__A_EntityListPaginationSerialized): void;
|
|
15
|
+
toJSON(): A_SERVER_TYPES__A_EntityListPaginationSerialized;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { type A_SERVER_TYPES__A_EntityListPaginationSerialized, A_ServerEntityListPagination };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { A_TYPES__Fragment_Serialized, A_Fragment } from '@adaas/a-concept';
|
|
2
|
+
import { A_SERVER_TYPES__A_EntityListPagination } from './A-EntityList.types.js';
|
|
3
|
+
|
|
4
|
+
type A_SERVER_TYPES__A_EntityListPaginationSerialized = A_SERVER_TYPES__A_EntityListPagination & A_TYPES__Fragment_Serialized;
|
|
5
|
+
declare class A_ServerEntityListPagination extends A_Fragment<A_SERVER_TYPES__A_EntityListPaginationSerialized> {
|
|
6
|
+
protected _total: number;
|
|
7
|
+
protected _page: number;
|
|
8
|
+
protected _pageSize: number;
|
|
9
|
+
constructor(init?: Partial<A_SERVER_TYPES__A_EntityListPagination>);
|
|
10
|
+
get total(): number;
|
|
11
|
+
get page(): number;
|
|
12
|
+
get pageSize(): number;
|
|
13
|
+
update(data: Partial<A_SERVER_TYPES__A_EntityListPagination>): void;
|
|
14
|
+
fromJSON(serialized: A_SERVER_TYPES__A_EntityListPaginationSerialized): void;
|
|
15
|
+
toJSON(): A_SERVER_TYPES__A_EntityListPaginationSerialized;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { type A_SERVER_TYPES__A_EntityListPaginationSerialized, A_ServerEntityListPagination };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var aConcept = require('@adaas/a-concept');
|
|
4
|
+
|
|
5
|
+
class A_ServerEntityListPagination extends aConcept.A_Fragment {
|
|
6
|
+
constructor(init) {
|
|
7
|
+
super();
|
|
8
|
+
this._total = 0;
|
|
9
|
+
this._page = 1;
|
|
10
|
+
this._pageSize = 10;
|
|
11
|
+
if (init) {
|
|
12
|
+
if (init.total !== void 0) this._total = init.total;
|
|
13
|
+
if (init.page !== void 0) this._page = init.page;
|
|
14
|
+
if (init.pageSize !== void 0) this._pageSize = init.pageSize;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
get total() {
|
|
18
|
+
return this._total;
|
|
19
|
+
}
|
|
20
|
+
get page() {
|
|
21
|
+
return this._page;
|
|
22
|
+
}
|
|
23
|
+
get pageSize() {
|
|
24
|
+
return this._pageSize;
|
|
25
|
+
}
|
|
26
|
+
update(data) {
|
|
27
|
+
if (data.total !== void 0) this._total = data.total;
|
|
28
|
+
if (data.page !== void 0) this._page = data.page;
|
|
29
|
+
if (data.pageSize !== void 0) this._pageSize = data.pageSize;
|
|
30
|
+
}
|
|
31
|
+
fromJSON(serialized) {
|
|
32
|
+
this._total = serialized.total;
|
|
33
|
+
this._page = serialized.page;
|
|
34
|
+
this._pageSize = serialized.pageSize;
|
|
35
|
+
}
|
|
36
|
+
toJSON() {
|
|
37
|
+
return {
|
|
38
|
+
name: this.name,
|
|
39
|
+
total: this._total,
|
|
40
|
+
page: this._page,
|
|
41
|
+
pageSize: this._pageSize
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
exports.A_ServerEntityListPagination = A_ServerEntityListPagination;
|
|
47
|
+
//# sourceMappingURL=A-EntityListPagination.context.js.map
|
|
48
|
+
//# sourceMappingURL=A-EntityListPagination.context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/A-ServerEntityList/A-EntityListPagination.context.ts"],"names":["A_Fragment"],"mappings":";;;;AAQO,MAAM,qCAAqCA,mBAAA,CAA6D;AAAA,EAM3G,YAAY,IAAA,EAAwD;AAChE,IAAA,KAAA,EAAM;AALV,IAAA,IAAA,CAAU,MAAA,GAAiB,CAAA;AAC3B,IAAA,IAAA,CAAU,KAAA,GAAgB,CAAA;AAC1B,IAAA,IAAA,CAAU,SAAA,GAAoB,EAAA;AAI1B,IAAA,IAAI,IAAA,EAAM;AACN,MAAA,IAAI,IAAA,CAAK,KAAA,KAAU,MAAA,EAAW,IAAA,CAAK,SAAS,IAAA,CAAK,KAAA;AACjD,MAAA,IAAI,IAAA,CAAK,IAAA,KAAS,MAAA,EAAW,IAAA,CAAK,QAAQ,IAAA,CAAK,IAAA;AAC/C,MAAA,IAAI,IAAA,CAAK,QAAA,KAAa,MAAA,EAAW,IAAA,CAAK,YAAY,IAAA,CAAK,QAAA;AAAA,IAC3D;AAAA,EACJ;AAAA,EAEA,IAAI,KAAA,GAAgB;AAAE,IAAA,OAAO,IAAA,CAAK,MAAA;AAAA,EAAQ;AAAA,EAC1C,IAAI,IAAA,GAAe;AAAE,IAAA,OAAO,IAAA,CAAK,KAAA;AAAA,EAAO;AAAA,EACxC,IAAI,QAAA,GAAmB;AAAE,IAAA,OAAO,IAAA,CAAK,SAAA;AAAA,EAAW;AAAA,EAEhD,OAAO,IAAA,EAA6D;AAChE,IAAA,IAAI,IAAA,CAAK,KAAA,KAAU,MAAA,EAAW,IAAA,CAAK,SAAS,IAAA,CAAK,KAAA;AACjD,IAAA,IAAI,IAAA,CAAK,IAAA,KAAS,MAAA,EAAW,IAAA,CAAK,QAAQ,IAAA,CAAK,IAAA;AAC/C,IAAA,IAAI,IAAA,CAAK,QAAA,KAAa,MAAA,EAAW,IAAA,CAAK,YAAY,IAAA,CAAK,QAAA;AAAA,EAC3D;AAAA,EAEA,SAAS,UAAA,EAAoE;AACzE,IAAA,IAAA,CAAK,SAAS,UAAA,CAAW,KAAA;AACzB,IAAA,IAAA,CAAK,QAAQ,UAAA,CAAW,IAAA;AACxB,IAAA,IAAA,CAAK,YAAY,UAAA,CAAW,QAAA;AAAA,EAChC;AAAA,EAEA,MAAA,GAA2D;AACvD,IAAA,OAAO;AAAA,MACH,MAAM,IAAA,CAAK,IAAA;AAAA,MACX,OAAO,IAAA,CAAK,MAAA;AAAA,MACZ,MAAM,IAAA,CAAK,KAAA;AAAA,MACX,UAAU,IAAA,CAAK;AAAA,KACnB;AAAA,EACJ;AACJ","file":"A-EntityListPagination.context.js","sourcesContent":["import { A_Fragment, A_TYPES__Fragment_Serialized } from \"@adaas/a-concept\";\nimport { A_SERVER_TYPES__A_EntityListPagination } from \"./A-EntityList.types\";\n\n\nexport type A_SERVER_TYPES__A_EntityListPaginationSerialized =\n A_SERVER_TYPES__A_EntityListPagination & A_TYPES__Fragment_Serialized;\n\n\nexport class A_ServerEntityListPagination extends A_Fragment<A_SERVER_TYPES__A_EntityListPaginationSerialized> {\n\n protected _total: number = 0;\n protected _page: number = 1;\n protected _pageSize: number = 10;\n\n constructor(init?: Partial<A_SERVER_TYPES__A_EntityListPagination>) {\n super();\n if (init) {\n if (init.total !== undefined) this._total = init.total;\n if (init.page !== undefined) this._page = init.page;\n if (init.pageSize !== undefined) this._pageSize = init.pageSize;\n }\n }\n\n get total(): number { return this._total; }\n get page(): number { return this._page; }\n get pageSize(): number { return this._pageSize; }\n\n update(data: Partial<A_SERVER_TYPES__A_EntityListPagination>): void {\n if (data.total !== undefined) this._total = data.total;\n if (data.page !== undefined) this._page = data.page;\n if (data.pageSize !== undefined) this._pageSize = data.pageSize;\n }\n\n fromJSON(serialized: A_SERVER_TYPES__A_EntityListPaginationSerialized): void {\n this._total = serialized.total;\n this._page = serialized.page;\n this._pageSize = serialized.pageSize;\n }\n\n toJSON(): A_SERVER_TYPES__A_EntityListPaginationSerialized {\n return {\n name: this.name,\n total: this._total,\n page: this._page,\n pageSize: this._pageSize,\n };\n }\n}\n"]}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import '../../chunk-EQQGB2QZ.mjs';
|
|
2
|
+
import { A_Fragment } from '@adaas/a-concept';
|
|
3
|
+
|
|
4
|
+
class A_ServerEntityListPagination extends A_Fragment {
|
|
5
|
+
constructor(init) {
|
|
6
|
+
super();
|
|
7
|
+
this._total = 0;
|
|
8
|
+
this._page = 1;
|
|
9
|
+
this._pageSize = 10;
|
|
10
|
+
if (init) {
|
|
11
|
+
if (init.total !== void 0) this._total = init.total;
|
|
12
|
+
if (init.page !== void 0) this._page = init.page;
|
|
13
|
+
if (init.pageSize !== void 0) this._pageSize = init.pageSize;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
get total() {
|
|
17
|
+
return this._total;
|
|
18
|
+
}
|
|
19
|
+
get page() {
|
|
20
|
+
return this._page;
|
|
21
|
+
}
|
|
22
|
+
get pageSize() {
|
|
23
|
+
return this._pageSize;
|
|
24
|
+
}
|
|
25
|
+
update(data) {
|
|
26
|
+
if (data.total !== void 0) this._total = data.total;
|
|
27
|
+
if (data.page !== void 0) this._page = data.page;
|
|
28
|
+
if (data.pageSize !== void 0) this._pageSize = data.pageSize;
|
|
29
|
+
}
|
|
30
|
+
fromJSON(serialized) {
|
|
31
|
+
this._total = serialized.total;
|
|
32
|
+
this._page = serialized.page;
|
|
33
|
+
this._pageSize = serialized.pageSize;
|
|
34
|
+
}
|
|
35
|
+
toJSON() {
|
|
36
|
+
return {
|
|
37
|
+
name: this.name,
|
|
38
|
+
total: this._total,
|
|
39
|
+
page: this._page,
|
|
40
|
+
pageSize: this._pageSize
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { A_ServerEntityListPagination };
|
|
46
|
+
//# sourceMappingURL=A-EntityListPagination.context.mjs.map
|
|
47
|
+
//# sourceMappingURL=A-EntityListPagination.context.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/A-ServerEntityList/A-EntityListPagination.context.ts"],"names":[],"mappings":";;;AAQO,MAAM,qCAAqC,UAAA,CAA6D;AAAA,EAM3G,YAAY,IAAA,EAAwD;AAChE,IAAA,KAAA,EAAM;AALV,IAAA,IAAA,CAAU,MAAA,GAAiB,CAAA;AAC3B,IAAA,IAAA,CAAU,KAAA,GAAgB,CAAA;AAC1B,IAAA,IAAA,CAAU,SAAA,GAAoB,EAAA;AAI1B,IAAA,IAAI,IAAA,EAAM;AACN,MAAA,IAAI,IAAA,CAAK,KAAA,KAAU,MAAA,EAAW,IAAA,CAAK,SAAS,IAAA,CAAK,KAAA;AACjD,MAAA,IAAI,IAAA,CAAK,IAAA,KAAS,MAAA,EAAW,IAAA,CAAK,QAAQ,IAAA,CAAK,IAAA;AAC/C,MAAA,IAAI,IAAA,CAAK,QAAA,KAAa,MAAA,EAAW,IAAA,CAAK,YAAY,IAAA,CAAK,QAAA;AAAA,IAC3D;AAAA,EACJ;AAAA,EAEA,IAAI,KAAA,GAAgB;AAAE,IAAA,OAAO,IAAA,CAAK,MAAA;AAAA,EAAQ;AAAA,EAC1C,IAAI,IAAA,GAAe;AAAE,IAAA,OAAO,IAAA,CAAK,KAAA;AAAA,EAAO;AAAA,EACxC,IAAI,QAAA,GAAmB;AAAE,IAAA,OAAO,IAAA,CAAK,SAAA;AAAA,EAAW;AAAA,EAEhD,OAAO,IAAA,EAA6D;AAChE,IAAA,IAAI,IAAA,CAAK,KAAA,KAAU,MAAA,EAAW,IAAA,CAAK,SAAS,IAAA,CAAK,KAAA;AACjD,IAAA,IAAI,IAAA,CAAK,IAAA,KAAS,MAAA,EAAW,IAAA,CAAK,QAAQ,IAAA,CAAK,IAAA;AAC/C,IAAA,IAAI,IAAA,CAAK,QAAA,KAAa,MAAA,EAAW,IAAA,CAAK,YAAY,IAAA,CAAK,QAAA;AAAA,EAC3D;AAAA,EAEA,SAAS,UAAA,EAAoE;AACzE,IAAA,IAAA,CAAK,SAAS,UAAA,CAAW,KAAA;AACzB,IAAA,IAAA,CAAK,QAAQ,UAAA,CAAW,IAAA;AACxB,IAAA,IAAA,CAAK,YAAY,UAAA,CAAW,QAAA;AAAA,EAChC;AAAA,EAEA,MAAA,GAA2D;AACvD,IAAA,OAAO;AAAA,MACH,MAAM,IAAA,CAAK,IAAA;AAAA,MACX,OAAO,IAAA,CAAK,MAAA;AAAA,MACZ,MAAM,IAAA,CAAK,KAAA;AAAA,MACX,UAAU,IAAA,CAAK;AAAA,KACnB;AAAA,EACJ;AACJ","file":"A-EntityListPagination.context.mjs","sourcesContent":["import { A_Fragment, A_TYPES__Fragment_Serialized } from \"@adaas/a-concept\";\nimport { A_SERVER_TYPES__A_EntityListPagination } from \"./A-EntityList.types\";\n\n\nexport type A_SERVER_TYPES__A_EntityListPaginationSerialized =\n A_SERVER_TYPES__A_EntityListPagination & A_TYPES__Fragment_Serialized;\n\n\nexport class A_ServerEntityListPagination extends A_Fragment<A_SERVER_TYPES__A_EntityListPaginationSerialized> {\n\n protected _total: number = 0;\n protected _page: number = 1;\n protected _pageSize: number = 10;\n\n constructor(init?: Partial<A_SERVER_TYPES__A_EntityListPagination>) {\n super();\n if (init) {\n if (init.total !== undefined) this._total = init.total;\n if (init.page !== undefined) this._page = init.page;\n if (init.pageSize !== undefined) this._pageSize = init.pageSize;\n }\n }\n\n get total(): number { return this._total; }\n get page(): number { return this._page; }\n get pageSize(): number { return this._pageSize; }\n\n update(data: Partial<A_SERVER_TYPES__A_EntityListPagination>): void {\n if (data.total !== undefined) this._total = data.total;\n if (data.page !== undefined) this._page = data.page;\n if (data.pageSize !== undefined) this._pageSize = data.pageSize;\n }\n\n fromJSON(serialized: A_SERVER_TYPES__A_EntityListPaginationSerialized): void {\n this._total = serialized.total;\n this._page = serialized.page;\n this._pageSize = serialized.pageSize;\n }\n\n toJSON(): A_SERVER_TYPES__A_EntityListPaginationSerialized {\n return {\n name: this.name,\n total: this._total,\n page: this._page,\n pageSize: this._pageSize,\n };\n }\n}\n"]}
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
import { A_Error } from '@adaas/a-concept';
|
|
2
|
-
import { A_Server } from '../A-Server/A-Server.context.mjs';
|
|
1
|
+
import { A_Error, A_Scope } from '@adaas/a-concept';
|
|
3
2
|
import { A as A_Request } from '../../A-Request.entity-r905O60G.mjs';
|
|
4
3
|
import { A as A_Response } from '../../A-Response.entity-6qhiV7BE.mjs';
|
|
5
4
|
import { A_HttpServerRequestContext } from '../A-Request/A-HttpServerRequest.context.mjs';
|
|
6
5
|
import { A_Config } from '@adaas/a-utils/a-config';
|
|
7
6
|
import { A_Logger } from '@adaas/a-utils/a-logger';
|
|
8
|
-
import '../A-Server/A-Server.types.mjs';
|
|
9
|
-
import '../A-ServerRoute/A-ServerRoute.entity.mjs';
|
|
10
|
-
import '@adaas/a-utils/a-route';
|
|
11
|
-
import '../A-ServerRoute/A-ServerRoute.types.mjs';
|
|
12
|
-
import '../A-ServerRoute/A-ServerRoute.constants.mjs';
|
|
13
7
|
import 'http';
|
|
14
8
|
import '../A-Server/A-HttpServer.error.mjs';
|
|
15
9
|
import '../A-Server/A-HttpServer.types.mjs';
|
|
@@ -18,6 +12,10 @@ import '../A-Request/A-Request.constants.mjs';
|
|
|
18
12
|
import '../A-Request/A-Request.env.mjs';
|
|
19
13
|
import '../A-Request/A-HttpRequestData.context.mjs';
|
|
20
14
|
import '@adaas/a-utils/a-execution';
|
|
15
|
+
import '../A-ServerRoute/A-ServerRoute.entity.mjs';
|
|
16
|
+
import '@adaas/a-utils/a-route';
|
|
17
|
+
import '../A-ServerRoute/A-ServerRoute.types.mjs';
|
|
18
|
+
import '../A-ServerRoute/A-ServerRoute.constants.mjs';
|
|
21
19
|
import 'stream';
|
|
22
20
|
import '../A-Response/A-Response.constants.mjs';
|
|
23
21
|
import '@adaas/a-utils/a-operation';
|
|
@@ -26,7 +24,7 @@ declare class A_ServerLogger extends A_Logger {
|
|
|
26
24
|
protected config: A_Config<any>;
|
|
27
25
|
logRequestFinish(request: A_Request, response: A_Response, context: A_HttpServerRequestContext): void;
|
|
28
26
|
logResponseError(request: A_Request, response: A_Response, context: A_HttpServerRequestContext, error: A_Error): void;
|
|
29
|
-
logStop(
|
|
27
|
+
logStop(scope: A_Scope): void;
|
|
30
28
|
serverReady(params: {
|
|
31
29
|
port: number;
|
|
32
30
|
app: {
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
import { A_Error } from '@adaas/a-concept';
|
|
2
|
-
import { A_Server } from '../A-Server/A-Server.context.js';
|
|
1
|
+
import { A_Error, A_Scope } from '@adaas/a-concept';
|
|
3
2
|
import { A as A_Request } from '../../A-Request.entity-8_9MCXT2.js';
|
|
4
3
|
import { A as A_Response } from '../../A-Response.entity-bjh6bofZ.js';
|
|
5
4
|
import { A_HttpServerRequestContext } from '../A-Request/A-HttpServerRequest.context.js';
|
|
6
5
|
import { A_Config } from '@adaas/a-utils/a-config';
|
|
7
6
|
import { A_Logger } from '@adaas/a-utils/a-logger';
|
|
8
|
-
import '../A-Server/A-Server.types.js';
|
|
9
|
-
import '../A-ServerRoute/A-ServerRoute.entity.js';
|
|
10
|
-
import '@adaas/a-utils/a-route';
|
|
11
|
-
import '../A-ServerRoute/A-ServerRoute.types.js';
|
|
12
|
-
import '../A-ServerRoute/A-ServerRoute.constants.js';
|
|
13
7
|
import 'http';
|
|
14
8
|
import '../A-Server/A-HttpServer.error.js';
|
|
15
9
|
import '../A-Server/A-HttpServer.types.js';
|
|
@@ -18,6 +12,10 @@ import '../A-Request/A-Request.constants.js';
|
|
|
18
12
|
import '../A-Request/A-Request.env.js';
|
|
19
13
|
import '../A-Request/A-HttpRequestData.context.js';
|
|
20
14
|
import '@adaas/a-utils/a-execution';
|
|
15
|
+
import '../A-ServerRoute/A-ServerRoute.entity.js';
|
|
16
|
+
import '@adaas/a-utils/a-route';
|
|
17
|
+
import '../A-ServerRoute/A-ServerRoute.types.js';
|
|
18
|
+
import '../A-ServerRoute/A-ServerRoute.constants.js';
|
|
21
19
|
import 'stream';
|
|
22
20
|
import '../A-Response/A-Response.constants.js';
|
|
23
21
|
import '@adaas/a-utils/a-operation';
|
|
@@ -26,7 +24,7 @@ declare class A_ServerLogger extends A_Logger {
|
|
|
26
24
|
protected config: A_Config<any>;
|
|
27
25
|
logRequestFinish(request: A_Request, response: A_Response, context: A_HttpServerRequestContext): void;
|
|
28
26
|
logResponseError(request: A_Request, response: A_Response, context: A_HttpServerRequestContext, error: A_Error): void;
|
|
29
|
-
logStop(
|
|
27
|
+
logStop(scope: A_Scope): void;
|
|
30
28
|
serverReady(params: {
|
|
31
29
|
port: number;
|
|
32
30
|
app: {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var aConcept = require('@adaas/a-concept');
|
|
4
|
-
var AServer_context = require('@adaas/a-server/server/A-Server.context');
|
|
5
4
|
var ARequest_entity = require('@adaas/a-server/request/A-Request.entity');
|
|
6
5
|
var AResponse_entity = require('@adaas/a-server/response/A-Response.entity');
|
|
7
6
|
var AResponse_constants = require('@adaas/a-server/response/A-Response.constants');
|
|
@@ -28,8 +27,8 @@ class A_ServerLogger extends aLogger.A_Logger {
|
|
|
28
27
|
this.info("red", `Request ${request.method} ${request.url} errored with status ${response.statusCode} in ${context.processingTime ?? "N/A"}ms`);
|
|
29
28
|
this.error(error);
|
|
30
29
|
}
|
|
31
|
-
logStop(
|
|
32
|
-
this.
|
|
30
|
+
logStop(scope) {
|
|
31
|
+
this.info("red", `Server ${scope.name} stopped`);
|
|
33
32
|
}
|
|
34
33
|
serverReady(params) {
|
|
35
34
|
const processId = process.pid;
|
|
@@ -80,7 +79,7 @@ __decorateClass([
|
|
|
80
79
|
name: aService.A_ServiceFeatures.onAfterStop,
|
|
81
80
|
scope: [aService.A_Service]
|
|
82
81
|
}),
|
|
83
|
-
__decorateParam(0, aConcept.A_Inject(
|
|
82
|
+
__decorateParam(0, aConcept.A_Inject(aConcept.A_Scope))
|
|
84
83
|
], A_ServerLogger.prototype, "logStop");
|
|
85
84
|
|
|
86
85
|
exports.A_ServerLogger = A_ServerLogger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/A-ServerLogger/A-ServerLogger.component.ts"],"names":["A_Logger","A_Feature","A_ResponseFeatures","A_Response","A_Request","A_HttpServerRequestContext","A_Error","A_ServiceFeatures","A_Service","
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/A-ServerLogger/A-ServerLogger.component.ts"],"names":["A_Logger","A_Feature","A_ResponseFeatures","A_Response","A_Request","A_HttpServerRequestContext","A_Error","A_ServiceFeatures","A_Service","A_Scope"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAUO,MAAM,uBAAuBA,gBAAA,CAAS;AAAA,EAUzC,gBAAA,CACyB,OAAA,EACC,QAAA,EACgB,OAAA,EACxC;AAEE,IAAA,IAAA,CAAK,IAAA,CAAK,OAAA,EAAS,CAAA,QAAA,EAAW,OAAA,CAAQ,MAAM,CAAA,CAAA,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BAAO,CAAA;AAAA,CAAA,EA5DZ,cAAA,CA2DT,SAAA,EAAA,SAAA,CAAA","file":"A-ServerLogger.component.js","sourcesContent":["import { A_Error, A_Feature, A_Inject, A_Scope, } from \"@adaas/a-concept\";\nimport { A_Request } from \"@adaas/a-server/request/A-Request.entity\";\nimport { A_Response } from \"@adaas/a-server/response/A-Response.entity\";\nimport { A_ResponseFeatures } from \"@adaas/a-server/response/A-Response.constants\";\nimport { A_HttpServerRequestContext } from \"@adaas/a-server/request/A-HttpServerRequest.context\";\nimport { A_Config } from \"@adaas/a-utils/a-config\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { A_Service, A_ServiceFeatures } from \"@adaas/a-utils/a-service\";\n\n\nexport class A_ServerLogger extends A_Logger {\n\n protected declare config: A_Config<any>\n\n\n\n @A_Feature.Extend({\n name: A_ResponseFeatures.onSend,\n scope: [A_Response]\n })\n logRequestFinish(\n @A_Inject(A_Request) request: A_Request,\n @A_Inject(A_Response) response: A_Response,\n @A_Inject(A_HttpServerRequestContext) context: A_HttpServerRequestContext,\n ) {\n\n this.info('green', `Request ${request.method} ${request.url} finished with status ${response.statusCode} in ${context.processingTime ?? 'N/A'}ms`);\n }\n\n\n @A_Feature.Extend({\n name: A_ResponseFeatures.onError,\n scope: [A_Response]\n })\n logResponseError(\n @A_Inject(A_Request) request: A_Request,\n @A_Inject(A_Response) response: A_Response,\n @A_Inject(A_HttpServerRequestContext) context: A_HttpServerRequestContext,\n @A_Inject(A_Error) error: A_Error,\n ) {\n this.info('red', `Request ${request.method} ${request.url} errored with status ${response.statusCode} in ${context.processingTime ?? 'N/A'}ms`);\n this.error(error);\n }\n\n\n\n\n // @A_Feature.Extend({\n // name: A_ServiceFeatures.onAfterStart,\n // scope: [A_Service]\n // })\n // logStart(\n // @A_Inject(A_Service) container: A_Service,\n // ): void {\n // // this.serverReady({\n // // port: container.port,\n // // app: {\n // // name: container.name,\n // // }\n // // })\n // }\n\n\n\n\n @A_Feature.Extend({\n name: A_ServiceFeatures.onAfterStop,\n scope: [A_Service]\n })\n logStop(\n @A_Inject(A_Scope) scope: A_Scope,\n ) {\n this.info('red', `Server ${scope.name} stopped`);\n }\n\n\n\n\n serverReady(\n params: {\n port: number,\n\n app: {\n name: string,\n version?: string\n }\n }\n ) {\n const processId = process.pid;\n\n this.info('cyan',\n ` ${params.app.name} v${params.app.version || '0.0.1'} is running on port ${params.port}`,\n ` Process ID: ${processId}`,\n ` Open In Browser: http://localhost:${params.port}`,\n ``,\n `-------------------------------`,\n ` ==============================`,\n ` LISTENING... `,\n ` ==============================`\n );\n }\n\n\n /**\n * Displays a proxy routes \n * \n * @param params \n */\n proxy(\n params: {\n original: string,\n destination: string,\n }\n ) {\n console.log(`\\x1b[35m[${this.scope.name}] |${this.getTime()}| Proxy:\n${' '.repeat(this.scopeLength + 3)}| ${params.original} -> ${params.destination}\n${' '.repeat(this.scopeLength + 3)}|-------------------------------\\x1b[0m`);\n }\n\n}"]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { __decorateClass, __decorateParam } from '../../chunk-EQQGB2QZ.mjs';
|
|
2
|
-
import { A_Feature, A_Inject, A_Error } from '@adaas/a-concept';
|
|
3
|
-
import { A_Server } from '@adaas/a-server/server/A-Server.context';
|
|
2
|
+
import { A_Feature, A_Inject, A_Error, A_Scope } from '@adaas/a-concept';
|
|
4
3
|
import { A_Request } from '@adaas/a-server/request/A-Request.entity';
|
|
5
4
|
import { A_Response } from '@adaas/a-server/response/A-Response.entity';
|
|
6
5
|
import { A_ResponseFeatures } from '@adaas/a-server/response/A-Response.constants';
|
|
@@ -16,8 +15,8 @@ class A_ServerLogger extends A_Logger {
|
|
|
16
15
|
this.info("red", `Request ${request.method} ${request.url} errored with status ${response.statusCode} in ${context.processingTime ?? "N/A"}ms`);
|
|
17
16
|
this.error(error);
|
|
18
17
|
}
|
|
19
|
-
logStop(
|
|
20
|
-
this.
|
|
18
|
+
logStop(scope) {
|
|
19
|
+
this.info("red", `Server ${scope.name} stopped`);
|
|
21
20
|
}
|
|
22
21
|
serverReady(params) {
|
|
23
22
|
const processId = process.pid;
|
|
@@ -68,7 +67,7 @@ __decorateClass([
|
|
|
68
67
|
name: A_ServiceFeatures.onAfterStop,
|
|
69
68
|
scope: [A_Service]
|
|
70
69
|
}),
|
|
71
|
-
__decorateParam(0, A_Inject(
|
|
70
|
+
__decorateParam(0, A_Inject(A_Scope))
|
|
72
71
|
], A_ServerLogger.prototype, "logStop", 1);
|
|
73
72
|
|
|
74
73
|
export { A_ServerLogger };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/A-ServerLogger/A-ServerLogger.component.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/A-ServerLogger/A-ServerLogger.component.ts"],"names":[],"mappings":";;;;;;;;;AAUO,MAAM,uBAAuB,QAAA,CAAS;AAAA,EAUzC,gBAAA,CACyB,OAAA,EACC,QAAA,EACgB,OAAA,EACxC;AAEE,IAAA,IAAA,CAAK,IAAA,CAAK,OAAA,EAAS,CAAA,QAAA,EAAW,OAAA,CAAQ,MAAM,CAAA,CAAA,EAAI,OAAA,CAAQ,GAAG,CAAA,sBAAA,EAAyB,SAAS,UAAU,CAAA,IAAA,EAAO,OAAA,CAAQ,cAAA,IAAkB,KAAK,CAAA,EAAA,CAAI,CAAA;AAAA,EACrJ;AAAA,EAOA,gBAAA,CACyB,OAAA,EACC,QAAA,EACgB,OAAA,EACnB,KAAA,EACrB;AACE,IAAA,IAAA,CAAK,IAAA,CAAK,KAAA,EAAO,CAAA,QAAA,EAAW,OAAA,CAAQ,MAAM,CAAA,CAAA,EAAI,OAAA,CAAQ,GAAG,CAAA,qBAAA,EAAwB,SAAS,UAAU,CAAA,IAAA,EAAO,OAAA,CAAQ,cAAA,IAAkB,KAAK,CAAA,EAAA,CAAI,CAAA;AAC9I,IAAA,IAAA,CAAK,MAAM,KAAK,CAAA;AAAA,EACpB;AAAA,EA2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AAC,UAAU;AAAA,GACrB,CAAA;AAAA,EAEI,4BAAS,SAAS,CAAA,CAAA;AAAA,EAClB,4BAAS,UAAU,CAAA,CAAA;AAAA,EACnB,4BAAS,0BAA0B,CAAA;AAAA,CAAA,EAb/B,cAAA,CAUT,SAAA,EAAA,kBAAA,EAAA,CAAA,CAAA;AAcA,eAAA,CAAA;AAAA,EAJC,UAAU,MAAA,CAAO;AAAA,IACd,MAAM,kBAAA,CAAmB,OAAA;AAAA,IACzB,KAAA,EAAO,CAAC,UAAU;AAAA,GACrB,CAAA;AAAA,EAEI,4BAAS,SAAS,CAAA,CAAA;AAAA,EAClB,4BAAS,UAAU,CAAA,CAAA;AAAA,EACnB,4BAAS,0BAA0B,CAAA,CAAA;AAAA,EACnC,4BAAS,OAAO,CAAA;AAAA,CAAA,EA5BZ,cAAA,CAwBT,SAAA,EAAA,kBAAA,EAAA,CAAA,CAAA;AAmCA,eAAA,CAAA;AAAA,EAJC,UAAU,MAAA,CAAO;AAAA,IACd,MAAM,iBAAA,CAAkB,WAAA;AAAA,IACxB,KAAA,EAAO,CAAC,SAAS;AAAA,GACpB,CAAA;AAAA,EAEI,4BAAS,OAAO,CAAA;AAAA,CAAA,EA5DZ,cAAA,CA2DT,SAAA,EAAA,SAAA,EAAA,CAAA,CAAA","file":"A-ServerLogger.component.mjs","sourcesContent":["import { A_Error, A_Feature, A_Inject, A_Scope, } from \"@adaas/a-concept\";\nimport { A_Request } from \"@adaas/a-server/request/A-Request.entity\";\nimport { A_Response } from \"@adaas/a-server/response/A-Response.entity\";\nimport { A_ResponseFeatures } from \"@adaas/a-server/response/A-Response.constants\";\nimport { A_HttpServerRequestContext } from \"@adaas/a-server/request/A-HttpServerRequest.context\";\nimport { A_Config } from \"@adaas/a-utils/a-config\";\nimport { A_Logger } from \"@adaas/a-utils/a-logger\";\nimport { A_Service, A_ServiceFeatures } from \"@adaas/a-utils/a-service\";\n\n\nexport class A_ServerLogger extends A_Logger {\n\n protected declare config: A_Config<any>\n\n\n\n @A_Feature.Extend({\n name: A_ResponseFeatures.onSend,\n scope: [A_Response]\n })\n logRequestFinish(\n @A_Inject(A_Request) request: A_Request,\n @A_Inject(A_Response) response: A_Response,\n @A_Inject(A_HttpServerRequestContext) context: A_HttpServerRequestContext,\n ) {\n\n this.info('green', `Request ${request.method} ${request.url} finished with status ${response.statusCode} in ${context.processingTime ?? 'N/A'}ms`);\n }\n\n\n @A_Feature.Extend({\n name: A_ResponseFeatures.onError,\n scope: [A_Response]\n })\n logResponseError(\n @A_Inject(A_Request) request: A_Request,\n @A_Inject(A_Response) response: A_Response,\n @A_Inject(A_HttpServerRequestContext) context: A_HttpServerRequestContext,\n @A_Inject(A_Error) error: A_Error,\n ) {\n this.info('red', `Request ${request.method} ${request.url} errored with status ${response.statusCode} in ${context.processingTime ?? 'N/A'}ms`);\n this.error(error);\n }\n\n\n\n\n // @A_Feature.Extend({\n // name: A_ServiceFeatures.onAfterStart,\n // scope: [A_Service]\n // })\n // logStart(\n // @A_Inject(A_Service) container: A_Service,\n // ): void {\n // // this.serverReady({\n // // port: container.port,\n // // app: {\n // // name: container.name,\n // // }\n // // })\n // }\n\n\n\n\n @A_Feature.Extend({\n name: A_ServiceFeatures.onAfterStop,\n scope: [A_Service]\n })\n logStop(\n @A_Inject(A_Scope) scope: A_Scope,\n ) {\n this.info('red', `Server ${scope.name} stopped`);\n }\n\n\n\n\n serverReady(\n params: {\n port: number,\n\n app: {\n name: string,\n version?: string\n }\n }\n ) {\n const processId = process.pid;\n\n this.info('cyan',\n ` ${params.app.name} v${params.app.version || '0.0.1'} is running on port ${params.port}`,\n ` Process ID: ${processId}`,\n ` Open In Browser: http://localhost:${params.port}`,\n ``,\n `-------------------------------`,\n ` ==============================`,\n ` LISTENING... `,\n ` ==============================`\n );\n }\n\n\n /**\n * Displays a proxy routes \n * \n * @param params \n */\n proxy(\n params: {\n original: string,\n destination: string,\n }\n ) {\n console.log(`\\x1b[35m[${this.scope.name}] |${this.getTime()}| Proxy:\n${' '.repeat(this.scopeLength + 3)}| ${params.original} -> ${params.destination}\n${' '.repeat(this.scopeLength + 3)}|-------------------------------\\x1b[0m`);\n }\n\n}"]}
|
|
@@ -17,8 +17,6 @@ import '../A-Request/A-HttpServerRequest.context.mjs';
|
|
|
17
17
|
import '@adaas/a-utils/a-operation';
|
|
18
18
|
import '../A-Request/A-HttpRequestData.context.mjs';
|
|
19
19
|
import '@adaas/a-utils/a-execution';
|
|
20
|
-
import '../A-Server/A-Server.context.mjs';
|
|
21
|
-
import '../A-Server/A-Server.types.mjs';
|
|
22
20
|
import '@adaas/a-utils/a-route';
|
|
23
21
|
import '../A-ServerRoute/A-ServerRoute.types.mjs';
|
|
24
22
|
import '../A-ServerRoute/A-ServerRoute.constants.mjs';
|
|
@@ -17,8 +17,6 @@ import '../A-Request/A-HttpServerRequest.context.js';
|
|
|
17
17
|
import '@adaas/a-utils/a-operation';
|
|
18
18
|
import '../A-Request/A-HttpRequestData.context.js';
|
|
19
19
|
import '@adaas/a-utils/a-execution';
|
|
20
|
-
import '../A-Server/A-Server.context.js';
|
|
21
|
-
import '../A-Server/A-Server.types.js';
|
|
22
20
|
import '@adaas/a-utils/a-route';
|
|
23
21
|
import '../A-ServerRoute/A-ServerRoute.types.js';
|
|
24
22
|
import '../A-ServerRoute/A-ServerRoute.constants.js';
|
|
@@ -52,7 +52,7 @@ __decorateClass([
|
|
|
52
52
|
__decorateParam(0, aConcept.A_Inject(aConfig.A_Config))
|
|
53
53
|
], A_ServerCORS.prototype, "init");
|
|
54
54
|
__decorateClass([
|
|
55
|
-
AHttpServer_container.A_HttpServer.
|
|
55
|
+
AHttpServer_container.A_HttpServer.onBeforeRequest,
|
|
56
56
|
__decorateParam(0, aConcept.A_Inject(ARequest_entity.A_Request)),
|
|
57
57
|
__decorateParam(1, aConcept.A_Inject(AResponse_entity.A_Response))
|
|
58
58
|
], A_ServerCORS.prototype, "apply");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/middlewares/A-ServerCORS/A_ServerCORS.component.ts"],"names":["A_ServerMiddleware","A_SERVER_DEFAULTS__CorsConfig","A_Feature","A_ServiceFeatures","A_Config","A_HttpServer","A_Request","A_Response"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAcO,MAAM,qBAAqBA,8CAAA,CAAmB;AAAA,EAOjD,MAAM,KACkB,MAAA,EACtB;AACE,IAAA,IAAA,CAAK,MAAA,GAAS;AAAA,MACV,MAAA,EAAQ,MAAA,CAAO,GAAA,CAAI,QAAQ,KAAKC,oDAAA,CAA8B,MAAA;AAAA,MAC9D,OAAA,EAAS,MAAA,CAAO,GAAA,CAAI,SAAS,KAAKA,oDAAA,CAA8B,OAAA;AAAA,MAChE,OAAA,EAAS,MAAA,CAAO,GAAA,CAAI,SAAS,KAAKA,oDAAA,CAA8B,OAAA;AAAA,MAChE,WAAA,EAAa,MAAA,CAAO,GAAA,CAAI,aAAa,KAAKA,oDAAA,CAA8B,WAAA;AAAA,MACxE,MAAA,EAAQ,MAAA,CAAO,GAAA,CAAI,SAAS,KAAKA,oDAAA,CAA8B;AAAA,KACnE;AAAA,EACJ;AAAA,EAIO,KAAA,CACkB,MACC,IAAA,EACxB;AAEE,IAAA,IAAA,CAAK,SAAA,CAAU,6BAAA,EAA+B,IAAA,CAAK,MAAA,CAAO,MAAM,CAAA;AAChE,IAAA,IAAA,CAAK,UAAU,8BAAA,EAAgC,IAAA,CAAK,OAAO,OAAA,CAAQ,IAAA,CAAK,IAAI,CAAC,CAAA;AAC7E,IAAA,IAAA,CAAK,UAAU,8BAAA,EAAgC,IAAA,CAAK,OAAO,OAAA,CAAQ,IAAA,CAAK,IAAI,CAAC,CAAA;AAE7E,IAAA,IAAI,IAAA,CAAK,OAAO,WAAA,EAAa;AACzB,MAAA,IAAA,CAAK,SAAA,CAAU,oCAAoC,MAAM,CAAA;AAAA,IAC7D;AAEA,IAAA,IAAI,IAAA,CAAK,OAAO,MAAA,EAAQ;AACpB,MAAA,IAAA,CAAK,UAAU,wBAAA,EAA0B,IAAA,CAAK,MAAA,CAAO,MAAA,CAAO,UAAU,CAAA;AAAA,IAC1E;AAGA,IAAA,IAAI,IAAA,CAAK,WAAW,SAAA,EAAW;AAC3B,MAAA,IAAA,CAAK,MAAA,CAAO,GAAG,CAAA,CAAE,IAAA,EAAK;AAAA,IAC1B;AAAA,EACJ;AACJ;AApCU,eAAA,CAAA;AAAA,EAHLC,mBAAU,MAAA,CAAO;AAAA,IACd,MAAMC,0BAAA,CAAkB;AAAA,GAC3B,CAAA;AAAA,EAEI,qCAASC,gBAAQ,CAAA;AAAA,CAAA,EARb,YAAA,CAOH,SAAA,EAAA,MAAA,CAAA;AAcC,eAAA,CAAA;AAAA,EADNC,kCAAA,CAAa,
|
|
1
|
+
{"version":3,"sources":["../../../../src/middlewares/A-ServerCORS/A_ServerCORS.component.ts"],"names":["A_ServerMiddleware","A_SERVER_DEFAULTS__CorsConfig","A_Feature","A_ServiceFeatures","A_Config","A_HttpServer","A_Request","A_Response"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAcO,MAAM,qBAAqBA,8CAAA,CAAmB;AAAA,EAOjD,MAAM,KACkB,MAAA,EACtB;AACE,IAAA,IAAA,CAAK,MAAA,GAAS;AAAA,MACV,MAAA,EAAQ,MAAA,CAAO,GAAA,CAAI,QAAQ,KAAKC,oDAAA,CAA8B,MAAA;AAAA,MAC9D,OAAA,EAAS,MAAA,CAAO,GAAA,CAAI,SAAS,KAAKA,oDAAA,CAA8B,OAAA;AAAA,MAChE,OAAA,EAAS,MAAA,CAAO,GAAA,CAAI,SAAS,KAAKA,oDAAA,CAA8B,OAAA;AAAA,MAChE,WAAA,EAAa,MAAA,CAAO,GAAA,CAAI,aAAa,KAAKA,oDAAA,CAA8B,WAAA;AAAA,MACxE,MAAA,EAAQ,MAAA,CAAO,GAAA,CAAI,SAAS,KAAKA,oDAAA,CAA8B;AAAA,KACnE;AAAA,EACJ;AAAA,EAIO,KAAA,CACkB,MACC,IAAA,EACxB;AAEE,IAAA,IAAA,CAAK,SAAA,CAAU,6BAAA,EAA+B,IAAA,CAAK,MAAA,CAAO,MAAM,CAAA;AAChE,IAAA,IAAA,CAAK,UAAU,8BAAA,EAAgC,IAAA,CAAK,OAAO,OAAA,CAAQ,IAAA,CAAK,IAAI,CAAC,CAAA;AAC7E,IAAA,IAAA,CAAK,UAAU,8BAAA,EAAgC,IAAA,CAAK,OAAO,OAAA,CAAQ,IAAA,CAAK,IAAI,CAAC,CAAA;AAE7E,IAAA,IAAI,IAAA,CAAK,OAAO,WAAA,EAAa;AACzB,MAAA,IAAA,CAAK,SAAA,CAAU,oCAAoC,MAAM,CAAA;AAAA,IAC7D;AAEA,IAAA,IAAI,IAAA,CAAK,OAAO,MAAA,EAAQ;AACpB,MAAA,IAAA,CAAK,UAAU,wBAAA,EAA0B,IAAA,CAAK,MAAA,CAAO,MAAA,CAAO,UAAU,CAAA;AAAA,IAC1E;AAGA,IAAA,IAAI,IAAA,CAAK,WAAW,SAAA,EAAW;AAC3B,MAAA,IAAA,CAAK,MAAA,CAAO,GAAG,CAAA,CAAE,IAAA,EAAK;AAAA,IAC1B;AAAA,EACJ;AACJ;AApCU,eAAA,CAAA;AAAA,EAHLC,mBAAU,MAAA,CAAO;AAAA,IACd,MAAMC,0BAAA,CAAkB;AAAA,GAC3B,CAAA;AAAA,EAEI,qCAASC,gBAAQ,CAAA;AAAA,CAAA,EARb,YAAA,CAOH,SAAA,EAAA,MAAA,CAAA;AAcC,eAAA,CAAA;AAAA,EADNC,kCAAA,CAAa,eAAA;AAAA,EAET,qCAASC,yBAAS,CAAA,CAAA;AAAA,EAClB,qCAASC,2BAAU,CAAA;AAAA,CAAA,EAvBf,YAAA,CAqBF,SAAA,EAAA,OAAA,CAAA","file":"A_ServerCORS.component.js","sourcesContent":["import { A_Feature, A_Inject } from '@adaas/a-concept';\nimport { A_ServiceFeatures } from '@adaas/a-utils/a-service';\nimport { A_Request } from '@adaas/a-server/request/A-Request.entity';\nimport { A_Response } from '@adaas/a-server/response/A-Response.entity';\nimport { A_HttpServerFeatures } from '@adaas/a-server/server/A-HttpServer.constants';\nimport { A_Config } from '@adaas/a-utils/a-config';\nimport { A_ServerMiddleware } from '@adaas/a-server/middleware/A-ServerMiddleware.component';\nimport { A_SERVER_TYPES__CorsConfig } from './A_ServerCORS.types';\nimport { A_SERVER_DEFAULTS__CorsConfig } from './A_ServerCORS.constants';\nimport { A_HttpServer } from '@adaas/a-server/server/A-HttpServer.container';\n\n\n\n\nexport class A_ServerCORS extends A_ServerMiddleware {\n\n private config!: A_SERVER_TYPES__CorsConfig;\n\n @A_Feature.Extend({\n name: A_ServiceFeatures.onBeforeStart\n })\n async init(\n @A_Inject(A_Config) config: A_Config<['ORIGIN', 'METHODS', 'HEADERS', 'CREDENTIALS', 'MAX_AGE']>,\n ) {\n this.config = {\n origin: config.get('ORIGIN') || A_SERVER_DEFAULTS__CorsConfig.origin,\n methods: config.get('METHODS') || A_SERVER_DEFAULTS__CorsConfig.methods,\n headers: config.get('HEADERS') || A_SERVER_DEFAULTS__CorsConfig.headers,\n credentials: config.get('CREDENTIALS') || A_SERVER_DEFAULTS__CorsConfig.credentials,\n maxAge: config.get('MAX_AGE') || A_SERVER_DEFAULTS__CorsConfig.maxAge,\n };\n }\n\n\n @A_HttpServer.onBeforeRequest\n public apply(\n @A_Inject(A_Request) aReq: A_Request,\n @A_Inject(A_Response) aRes: A_Response,\n ) {\n\n aRes.setHeader('Access-Control-Allow-Origin', this.config.origin);\n aRes.setHeader('Access-Control-Allow-Methods', this.config.methods.join(', '));\n aRes.setHeader('Access-Control-Allow-Headers', this.config.headers.join(', '));\n\n if (this.config.credentials) {\n aRes.setHeader('Access-Control-Allow-Credentials', 'true');\n }\n\n if (this.config.maxAge) {\n aRes.setHeader('Access-Control-Max-Age', this.config.maxAge.toString());\n }\n\n // Handle preflight OPTIONS requests\n if (aReq.method === 'OPTIONS') {\n aRes.status(204).send();\n }\n }\n}\n"]}
|
|
@@ -40,7 +40,7 @@ __decorateClass([
|
|
|
40
40
|
__decorateParam(0, A_Inject(A_Config))
|
|
41
41
|
], A_ServerCORS.prototype, "init", 1);
|
|
42
42
|
__decorateClass([
|
|
43
|
-
A_HttpServer.
|
|
43
|
+
A_HttpServer.onBeforeRequest,
|
|
44
44
|
__decorateParam(0, A_Inject(A_Request)),
|
|
45
45
|
__decorateParam(1, A_Inject(A_Response))
|
|
46
46
|
], A_ServerCORS.prototype, "apply", 1);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/middlewares/A-ServerCORS/A_ServerCORS.component.ts"],"names":[],"mappings":";;;;;;;;;;AAcO,MAAM,qBAAqB,kBAAA,CAAmB;AAAA,EAOjD,MAAM,KACkB,MAAA,EACtB;AACE,IAAA,IAAA,CAAK,MAAA,GAAS;AAAA,MACV,MAAA,EAAQ,MAAA,CAAO,GAAA,CAAI,QAAQ,KAAK,6BAAA,CAA8B,MAAA;AAAA,MAC9D,OAAA,EAAS,MAAA,CAAO,GAAA,CAAI,SAAS,KAAK,6BAAA,CAA8B,OAAA;AAAA,MAChE,OAAA,EAAS,MAAA,CAAO,GAAA,CAAI,SAAS,KAAK,6BAAA,CAA8B,OAAA;AAAA,MAChE,WAAA,EAAa,MAAA,CAAO,GAAA,CAAI,aAAa,KAAK,6BAAA,CAA8B,WAAA;AAAA,MACxE,MAAA,EAAQ,MAAA,CAAO,GAAA,CAAI,SAAS,KAAK,6BAAA,CAA8B;AAAA,KACnE;AAAA,EACJ;AAAA,EAIO,KAAA,CACkB,MACC,IAAA,EACxB;AAEE,IAAA,IAAA,CAAK,SAAA,CAAU,6BAAA,EAA+B,IAAA,CAAK,MAAA,CAAO,MAAM,CAAA;AAChE,IAAA,IAAA,CAAK,UAAU,8BAAA,EAAgC,IAAA,CAAK,OAAO,OAAA,CAAQ,IAAA,CAAK,IAAI,CAAC,CAAA;AAC7E,IAAA,IAAA,CAAK,UAAU,8BAAA,EAAgC,IAAA,CAAK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AA,CAAA","file":"A_ServerCORS.component.mjs","sourcesContent":["import { A_Feature, A_Inject } from '@adaas/a-concept';\nimport { A_ServiceFeatures } from '@adaas/a-utils/a-service';\nimport { A_Request } from '@adaas/a-server/request/A-Request.entity';\nimport { A_Response } from '@adaas/a-server/response/A-Response.entity';\nimport { A_HttpServerFeatures } from '@adaas/a-server/server/A-HttpServer.constants';\nimport { A_Config } from '@adaas/a-utils/a-config';\nimport { A_ServerMiddleware } from '@adaas/a-server/middleware/A-ServerMiddleware.component';\nimport { A_SERVER_TYPES__CorsConfig } from './A_ServerCORS.types';\nimport { A_SERVER_DEFAULTS__CorsConfig } from './A_ServerCORS.constants';\nimport { A_HttpServer } from '@adaas/a-server/server/A-HttpServer.container';\n\n\n\n\nexport class A_ServerCORS extends A_ServerMiddleware {\n\n private config!: A_SERVER_TYPES__CorsConfig;\n\n @A_Feature.Extend({\n name: A_ServiceFeatures.onBeforeStart\n })\n async init(\n @A_Inject(A_Config) config: A_Config<['ORIGIN', 'METHODS', 'HEADERS', 'CREDENTIALS', 'MAX_AGE']>,\n ) {\n this.config = {\n origin: config.get('ORIGIN') || A_SERVER_DEFAULTS__CorsConfig.origin,\n methods: config.get('METHODS') || A_SERVER_DEFAULTS__CorsConfig.methods,\n headers: config.get('HEADERS') || A_SERVER_DEFAULTS__CorsConfig.headers,\n credentials: config.get('CREDENTIALS') || A_SERVER_DEFAULTS__CorsConfig.credentials,\n maxAge: config.get('MAX_AGE') || A_SERVER_DEFAULTS__CorsConfig.maxAge,\n };\n }\n\n\n @A_HttpServer.onBeforeRequest\n public apply(\n @A_Inject(A_Request) aReq: A_Request,\n @A_Inject(A_Response) aRes: A_Response,\n ) {\n\n aRes.setHeader('Access-Control-Allow-Origin', this.config.origin);\n aRes.setHeader('Access-Control-Allow-Methods', this.config.methods.join(', '));\n aRes.setHeader('Access-Control-Allow-Headers', this.config.headers.join(', '));\n\n if (this.config.credentials) {\n aRes.setHeader('Access-Control-Allow-Credentials', 'true');\n }\n\n if (this.config.maxAge) {\n aRes.setHeader('Access-Control-Max-Age', this.config.maxAge.toString());\n }\n\n // Handle preflight OPTIONS requests\n if (aReq.method === 'OPTIONS') {\n aRes.status(204).send();\n }\n }\n}\n"]}
|
|
@@ -12,6 +12,7 @@ import '@adaas/a-utils/a-route';
|
|
|
12
12
|
import '../../lib/A-ServerRoute/A-ServerRoute.types.mjs';
|
|
13
13
|
import '../../lib/A-ServerRoute/A-ServerRoute.constants.mjs';
|
|
14
14
|
import '../../lib/A-ServerEntityList/A-EntityList.types.mjs';
|
|
15
|
+
import '../../lib/A-ServerEntityList/A-EntityListPagination.context.mjs';
|
|
15
16
|
|
|
16
17
|
declare class A_EntityRepository extends A_HTTPChannel {
|
|
17
18
|
execute(command: A_Command, scope: A_Scope): Promise<void>;
|
|
@@ -12,6 +12,7 @@ import '@adaas/a-utils/a-route';
|
|
|
12
12
|
import '../../lib/A-ServerRoute/A-ServerRoute.types.js';
|
|
13
13
|
import '../../lib/A-ServerRoute/A-ServerRoute.constants.js';
|
|
14
14
|
import '../../lib/A-ServerEntityList/A-EntityList.types.js';
|
|
15
|
+
import '../../lib/A-ServerEntityList/A-EntityListPagination.context.js';
|
|
15
16
|
|
|
16
17
|
declare class A_EntityRepository extends A_HTTPChannel {
|
|
17
18
|
execute(command: A_Command, scope: A_Scope): Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A_Component, A_Entity, A_Feature, A_Inject,
|
|
1
|
+
import { A_Component, A_Entity, A_Feature, A_Inject, A_Scope, A_TYPES__EntityFeatures, } from "@adaas/a-concept";
|
|
2
2
|
import { User } from "../entities/User/User.entity";
|
|
3
3
|
import { UserJSON } from "../entities/User/User.entity.types";
|
|
4
4
|
import { SignInCommand } from "../commands/SignIn.command";
|
|
@@ -49,7 +49,7 @@ export class UsersRepository extends A_Component {
|
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
@A_Feature.Extend({
|
|
52
|
-
name:
|
|
52
|
+
name: A_TYPES__EntityFeatures.LOAD,
|
|
53
53
|
scope: [A_ServerEntityList]
|
|
54
54
|
})
|
|
55
55
|
list(
|