@onylab/common-api 0.1.177 → 0.1.178

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.
@@ -647,6 +647,55 @@ declare module "@onylab/common-api" {
647
647
  import * as Util from "util/index";
648
648
  export { Constant, Exception, Http, Service, Template, Tool, Util };
649
649
  }
650
+ declare module "exception/ForbiddenException" {
651
+ import { MainException } from "exception/MainException";
652
+ import { ExceptionContract } from "exception/ExceptionContract";
653
+ export class ForbiddenException extends MainException implements ExceptionContract {
654
+ static readonly ERROR_CODE: number;
655
+ constructor(message: string, data?: {
656
+ [key: string]: any;
657
+ });
658
+ }
659
+ }
660
+ declare module "http/AuthenticationMiddlewareContract" {
661
+ import * as express from 'express';
662
+ export interface AuthenticationMiddlewareContract {
663
+ handler(): (request: express.Request, response: express.Response, next: () => void) => void;
664
+ }
665
+ }
666
+ declare module "http/AuthentificationConfigurationContract" {
667
+ export interface AuthentificationConfigurationContract {
668
+ jwt?: {};
669
+ key?: {
670
+ secret: string;
671
+ };
672
+ session?: {
673
+ required: string[];
674
+ };
675
+ }
676
+ }
677
+ declare module "http/AuthenticationMiddleware" {
678
+ import * as express from 'express';
679
+ import { AuthenticationMiddlewareContract } from "http/AuthenticationMiddlewareContract";
680
+ import { AuthentificationConfigurationContract } from "http/AuthentificationConfigurationContract";
681
+ export class AuthenticationMiddleware implements AuthenticationMiddlewareContract {
682
+ private configuration;
683
+ constructor(configuration: AuthentificationConfigurationContract);
684
+ handler(): (request: express.Request, response: express.Response, next: () => void) => void;
685
+ private authApiKey;
686
+ }
687
+ }
688
+ declare module "http/AuthorizationMiddlewareContract" {
689
+ export interface AuthorizationMiddlewareContract {
690
+ can(action: string, subject: string): void;
691
+ }
692
+ }
693
+ declare module "http/AuthorizationMiddleware" {
694
+ import { AuthorizationMiddlewareContract } from "http/AuthorizationMiddlewareContract";
695
+ export class AuthorizationMiddleware implements AuthorizationMiddlewareContract {
696
+ can(_action: string, _subject: string): void;
697
+ }
698
+ }
650
699
  declare module "service/sender/EmailSenderApiMockup" {
651
700
  export class EmailSenderApiMockup {
652
701
  private static readonly BASE_API_URL;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Common API",
4
4
  "main": "dist/common-api.node.min.js",
5
5
  "types": "dist/common-api.d.ts",
6
- "version": "0.1.177",
6
+ "version": "0.1.178",
7
7
  "author": "Paul M.",
8
8
  "license": "NO LICENSE",
9
9
  "engines": {