@mini2/core 1.0.2 → 1.0.5
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 +75 -2
- package/dist/app.d.ts +14 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/app.js +65 -0
- package/dist/app.js.map +1 -0
- package/dist/container.d.ts +4 -0
- package/dist/container.d.ts.map +1 -0
- package/dist/container.js +11 -0
- package/dist/container.js.map +1 -0
- package/dist/expections/http.expection.d.ts +79 -0
- package/dist/expections/http.expection.d.ts.map +1 -0
- package/dist/expections/http.expection.js +140 -0
- package/dist/expections/http.expection.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +52 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/app.interface.d.ts +6 -0
- package/dist/interfaces/app.interface.d.ts.map +1 -0
- package/dist/interfaces/app.interface.js +3 -0
- package/dist/interfaces/app.interface.js.map +1 -0
- package/dist/interfaces/authenticated.interface.d.ts +5 -0
- package/dist/interfaces/authenticated.interface.d.ts.map +1 -0
- package/dist/interfaces/authenticated.interface.js +3 -0
- package/dist/interfaces/authenticated.interface.js.map +1 -0
- package/dist/interfaces/config.interface.d.ts +6 -0
- package/dist/interfaces/config.interface.d.ts.map +1 -0
- package/dist/interfaces/config.interface.js +3 -0
- package/dist/interfaces/config.interface.js.map +1 -0
- package/dist/interfaces/queue.interface.d.ts +6 -0
- package/dist/interfaces/queue.interface.d.ts.map +1 -0
- package/dist/interfaces/queue.interface.js +3 -0
- package/dist/interfaces/queue.interface.js.map +1 -0
- package/dist/interfaces/repository.interface.d.ts +34 -0
- package/dist/interfaces/repository.interface.d.ts.map +1 -0
- package/dist/interfaces/repository.interface.js +3 -0
- package/dist/interfaces/repository.interface.js.map +1 -0
- package/dist/middlewares/authenticated.middleware.d.ts +4 -0
- package/dist/middlewares/authenticated.middleware.d.ts.map +1 -0
- package/dist/middlewares/authenticated.middleware.js +14 -0
- package/dist/middlewares/authenticated.middleware.js.map +1 -0
- package/dist/middlewares/authorized.middleware.d.ts +7 -0
- package/dist/middlewares/authorized.middleware.d.ts.map +1 -0
- package/dist/middlewares/authorized.middleware.js +16 -0
- package/dist/middlewares/authorized.middleware.js.map +1 -0
- package/dist/middlewares/validation.middleware.d.ts +4 -0
- package/dist/middlewares/validation.middleware.d.ts.map +1 -0
- package/dist/middlewares/validation.middleware.js +65 -0
- package/dist/middlewares/validation.middleware.js.map +1 -0
- package/dist/response-builder.d.ts +26 -0
- package/dist/response-builder.d.ts.map +1 -0
- package/dist/response-builder.js +45 -0
- package/dist/response-builder.js.map +1 -0
- package/dist/rest.d.ts +43 -0
- package/dist/rest.d.ts.map +1 -0
- package/dist/rest.js +213 -0
- package/dist/rest.js.map +1 -0
- package/dist/swagger.d.ts +30 -0
- package/dist/swagger.d.ts.map +1 -0
- package/dist/swagger.js +214 -0
- package/dist/swagger.js.map +1 -0
- package/dist/types.d.ts +4 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/array-unify.d.ts +2 -0
- package/dist/utils/array-unify.d.ts.map +1 -0
- package/dist/utils/array-unify.js +8 -0
- package/dist/utils/array-unify.js.map +1 -0
- package/dist/utils/math.d.ts +2 -0
- package/dist/utils/math.d.ts.map +1 -0
- package/dist/utils/math.js +7 -0
- package/dist/utils/math.js.map +1 -0
- package/package.json +38 -6
- package/__tests__/controller.test.ts +0 -349
- package/app.ts +0 -51
- package/container.ts +0 -7
- package/expections/http.expection.ts +0 -147
- package/interfaces/app.interface.ts +0 -6
- package/interfaces/authenticated.interface.ts +0 -3
- package/interfaces/config.interface.ts +0 -5
- package/interfaces/queue.interface.ts +0 -5
- package/interfaces/repository.interface.ts +0 -32
- package/middlewares/authenticated.middleware.ts +0 -15
- package/middlewares/authorized.middleware.ts +0 -19
- package/middlewares/validation.middleware.ts +0 -76
- package/response-builder.ts +0 -61
- package/rest.ts +0 -254
- package/swagger.ts +0 -265
- package/types.ts +0 -3
- package/utils/array-unify.ts +0 -4
- package/utils/math.ts +0 -3
package/Readme.MD
CHANGED
|
@@ -1,3 +1,76 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @mini2/core
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Mini Express Framework - Express.js tabanlı hafif ve modüler web framework'ü. TypeScript desteği, otomatik Swagger dokümantasyonu ve dependency injection özelliklerine sahiptir.
|
|
4
|
+
|
|
5
|
+
## Kurulum
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @mini2/core
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Temel Kullanım
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { App, IConfig } from '@mini2/core';
|
|
15
|
+
|
|
16
|
+
// Konfigürasyon
|
|
17
|
+
const config: IConfig = {
|
|
18
|
+
port: 3000,
|
|
19
|
+
host: 'localhost',
|
|
20
|
+
applicationName: 'My API',
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// Controller'ları tanımlayın
|
|
24
|
+
const controllers = [
|
|
25
|
+
// Controller sınıflarınız buraya gelecek
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
// Uygulamayı başlatın
|
|
29
|
+
const app = new App(controllers);
|
|
30
|
+
await app.init(config);
|
|
31
|
+
await app.afterInit();
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Özellikler
|
|
35
|
+
|
|
36
|
+
- 🚀 **Hızlı Kurulum**: Minimal konfigürasyon ile hızlıca başlayın
|
|
37
|
+
- 📝 **Otomatik Swagger**: API dokümantasyonu otomatik olarak oluşturulur
|
|
38
|
+
- 🔧 **Dependency Injection**: InversifyJS tabanlı DI container
|
|
39
|
+
- 🛡️ **Middleware Desteği**: Authentication, authorization ve validation
|
|
40
|
+
- 📦 **TypeScript**: Tam TypeScript desteği
|
|
41
|
+
- 🎯 **Response Builder**: Tutarlı API yanıtları için yardımcı fonksiyonlar
|
|
42
|
+
|
|
43
|
+
## API Referansı
|
|
44
|
+
|
|
45
|
+
### Ana Sınıflar
|
|
46
|
+
|
|
47
|
+
- **App**: Ana uygulama sınıfı
|
|
48
|
+
- **Container**: Dependency injection container'ı
|
|
49
|
+
|
|
50
|
+
### Arayüzler (Interfaces)
|
|
51
|
+
|
|
52
|
+
- **IApp**: Uygulama arayüzü
|
|
53
|
+
- **IConfig**: Konfigürasyon arayüzü
|
|
54
|
+
- **IAuthenticated**: Authentication arayüzü
|
|
55
|
+
- **IQueue**: Queue işlemleri arayüzü
|
|
56
|
+
- **IRepository**: Repository pattern arayüzü
|
|
57
|
+
|
|
58
|
+
### Middleware'ler
|
|
59
|
+
|
|
60
|
+
- **AuthenticatedMiddleware**: Kimlik doğrulama middleware'i
|
|
61
|
+
- **AuthorizedMiddleware**: Yetkilendirme middleware'i
|
|
62
|
+
- **ValidationMiddleware**: Veri validasyon middleware'i
|
|
63
|
+
|
|
64
|
+
### Yardımcı Fonksiyonlar
|
|
65
|
+
|
|
66
|
+
- **ArrayUnify**: Dizi birleştirme yardımcıları
|
|
67
|
+
- **Math**: Matematik işlemleri
|
|
68
|
+
- **ResponseBuilder**: API yanıt oluşturucu
|
|
69
|
+
|
|
70
|
+
## Lisans
|
|
71
|
+
|
|
72
|
+
ISC
|
|
73
|
+
|
|
74
|
+
## Yazar
|
|
75
|
+
|
|
76
|
+
Mustafa Çolakoglu <mustafacolakoglu94@gmail.com>
|
package/dist/app.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Express } from 'express';
|
|
2
|
+
import { IApp } from './interfaces/app.interface';
|
|
3
|
+
import { IConfig } from './interfaces/config.interface';
|
|
4
|
+
import { Container } from 'inversify';
|
|
5
|
+
declare class App implements IApp {
|
|
6
|
+
private controllers;
|
|
7
|
+
app: Express;
|
|
8
|
+
container: Container;
|
|
9
|
+
constructor(controllers: any[]);
|
|
10
|
+
init(config: IConfig): Promise<void>;
|
|
11
|
+
afterInit(): Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export default App;
|
|
14
|
+
//# sourceMappingURL=app.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../app.ts"],"names":[],"mappings":"AAAA,OAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAG3C,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAExD,OAAO,EAAE,SAAS,EAAe,MAAM,WAAW,CAAC;AAInD,cAAM,GAAI,YAAW,IAAI;IAIyB,OAAO,CAAC,WAAW;IAHpE,GAAG,EAAE,OAAO,CAAC;IACb,SAAS,EAAE,SAAS,CAAC;gBAEoC,WAAW,EAAE,GAAG,EAAE;IAKrE,IAAI,CAAC,MAAM,EAAE,OAAO;IA0BpB,SAAS;CAGf;AAED,eAAe,GAAG,CAAC"}
|
package/dist/app.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
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
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const express_1 = __importDefault(require("express"));
|
|
19
|
+
const cors_1 = __importDefault(require("cors"));
|
|
20
|
+
const morgan_1 = __importDefault(require("morgan"));
|
|
21
|
+
const rest_1 = require("./rest");
|
|
22
|
+
const inversify_1 = require("inversify");
|
|
23
|
+
const swagger_1 = require("./swagger");
|
|
24
|
+
const types_1 = require("./types");
|
|
25
|
+
let App = class App {
|
|
26
|
+
constructor(controllers) {
|
|
27
|
+
this.controllers = controllers;
|
|
28
|
+
this.app = (0, express_1.default)();
|
|
29
|
+
this.container = new inversify_1.Container();
|
|
30
|
+
}
|
|
31
|
+
async init(config) {
|
|
32
|
+
this.app.use(express_1.default.json());
|
|
33
|
+
this.app.use(express_1.default.urlencoded({ extended: true }));
|
|
34
|
+
this.app.use((0, cors_1.default)());
|
|
35
|
+
this.app.use((0, morgan_1.default)('dev'));
|
|
36
|
+
this.app.listen(config.port, () => {
|
|
37
|
+
console.log(`Server is running on port ${config.port}`);
|
|
38
|
+
});
|
|
39
|
+
const swaggerIntegration = new swagger_1.SwaggerIntegration({
|
|
40
|
+
title: config.applicationName,
|
|
41
|
+
description: `API documentation for ${config.applicationName}`,
|
|
42
|
+
version: '1.0.0',
|
|
43
|
+
servers: [
|
|
44
|
+
{
|
|
45
|
+
url: `http://${config.host}:${config.port}`,
|
|
46
|
+
description: 'Development server',
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
docsPath: '/api-docs',
|
|
50
|
+
jsonPath: '/api-docs.json',
|
|
51
|
+
});
|
|
52
|
+
swaggerIntegration.generateSwaggerSpec(this.controllers);
|
|
53
|
+
swaggerIntegration.setupSwagger(this.app);
|
|
54
|
+
(0, rest_1.buildApp)(this.app, this.controllers);
|
|
55
|
+
}
|
|
56
|
+
async afterInit() {
|
|
57
|
+
console.log('afterInit');
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
App = __decorate([
|
|
61
|
+
__param(0, (0, inversify_1.multiInject)(types_1.MINI_TYPES.IController)),
|
|
62
|
+
__metadata("design:paramtypes", [Array])
|
|
63
|
+
], App);
|
|
64
|
+
exports.default = App;
|
|
65
|
+
//# sourceMappingURL=app.js.map
|
package/dist/app.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../app.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,sDAA2C;AAC3C,gDAAwB;AACxB,oDAA4B;AAG5B,iCAAkC;AAClC,yCAAmD;AACnD,uCAA+C;AAC/C,mCAAqC;AAErC,IAAM,GAAG,GAAT,MAAM,GAAG;IAIR,YAAyD,WAAkB;QAAlB,gBAAW,GAAX,WAAW,CAAO;QAC1E,IAAI,CAAC,GAAG,GAAG,IAAA,iBAAO,GAAE,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,IAAI,qBAAS,EAAE,CAAC;IAClC,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,MAAe;QACzB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,iBAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QAC7B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,iBAAO,CAAC,UAAU,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QACrD,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAA,cAAI,GAAE,CAAC,CAAC;QACrB,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAA,gBAAM,EAAC,KAAK,CAAC,CAAC,CAAC;QAC5B,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,EAAE;YACjC,OAAO,CAAC,GAAG,CAAC,6BAA6B,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QACzD,CAAC,CAAC,CAAC;QACH,MAAM,kBAAkB,GAAG,IAAI,4BAAkB,CAAC;YACjD,KAAK,EAAE,MAAM,CAAC,eAAe;YAC7B,WAAW,EAAE,yBAAyB,MAAM,CAAC,eAAe,EAAE;YAC9D,OAAO,EAAE,OAAO;YAChB,OAAO,EAAE;gBACR;oBACC,GAAG,EAAE,UAAU,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,EAAE;oBAC3C,WAAW,EAAE,oBAAoB;iBACjC;aACD;YACD,QAAQ,EAAE,WAAW;YACrB,QAAQ,EAAE,gBAAgB;SAC1B,CAAC,CAAC;QACH,kBAAkB,CAAC,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACzD,kBAAkB,CAAC,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC1C,IAAA,eAAQ,EAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,SAAS;QACd,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC1B,CAAC;CACD,CAAA;AAtCK,GAAG;IAIK,WAAA,IAAA,uBAAW,EAAC,kBAAU,CAAC,WAAW,CAAC,CAAA;;GAJ3C,GAAG,CAsCR;AAED,kBAAe,GAAG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAGtC,QAAA,MAAM,SAAS,WAAkB,CAAC;AAGlC,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const inversify_1 = require("inversify");
|
|
7
|
+
const app_1 = __importDefault(require("./app"));
|
|
8
|
+
const container = new inversify_1.Container();
|
|
9
|
+
container.bind(app_1.default).toSelf();
|
|
10
|
+
exports.default = container;
|
|
11
|
+
//# sourceMappingURL=container.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container.js","sourceRoot":"","sources":["../container.ts"],"names":[],"mappings":";;;;;AAAA,yCAAsC;AACtC,gDAAwB;AAExB,MAAM,SAAS,GAAG,IAAI,qBAAS,EAAE,CAAC;AAClC,SAAS,CAAC,IAAI,CAAC,aAAG,CAAC,CAAC,MAAM,EAAE,CAAC;AAE7B,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export interface IValidationError {
|
|
2
|
+
field: string;
|
|
3
|
+
errors: string[];
|
|
4
|
+
}
|
|
5
|
+
export interface IErrorMessage {
|
|
6
|
+
validationErrors?: IValidationError[];
|
|
7
|
+
message?: string;
|
|
8
|
+
errorId?: number;
|
|
9
|
+
}
|
|
10
|
+
export default class HttpException extends Error {
|
|
11
|
+
code: number;
|
|
12
|
+
message: string;
|
|
13
|
+
messageJson: IErrorMessage;
|
|
14
|
+
constructor(message: IErrorMessage, code?: number);
|
|
15
|
+
}
|
|
16
|
+
export declare class BadRequestException extends HttpException {
|
|
17
|
+
constructor(error: IErrorMessage);
|
|
18
|
+
}
|
|
19
|
+
export declare class UnauthorizedException extends HttpException {
|
|
20
|
+
constructor(error: IErrorMessage);
|
|
21
|
+
}
|
|
22
|
+
export declare class PaymentRequiredException extends HttpException {
|
|
23
|
+
constructor(error: IErrorMessage);
|
|
24
|
+
}
|
|
25
|
+
export declare class ForbiddenException extends HttpException {
|
|
26
|
+
constructor(error: IErrorMessage);
|
|
27
|
+
}
|
|
28
|
+
export declare class NotFoundException extends HttpException {
|
|
29
|
+
constructor(error: IErrorMessage);
|
|
30
|
+
}
|
|
31
|
+
export declare class MethodNotAllowedException extends HttpException {
|
|
32
|
+
constructor(error: IErrorMessage);
|
|
33
|
+
}
|
|
34
|
+
export declare class NotAcceptableException extends HttpException {
|
|
35
|
+
constructor(error: IErrorMessage);
|
|
36
|
+
}
|
|
37
|
+
export declare class ConflictException extends HttpException {
|
|
38
|
+
constructor(error: IErrorMessage);
|
|
39
|
+
}
|
|
40
|
+
export declare class GoneException extends HttpException {
|
|
41
|
+
constructor(error: IErrorMessage);
|
|
42
|
+
}
|
|
43
|
+
export declare class LengthRequiredException extends HttpException {
|
|
44
|
+
constructor(error: IErrorMessage);
|
|
45
|
+
}
|
|
46
|
+
export declare class PreconditionFailedException extends HttpException {
|
|
47
|
+
constructor(error: IErrorMessage);
|
|
48
|
+
}
|
|
49
|
+
export declare class PayloadTooLargeException extends HttpException {
|
|
50
|
+
constructor(error: IErrorMessage);
|
|
51
|
+
}
|
|
52
|
+
export declare class UnsupportedMediaTypeException extends HttpException {
|
|
53
|
+
constructor(error: IErrorMessage);
|
|
54
|
+
}
|
|
55
|
+
export declare class UnprocessableEntityException extends HttpException {
|
|
56
|
+
constructor(error: IErrorMessage);
|
|
57
|
+
}
|
|
58
|
+
export declare class TooManyRequestsException extends HttpException {
|
|
59
|
+
constructor(error: IErrorMessage);
|
|
60
|
+
}
|
|
61
|
+
export declare class InternalServerErrorException extends HttpException {
|
|
62
|
+
constructor(error: IErrorMessage);
|
|
63
|
+
}
|
|
64
|
+
export declare class NotImplementedException extends HttpException {
|
|
65
|
+
constructor(error: IErrorMessage);
|
|
66
|
+
}
|
|
67
|
+
export declare class BadGatewayException extends HttpException {
|
|
68
|
+
constructor(error: IErrorMessage);
|
|
69
|
+
}
|
|
70
|
+
export declare class ServiceUnavailableException extends HttpException {
|
|
71
|
+
constructor(error: IErrorMessage);
|
|
72
|
+
}
|
|
73
|
+
export declare class GatewayTimeoutException extends HttpException {
|
|
74
|
+
constructor(error: IErrorMessage);
|
|
75
|
+
}
|
|
76
|
+
export declare class ExpiredException extends HttpException {
|
|
77
|
+
constructor(error: IErrorMessage);
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=http.expection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.expection.d.ts","sourceRoot":"","sources":["../../expections/http.expection.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;CACjB;AACD,MAAM,WAAW,aAAa;IAC7B,gBAAgB,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,KAAK;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,aAAa,CAAC;gBACf,OAAO,EAAE,aAAa,EAAE,IAAI,SAAM;CAO9C;AAED,qBAAa,mBAAoB,SAAQ,aAAa;gBACzC,KAAK,EAAE,aAAa;CAGhC;AAED,qBAAa,qBAAsB,SAAQ,aAAa;gBAC3C,KAAK,EAAE,aAAa;CAGhC;AAED,qBAAa,wBAAyB,SAAQ,aAAa;gBAC9C,KAAK,EAAE,aAAa;CAGhC;AAED,qBAAa,kBAAmB,SAAQ,aAAa;gBACxC,KAAK,EAAE,aAAa;CAGhC;AAED,qBAAa,iBAAkB,SAAQ,aAAa;gBACvC,KAAK,EAAE,aAAa;CAGhC;AAED,qBAAa,yBAA0B,SAAQ,aAAa;gBAC/C,KAAK,EAAE,aAAa;CAGhC;AAED,qBAAa,sBAAuB,SAAQ,aAAa;gBAC5C,KAAK,EAAE,aAAa;CAGhC;AAED,qBAAa,iBAAkB,SAAQ,aAAa;gBACvC,KAAK,EAAE,aAAa;CAGhC;AAED,qBAAa,aAAc,SAAQ,aAAa;gBACnC,KAAK,EAAE,aAAa;CAGhC;AAED,qBAAa,uBAAwB,SAAQ,aAAa;gBAC7C,KAAK,EAAE,aAAa;CAGhC;AAED,qBAAa,2BAA4B,SAAQ,aAAa;gBACjD,KAAK,EAAE,aAAa;CAGhC;AAED,qBAAa,wBAAyB,SAAQ,aAAa;gBAC9C,KAAK,EAAE,aAAa;CAGhC;AAED,qBAAa,6BAA8B,SAAQ,aAAa;gBACnD,KAAK,EAAE,aAAa;CAGhC;AAED,qBAAa,4BAA6B,SAAQ,aAAa;gBAClD,KAAK,EAAE,aAAa;CAGhC;AAED,qBAAa,wBAAyB,SAAQ,aAAa;gBAC9C,KAAK,EAAE,aAAa;CAGhC;AAED,qBAAa,4BAA6B,SAAQ,aAAa;gBAClD,KAAK,EAAE,aAAa;CAGhC;AAED,qBAAa,uBAAwB,SAAQ,aAAa;gBAC7C,KAAK,EAAE,aAAa;CAGhC;AAED,qBAAa,mBAAoB,SAAQ,aAAa;gBACzC,KAAK,EAAE,aAAa;CAGhC;AAED,qBAAa,2BAA4B,SAAQ,aAAa;gBACjD,KAAK,EAAE,aAAa;CAGhC;AAED,qBAAa,uBAAwB,SAAQ,aAAa;gBAC7C,KAAK,EAAE,aAAa;CAGhC;AACD,qBAAa,gBAAiB,SAAQ,aAAa;gBACtC,KAAK,EAAE,aAAa;CAGhC"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExpiredException = exports.GatewayTimeoutException = exports.ServiceUnavailableException = exports.BadGatewayException = exports.NotImplementedException = exports.InternalServerErrorException = exports.TooManyRequestsException = exports.UnprocessableEntityException = exports.UnsupportedMediaTypeException = exports.PayloadTooLargeException = exports.PreconditionFailedException = exports.LengthRequiredException = exports.GoneException = exports.ConflictException = exports.NotAcceptableException = exports.MethodNotAllowedException = exports.NotFoundException = exports.ForbiddenException = exports.PaymentRequiredException = exports.UnauthorizedException = exports.BadRequestException = void 0;
|
|
4
|
+
class HttpException extends Error {
|
|
5
|
+
constructor(message, code = 500) {
|
|
6
|
+
super(JSON.stringify(message));
|
|
7
|
+
this.code = code;
|
|
8
|
+
this.message = JSON.stringify(message);
|
|
9
|
+
this.messageJson = message;
|
|
10
|
+
Error.captureStackTrace(this, this.constructor);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.default = HttpException;
|
|
14
|
+
class BadRequestException extends HttpException {
|
|
15
|
+
constructor(error) {
|
|
16
|
+
super(error, 400);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.BadRequestException = BadRequestException;
|
|
20
|
+
class UnauthorizedException extends HttpException {
|
|
21
|
+
constructor(error) {
|
|
22
|
+
super(error, 401);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.UnauthorizedException = UnauthorizedException;
|
|
26
|
+
class PaymentRequiredException extends HttpException {
|
|
27
|
+
constructor(error) {
|
|
28
|
+
super(error, 402);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.PaymentRequiredException = PaymentRequiredException;
|
|
32
|
+
class ForbiddenException extends HttpException {
|
|
33
|
+
constructor(error) {
|
|
34
|
+
super(error, 403);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.ForbiddenException = ForbiddenException;
|
|
38
|
+
class NotFoundException extends HttpException {
|
|
39
|
+
constructor(error) {
|
|
40
|
+
super(error, 404);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.NotFoundException = NotFoundException;
|
|
44
|
+
class MethodNotAllowedException extends HttpException {
|
|
45
|
+
constructor(error) {
|
|
46
|
+
super(error, 405);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.MethodNotAllowedException = MethodNotAllowedException;
|
|
50
|
+
class NotAcceptableException extends HttpException {
|
|
51
|
+
constructor(error) {
|
|
52
|
+
super(error, 406);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.NotAcceptableException = NotAcceptableException;
|
|
56
|
+
class ConflictException extends HttpException {
|
|
57
|
+
constructor(error) {
|
|
58
|
+
super(error, 409);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.ConflictException = ConflictException;
|
|
62
|
+
class GoneException extends HttpException {
|
|
63
|
+
constructor(error) {
|
|
64
|
+
super(error, 410);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.GoneException = GoneException;
|
|
68
|
+
class LengthRequiredException extends HttpException {
|
|
69
|
+
constructor(error) {
|
|
70
|
+
super(error, 411);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.LengthRequiredException = LengthRequiredException;
|
|
74
|
+
class PreconditionFailedException extends HttpException {
|
|
75
|
+
constructor(error) {
|
|
76
|
+
super(error, 412);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.PreconditionFailedException = PreconditionFailedException;
|
|
80
|
+
class PayloadTooLargeException extends HttpException {
|
|
81
|
+
constructor(error) {
|
|
82
|
+
super(error, 413);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
exports.PayloadTooLargeException = PayloadTooLargeException;
|
|
86
|
+
class UnsupportedMediaTypeException extends HttpException {
|
|
87
|
+
constructor(error) {
|
|
88
|
+
super(error, 415);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
exports.UnsupportedMediaTypeException = UnsupportedMediaTypeException;
|
|
92
|
+
class UnprocessableEntityException extends HttpException {
|
|
93
|
+
constructor(error) {
|
|
94
|
+
super(error, 422);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
exports.UnprocessableEntityException = UnprocessableEntityException;
|
|
98
|
+
class TooManyRequestsException extends HttpException {
|
|
99
|
+
constructor(error) {
|
|
100
|
+
super(error, 429);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
exports.TooManyRequestsException = TooManyRequestsException;
|
|
104
|
+
class InternalServerErrorException extends HttpException {
|
|
105
|
+
constructor(error) {
|
|
106
|
+
super(error, 500);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
exports.InternalServerErrorException = InternalServerErrorException;
|
|
110
|
+
class NotImplementedException extends HttpException {
|
|
111
|
+
constructor(error) {
|
|
112
|
+
super(error, 501);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
exports.NotImplementedException = NotImplementedException;
|
|
116
|
+
class BadGatewayException extends HttpException {
|
|
117
|
+
constructor(error) {
|
|
118
|
+
super(error, 502);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
exports.BadGatewayException = BadGatewayException;
|
|
122
|
+
class ServiceUnavailableException extends HttpException {
|
|
123
|
+
constructor(error) {
|
|
124
|
+
super(error, 503);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
exports.ServiceUnavailableException = ServiceUnavailableException;
|
|
128
|
+
class GatewayTimeoutException extends HttpException {
|
|
129
|
+
constructor(error) {
|
|
130
|
+
super(error, 504);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
exports.GatewayTimeoutException = GatewayTimeoutException;
|
|
134
|
+
class ExpiredException extends HttpException {
|
|
135
|
+
constructor(error) {
|
|
136
|
+
super(error, 410);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
exports.ExpiredException = ExpiredException;
|
|
140
|
+
//# sourceMappingURL=http.expection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.expection.js","sourceRoot":"","sources":["../../expections/http.expection.ts"],"names":[],"mappings":"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"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export { default as App } from './app';
|
|
2
|
+
export { default as Container } from './container';
|
|
3
|
+
export * from './interfaces/app.interface';
|
|
4
|
+
export * from './interfaces/authenticated.interface';
|
|
5
|
+
export * from './interfaces/config.interface';
|
|
6
|
+
export * from './interfaces/queue.interface';
|
|
7
|
+
export * from './interfaces/repository.interface';
|
|
8
|
+
export * from './middlewares/authenticated.middleware';
|
|
9
|
+
export * from './middlewares/authorized.middleware';
|
|
10
|
+
export * from './middlewares/validation.middleware';
|
|
11
|
+
export * from './utils/array-unify';
|
|
12
|
+
export * from './utils/math';
|
|
13
|
+
export * from './expections/http.expection';
|
|
14
|
+
export { default as HttpException } from './expections/http.expection';
|
|
15
|
+
export * from './types';
|
|
16
|
+
export * from './response-builder';
|
|
17
|
+
export * from './rest';
|
|
18
|
+
export * from './swagger';
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AAGnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sCAAsC,CAAC;AACrD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mCAAmC,CAAC;AAGlD,cAAc,wCAAwC,CAAC;AACvD,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC;AAGpD,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAG7B,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAGvE,cAAc,SAAS,CAAC;AAGxB,cAAc,oBAAoB,CAAC;AAGnC,cAAc,QAAQ,CAAC;AAGvB,cAAc,WAAW,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.HttpException = exports.Container = exports.App = void 0;
|
|
21
|
+
// Ana Application sınıfı
|
|
22
|
+
var app_1 = require("./app");
|
|
23
|
+
Object.defineProperty(exports, "App", { enumerable: true, get: function () { return __importDefault(app_1).default; } });
|
|
24
|
+
// Container için
|
|
25
|
+
var container_1 = require("./container");
|
|
26
|
+
Object.defineProperty(exports, "Container", { enumerable: true, get: function () { return __importDefault(container_1).default; } });
|
|
27
|
+
// Interfaces
|
|
28
|
+
__exportStar(require("./interfaces/app.interface"), exports);
|
|
29
|
+
__exportStar(require("./interfaces/authenticated.interface"), exports);
|
|
30
|
+
__exportStar(require("./interfaces/config.interface"), exports);
|
|
31
|
+
__exportStar(require("./interfaces/queue.interface"), exports);
|
|
32
|
+
__exportStar(require("./interfaces/repository.interface"), exports);
|
|
33
|
+
// Middlewares
|
|
34
|
+
__exportStar(require("./middlewares/authenticated.middleware"), exports);
|
|
35
|
+
__exportStar(require("./middlewares/authorized.middleware"), exports);
|
|
36
|
+
__exportStar(require("./middlewares/validation.middleware"), exports);
|
|
37
|
+
// Utils
|
|
38
|
+
__exportStar(require("./utils/array-unify"), exports);
|
|
39
|
+
__exportStar(require("./utils/math"), exports);
|
|
40
|
+
// Exceptions
|
|
41
|
+
__exportStar(require("./expections/http.expection"), exports);
|
|
42
|
+
var http_expection_1 = require("./expections/http.expection");
|
|
43
|
+
Object.defineProperty(exports, "HttpException", { enumerable: true, get: function () { return __importDefault(http_expection_1).default; } });
|
|
44
|
+
// Types
|
|
45
|
+
__exportStar(require("./types"), exports);
|
|
46
|
+
// Response builder
|
|
47
|
+
__exportStar(require("./response-builder"), exports);
|
|
48
|
+
// REST utilities
|
|
49
|
+
__exportStar(require("./rest"), exports);
|
|
50
|
+
// Swagger integration
|
|
51
|
+
__exportStar(require("./swagger"), exports);
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,yBAAyB;AACzB,6BAAuC;AAA9B,2GAAA,OAAO,OAAO;AAEvB,iBAAiB;AACjB,yCAAmD;AAA1C,uHAAA,OAAO,OAAa;AAE7B,aAAa;AACb,6DAA2C;AAC3C,uEAAqD;AACrD,gEAA8C;AAC9C,+DAA6C;AAC7C,oEAAkD;AAElD,cAAc;AACd,yEAAuD;AACvD,sEAAoD;AACpD,sEAAoD;AAEpD,QAAQ;AACR,sDAAoC;AACpC,+CAA6B;AAE7B,aAAa;AACb,8DAA4C;AAC5C,8DAAuE;AAA9D,gIAAA,OAAO,OAAiB;AAEjC,QAAQ;AACR,0CAAwB;AAExB,mBAAmB;AACnB,qDAAmC;AAEnC,iBAAiB;AACjB,yCAAuB;AAEvB,sBAAsB;AACtB,4CAA0B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.interface.d.ts","sourceRoot":"","sources":["../../interfaces/app.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C,MAAM,WAAW,IAAI;IACpB,IAAI,CAAC,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.interface.js","sourceRoot":"","sources":["../../interfaces/app.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authenticated.interface.d.ts","sourceRoot":"","sources":["../../interfaces/authenticated.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,MAAM,WAAW,qBAAsB,SAAQ,OAAO;IACrD,aAAa,EAAE,OAAO,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authenticated.interface.js","sourceRoot":"","sources":["../../interfaces/authenticated.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.interface.d.ts","sourceRoot":"","sources":["../../interfaces/config.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.interface.js","sourceRoot":"","sources":["../../interfaces/config.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue.interface.d.ts","sourceRoot":"","sources":["../../interfaces/queue.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACnB,UAAU,EAAC,GAAG,CAAC;IACf,EAAE,EAAC,CAAC,SAAS,EAAC,MAAM,EAAE,KAAK,EAAC,GAAG,KAAK,IAAI,CAAC;IACzC,IAAI,EAAC,CAAC,SAAS,EAAC,MAAM,EAAE,KAAK,EAAC,GAAG,KAAK,IAAI,CAAC;CAC9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queue.interface.js","sourceRoot":"","sources":["../../interfaces/queue.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface IRepository<IdentifierType, ModelType> {
|
|
2
|
+
findAll(): Promise<(ModelType & {
|
|
3
|
+
id: string;
|
|
4
|
+
createdAt: Date;
|
|
5
|
+
updatedAt: Date;
|
|
6
|
+
})[]>;
|
|
7
|
+
findById(id: IdentifierType): Promise<(ModelType & {
|
|
8
|
+
id: string;
|
|
9
|
+
createdAt: Date;
|
|
10
|
+
updatedAt: Date;
|
|
11
|
+
}) | null>;
|
|
12
|
+
create(item: ModelType): Promise<ModelType & {
|
|
13
|
+
id: string;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
updatedAt: Date;
|
|
16
|
+
}>;
|
|
17
|
+
update(id: IdentifierType, item: Partial<ModelType>): Promise<ModelType & {
|
|
18
|
+
id: string;
|
|
19
|
+
createdAt: Date;
|
|
20
|
+
updatedAt: Date;
|
|
21
|
+
}>;
|
|
22
|
+
delete(id: IdentifierType): Promise<void>;
|
|
23
|
+
findPaginated(query: Partial<ModelType>, page: number, limit: number): Promise<(ModelType & {
|
|
24
|
+
id: string;
|
|
25
|
+
createdAt: Date;
|
|
26
|
+
updatedAt: Date;
|
|
27
|
+
})[]>;
|
|
28
|
+
mapper(model: any): ModelType & {
|
|
29
|
+
id: string;
|
|
30
|
+
createdAt: Date;
|
|
31
|
+
updatedAt: Date;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=repository.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository.interface.d.ts","sourceRoot":"","sources":["../../interfaces/repository.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW,CAAC,cAAc,EAAE,SAAS;IACrD,OAAO,IAAI,OAAO,CACjB,CAAC,SAAS,GAAG;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,IAAI,CAAC;QAAC,SAAS,EAAE,IAAI,CAAA;KAAE,CAAC,EAAE,CAChE,CAAC;IACF,QAAQ,CACP,EAAE,EAAE,cAAc,GAChB,OAAO,CACT,CAAC,SAAS,GAAG;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,IAAI,CAAC;QAAC,SAAS,EAAE,IAAI,CAAA;KAAE,CAAC,GAAG,IAAI,CACrE,CAAC;IACF,MAAM,CACL,IAAI,EAAE,SAAS,GACb,OAAO,CAAC,SAAS,GAAG;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,IAAI,CAAC;QAAC,SAAS,EAAE,IAAI,CAAA;KAAE,CAAC,CAAC;IACzE,MAAM,CACL,EAAE,EAAE,cAAc,EAClB,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC,GACtB,OAAO,CAAC,SAAS,GAAG;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,IAAI,CAAC;QAAC,SAAS,EAAE,IAAI,CAAA;KAAE,CAAC,CAAC;IACzE,MAAM,CAAC,EAAE,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,aAAa,CACZ,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC,EACzB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GACX,OAAO,CAAC,CAAC,SAAS,GAAG;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,IAAI,CAAC;QAAC,SAAS,EAAE,IAAI,CAAA;KAAE,CAAC,EAAE,CAAC,CAAC;IAC7E,MAAM,CACL,KAAK,EAAE,GAAG,GACR,SAAS,GAAG;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,IAAI,CAAC;QAAC,SAAS,EAAE,IAAI,CAAA;KAAE,CAAC;CAChE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository.interface.js","sourceRoot":"","sources":["../../interfaces/repository.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { NextFunction, Response } from 'express';
|
|
2
|
+
import { IAuthenticatedRequest } from '../interfaces/authenticated.interface';
|
|
3
|
+
export declare const authenticatedMiddleware: (req: IAuthenticatedRequest, _res: Response, next: NextFunction) => void;
|
|
4
|
+
//# sourceMappingURL=authenticated.middleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authenticated.middleware.d.ts","sourceRoot":"","sources":["../../middlewares/authenticated.middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAE9E,eAAO,MAAM,uBAAuB,GACnC,KAAK,qBAAqB,EAC1B,MAAM,QAAQ,EACd,MAAM,YAAY,SAOlB,CAAC"}
|