@clairejs/server 3.3.27 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/.prettierrc +8 -8
  2. package/README.md +643 -639
  3. package/dist/common/FileOperation.d.ts +5 -5
  4. package/dist/common/ServerModelMetadata.d.ts +10 -10
  5. package/dist/common/auth/AbstractPrincipalResolver.d.ts +4 -4
  6. package/dist/common/auth/IPrincipal.d.ts +4 -4
  7. package/dist/common/constants.d.ts +1 -1
  8. package/dist/common/request/EndpointMetadata.d.ts +40 -40
  9. package/dist/common/request/HttpData.d.ts +1 -1
  10. package/dist/common/request/HttpEndpoint.d.ts +8 -8
  11. package/dist/common/request/JobData.d.ts +1 -1
  12. package/dist/common/request/MountedEndpointInfo.d.ts +6 -6
  13. package/dist/common/request/RequestOptions.d.ts +6 -6
  14. package/dist/common/request/SocketData.d.ts +1 -1
  15. package/dist/common/request/types.d.ts +1 -1
  16. package/dist/database/QueryOperator.d.ts +15 -15
  17. package/dist/database/adapter/AbstractDatabaseAdapter.d.ts +20 -20
  18. package/dist/database/adapter/AbstractQuery.d.ts +53 -53
  19. package/dist/database/adapter/DefaultSqlDatabaseAdapter.d.ts +17 -17
  20. package/dist/database/adapter/IQuery.d.ts +77 -77
  21. package/dist/database/adapter/IQueryProvider.d.ts +9 -9
  22. package/dist/database/adapter/aggregators.d.ts +21 -21
  23. package/dist/database/adapter/providers.d.ts +8 -8
  24. package/dist/database/decorators.d.ts +2 -2
  25. package/dist/database/migrator/AbstractDatabaseMigrator.d.ts +4 -4
  26. package/dist/database/migrator/DefaultSqlDatabaseMigrator.d.ts +27 -27
  27. package/dist/database/transaction/ITransaction.d.ts +10 -10
  28. package/dist/database/transaction/ITransactionFactory.d.ts +4 -4
  29. package/dist/database/transaction/ITransactionProvider.d.ts +4 -4
  30. package/dist/database/transaction/TransactionLink.d.ts +14 -14
  31. package/dist/database/transaction/TransactionObjectMetadata.d.ts +4 -4
  32. package/dist/database/transaction/TransactionState.d.ts +5 -5
  33. package/dist/database/util/transaction-provider.d.ts +1 -1
  34. package/dist/http/auth/AbstractHttpAuthorizationProvider.d.ts +9 -9
  35. package/dist/http/auth/AbstractRbacAuthProvider.d.ts +18 -18
  36. package/dist/http/auth/RedisRbacAuthProvider.d.ts +23 -23
  37. package/dist/http/auth/SocketRbacAuthProvider.d.ts +25 -25
  38. package/dist/http/auth/rbac.d.ts +34 -34
  39. package/dist/http/common/HttpRequest.d.ts +37 -37
  40. package/dist/http/common/HttpResponse.d.ts +25 -25
  41. package/dist/http/controller/AbstractHttpController.d.ts +10 -10
  42. package/dist/http/controller/AbstractHttpMiddleware.d.ts +5 -5
  43. package/dist/http/controller/AbstractHttpRequestHandler.d.ts +16 -16
  44. package/dist/http/controller/ControllerMetadata.d.ts +6 -6
  45. package/dist/http/controller/CrudHttpController.d.ts +56 -56
  46. package/dist/http/controller/DefaultHttpRequestHandler.d.ts +19 -19
  47. package/dist/http/decorators.d.ts +32 -32
  48. package/dist/http/file-upload/AbstractFileUploadHandler.d.ts +6 -6
  49. package/dist/http/file-upload/FileUploadHandler.d.ts +10 -10
  50. package/dist/http/file-upload/types.d.ts +3 -3
  51. package/dist/http/repository/AbstractRepository.d.ts +10 -10
  52. package/dist/http/repository/DtoRepository.d.ts +60 -60
  53. package/dist/http/repository/ICrudRepository.d.ts +29 -29
  54. package/dist/http/repository/ModelRepository.d.ts +39 -39
  55. package/dist/http/security/AbstractAccessCondition.d.ts +7 -7
  56. package/dist/http/security/access-conditions/DtoFieldValidation.d.ts +4 -4
  57. package/dist/http/security/access-conditions/FilterModelFieldAccessCondition.d.ts +4 -4
  58. package/dist/http/security/access-conditions/MaximumQueryLimit.d.ts +8 -8
  59. package/dist/index.d.ts +69 -61
  60. package/dist/index.js +1 -1
  61. package/dist/job/AbstractJobController.d.ts +4 -2
  62. package/dist/job/AbstractJobExecutor.d.ts +4 -0
  63. package/dist/job/AbstractJobScheduler.d.ts +9 -0
  64. package/dist/job/AwsJobExecutor.d.ts +5 -0
  65. package/dist/job/LocalJobExecutor.d.ts +5 -0
  66. package/dist/job/LocalJobScheduler.d.ts +14 -0
  67. package/dist/job/decorators.d.ts +3 -0
  68. package/dist/job/interfaces.d.ts +16 -0
  69. package/dist/logging/FileLogMedium.d.ts +13 -13
  70. package/dist/service/AbstractCacheService.d.ts +22 -22
  71. package/dist/service/AbstractFileService.d.ts +8 -8
  72. package/dist/service/AbstractService.d.ts +8 -8
  73. package/dist/socket/AbstractServerSocket.d.ts +19 -19
  74. package/dist/socket/AbstractServerSocketManager.d.ts +42 -42
  75. package/dist/socket/AbstractSocketConnectionHandler.d.ts +6 -6
  76. package/dist/socket/AbstractSocketController.d.ts +14 -14
  77. package/dist/socket/AwsSocketManager.d.ts +34 -34
  78. package/dist/socket/IServerSocket.d.ts +16 -16
  79. package/dist/socket/LocalSocketManager.d.ts +42 -42
  80. package/dist/system/ClaireServer.d.ts +13 -13
  81. package/dist/system/ExpressWrapper.d.ts +17 -17
  82. package/dist/system/LambdaWrapper.d.ts +19 -19
  83. package/dist/system/ServerGlobalStore.d.ts +5 -5
  84. package/dist/system/errors.d.ts +14 -14
  85. package/dist/system/lamba-request-mapper.d.ts +12 -12
  86. package/package.json +61 -59
  87. package/dist/job/AbstractJobManager.d.ts +0 -5
  88. package/dist/job/Job.d.ts +0 -4
  89. package/dist/job/RedisJobManager.d.ts +0 -6
  90. package/dist/job/SnsJobManager.d.ts +0 -6
