@spinajs/http 2.0.68 → 2.0.69
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/http.d.ts +3 -1
- package/lib/config/http.d.ts.map +1 -1
- package/lib/config/http.js +1 -1
- package/lib/config/http.js.map +1 -1
- package/lib/locales/en.json +10 -0
- package/lib/locales/pl.json +10 -0
- package/lib/static/favicon.ico +0 -0
- package/lib/static/style.css +15 -0
- package/lib/views/responses/badRequest.pug +13 -0
- package/lib/views/responses/conflict.pug +13 -0
- package/lib/views/responses/forbidden.pug +13 -0
- package/lib/views/responses/noContent.pug +13 -0
- package/lib/views/responses/not-allowed.pug +13 -0
- package/lib/views/responses/notFound.pug +13 -0
- package/lib/views/responses/ok.pug +12 -0
- package/lib/views/responses/serverError.pug +13 -0
- package/lib/views/responses/unauthorized.pug +13 -0
- package/package.json +12 -11
package/lib/config/http.d.ts
CHANGED
|
@@ -20,7 +20,9 @@ declare const http: {
|
|
|
20
20
|
port: number;
|
|
21
21
|
middlewares: (express.RequestHandler<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>> | ((req: cors.CorsRequest, res: {
|
|
22
22
|
statusCode?: number;
|
|
23
|
-
setHeader(key: string, value: string): any;
|
|
23
|
+
setHeader(key: string, value: string): any; /**
|
|
24
|
+
* Static files folder. Feel free to override this per app
|
|
25
|
+
*/
|
|
24
26
|
end(): any;
|
|
25
27
|
}, next: (err?: any) => any) => void))[];
|
|
26
28
|
/**
|
package/lib/config/http.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/config/http.ts"],"names":[],"mappings":";AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAI9B,OAAO,IAAI,MAAM,MAAM,CAAC;AAyBxB,QAAA,MAAM,IAAI
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/config/http.ts"],"names":[],"mappings":";AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAI9B,OAAO,IAAI,MAAM,MAAM,CAAC;AAyBxB,QAAA,MAAM,IAAI;;;;;;;;;;;;;;;;;;;wDAwCN;;eAEG;;;QAZH;;WAEG;;;;;QAQH;;WAEG;;YAGC;;eAEG;;YAGH;;eAEG;;;QAKP;;WAEG;;QAGH;;;WAGG;;;CAgBN,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
package/lib/config/http.js
CHANGED
|
@@ -7,7 +7,7 @@ import { join, normalize, resolve } from 'path';
|
|
|
7
7
|
import { HttpAcceptHeaders } from '../interfaces.js';
|
|
8
8
|
import fs from 'fs';
|
|
9
9
|
function dir(path) {
|
|
10
|
-
return resolve(normalize(join(process.cwd(), "node_modules", "@spinajs", "http", path)));
|
|
10
|
+
return resolve(normalize(join(process.cwd(), "node_modules", "@spinajs", "http", "lib", path)));
|
|
11
11
|
}
|
|
12
12
|
const corsPath = resolve(normalize(join(process.cwd(), 'cors.json')));
|
|
13
13
|
const cOptions = JSON.parse(fs.readFileSync(corsPath, 'utf-8'));
|
package/lib/config/http.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/config/http.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,WAAW,MAAM,aAAa,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,SAAS,GAAG,CAAC,IAAY;IACvB,OAAO,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO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CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Not found": "Resource not found",
|
|
3
|
+
"Server error": "Critital server error",
|
|
4
|
+
"Forbidden" : "Access forbidden",
|
|
5
|
+
"Route not found": "Route not found",
|
|
6
|
+
"Unauthorized": "Access denied",
|
|
7
|
+
"No content" : "No content",
|
|
8
|
+
"Bad request" : "Bad request",
|
|
9
|
+
"You do not have access to this resource." : "You do not have access to this resource"
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Not found": "Nie znaleziono zasobu",
|
|
3
|
+
"Server error": "Błąd serwera",
|
|
4
|
+
"Forbidden" : "Zabroniony dostęp",
|
|
5
|
+
"Route not found": "Ścieżka nie odnaleziona",
|
|
6
|
+
"Unauthorized": "Brak uprawnień",
|
|
7
|
+
"No content" : "Brak zawartości",
|
|
8
|
+
"Bad request" : "Złe żądanie",
|
|
9
|
+
"You do not have access to this resource." : "Nie posiadasz uprawnień do tego zasobu."
|
|
10
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
html
|
|
2
|
+
head
|
|
3
|
+
link(rel="icon", type="image/x-icon", href="/static/favicon.ico")
|
|
4
|
+
|
|
5
|
+
title #{__("Bad request")}
|
|
6
|
+
|
|
7
|
+
link(href="/static/style.css",rel="stylesheet")
|
|
8
|
+
body
|
|
9
|
+
div(class="container")
|
|
10
|
+
div(class="item")
|
|
11
|
+
div(class="entry")
|
|
12
|
+
h1 400 - #{__("Bad request")}
|
|
13
|
+
div #{__(message)}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
html
|
|
2
|
+
head
|
|
3
|
+
link(rel="icon", type="image/x-icon", href="/static/favicon.ico")
|
|
4
|
+
|
|
5
|
+
title #{__("Conflict")}
|
|
6
|
+
|
|
7
|
+
link(href="/static/style.css",rel="stylesheet")
|
|
8
|
+
body
|
|
9
|
+
div(class="container")
|
|
10
|
+
div(class="item")
|
|
11
|
+
div(class="entry")
|
|
12
|
+
h1 409 - #{__("Conflict")}
|
|
13
|
+
div #{__(message)}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
html
|
|
2
|
+
head
|
|
3
|
+
link(rel="icon", type="image/x-icon", href="/static/favicon.ico")
|
|
4
|
+
|
|
5
|
+
title #{__("Forbidden")}
|
|
6
|
+
|
|
7
|
+
link(href="/static/style.css",rel="stylesheet")
|
|
8
|
+
body
|
|
9
|
+
div(class="container")
|
|
10
|
+
div(class="item")
|
|
11
|
+
div(class="entry")
|
|
12
|
+
h1 403 - #{__("Forbidden")}
|
|
13
|
+
div #{__(message)}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
html
|
|
2
|
+
head
|
|
3
|
+
link(rel="icon", type="image/x-icon", href="/static/favicon.ico")
|
|
4
|
+
|
|
5
|
+
title #{__("No content")}
|
|
6
|
+
|
|
7
|
+
link(href="/static/style.css",rel="stylesheet")
|
|
8
|
+
body
|
|
9
|
+
div(class="container")
|
|
10
|
+
div(class="item")
|
|
11
|
+
div(class="entry")
|
|
12
|
+
h1 204 - #{__("No content")}
|
|
13
|
+
div #{__(message)}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
html
|
|
2
|
+
head
|
|
3
|
+
link(rel="icon", type="image/x-icon", href="/static/favicon.ico")
|
|
4
|
+
|
|
5
|
+
title #{__("Not allowed")}
|
|
6
|
+
|
|
7
|
+
link(href="/static/style.css",rel="stylesheet")
|
|
8
|
+
body
|
|
9
|
+
div(class="container")
|
|
10
|
+
div(class="item")
|
|
11
|
+
div(class="entry")
|
|
12
|
+
h1 405 - #{__("Not allowed")}
|
|
13
|
+
div #{__(message)}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
html
|
|
2
|
+
head
|
|
3
|
+
link(rel="icon", type="image/x-icon", href="/static/favicon.ico")
|
|
4
|
+
|
|
5
|
+
title #{__("Not found")}
|
|
6
|
+
|
|
7
|
+
link(href="/static/style.css",rel="stylesheet")
|
|
8
|
+
body
|
|
9
|
+
div(class="container")
|
|
10
|
+
div(class="item")
|
|
11
|
+
div(class="entry")
|
|
12
|
+
h1 404 - #{__("Not found")}
|
|
13
|
+
div #{__(message)}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
html
|
|
2
|
+
head
|
|
3
|
+
link(rel="icon", type="image/x-icon", href="/static/favicon.png")
|
|
4
|
+
|
|
5
|
+
title #{__("All ok")}
|
|
6
|
+
|
|
7
|
+
link(href="/static/style.css",rel="stylesheet")
|
|
8
|
+
body
|
|
9
|
+
div(class="container")
|
|
10
|
+
div(class="item")
|
|
11
|
+
div(class="entry")
|
|
12
|
+
h1 200 - #{__("All ok")}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
html
|
|
2
|
+
head
|
|
3
|
+
link(rel="icon", type="image/x-icon", href="/static/favicon.ico")
|
|
4
|
+
|
|
5
|
+
title #{__("Server error")}
|
|
6
|
+
|
|
7
|
+
link(href="/static/style.css",rel="stylesheet")
|
|
8
|
+
body
|
|
9
|
+
div(class="container")
|
|
10
|
+
div(class="item")
|
|
11
|
+
div(class="entry")
|
|
12
|
+
h1 500 - #{__("Server error")}
|
|
13
|
+
div #{__(message)}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
html
|
|
2
|
+
head
|
|
3
|
+
link(rel="icon", type="image/x-icon", href="/static/favicon.ico")
|
|
4
|
+
|
|
5
|
+
title #{__("Unauthorized")}
|
|
6
|
+
|
|
7
|
+
link(href="/static/style.css",rel="stylesheet")
|
|
8
|
+
body
|
|
9
|
+
div(class="container")
|
|
10
|
+
div(class="item")
|
|
11
|
+
div(class="entry")
|
|
12
|
+
h1 401 - #{__("Unauthorized")}
|
|
13
|
+
div #{__(message)}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spinajs/http",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.69",
|
|
4
4
|
"description": "framework HTTP module base on express.js",
|
|
5
5
|
"exports": "./lib/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -49,18 +49,19 @@
|
|
|
49
49
|
"@types/luxon": "^3.2.0",
|
|
50
50
|
"@types/node": "^18.11.18",
|
|
51
51
|
"@types/pug": "^2.0.6",
|
|
52
|
-
"@types/uuid": "^9.0.0"
|
|
52
|
+
"@types/uuid": "^9.0.0",
|
|
53
|
+
"cpx": "1.5.0"
|
|
53
54
|
},
|
|
54
55
|
"dependencies": {
|
|
55
|
-
"@spinajs/configuration": "^2.0.
|
|
56
|
-
"@spinajs/di": "^2.0.
|
|
57
|
-
"@spinajs/exceptions": "^2.0.
|
|
58
|
-
"@spinajs/fs": "^2.0.
|
|
59
|
-
"@spinajs/log": "^2.0.
|
|
60
|
-
"@spinajs/reflection": "^2.0.
|
|
61
|
-
"@spinajs/templates": "^2.0.
|
|
62
|
-
"@spinajs/validation": "^2.0.
|
|
63
|
-
"@spinajs/templates-pug": "^2.0.
|
|
56
|
+
"@spinajs/configuration": "^2.0.69",
|
|
57
|
+
"@spinajs/di": "^2.0.69",
|
|
58
|
+
"@spinajs/exceptions": "^2.0.69",
|
|
59
|
+
"@spinajs/fs": "^2.0.69",
|
|
60
|
+
"@spinajs/log": "^2.0.69",
|
|
61
|
+
"@spinajs/reflection": "^2.0.69",
|
|
62
|
+
"@spinajs/templates": "^2.0.69",
|
|
63
|
+
"@spinajs/validation": "^2.0.69",
|
|
64
|
+
"@spinajs/templates-pug": "^2.0.69",
|
|
64
65
|
"compression": "^1.7.4",
|
|
65
66
|
"cookie-parser": "^1.4.6",
|
|
66
67
|
"cookie-signature": "^1.2.0",
|