@clairejs/server 3.25.0 → 3.25.1

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ## Change Log
2
2
 
3
- #### 3.25.0
3
+ #### 3.25.1
4
4
 
5
5
  - add other security access condition classes
6
6
 
@@ -5,6 +5,7 @@ import { AbstractAccessCondition } from "../../http/security/abstract-access-con
5
5
  export interface EndpointMetadata extends ApiInfo, ObjectFieldMetadata {
6
6
  controller: any;
7
7
  accessConditionCls?: Constructor<AbstractAccessCondition<any>>[];
8
+ accessConditionInstances?: AbstractAccessCondition<any>[];
8
9
  params?: {
9
10
  [index: number]: {
10
11
  source?: RequestDataSource;
@@ -53,7 +53,8 @@ export class AbstractHttpRequestHandler {
53
53
  this.logger?.warn(`Implicit overriding endpoint: ${overridingEndpoint.method}:${overridingEndpoint.mount} of ${overridingEndpoint.controller?.constructor.name}:${overridingEndpoint.name}`, `Ignore ${endpointInfo.method}:${endpointInfo.mount} of ${endpointInfo.controller?.constructor.name}:${endpointInfo.name}`);
54
54
  }
55
55
  else {
56
- endpointInfo.accessConditions = endpointInfo.accessConditionCls?.map((cls) => injector.resolve(cls).getConditionMetadata());
56
+ endpointInfo.accessConditionInstances = endpointInfo.accessConditionCls?.map((cls) => injector.resolve(cls));
57
+ endpointInfo.accessConditions = endpointInfo.accessConditionInstances?.map((instance) => instance.getConditionMetadata());
57
58
  mountedEndpointInfo.push(endpointInfo);
58
59
  }
59
60
  }
@@ -11,7 +11,7 @@ export const getApiInfo = async () => {
11
11
  socketManager ? socketManager.getMountedEndpointInfo() : Promise.resolve([]),
12
12
  ]);
13
13
  const result = {
14
- apis: [...httpInfo, ...socketInfo].map(({ controller, params, injecteeSuperClass, accessConditionCls, ...api }) => api),
14
+ apis: [...httpInfo, ...socketInfo].map(({ controller, params, injecteeSuperClass, accessConditionCls, accessConditionInstances, ...api }) => api),
15
15
  };
16
16
  await injector.initInstances();
17
17
  return result;
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export * from "./common/request/endpoint-metadata";
5
5
  export * from "./common/request/RequestOptions";
6
6
  export * from "./common/ControllerMetadata";
7
7
  export * from "./common/decorator";
8
+ export * from "./http/common/dto";
8
9
  export * from "./http/common/HttpResponse";
9
10
  export * from "./http/decorators";
10
11
  export * from "./http/common/HttpRequest";
package/dist/index.js CHANGED
@@ -7,6 +7,7 @@ export * from "./common/request/RequestOptions";
7
7
  export * from "./common/ControllerMetadata";
8
8
  export * from "./common/decorator";
9
9
  //-- http & security
10
+ export * from "./http/common/dto";
10
11
  export * from "./http/common/HttpResponse";
11
12
  export * from "./http/decorators";
12
13
  export * from "./http/common/HttpRequest";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clairejs/server",
3
- "version": "3.25.0",
3
+ "version": "3.25.1",
4
4
  "description": "Claire server NodeJs framework written in Typescript.",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",