@atlantjs/arch 3.2.19 → 3.2.21

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.
@@ -1,9 +1,9 @@
1
+ import { Response } from "express";
1
2
  import { FailureAbstract } from "../../application/failures/failure.abstract";
2
3
  import { HttpStatusCodes } from "../../domain/enums/http-status-codes.enum";
3
4
  import { ResponseAbstract } from "./responses/response.abstract";
4
- import { Response } from "express";
5
5
  export declare abstract class ControllerAbstract {
6
- protected readonly response: Response;
6
+ protected abstract readonly response: Response;
7
7
  abstract handler(...args: unknown[]): Promise<Response>;
8
8
  protected onSuccess<Payload extends ResponseAbstract>(payload?: Payload, httpStatusCode?: HttpStatusCodes): Response;
9
9
  protected onFailure(failure: FailureAbstract, httpStatusCode?: HttpStatusCodes): Response;
@@ -5,13 +5,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
6
  return c > 3 && r && Object.defineProperty(target, key, r), r;
7
7
  };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
8
  Object.defineProperty(exports, "__esModule", { value: true });
12
9
  exports.ControllerAbstract = void 0;
13
- const http_status_codes_enum_1 = require("../../domain/enums/http-status-codes.enum");
14
10
  const routing_controllers_1 = require("routing-controllers");
11
+ const http_status_codes_enum_1 = require("../../domain/enums/http-status-codes.enum");
15
12
  let ControllerAbstract = class ControllerAbstract {
16
13
  onSuccess(payload, httpStatusCode = http_status_codes_enum_1.HttpStatusCodes.OK) {
17
14
  return this.response.status(httpStatusCode).send(payload?.toPlain() ?? {});
@@ -21,10 +18,6 @@ let ControllerAbstract = class ControllerAbstract {
21
18
  }
22
19
  };
23
20
  exports.ControllerAbstract = ControllerAbstract;
24
- __decorate([
25
- (0, routing_controllers_1.Res)(),
26
- __metadata("design:type", Object)
27
- ], ControllerAbstract.prototype, "response", void 0);
28
21
  exports.ControllerAbstract = ControllerAbstract = __decorate([
29
22
  (0, routing_controllers_1.JsonController)()
30
23
  ], ControllerAbstract);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlantjs/arch",
3
- "version": "3.2.19",
3
+ "version": "3.2.21",
4
4
  "main": "index.js",
5
5
  "license": "UNLICENSED",
6
6
  "publishConfig": {
@@ -48,6 +48,7 @@
48
48
  "module-alias": "^2.2.3",
49
49
  "reflect-metadata": "^0.2.2",
50
50
  "routing-controllers": "^0.10.4",
51
+ "routing-controllers-openapi": "^4.0.0",
51
52
  "typeorm": "^0.3.20",
52
53
  "uuid": "^10.0.0"
53
54
  },