@forklaunch/core 0.1.9 → 0.1.10
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/cache/index.d.ts +1 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +3 -20
- package/dist/cache/interfaces/ttlCache.interface.d.ts +1 -0
- package/dist/cache/interfaces/ttlCache.interface.d.ts.map +1 -0
- package/dist/cache/interfaces/ttlCache.interface.js +1 -3
- package/dist/cache/redisTtlCache.d.ts +1 -0
- package/dist/cache/redisTtlCache.d.ts.map +1 -0
- package/dist/cache/redisTtlCache.js +3 -8
- package/dist/cache/types/ttlCacheRecord.types.d.ts +1 -0
- package/dist/cache/types/ttlCacheRecord.types.d.ts.map +1 -0
- package/dist/cache/types/ttlCacheRecord.types.js +1 -3
- package/dist/controllers/index.d.ts +1 -0
- package/dist/controllers/index.d.ts.map +1 -0
- package/dist/controllers/index.js +1 -18
- package/dist/controllers/interfaces/controller.interface.d.ts +1 -0
- package/dist/controllers/interfaces/controller.interface.d.ts.map +1 -0
- package/dist/controllers/interfaces/controller.interface.js +1 -3
- package/dist/database/index.d.ts +1 -0
- package/dist/database/index.d.ts.map +1 -0
- package/dist/database/index.js +1 -18
- package/dist/database/mikro/models/entities/base.entity.d.ts +1 -0
- package/dist/database/mikro/models/entities/base.entity.d.ts.map +1 -0
- package/dist/database/mikro/models/entities/base.entity.js +7 -18
- package/dist/entityMapper/index.d.ts +1 -0
- package/dist/entityMapper/index.d.ts.map +1 -0
- package/dist/entityMapper/index.js +2 -19
- package/dist/entityMapper/interfaces/entityMapper.interface.d.ts +1 -0
- package/dist/entityMapper/interfaces/entityMapper.interface.d.ts.map +1 -0
- package/dist/entityMapper/interfaces/entityMapper.interface.js +1 -3
- package/dist/entityMapper/models/baseEntityMapper.model.d.ts +1 -0
- package/dist/entityMapper/models/baseEntityMapper.model.d.ts.map +1 -0
- package/dist/entityMapper/models/baseEntityMapper.model.js +2 -8
- package/dist/entityMapper/models/requestEntityMapper.model.d.ts +1 -0
- package/dist/entityMapper/models/requestEntityMapper.model.d.ts.map +1 -0
- package/dist/entityMapper/models/requestEntityMapper.model.js +4 -9
- package/dist/entityMapper/models/responseEntityMapper.model.d.ts +1 -0
- package/dist/entityMapper/models/responseEntityMapper.model.d.ts.map +1 -0
- package/dist/entityMapper/models/responseEntityMapper.model.js +4 -9
- package/dist/entityMapper/types/entityMapper.types.d.ts +1 -0
- package/dist/entityMapper/types/entityMapper.types.d.ts.map +1 -0
- package/dist/entityMapper/types/entityMapper.types.js +1 -3
- package/dist/eslint.config.d.mts +3 -0
- package/dist/eslint.config.d.mts.map +1 -0
- package/dist/eslint.config.mjs +10 -0
- package/dist/http/httpStatusCodes.d.ts +1 -0
- package/dist/http/httpStatusCodes.d.ts.map +1 -0
- package/dist/http/httpStatusCodes.js +10 -21
- package/dist/http/index.d.ts +1 -0
- package/dist/http/index.d.ts.map +1 -0
- package/dist/http/index.js +5 -22
- package/dist/http/interfaces/forklaunchExpress.abstractClass.d.ts +146 -0
- package/dist/http/interfaces/forklaunchExpress.abstractClass.d.ts.map +1 -0
- package/dist/http/interfaces/forklaunchExpress.abstractClass.js +316 -0
- package/dist/http/middleware/index.d.ts +1 -0
- package/dist/http/middleware/index.d.ts.map +1 -0
- package/dist/http/middleware/index.js +2 -19
- package/dist/http/middleware/request.middleware.d.ts +11 -9
- package/dist/http/middleware/request.middleware.d.ts.map +1 -0
- package/dist/http/middleware/request.middleware.js +11 -45
- package/dist/http/middleware/response.middleware.d.ts +5 -2
- package/dist/http/middleware/response.middleware.d.ts.map +1 -0
- package/dist/http/middleware/response.middleware.js +1 -5
- package/dist/http/openApiV3Generator.d.ts +1 -0
- package/dist/http/openApiV3Generator.d.ts.map +1 -0
- package/dist/http/openApiV3Generator.js +28 -13
- package/dist/http/regex.d.ts +1 -0
- package/dist/http/regex.d.ts.map +1 -0
- package/dist/http/regex.js +1 -5
- package/dist/http/types/api.types.d.ts +128 -50
- package/dist/http/types/api.types.d.ts.map +1 -0
- package/dist/http/types/api.types.js +1 -3
- package/dist/http/types/forklaunch.types.d.ts +2 -3
- package/dist/http/types/forklaunch.types.d.ts.map +1 -0
- package/dist/http/types/forklaunch.types.js +1 -3
- package/dist/http/types/index.d.ts +1 -0
- package/dist/http/types/index.d.ts.map +1 -0
- package/dist/http/types/index.js +3 -20
- package/dist/http/types/primitive.types.d.ts +5 -4
- package/dist/http/types/primitive.types.d.ts.map +1 -0
- package/dist/http/types/primitive.types.js +1 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -23
- package/dist/jest.config.d.ts +1 -0
- package/dist/jest.config.d.ts.map +1 -0
- package/dist/jest.config.js +1 -4
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +1 -18
- package/dist/services/interfaces/baseService.d.ts +1 -0
- package/dist/services/interfaces/baseService.d.ts.map +1 -0
- package/dist/services/interfaces/baseService.js +1 -3
- package/dist/tests/entityMapper.test.d.ts +1 -0
- package/dist/tests/entityMapper.test.d.ts.map +1 -0
- package/dist/tests/entityMapper.test.js +34 -24
- package/dist/tests/http.middleware.test.d.ts +1 -0
- package/dist/tests/http.middleware.test.d.ts.map +1 -0
- package/dist/tests/http.middleware.test.js +16 -17
- package/dist/tests/openApiV3Generator.test.d.ts +1 -0
- package/dist/tests/openApiV3Generator.test.d.ts.map +1 -0
- package/dist/tests/openApiV3Generator.test.js +5 -9
- package/dist/tests/redisTtlCache.test.d.ts +1 -0
- package/dist/tests/redisTtlCache.test.d.ts.map +1 -0
- package/dist/tests/redisTtlCache.test.js +4 -7
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +13 -10
- package/LICENSE +0 -21
- package/dist/cache/index.js.map +0 -1
- package/dist/cache/interfaces/ttlCache.interface.js.map +0 -1
- package/dist/cache/redisTtlCache.js.map +0 -1
- package/dist/cache/types/ttlCacheRecord.types.js.map +0 -1
- package/dist/controllers/index.js.map +0 -1
- package/dist/controllers/interfaces/controller.interface.js.map +0 -1
- package/dist/database/index.js.map +0 -1
- package/dist/database/mikro/models/entities/base.entity.js.map +0 -1
- package/dist/entityMapper/index.js.map +0 -1
- package/dist/entityMapper/interfaces/entityMapper.interface.js.map +0 -1
- package/dist/entityMapper/models/baseEntityMapper.model.js.map +0 -1
- package/dist/entityMapper/models/requestEntityMapper.model.js.map +0 -1
- package/dist/entityMapper/models/responseEntityMapper.model.js.map +0 -1
- package/dist/entityMapper/types/entityMapper.types.js.map +0 -1
- package/dist/http/httpStatusCodes.js.map +0 -1
- package/dist/http/index.js.map +0 -1
- package/dist/http/middleware/index.js.map +0 -1
- package/dist/http/middleware/request.middleware.js.map +0 -1
- package/dist/http/middleware/response.middleware.js.map +0 -1
- package/dist/http/openApiV3Generator.js.map +0 -1
- package/dist/http/regex.js.map +0 -1
- package/dist/http/types/api.types.js.map +0 -1
- package/dist/http/types/forklaunch.types.js.map +0 -1
- package/dist/http/types/index.js.map +0 -1
- package/dist/http/types/primitive.types.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/jest.config.js.map +0 -1
- package/dist/services/index.js.map +0 -1
- package/dist/services/interfaces/baseService.js.map +0 -1
- package/dist/tests/entityMapper.test.js.map +0 -1
- package/dist/tests/http.middleware.test.js.map +0 -1
- package/dist/tests/openApiV3Generator.test.js.map +0 -1
- package/dist/tests/redisTtlCache.test.js.map +0 -1
package/dist/cache/index.d.ts
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../cache/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,iBAAiB,CAAC;AAChC,cAAc,8BAA8B,CAAC"}
|
package/dist/cache/index.js
CHANGED
@@ -1,20 +1,3 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
__exportStar(require("./interfaces/ttlCache.interface"), exports);
|
18
|
-
__exportStar(require("./redisTtlCache"), exports);
|
19
|
-
__exportStar(require("./types/ttlCacheRecord.types"), exports);
|
20
|
-
//# sourceMappingURL=index.js.map
|
1
|
+
export * from './interfaces/ttlCache.interface';
|
2
|
+
export * from './redisTtlCache';
|
3
|
+
export * from './types/ttlCacheRecord.types';
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ttlCache.interface.d.ts","sourceRoot":"","sources":["../../../cache/interfaces/ttlCache.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB;;;;;OAKG;IACH,SAAS,CAAC,WAAW,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtD;;;;;OAKG;IACH,YAAY,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpD;;;;;OAKG;IACH,UAAU,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAE5D;;;;;OAKG;IACH,UAAU,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAErD;;;;OAIG;IACH,kBAAkB,IAAI,MAAM,CAAC;IAE7B;;;;;OAKG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;CACrD"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"redisTtlCache.d.ts","sourceRoot":"","sources":["../../cache/redisTtlCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAgB,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D;;;GAGG;AACH,qBAAa,aAAc,YAAW,QAAQ;IAU1C,OAAO,CAAC,eAAe;IATzB,OAAO,CAAC,MAAM,CAAC;IAEf;;;;;OAKG;gBAEO,eAAe,EAAE,MAAM,EAC/B,cAAc,CAAC,EAAE,kBAAkB;IAYrC;;;;;OAKG;IACG,SAAS,CAAC,EACd,GAAG,EACH,KAAK,EACL,eAAsC,EACvC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAMjC;;;;;OAKG;IACG,YAAY,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzD;;;;;;OAMG;IACG,UAAU,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAajE;;;;;OAKG;IACG,QAAQ,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAKzD;;;;;OAKG;IACG,UAAU,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAK1D;;;;OAIG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAIjC;;;;OAIG;IACH,kBAAkB,IAAI,MAAM;CAG7B"}
|
@@ -1,12 +1,9 @@
|
|
1
|
-
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.RedisTtlCache = void 0;
|
4
|
-
const redis_1 = require("redis");
|
1
|
+
import { createClient } from 'redis';
|
5
2
|
/**
|
6
3
|
* Class representing a Redis-based TTL (Time-To-Live) cache.
|
7
4
|
* Implements the TtlCache interface.
|
8
5
|
*/
|
9
|
-
class RedisTtlCache {
|
6
|
+
export class RedisTtlCache {
|
10
7
|
ttlMilliseconds;
|
11
8
|
client;
|
12
9
|
/**
|
@@ -19,7 +16,7 @@ class RedisTtlCache {
|
|
19
16
|
this.ttlMilliseconds = ttlMilliseconds;
|
20
17
|
// Connects to localhost:6379 by default
|
21
18
|
// url usage: redis[s]://[[username][:password]@][host][:port][/db-number]
|
22
|
-
this.client =
|
19
|
+
this.client = createClient(hostingOptions);
|
23
20
|
this.client.on('error', (err) => console.log('Redis Client Error', err));
|
24
21
|
this.client.on('connect', () => {
|
25
22
|
console.log('\x1b[32m%s\x1b[0m', 'Successfully Connected to Redis'); // Green text
|
@@ -102,5 +99,3 @@ class RedisTtlCache {
|
|
102
99
|
return this.ttlMilliseconds;
|
103
100
|
}
|
104
101
|
}
|
105
|
-
exports.RedisTtlCache = RedisTtlCache;
|
106
|
-
//# sourceMappingURL=redisTtlCache.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ttlCacheRecord.types.d.ts","sourceRoot":"","sources":["../../../cache/types/ttlCacheRecord.types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,OAAO,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../controllers/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC"}
|
@@ -1,18 +1 @@
|
|
1
|
-
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
__exportStar(require("./interfaces/controller.interface"), exports);
|
18
|
-
//# sourceMappingURL=index.js.map
|
1
|
+
export * from './interfaces/controller.interface';
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"controller.interface.d.ts","sourceRoot":"","sources":["../../../controllers/interfaces/controller.interface.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,UAAU,UAAU;IAClB;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,eAAe,UAAU,CAAC"}
|
package/dist/database/index.d.ts
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../database/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC"}
|
package/dist/database/index.js
CHANGED
@@ -1,18 +1 @@
|
|
1
|
-
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
__exportStar(require("./mikro/models/entities/base.entity"), exports);
|
18
|
-
//# sourceMappingURL=index.js.map
|
1
|
+
export * from './mikro/models/entities/base.entity';
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"base.entity.d.ts","sourceRoot":"","sources":["../../../../../database/mikro/models/entities/base.entity.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,8BAAsB,UAAU;IAC9B;;;;;OAKG;IAEH,EAAE,EAAE,MAAM,CAAQ;IAElB;;;;OAIG;IAEH,SAAS,EAAE,IAAI,CAAc;IAE7B;;;;;OAKG;IAEH,SAAS,EAAE,IAAI,CAAc;CAC9B"}
|
@@ -1,28 +1,22 @@
|
|
1
|
-
"use strict";
|
2
1
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
2
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
3
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
4
|
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
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
6
|
};
|
8
|
-
|
9
|
-
|
10
|
-
};
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
-
exports.BaseEntity = void 0;
|
13
|
-
const uuid_1 = require("uuid");
|
14
|
-
const core_1 = require("@mikro-orm/core");
|
7
|
+
import { v4 } from 'uuid';
|
8
|
+
import { PrimaryKey, Property } from '@mikro-orm/core';
|
15
9
|
/**
|
16
10
|
* Abstract class representing a base entity.
|
17
11
|
*/
|
18
|
-
class BaseEntity {
|
12
|
+
export class BaseEntity {
|
19
13
|
/**
|
20
14
|
* The unique identifier for the entity.
|
21
15
|
*
|
22
16
|
* @type {string}
|
23
17
|
* @readonly
|
24
18
|
*/
|
25
|
-
id =
|
19
|
+
id = v4();
|
26
20
|
/**
|
27
21
|
* The date when the entity was created.
|
28
22
|
*
|
@@ -37,17 +31,12 @@ class BaseEntity {
|
|
37
31
|
*/
|
38
32
|
updatedAt = new Date();
|
39
33
|
}
|
40
|
-
exports.BaseEntity = BaseEntity;
|
41
34
|
__decorate([
|
42
|
-
|
43
|
-
__metadata("design:type", String)
|
35
|
+
PrimaryKey({ type: 'uuid' })
|
44
36
|
], BaseEntity.prototype, "id", void 0);
|
45
37
|
__decorate([
|
46
|
-
|
47
|
-
__metadata("design:type", Date)
|
38
|
+
Property()
|
48
39
|
], BaseEntity.prototype, "createdAt", void 0);
|
49
40
|
__decorate([
|
50
|
-
|
51
|
-
__metadata("design:type", Date)
|
41
|
+
Property({ onUpdate: () => new Date() })
|
52
42
|
], BaseEntity.prototype, "updatedAt", void 0);
|
53
|
-
//# sourceMappingURL=base.entity.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../entityMapper/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC"}
|
@@ -1,19 +1,2 @@
|
|
1
|
-
|
2
|
-
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
__exportStar(require("./models/requestEntityMapper.model"), exports);
|
18
|
-
__exportStar(require("./models/responseEntityMapper.model"), exports);
|
19
|
-
//# sourceMappingURL=index.js.map
|
1
|
+
export * from './models/requestEntityMapper.model';
|
2
|
+
export * from './models/responseEntityMapper.model';
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"entityMapper.interface.d.ts","sourceRoot":"","sources":["../../../entityMapper/interfaces/entityMapper.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB,CAAC,CAAC,EAAE,EAAE,SAAS,kBAAkB;IACvE;;;;;OAKG;IACH,KAAK,eAAe,EAAE,EAAE,GAAG,CAAC,CAAC;CAC9B"}
|
@@ -69,3 +69,4 @@ export declare abstract class BaseEntityMapper<SV extends AnySchemaValidator> {
|
|
69
69
|
*/
|
70
70
|
static schema<T extends BaseEntityMapper<SV>, SV extends AnySchemaValidator>(this: EntityMapperConstructor<T, SV>): T['schema'];
|
71
71
|
}
|
72
|
+
//# sourceMappingURL=baseEntityMapper.model.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"baseEntityMapper.model.d.ts","sourceRoot":"","sources":["../../../entityMapper/models/baseEntityMapper.model.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,MAAM,EACN,eAAe,EAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,iCAAiC,EAAE,MAAM,6BAA6B,CAAC;AAEhF;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,EAAE,SAAS,kBAAkB,EACxD,IAAI,EAAE,uBAAuB,CAAC,CAAC,EAAE,EAAE,CAAC,EACpC,eAAe,CAAC,EAAE,EAAE,GACnB,CAAC,CAEH;AAED;;;;GAIG;AACH,8BAAsB,gBAAgB,CAAC,EAAE,SAAS,kBAAkB;IAClE;;;;OAIG;IACH,GAAG,EAAG,EAAE,CAAC;IAET;;;;OAIG;IACH,SAAS,CAAC,eAAe,EAAE,eAAe,CAAC;IAE3C;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,iCAAiC,CAAC,EAAE,CAAC,CAAC;IAEvD;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,CAG9B;IAEF;;;;OAIG;gBACS,eAAe,EAAE,EAAE;IAI/B;;;;;OAKG;IACH,IAAI,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,EAUzB;IAED;;;;OAIG;IACH,IAAI,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,CAEtB;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,gBAAgB,CAAC,EAAE,CAAC,EAAE,EAAE,SAAS,kBAAkB,EACzE,IAAI,EAAE,uBAAuB,CAAC,CAAC,EAAE,EAAE,CAAC,GACnC,CAAC,CAAC,QAAQ,CAAC;CAGf"}
|
@@ -1,7 +1,3 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.BaseEntityMapper = void 0;
|
4
|
-
exports.construct = construct;
|
5
1
|
/**
|
6
2
|
* Constructs an instance of a T.
|
7
3
|
*
|
@@ -11,7 +7,7 @@ exports.construct = construct;
|
|
11
7
|
* @param {SV} [schemaValidator] - The optional schema validator.
|
12
8
|
* @returns {T} - An instance of the T.
|
13
9
|
*/
|
14
|
-
function construct(self, schemaValidator) {
|
10
|
+
export function construct(self, schemaValidator) {
|
15
11
|
return new self(schemaValidator || {});
|
16
12
|
}
|
17
13
|
/**
|
@@ -19,7 +15,7 @@ function construct(self, schemaValidator) {
|
|
19
15
|
*
|
20
16
|
* @template SV - A type that extends AnySchemaValidator.
|
21
17
|
*/
|
22
|
-
class BaseEntityMapper {
|
18
|
+
export class BaseEntityMapper {
|
23
19
|
/**
|
24
20
|
* The schema validator exact type.
|
25
21
|
* @type {SV}
|
@@ -77,5 +73,3 @@ class BaseEntityMapper {
|
|
77
73
|
return construct(this).schema;
|
78
74
|
}
|
79
75
|
}
|
80
|
-
exports.BaseEntityMapper = BaseEntityMapper;
|
81
|
-
//# sourceMappingURL=baseEntityMapper.model.js.map
|
@@ -65,3 +65,4 @@ export declare abstract class RequestEntityMapper<Entity extends BaseEntity, SV
|
|
65
65
|
*/
|
66
66
|
static deserializeJsonToEntity<T extends RequestEntityMapper<BaseEntity, SV>, SV extends AnySchemaValidator, JsonType extends T['_dto']>(this: EntityMapperConstructor<T, SV>, schemaValidator: SV, json: JsonType, ...additionalArgs: unknown[]): T['_Entity'];
|
67
67
|
}
|
68
|
+
//# sourceMappingURL=requestEntityMapper.model.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"requestEntityMapper.model.d.ts","sourceRoot":"","sources":["../../../entityMapper/models/requestEntityMapper.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,kDAAkD,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAa,MAAM,0BAA0B,CAAC;AAEvE;;;;;;GAMG;AACH,8BAAsB,mBAAmB,CACvC,MAAM,SAAS,UAAU,EACzB,EAAE,SAAS,kBAAkB,CAC7B,SAAQ,gBAAgB,CAAC,EAAE,CAAC;IAC5B;;;;OAIG;IACH,OAAO,EAAG,MAAM,CAAC;IAEjB;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,CAAC,GAAG,cAAc,EAAE,OAAO,EAAE,GAAG,MAAM;IAEvD;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI;IAalC;;;;;;OAMG;IACH,uBAAuB,CACrB,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,EAClB,GAAG,cAAc,EAAE,OAAO,EAAE,GAC3B,MAAM;IAIT;;;;;;;;;;OAUG;IACH,MAAM,CAAC,QAAQ,CACb,CAAC,SAAS,mBAAmB,CAAC,UAAU,EAAE,EAAE,CAAC,EAC7C,EAAE,SAAS,kBAAkB,EAC7B,QAAQ,SAAS,CAAC,CAAC,MAAM,CAAC,EAE1B,IAAI,EAAE,uBAAuB,CAAC,CAAC,EAAE,EAAE,CAAC,EACpC,eAAe,EAAE,EAAE,EACnB,IAAI,EAAE,QAAQ,GACb,CAAC;IAIJ;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,uBAAuB,CAC5B,CAAC,SAAS,mBAAmB,CAAC,UAAU,EAAE,EAAE,CAAC,EAC7C,EAAE,SAAS,kBAAkB,EAC7B,QAAQ,SAAS,CAAC,CAAC,MAAM,CAAC,EAE1B,IAAI,EAAE,uBAAuB,CAAC,CAAC,EAAE,EAAE,CAAC,EACpC,eAAe,EAAE,EAAE,EACnB,IAAI,EAAE,QAAQ,EACd,GAAG,cAAc,EAAE,OAAO,EAAE,GAC3B,CAAC,CAAC,SAAS,CAAC;CAKhB"}
|
@@ -1,7 +1,4 @@
|
|
1
|
-
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.RequestEntityMapper = void 0;
|
4
|
-
const baseEntityMapper_model_1 = require("./baseEntityMapper.model");
|
1
|
+
import { BaseEntityMapper, construct } from './baseEntityMapper.model';
|
5
2
|
/**
|
6
3
|
* Abstract class representing a request entity mapper.
|
7
4
|
*
|
@@ -9,7 +6,7 @@ const baseEntityMapper_model_1 = require("./baseEntityMapper.model");
|
|
9
6
|
* @template SV - A type that extends AnySchemaValidator.
|
10
7
|
* @extends {BaseEntityMapper<SV>}
|
11
8
|
*/
|
12
|
-
class RequestEntityMapper extends
|
9
|
+
export class RequestEntityMapper extends BaseEntityMapper {
|
13
10
|
/**
|
14
11
|
* The entity type.
|
15
12
|
* @type {Entity}
|
@@ -51,7 +48,7 @@ class RequestEntityMapper extends baseEntityMapper_model_1.BaseEntityMapper {
|
|
51
48
|
* @returns {T} - An instance of the T.
|
52
49
|
*/
|
53
50
|
static fromJson(schemaValidator, json) {
|
54
|
-
return
|
51
|
+
return construct(this, schemaValidator).fromJson(json);
|
55
52
|
}
|
56
53
|
/**
|
57
54
|
* Deserializes a JSON object to an entity.
|
@@ -66,10 +63,8 @@ class RequestEntityMapper extends baseEntityMapper_model_1.BaseEntityMapper {
|
|
66
63
|
* @returns {T['_Entity']} - The entity.
|
67
64
|
*/
|
68
65
|
static deserializeJsonToEntity(schemaValidator, json, ...additionalArgs) {
|
69
|
-
return
|
66
|
+
return construct(this, schemaValidator)
|
70
67
|
.fromJson(json)
|
71
68
|
.toEntity(...additionalArgs);
|
72
69
|
}
|
73
70
|
}
|
74
|
-
exports.RequestEntityMapper = RequestEntityMapper;
|
75
|
-
//# sourceMappingURL=requestEntityMapper.model.js.map
|
@@ -64,3 +64,4 @@ export declare abstract class ResponseEntityMapper<Entity extends BaseEntity, SV
|
|
64
64
|
*/
|
65
65
|
static serializeEntityToJson<T extends ResponseEntityMapper<BaseEntity, SV>, SV extends AnySchemaValidator>(this: EntityMapperConstructor<T, SV>, schemaValidator: SV, entity: T['_Entity']): T['_dto'];
|
66
66
|
}
|
67
|
+
//# sourceMappingURL=responseEntityMapper.model.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"responseEntityMapper.model.d.ts","sourceRoot":"","sources":["../../../entityMapper/models/responseEntityMapper.model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,kDAAkD,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAa,MAAM,0BAA0B,CAAC;AAEvE;;;;;;GAMG;AACH,8BAAsB,oBAAoB,CACxC,MAAM,SAAS,UAAU,EACzB,EAAE,SAAS,kBAAkB,CAC7B,SAAQ,gBAAgB,CAAC,EAAE,CAAC;IAC5B;;;;OAIG;IACH,OAAO,EAAG,MAAM,CAAC;IAEjB;;;;;;;OAOG;IACH,QAAQ,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,OAAO,EAAE,GAAG,IAAI;IAEvE;;;;;OAKG;IACH,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC;IAYtB;;;;;;OAMG;IACH,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IAInD;;;;;;;;;OASG;IACH,MAAM,CAAC,UAAU,CACf,CAAC,SAAS,oBAAoB,CAAC,UAAU,EAAE,EAAE,CAAC,EAC9C,EAAE,SAAS,kBAAkB,EAE7B,IAAI,EAAE,uBAAuB,CAAC,CAAC,EAAE,EAAE,CAAC,EACpC,eAAe,EAAE,EAAE,EACnB,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC,GACnB,CAAC;IAIJ;;;;;;;;;;OAUG;IACH,MAAM,CAAC,qBAAqB,CAC1B,CAAC,SAAS,oBAAoB,CAAC,UAAU,EAAE,EAAE,CAAC,EAC9C,EAAE,SAAS,kBAAkB,EAE7B,IAAI,EAAE,uBAAuB,CAAC,CAAC,EAAE,EAAE,CAAC,EACpC,eAAe,EAAE,EAAE,EACnB,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC,GACnB,CAAC,CAAC,MAAM,CAAC;CAGb"}
|
@@ -1,7 +1,4 @@
|
|
1
|
-
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.ResponseEntityMapper = void 0;
|
4
|
-
const baseEntityMapper_model_1 = require("./baseEntityMapper.model");
|
1
|
+
import { BaseEntityMapper, construct } from './baseEntityMapper.model';
|
5
2
|
/**
|
6
3
|
* Abstract class representing a response entity mapper.
|
7
4
|
*
|
@@ -9,7 +6,7 @@ const baseEntityMapper_model_1 = require("./baseEntityMapper.model");
|
|
9
6
|
* @template SV - A type that extends AnySchemaValidator.
|
10
7
|
* @extends {BaseEntityMapper<SV>}
|
11
8
|
*/
|
12
|
-
class ResponseEntityMapper extends
|
9
|
+
export class ResponseEntityMapper extends BaseEntityMapper {
|
13
10
|
/**
|
14
11
|
* The entity type.
|
15
12
|
* @type {Entity}
|
@@ -49,7 +46,7 @@ class ResponseEntityMapper extends baseEntityMapper_model_1.BaseEntityMapper {
|
|
49
46
|
* @returns {T} - An instance of the T.
|
50
47
|
*/
|
51
48
|
static fromEntity(schemaValidator, entity) {
|
52
|
-
return
|
49
|
+
return construct(this, schemaValidator).fromEntity(entity);
|
53
50
|
}
|
54
51
|
/**
|
55
52
|
* Serializes an entity to a JSON object.
|
@@ -63,8 +60,6 @@ class ResponseEntityMapper extends baseEntityMapper_model_1.BaseEntityMapper {
|
|
63
60
|
* @throws {Error} - Throws an error if the DTO is invalid.
|
64
61
|
*/
|
65
62
|
static serializeEntityToJson(schemaValidator, entity) {
|
66
|
-
return
|
63
|
+
return construct(this, schemaValidator).serializeEntityToJson(entity);
|
67
64
|
}
|
68
65
|
}
|
69
|
-
exports.ResponseEntityMapper = ResponseEntityMapper;
|
70
|
-
//# sourceMappingURL=responseEntityMapper.model.js.map
|
@@ -7,3 +7,4 @@ import { UnboxedObjectSchema } from '@forklaunch/validator/types';
|
|
7
7
|
* @typedef {SV['_ValidSchemaObject'] | UnboxedObjectSchema<SV>} EntityMapperSchemaValidatorObject
|
8
8
|
*/
|
9
9
|
export type EntityMapperSchemaValidatorObject<SV extends AnySchemaValidator> = SV['_ValidSchemaObject'] | UnboxedObjectSchema<SV>;
|
10
|
+
//# sourceMappingURL=entityMapper.types.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"entityMapper.types.d.ts","sourceRoot":"","sources":["../../../entityMapper/types/entityMapper.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE;;;;;GAKG;AACH,MAAM,MAAM,iCAAiC,CAAC,EAAE,SAAS,kBAAkB,IACvE,EAAE,CAAC,oBAAoB,CAAC,GACxB,mBAAmB,CAAC,EAAE,CAAC,CAAC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"eslint.config.d.mts","sourceRoot":"","sources":["../eslint.config.mjs"],"names":[],"mappings":""}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import pluginJs from "@eslint/js";
|
2
|
+
import globals from "globals";
|
3
|
+
import tseslint from "typescript-eslint";
|
4
|
+
export default [
|
5
|
+
{ files: ["**/*.{ts}"] },
|
6
|
+
{ ignores: ["tests/**/*", "dist/**/*", "node_modules/**/*"] },
|
7
|
+
{ languageOptions: { globals: globals.browser } },
|
8
|
+
pluginJs.configs.recommended,
|
9
|
+
...tseslint.configs.recommended,
|
10
|
+
];
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"httpStatusCodes.d.ts","sourceRoot":"","sources":["../../http/httpStatusCodes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAmgCnD,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,YAAY,CAAC;AAEnD;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,SAAU,MAAM,KAAG,OAC3B,CAAC;AAEvB;;;;;GAKG;AACH,eAAO,MAAM,eAAe,SAAU,UAAU,KAAG,OACxB,CAAC;AAE5B;;;;;GAKG;AACH,eAAO,MAAM,YAAY,SAAU,UAAU,KAAG,OACrB,CAAC;AAE5B;;;;;GAKG;AACH,eAAO,MAAM,aAAa,SAAU,UAAU,KAAG,OACtB,CAAC;AAE5B;;;;;GAKG;AACH,eAAO,MAAM,aAAa,SAAU,UAAU,KAAG,OACtB,CAAC;AAE5B;;;;;GAKG;AACH,eAAO,MAAM,aAAa,SAAU,UAAU,KAAG,OAAsB,CAAC;AAExE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,gBAAgB,WAAY,MAAM,KAAG,IAAI,GAAG,UAOxD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
@@ -1,6 +1,3 @@
|
|
1
|
-
"use strict";
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.getCodeForStatus = exports.isServerError = exports.isClientError = exports.isRedirection = exports.isSuccessful = exports.isInformational = exports.isValidStatusCode = exports.HTTPStatuses = void 0;
|
4
1
|
/**
|
5
2
|
* Object-map of the HTTP Status Codes. Maps from the status code, to the
|
6
3
|
* textual name. The key is the HTTP Status Code number, and the resulting
|
@@ -12,7 +9,7 @@ exports.getCodeForStatus = exports.isServerError = exports.isClientError = expor
|
|
12
9
|
* @see https://httpstatuses.com
|
13
10
|
* @see https://datatracker.ietf.org/doc/html/rfc7231
|
14
11
|
*/
|
15
|
-
|
12
|
+
export const HTTPStatuses = {
|
16
13
|
/**
|
17
14
|
* The initial part of a request has been received and has not yet been
|
18
15
|
* rejected by the server. The server intends to send a final response after
|
@@ -985,48 +982,42 @@ exports.HTTPStatuses = {
|
|
985
982
|
* @param code HTTP Status code
|
986
983
|
* @returns True if the code is a valid HTTP status code
|
987
984
|
*/
|
988
|
-
const isValidStatusCode = (code) => !!
|
989
|
-
exports.isValidStatusCode = isValidStatusCode;
|
985
|
+
export const isValidStatusCode = (code) => !!HTTPStatuses[code];
|
990
986
|
/**
|
991
987
|
* Checks if the given status code is in the informational range (1XX).
|
992
988
|
*
|
993
989
|
* @param code HTTP Status code
|
994
990
|
* @returns True if the code is in the "informational" range.
|
995
991
|
*/
|
996
|
-
const isInformational = (code) => code >= 100 && code < 200;
|
997
|
-
exports.isInformational = isInformational;
|
992
|
+
export const isInformational = (code) => code >= 100 && code < 200;
|
998
993
|
/**
|
999
994
|
* Checks if the given status code is in the successful range (2XX).
|
1000
995
|
*
|
1001
996
|
* @param code HTTP Status code
|
1002
997
|
* @returns True if the code is in the "success" range.
|
1003
998
|
*/
|
1004
|
-
const isSuccessful = (code) => code >= 200 && code < 300;
|
1005
|
-
exports.isSuccessful = isSuccessful;
|
999
|
+
export const isSuccessful = (code) => code >= 200 && code < 300;
|
1006
1000
|
/**
|
1007
1001
|
* Checks if the given status code is in the redirection range (3XX).
|
1008
1002
|
*
|
1009
1003
|
* @param code HTTP Status code
|
1010
1004
|
* @returns True if the code is in the "redirection" range.
|
1011
1005
|
*/
|
1012
|
-
const isRedirection = (code) => code >= 300 && code < 400;
|
1013
|
-
exports.isRedirection = isRedirection;
|
1006
|
+
export const isRedirection = (code) => code >= 300 && code < 400;
|
1014
1007
|
/**
|
1015
1008
|
* Checks if the given status code is in the client error range (4XX).
|
1016
1009
|
*
|
1017
1010
|
* @param code HTTP Status code
|
1018
1011
|
* @returns True if the code is in the "client error" range.
|
1019
1012
|
*/
|
1020
|
-
const isClientError = (code) => code >= 400 && code < 500;
|
1021
|
-
exports.isClientError = isClientError;
|
1013
|
+
export const isClientError = (code) => code >= 400 && code < 500;
|
1022
1014
|
/**
|
1023
1015
|
* Checks if the given status code is in the server error range (5XX).
|
1024
1016
|
*
|
1025
1017
|
* @param code HTTP Status code
|
1026
1018
|
* @returns True if the code is in the "server error" range.
|
1027
1019
|
*/
|
1028
|
-
const isServerError = (code) => code >= 500;
|
1029
|
-
exports.isServerError = isServerError;
|
1020
|
+
export const isServerError = (code) => code >= 500;
|
1030
1021
|
/**
|
1031
1022
|
* Searches the list of HTTP statuses for a matching textual name to the one
|
1032
1023
|
* provided. If a match is found, then the numerical status code is returned,
|
@@ -1038,13 +1029,11 @@ exports.isServerError = isServerError;
|
|
1038
1029
|
* @param status HTTP Status textual name
|
1039
1030
|
* @returns The numerical status code, or null if not found
|
1040
1031
|
*/
|
1041
|
-
const getCodeForStatus = (status) => {
|
1032
|
+
export const getCodeForStatus = (status) => {
|
1042
1033
|
const clnStr = status.toLocaleLowerCase().trim();
|
1043
|
-
const entry = Object.entries(
|
1034
|
+
const entry = Object.entries(HTTPStatuses).find((ent) => ent[1].toLowerCase() === clnStr);
|
1044
1035
|
if (entry)
|
1045
1036
|
return parseInt(entry[0]);
|
1046
1037
|
return null;
|
1047
1038
|
};
|
1048
|
-
|
1049
|
-
exports.default = exports.HTTPStatuses;
|
1050
|
-
//# sourceMappingURL=httpStatusCodes.js.map
|
1039
|
+
export default HTTPStatuses;
|
package/dist/http/index.d.ts
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../http/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
package/dist/http/index.js
CHANGED
@@ -1,22 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
__exportStar(require("./httpStatusCodes"), exports);
|
18
|
-
__exportStar(require("./middleware"), exports);
|
19
|
-
__exportStar(require("./openApiV3Generator"), exports);
|
20
|
-
__exportStar(require("./regex"), exports);
|
21
|
-
__exportStar(require("./types"), exports);
|
22
|
-
//# sourceMappingURL=index.js.map
|
1
|
+
export * from './httpStatusCodes';
|
2
|
+
export * from './middleware';
|
3
|
+
export * from './openApiV3Generator';
|
4
|
+
export * from './regex';
|
5
|
+
export * from './types';
|