@@ -1,19 +1,19 @@
1
- import { RequestOptions } from "../common/request/RequestOptions";
2
- import { ClaireServer } from "./ClaireServer";
3
- interface LambdaResponse {
4
- statusCode: number;
5
- body: string;
6
- headers: any;
7
- }
8
- export declare class LambdaWrapper {
9
- readonly serverFactory: () => Promise<ClaireServer>;
10
- readonly requestMapper: (event: any) => RequestOptions | undefined;
11
- private readonly injector;
12
- private readonly httpRequestHandler?;
13
- private readonly socketManager?;
14
- private _server?;
15
- constructor(serverFactory: () => Promise<ClaireServer>, requestMapper: (event: any) => RequestOptions | undefined);
16
- private bootServer;
17
- handler(event: any): Promise<LambdaResponse>;
18
- }
19
- export {};
1
+ import { RequestOptions } from "../common/request/RequestOptions";
2
+ import { ClaireServer } from "./ClaireServer";
3
+ interface LambdaResponse {
4
+ statusCode: number;
5
+ body: string;
6
+ headers: any;
7
+ }
8
+ export declare class LambdaWrapper {
9
+ readonly serverFactory: () => Promise<ClaireServer>;
10
+ readonly requestMapper: (event: any) => RequestOptions | undefined;
11
+ private readonly injector;
12
+ private readonly httpRequestHandler?;
13
+ private readonly socketManager?;
14
+ private _server?;
15
+ constructor(serverFactory: () => Promise<ClaireServer>, requestMapper: (event: any) => RequestOptions | undefined);
16
+ private bootServer;
17
+ handler(event: any): Promise<LambdaResponse>;
18
+ }
19
+ export {};
@@ -1,5 +1,5 @@
1
- import { CoreGlobalStore } from "@clairejs/core";
2
- import { MountedEndpointInfo } from "../common/request/MountedEndpointInfo";
3
- export interface ServerGlobalStore extends CoreGlobalStore {
4
- mountedEndpointInfo?: MountedEndpointInfo[];
5
- }
1
+ import { CoreGlobalStore } from "@clairejs/core";
2
+ import { MountedEndpointInfo } from "../common/request/MountedEndpointInfo";
3
+ export interface ServerGlobalStore extends CoreGlobalStore {
4
+ mountedEndpointInfo?: MountedEndpointInfo[];
5
+ }
@@ -1,14 +1,14 @@
1
- export declare const Errors: {
2
- TFA_REQUIRED: string;
3
- SYSTEM_ERROR: string;
4
- HTTP_REQUEST_ERROR: string;
5
- SESSION_EXPIRED: string;
6
- ACCESS_DENIED: string;
7
- AUTHENTICATION_ERROR: string;
8
- NOT_FOUND: string;
9
- VALIDATION_ERROR: string;
10
- BAD_STATE: string;
11
- QUERY_ERROR: string;
12
- REQUEST_RATE_LIMIT: string;
13
- CANNOT_LOCK: string;
14
- };
1
+ export declare const Errors: {
2
+ TFA_REQUIRED: string;
3
+ SYSTEM_ERROR: string;
4
+ HTTP_REQUEST_ERROR: string;
5
+ SESSION_EXPIRED: string;
6
+ ACCESS_DENIED: string;
7
+ AUTHENTICATION_ERROR: string;
8
+ NOT_FOUND: string;
9
+ VALIDATION_ERROR: string;
10
+ BAD_STATE: string;
11
+ QUERY_ERROR: string;
12
+ REQUEST_RATE_LIMIT: string;
13
+ CANNOT_LOCK: string;
14
+ };
@@ -1,12 +1,12 @@
1
- import { HttpMethod, SocketMethod } from "@clairejs/core";
2
- export declare const lambdaRequestMapper: (event: any) => {
3
- method: SocketMethod;
4
- rawPath: any;
5
- body: any;
6
- headers?: undefined;
7
- } | {
8
- method: HttpMethod;
9
- rawPath: string;
10
- body: any;
11
- headers: any;
12
- };
1
+ import { HttpMethod, SocketMethod } from "@clairejs/core";
2
+ export declare const lambdaRequestMapper: (event: any) => {
3
+ method: SocketMethod;
4
+ rawPath: any;
5
+ body: any;
6
+ headers?: undefined;
7
+ } | {
8
+ method: HttpMethod;
9
+ rawPath: string;
10
+ body: any;
11
+ headers: any;
12
+ };
package/package.json CHANGED
@@ -1,59 +1,61 @@
1
- {
2
- "name": "@clairejs/server",
3
- "version": "3.3.27",
4
- "description": "Claire server NodeJs framework written in Typescript.",
5
- "types": "dist/index.d.ts",
6
- "main": "dist/index.js",
7
- "scripts": {
8
- "test-db": "mocha -r ts-node/register ./test/database/database.test.ts",
9
- "test-http": "mocha -r ts-node/register ./test/e2e/e2e.test.ts",
10
- "test-socket": "mocha -r ts-node/register ./test/socket/socket.test.ts",
11
- "test": "npm run test-db && npm run test-http && npm run test-socket",
12
- "build": "rm -rf ./dist && webpack --mode production --display-modules",
13
- "push": "npm run build && npm test && npm publish && git push"
14
- },
15
- "author": "immort",
16
- "license": "ISC",
17
- "dependencies": {
18
- "aws-sdk": "^2.841.0",
19
- "cors": "^2.8.5",
20
- "express": "^4.17.1",
21
- "express-fileupload": "^1.2.1",
22
- "mysql2": "^2.2.5",
23
- "parseurl": "^1.3.3",
24
- "path-to-regexp": "^6.2.0",
25
- "pg": "^8.5.1",
26
- "pg-hstore": "^2.3.4",
27
- "query-string": "^6.14.0",
28
- "redis": "^4.1.1",
29
- "reflect-metadata": "^0.1.13",
30
- "sequelize": "^6.5.0",
31
- "sequelize-cli": "^6.2.0",
32
- "ws": "^7.5.5"
33
- },
34
- "peerDependencies": {
35
- "@clairejs/core": "^3.1.7"
36
- },
37
- "devDependencies": {
38
- "@types/body-parser": "^1.19.0",
39
- "@types/cors": "^2.8.9",
40
- "@types/express": "^4.17.11",
41
- "@types/express-fileupload": "^1.1.6",
42
- "@types/mocha": "^8.2.2",
43
- "@types/node": "^14.14.25",
44
- "@types/parseurl": "^1.3.1",
45
- "@types/validator": "^13.1.3",
46
- "@types/webpack-env": "^1.16.0",
47
- "@types/ws": "^7.4.0",
48
- "axios": "^0.21.1",
49
- "mocha": "^8.3.2",
50
- "terser-webpack-plugin": "^4.2.3",
51
- "ts-loader": "^8.0.17",
52
- "ts-node": "^9.1.1",
53
- "tslib": "^2.1.0",
54
- "typescript": "^4.4.4",
55
- "webpack": "^4.46.0",
56
- "webpack-cli": "^3.3.12",
57
- "webpack-node-externals": "^2.5.1"
58
- }
59
- }
1
+ {
2
+ "name": "@clairejs/server",
3
+ "version": "3.4.0",
4
+ "description": "Claire server NodeJs framework written in Typescript.",
5
+ "types": "dist/index.d.ts",
6
+ "main": "dist/index.js",
7
+ "scripts": {
8
+ "test-db": "mocha -r ts-node/register ./test/database/database.test.ts",
9
+ "test-http": "mocha -r ts-node/register ./test/e2e/e2e.test.ts",
10
+ "test-socket": "mocha -r ts-node/register ./test/socket/socket.test.ts",
11
+ "test": "npm run test-db && npm run test-http && npm run test-socket",
12
+ "build": "rm -rf ./dist && webpack --mode production --display-modules",
13
+ "push": "npm run build && npm test && npm publish && git push"
14
+ },
15
+ "author": "immort",
16
+ "license": "ISC",
17
+ "dependencies": {
18
+ "aws-sdk": "^2.841.0",
19
+ "cors": "^2.8.5",
20
+ "express": "^4.17.1",
21
+ "express-fileupload": "^1.2.1",
22
+ "mysql2": "^2.2.5",
23
+ "node-cron": "^3.0.1",
24
+ "parseurl": "^1.3.3",
25
+ "path-to-regexp": "^6.2.0",
26
+ "pg": "^8.5.1",
27
+ "pg-hstore": "^2.3.4",
28
+ "query-string": "^6.14.0",
29
+ "redis": "^4.1.1",
30
+ "reflect-metadata": "^0.1.13",
31
+ "sequelize": "^6.5.0",
32
+ "sequelize-cli": "^6.2.0",
33
+ "ws": "^7.5.5"
34
+ },
35
+ "peerDependencies": {
36
+ "@clairejs/core": "^3.1.7"
37
+ },
38
+ "devDependencies": {
39
+ "@types/body-parser": "^1.19.0",
40
+ "@types/cors": "^2.8.9",
41
+ "@types/express": "^4.17.11",
42
+ "@types/express-fileupload": "^1.1.6",
43
+ "@types/mocha": "^8.2.2",
44
+ "@types/node": "^14.14.25",
45
+ "@types/node-cron": "^3.0.2",
46
+ "@types/parseurl": "^1.3.1",
47
+ "@types/validator": "^13.1.3",
48
+ "@types/webpack-env": "^1.16.0",
49
+ "@types/ws": "^7.4.0",
50
+ "axios": "^0.21.1",
51
+ "mocha": "^8.3.2",
52
+ "terser-webpack-plugin": "^4.2.3",
53
+ "ts-loader": "^8.0.17",
54
+ "ts-node": "^9.1.1",
55
+ "tslib": "^2.1.0",
56
+ "typescript": "^4.4.4",
57
+ "webpack": "^4.46.0",
58
+ "webpack-cli": "^3.3.12",
59
+ "webpack-node-externals": "^2.5.1"
60
+ }
61
+ }
@@ -1,5 +0,0 @@
1
- import { Job } from "./Job";
2
- export declare abstract class AbstractJobManager {
3
- abstract publishJobs(jobs: Job[]): Promise<void>;
4
- abstract retrieveJob(): Promise<Job | undefined>;
5
- }
package/dist/job/Job.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export interface Job {
2
- name: string;
3
- data: any;
4
- }
@@ -1,6 +0,0 @@
1
- import { AbstractJobManager } from "./AbstractJobManager";
2
- import { Job } from "./Job";
3
- export declare class RedisJobManager extends AbstractJobManager {
4
- publishJobs(jobs: Job[]): Promise<void>;
5
- retrieveJob(): Promise<Job | undefined>;
6
- }
@@ -1,6 +0,0 @@
1
- import { AbstractJobManager } from "./AbstractJobManager";
2
- import { Job } from "./Job";
3
- export declare class SnsJobManager extends AbstractJobManager {
4
- publishJobs(jobs: Job[]): Promise<void>;
5
- retrieveJob(): Promise<Job | undefined>;
6
- }