@forklaunch/hyper-express 0.1.1 → 0.1.3
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/lib/config.d.ts +2 -0
- package/lib/config.d.ts.map +1 -0
- package/lib/config.js +1 -0
- package/lib/eslint.config.d.mts +3 -0
- package/lib/eslint.config.d.mts.map +1 -0
- package/lib/eslint.config.mjs +10 -0
- package/lib/index.d.ts +23 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +25 -0
- package/lib/jest.config.d.ts +4 -0
- package/lib/jest.config.d.ts.map +1 -0
- package/lib/jest.config.js +19 -0
- package/lib/src/hyperExpressApplication.d.ts +36 -0
- package/lib/src/hyperExpressApplication.d.ts.map +1 -0
- package/lib/src/hyperExpressApplication.js +70 -0
- package/lib/src/hyperExpressRouter.d.ts +10 -0
- package/lib/src/hyperExpressRouter.d.ts.map +1 -0
- package/lib/src/hyperExpressRouter.js +22 -0
- package/lib/src/middleware/contentParse.middleware.d.ts +8 -0
- package/lib/src/middleware/contentParse.middleware.d.ts.map +1 -0
- package/lib/src/middleware/contentParse.middleware.js +26 -0
- package/lib/src/middleware/enrichResponseTransmission.middleware.d.ts +14 -0
- package/lib/src/middleware/enrichResponseTransmission.middleware.d.ts.map +1 -0
- package/{dist/middleware/response.middleware.js → lib/src/middleware/enrichResponseTransmission.middleware.js} +19 -17
- package/lib/src/middleware/polyfillGetHeaders.middleware.d.ts +3 -0
- package/lib/src/middleware/polyfillGetHeaders.middleware.d.ts.map +1 -0
- package/lib/src/middleware/polyfillGetHeaders.middleware.js +8 -0
- package/{dist → lib/src}/middleware/swagger.middleware.d.ts +1 -0
- package/lib/src/middleware/swagger.middleware.d.ts.map +1 -0
- package/{dist → lib/src}/middleware/swagger.middleware.js +9 -19
- package/lib/src/types/hyperExpress.types.d.ts +42 -0
- package/lib/src/types/hyperExpress.types.d.ts.map +1 -0
- package/lib/tests/typebox.forklaunch.hyperExpress.test.d.ts +2 -0
- package/lib/tests/typebox.forklaunch.hyperExpress.test.d.ts.map +1 -0
- package/{dist/tests/zod.forklaunch.hyperExpress.test.js → lib/tests/typebox.forklaunch.hyperExpress.test.js} +23 -53
- package/lib/tests/zod.forklaunch.hyperExpress.test.d.ts +2 -0
- package/lib/tests/zod.forklaunch.hyperExpress.test.d.ts.map +1 -0
- package/{dist/tests/typebox.forklaunch.hyperExpress.test.js → lib/tests/zod.forklaunch.hyperExpress.test.js} +22 -54
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/lib/vitest.config.d.ts +3 -0
- package/lib/vitest.config.d.ts.map +1 -0
- package/lib/vitest.config.js +7 -0
- package/package.json +27 -14
- package/.prettierignore +0 -2
- package/.prettierrc +0 -7
- package/dist/forklaunch.hyperExpress.d.ts +0 -192
- package/dist/forklaunch.hyperExpress.js +0 -358
- package/dist/forklaunch.hyperExpress.js.map +0 -1
- package/dist/jest.config.d.ts +0 -3
- package/dist/jest.config.js.map +0 -1
- package/dist/main.js +0 -90
- package/dist/main.js.map +0 -1
- package/dist/middleware/contentParse.middleware.d.ts +0 -7
- package/dist/middleware/contentParse.middleware.js +0 -30
- package/dist/middleware/contentParse.middleware.js.map +0 -1
- package/dist/middleware/response.middleware.d.ts +0 -12
- package/dist/middleware/response.middleware.js.map +0 -1
- package/dist/middleware/swagger.middleware.js.map +0 -1
- package/dist/tests/typebox.forklaunch.hyperExpress.test.d.ts +0 -1
- package/dist/tests/typebox.forklaunch.hyperExpress.test.js.map +0 -1
- package/dist/tests/zod.forklaunch.hyperExpress.test.d.ts +0 -1
- package/dist/tests/zod.forklaunch.hyperExpress.test.js.map +0 -1
- package/dist/types/forklaunch.hyperExpress.types.d.ts +0 -67
- package/dist/types/forklaunch.hyperExpress.types.js +0 -3
- package/dist/types/forklaunch.hyperExpress.types.js.map +0 -1
- package/eslint.config.mjs +0 -12
- package/forklaunch.hyperExpress.ts +0 -649
- package/jest.config.ts +0 -10
- package/main.ts +0 -97
- package/tests/typebox.forklaunch.hyperExpress.test.ts +0 -164
- package/tests/zod.forklaunch.hyperExpress.test.ts +0 -164
- /package/{dist/main.d.ts → lib/src/types/hyperExpress.types.js} +0 -0
@@ -1,56 +1,27 @@
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
-
}) : function(o, v) {
|
16
|
-
o["default"] = v;
|
17
|
-
});
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
-
if (mod && mod.__esModule) return mod;
|
20
|
-
var result = {};
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
-
__setModuleDefault(result, mod);
|
23
|
-
return result;
|
24
|
-
};
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
-
const zod_1 = require("@forklaunch/validator/zod");
|
27
|
-
const kill_port_process_1 = require("kill-port-process");
|
28
|
-
const forklaunch_hyperExpress_1 = __importStar(require("../forklaunch.hyperExpress"));
|
29
|
-
const zodSchemaValidator = new zod_1.ZodSchemaValidator();
|
1
|
+
import { SchemaValidator, string } from '@forklaunch/validator/typebox';
|
2
|
+
import { forklaunchExpress, forklaunchRouter } from '../index';
|
3
|
+
const typeboxSchemaValidator = SchemaValidator();
|
4
|
+
const forklaunchApplication = forklaunchExpress(typeboxSchemaValidator);
|
5
|
+
const forklaunchRouterInstance = forklaunchRouter('/testpath', typeboxSchemaValidator);
|
30
6
|
describe('Forklaunch Hyper-Express Tests', () => {
|
31
|
-
let forklaunchApplication;
|
32
|
-
let forklaunchRouterInstance;
|
33
7
|
beforeAll(async () => {
|
34
|
-
await (0, kill_port_process_1.killPortProcess)(6935);
|
35
|
-
forklaunchApplication = (0, forklaunch_hyperExpress_1.default)(zodSchemaValidator);
|
36
|
-
forklaunchRouterInstance = (0, forklaunch_hyperExpress_1.forklaunchRouter)('/testpath', zodSchemaValidator);
|
37
8
|
forklaunchRouterInstance.get('/test', {
|
38
9
|
name: 'Test',
|
39
10
|
summary: 'Test Summary',
|
40
11
|
responses: {
|
41
|
-
200:
|
12
|
+
200: string
|
42
13
|
}
|
43
|
-
}, (
|
14
|
+
}, (_req, res) => {
|
44
15
|
res.status(200).send('Hello World');
|
45
16
|
});
|
46
17
|
forklaunchRouterInstance.post('/test', {
|
47
18
|
name: 'Test',
|
48
19
|
summary: 'Test Summary',
|
49
20
|
body: {
|
50
|
-
test:
|
21
|
+
test: string
|
51
22
|
},
|
52
23
|
responses: {
|
53
|
-
200:
|
24
|
+
200: string
|
54
25
|
}
|
55
26
|
}, (req, res) => {
|
56
27
|
res.status(200).send(req.body.test);
|
@@ -59,10 +30,10 @@ describe('Forklaunch Hyper-Express Tests', () => {
|
|
59
30
|
name: 'Test',
|
60
31
|
summary: 'Test Summary',
|
61
32
|
body: {
|
62
|
-
test:
|
33
|
+
test: string
|
63
34
|
},
|
64
35
|
responses: {
|
65
|
-
200:
|
36
|
+
200: string
|
66
37
|
}
|
67
38
|
}, (req, res) => {
|
68
39
|
res.status(200).send(req.body.test);
|
@@ -71,10 +42,10 @@ describe('Forklaunch Hyper-Express Tests', () => {
|
|
71
42
|
name: 'Test',
|
72
43
|
summary: 'Test Summary',
|
73
44
|
body: {
|
74
|
-
test:
|
45
|
+
test: string
|
75
46
|
},
|
76
47
|
responses: {
|
77
|
-
200:
|
48
|
+
200: string
|
78
49
|
}
|
79
50
|
}, (req, res) => {
|
80
51
|
res.status(200).send(req.body.test);
|
@@ -83,25 +54,25 @@ describe('Forklaunch Hyper-Express Tests', () => {
|
|
83
54
|
name: 'Test',
|
84
55
|
summary: 'Test Summary',
|
85
56
|
responses: {
|
86
|
-
200:
|
57
|
+
200: string
|
87
58
|
}
|
88
|
-
}, (
|
59
|
+
}, (_req, res) => {
|
89
60
|
res.status(200).send('Hello World');
|
90
61
|
});
|
91
62
|
forklaunchApplication.use(forklaunchRouterInstance);
|
92
|
-
await forklaunchApplication.listen(
|
93
|
-
console.log('
|
63
|
+
await forklaunchApplication.listen(6936, () => {
|
64
|
+
console.log('server started on 6936');
|
94
65
|
});
|
95
66
|
});
|
96
67
|
test('Get', async () => {
|
97
|
-
const testGet = await fetch('http://localhost:
|
68
|
+
const testGet = await fetch('http://localhost:6936/testpath/test', {
|
98
69
|
method: 'GET'
|
99
70
|
});
|
100
71
|
expect(testGet.status).toBe(200);
|
101
72
|
expect(await testGet.text()).toBe('Hello World');
|
102
73
|
});
|
103
74
|
test('Post', async () => {
|
104
|
-
const testPost = await fetch('http://localhost:
|
75
|
+
const testPost = await fetch('http://localhost:6936/testpath/test', {
|
105
76
|
method: 'POST',
|
106
77
|
body: JSON.stringify({ test: 'Hello World' }),
|
107
78
|
headers: { 'Content-Type': 'application/json' }
|
@@ -110,7 +81,7 @@ describe('Forklaunch Hyper-Express Tests', () => {
|
|
110
81
|
expect(await testPost.text()).toBe('Hello World');
|
111
82
|
});
|
112
83
|
test('Put', async () => {
|
113
|
-
const testPut = await fetch('http://localhost:
|
84
|
+
const testPut = await fetch('http://localhost:6936/testpath/test', {
|
114
85
|
method: 'PUT',
|
115
86
|
body: JSON.stringify({ test: 'Hello World' }),
|
116
87
|
headers: { 'Content-Type': 'application/json' }
|
@@ -119,7 +90,7 @@ describe('Forklaunch Hyper-Express Tests', () => {
|
|
119
90
|
expect(await testPut.text()).toBe('Hello World');
|
120
91
|
});
|
121
92
|
test('Patch', async () => {
|
122
|
-
const testPatch = await fetch('http://localhost:
|
93
|
+
const testPatch = await fetch('http://localhost:6936/testpath/test', {
|
123
94
|
method: 'PATCH',
|
124
95
|
body: JSON.stringify({ test: 'Hello World' }),
|
125
96
|
headers: { 'Content-Type': 'application/json' }
|
@@ -128,14 +99,13 @@ describe('Forklaunch Hyper-Express Tests', () => {
|
|
128
99
|
expect(await testPatch.text()).toBe('Hello World');
|
129
100
|
});
|
130
101
|
test('Delete', async () => {
|
131
|
-
const testDelete = await fetch('http://localhost:
|
102
|
+
const testDelete = await fetch('http://localhost:6936/testpath/test', {
|
132
103
|
method: 'DELETE'
|
133
104
|
});
|
134
105
|
expect(testDelete.status).toBe(200);
|
135
106
|
expect(await testDelete.text()).toBe('Hello World');
|
136
107
|
});
|
137
108
|
afterAll(async () => {
|
138
|
-
|
109
|
+
forklaunchApplication.internal.shutdown();
|
139
110
|
});
|
140
111
|
});
|
141
|
-
//# sourceMappingURL=zod.forklaunch.hyperExpress.test.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"zod.forklaunch.hyperExpress.test.d.ts","sourceRoot":"","sources":["../../tests/zod.forklaunch.hyperExpress.test.ts"],"names":[],"mappings":""}
|
@@ -1,56 +1,27 @@
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
-
}) : function(o, v) {
|
16
|
-
o["default"] = v;
|
17
|
-
});
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
-
if (mod && mod.__esModule) return mod;
|
20
|
-
var result = {};
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
-
__setModuleDefault(result, mod);
|
23
|
-
return result;
|
24
|
-
};
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
-
const typebox_1 = require("@forklaunch/validator/typebox");
|
27
|
-
const kill_port_process_1 = require("kill-port-process");
|
28
|
-
const forklaunch_hyperExpress_1 = __importStar(require("../forklaunch.hyperExpress"));
|
29
|
-
const typeboxSchemaValidator = new typebox_1.TypeboxSchemaValidator();
|
1
|
+
import { SchemaValidator, string } from '@forklaunch/validator/zod';
|
2
|
+
import { forklaunchExpress, forklaunchRouter } from '../index';
|
3
|
+
const zodSchemaValidator = SchemaValidator();
|
4
|
+
const forklaunchApplication = forklaunchExpress(zodSchemaValidator);
|
5
|
+
const forklaunchRouterInstance = forklaunchRouter('/testpath', zodSchemaValidator);
|
30
6
|
describe('Forklaunch Hyper-Express Tests', () => {
|
31
|
-
let forklaunchApplication;
|
32
|
-
let forklaunchRouterInstance;
|
33
7
|
beforeAll(async () => {
|
34
|
-
await (0, kill_port_process_1.killPortProcess)(6934);
|
35
|
-
forklaunchApplication = (0, forklaunch_hyperExpress_1.default)(typeboxSchemaValidator);
|
36
|
-
forklaunchRouterInstance = (0, forklaunch_hyperExpress_1.forklaunchRouter)('/testpath', typeboxSchemaValidator);
|
37
8
|
forklaunchRouterInstance.get('/test', {
|
38
9
|
name: 'Test',
|
39
10
|
summary: 'Test Summary',
|
40
11
|
responses: {
|
41
|
-
200:
|
12
|
+
200: string
|
42
13
|
}
|
43
|
-
}, (
|
14
|
+
}, (_req, res) => {
|
44
15
|
res.status(200).send('Hello World');
|
45
16
|
});
|
46
17
|
forklaunchRouterInstance.post('/test', {
|
47
18
|
name: 'Test',
|
48
19
|
summary: 'Test Summary',
|
49
20
|
body: {
|
50
|
-
test:
|
21
|
+
test: string
|
51
22
|
},
|
52
23
|
responses: {
|
53
|
-
200:
|
24
|
+
200: string
|
54
25
|
}
|
55
26
|
}, (req, res) => {
|
56
27
|
res.status(200).send(req.body.test);
|
@@ -59,10 +30,10 @@ describe('Forklaunch Hyper-Express Tests', () => {
|
|
59
30
|
name: 'Test',
|
60
31
|
summary: 'Test Summary',
|
61
32
|
body: {
|
62
|
-
test:
|
33
|
+
test: string
|
63
34
|
},
|
64
35
|
responses: {
|
65
|
-
200:
|
36
|
+
200: string
|
66
37
|
}
|
67
38
|
}, (req, res) => {
|
68
39
|
res.status(200).send(req.body.test);
|
@@ -71,10 +42,10 @@ describe('Forklaunch Hyper-Express Tests', () => {
|
|
71
42
|
name: 'Test',
|
72
43
|
summary: 'Test Summary',
|
73
44
|
body: {
|
74
|
-
test:
|
45
|
+
test: string
|
75
46
|
},
|
76
47
|
responses: {
|
77
|
-
200:
|
48
|
+
200: string
|
78
49
|
}
|
79
50
|
}, (req, res) => {
|
80
51
|
res.status(200).send(req.body.test);
|
@@ -83,25 +54,23 @@ describe('Forklaunch Hyper-Express Tests', () => {
|
|
83
54
|
name: 'Test',
|
84
55
|
summary: 'Test Summary',
|
85
56
|
responses: {
|
86
|
-
200:
|
57
|
+
200: string
|
87
58
|
}
|
88
|
-
}, (
|
59
|
+
}, (_req, res) => {
|
89
60
|
res.status(200).send('Hello World');
|
90
61
|
});
|
91
62
|
forklaunchApplication.use(forklaunchRouterInstance);
|
92
|
-
await forklaunchApplication.listen(
|
93
|
-
console.log('Server started');
|
94
|
-
});
|
63
|
+
await forklaunchApplication.listen(6937, () => { });
|
95
64
|
});
|
96
65
|
test('Get', async () => {
|
97
|
-
const testGet = await fetch('http://localhost:
|
66
|
+
const testGet = await fetch('http://localhost:6937/testpath/test', {
|
98
67
|
method: 'GET'
|
99
68
|
});
|
100
69
|
expect(testGet.status).toBe(200);
|
101
70
|
expect(await testGet.text()).toBe('Hello World');
|
102
71
|
});
|
103
72
|
test('Post', async () => {
|
104
|
-
const testPost = await fetch('http://localhost:
|
73
|
+
const testPost = await fetch('http://localhost:6937/testpath/test', {
|
105
74
|
method: 'POST',
|
106
75
|
body: JSON.stringify({ test: 'Hello World' }),
|
107
76
|
headers: { 'Content-Type': 'application/json' }
|
@@ -110,7 +79,7 @@ describe('Forklaunch Hyper-Express Tests', () => {
|
|
110
79
|
expect(await testPost.text()).toBe('Hello World');
|
111
80
|
});
|
112
81
|
test('Put', async () => {
|
113
|
-
const testPut = await fetch('http://localhost:
|
82
|
+
const testPut = await fetch('http://localhost:6937/testpath/test', {
|
114
83
|
method: 'PUT',
|
115
84
|
body: JSON.stringify({ test: 'Hello World' }),
|
116
85
|
headers: { 'Content-Type': 'application/json' }
|
@@ -119,7 +88,7 @@ describe('Forklaunch Hyper-Express Tests', () => {
|
|
119
88
|
expect(await testPut.text()).toBe('Hello World');
|
120
89
|
});
|
121
90
|
test('Patch', async () => {
|
122
|
-
const testPatch = await fetch('http://localhost:
|
91
|
+
const testPatch = await fetch('http://localhost:6937/testpath/test', {
|
123
92
|
method: 'PATCH',
|
124
93
|
body: JSON.stringify({ test: 'Hello World' }),
|
125
94
|
headers: { 'Content-Type': 'application/json' }
|
@@ -128,14 +97,13 @@ describe('Forklaunch Hyper-Express Tests', () => {
|
|
128
97
|
expect(await testPatch.text()).toBe('Hello World');
|
129
98
|
});
|
130
99
|
test('Delete', async () => {
|
131
|
-
const testDelete = await fetch('http://localhost:
|
100
|
+
const testDelete = await fetch('http://localhost:6937/testpath/test', {
|
132
101
|
method: 'DELETE'
|
133
102
|
});
|
134
103
|
expect(testDelete.status).toBe(200);
|
135
104
|
expect(await testDelete.text()).toBe('Hello World');
|
136
105
|
});
|
137
106
|
afterAll(async () => {
|
138
|
-
|
107
|
+
forklaunchApplication.internal.shutdown();
|
139
108
|
});
|
140
109
|
});
|
141
|
-
//# sourceMappingURL=typebox.forklaunch.hyperExpress.test.js.map
|