c2-http 1.0.52 → 1.0.53

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/index.d.ts CHANGED
@@ -1,9 +1,11 @@
1
1
  import { getMessage, initializei18n } from "./i18n";
2
2
  import { Controller, HttpDispatchDownload, HttpDispatchHandling, OpenApi } from "./model/Controller";
3
+ import { ControllerRoleMiddleware } from "./model/ControllerRoleMiddleware";
4
+ import { ControllerRoute, IOpenApiPath } from "./model/ControllerRoute";
3
5
  import { CrudController } from "./model/CrudController";
4
6
  import { HttpError } from "./model/HttpError";
5
7
  import { IControllerOptions } from "./model/IControllerOptions";
6
8
  import { ICrudControllerOptions } from "./model/ICrudControllerOptions";
7
9
  import { IServerConfig, Server } from "./model/Server";
8
10
  export declare const convertErrorToHttpError: (error: any) => HttpError;
9
- export { Controller, CrudController, HttpDispatchDownload, HttpDispatchHandling, IControllerOptions, ICrudControllerOptions, IServerConfig, OpenApi, Server, getMessage, initializei18n };
11
+ export { Controller, ControllerRoleMiddleware, ControllerRoute, CrudController, HttpDispatchDownload, HttpDispatchHandling, IControllerOptions, ICrudControllerOptions, IOpenApiPath, IServerConfig, OpenApi, Server, getMessage, initializei18n };
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.initializei18n = exports.getMessage = exports.Server = exports.OpenApi = exports.HttpDispatchHandling = exports.HttpDispatchDownload = exports.CrudController = exports.Controller = exports.convertErrorToHttpError = void 0;
6
+ exports.initializei18n = exports.getMessage = exports.Server = exports.OpenApi = exports.HttpDispatchHandling = exports.HttpDispatchDownload = exports.CrudController = exports.ControllerRoute = exports.ControllerRoleMiddleware = exports.Controller = exports.convertErrorToHttpError = void 0;
7
7
  const axios_1 = __importDefault(require("axios"));
8
8
  const express_http_context_1 = __importDefault(require("express-http-context"));
9
9
  const http_status_1 = require("http-status");
@@ -17,6 +17,10 @@ Object.defineProperty(exports, "Controller", { enumerable: true, get: function (
17
17
  Object.defineProperty(exports, "HttpDispatchDownload", { enumerable: true, get: function () { return Controller_1.HttpDispatchDownload; } });
18
18
  Object.defineProperty(exports, "HttpDispatchHandling", { enumerable: true, get: function () { return Controller_1.HttpDispatchHandling; } });
19
19
  Object.defineProperty(exports, "OpenApi", { enumerable: true, get: function () { return Controller_1.OpenApi; } });
20
+ const ControllerRoleMiddleware_1 = require("./model/ControllerRoleMiddleware");
21
+ Object.defineProperty(exports, "ControllerRoleMiddleware", { enumerable: true, get: function () { return ControllerRoleMiddleware_1.ControllerRoleMiddleware; } });
22
+ const ControllerRoute_1 = require("./model/ControllerRoute");
23
+ Object.defineProperty(exports, "ControllerRoute", { enumerable: true, get: function () { return ControllerRoute_1.ControllerRoute; } });
20
24
  const CrudController_1 = require("./model/CrudController");
21
25
  Object.defineProperty(exports, "CrudController", { enumerable: true, get: function () { return CrudController_1.CrudController; } });
22
26
  const HttpError_1 = require("./model/HttpError");
@@ -17,12 +17,10 @@ class Server {
17
17
  async initialize(callback) {
18
18
  (0, i18n_1.initializei18n)(this.config.i18n);
19
19
  console.log(`Initializing server on ${this.config.port}...`);
20
- // this.app.use(Router().get("/docs", swaggerUI.serve, swaggerUI.setup(Controller.openApi)))
21
20
  this.config.globalMiddleware(this.app);
22
21
  for (const router of this.config.routes) {
23
22
  this.app.use(router);
24
23
  }
25
- // this.app.use(this.config.tokenCheckMiddleware)
26
24
  for (const router of this.config.routesWithToken) {
27
25
  router.use(this.config.tokenCheckMiddleware);
28
26
  this.app.use(router);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-http",
3
- "version": "1.0.52",
3
+ "version": "1.0.53",
4
4
  "description": "Biblioteca Typescript para API NodeJS",
5
5
  "repository": "https://cabralsilva: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@github.com/cabralsilva/c2-http.git",
6
6
  "author": "Daniel Cabral <cabralconsultoriaemsoftware@gmail.com>",