@emoyly/problem 4.1.8 → 4.1.11

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.
Files changed (56) hide show
  1. package/defaults/4xx.d.ts +147 -0
  2. package/defaults/4xx.js +151 -0
  3. package/defaults/5xx.d.ts +57 -0
  4. package/defaults/5xx.js +61 -0
  5. package/defaults/aws.d.ts +12 -0
  6. package/defaults/aws.js +16 -0
  7. package/defaults/cloudflare.d.ts +47 -0
  8. package/defaults/cloudflare.js +52 -0
  9. package/defaults/iis.d.ts +17 -0
  10. package/defaults/iis.js +21 -0
  11. package/defaults/index.d.ts +7 -0
  12. package/defaults/index.js +17 -0
  13. package/defaults/nginx.d.ts +32 -0
  14. package/defaults/nginx.js +36 -0
  15. package/defaults/others.d.ts +37 -0
  16. package/defaults/others.js +40 -0
  17. package/index.d.ts +4 -0
  18. package/index.js +34 -0
  19. package/middleware/axios.d.ts +13 -0
  20. package/middleware/axios.js +36 -0
  21. package/middleware/base.d.ts +24 -0
  22. package/middleware/base.js +49 -0
  23. package/middleware/express.d.ts +19 -0
  24. package/middleware/express.js +57 -0
  25. package/package.json +7 -25
  26. package/parsers/axios.d.ts +3 -0
  27. package/parsers/axios.js +39 -0
  28. package/parsers/http.d.ts +3 -0
  29. package/parsers/http.js +15 -0
  30. package/parsers/jsonwebtoken.d.ts +3 -0
  31. package/parsers/jsonwebtoken.js +96 -0
  32. package/parsers/mikroorm.d.ts +3 -0
  33. package/parsers/mikroorm.js +15 -0
  34. package/parsers/tsoa.d.ts +3 -0
  35. package/parsers/tsoa.js +17 -0
  36. package/problem.d.ts +13 -0
  37. package/problem.js +50 -0
  38. package/tsconfig.tsbuildinfo +3797 -0
  39. package/typings/events.d.ts +2 -0
  40. package/typings/events.js +2 -0
  41. package/typings/index.d.ts +5 -0
  42. package/typings/index.js +17 -0
  43. package/typings/middleware.d.ts +9 -0
  44. package/typings/middleware.js +2 -0
  45. package/typings/misc.d.ts +3 -0
  46. package/typings/misc.js +2 -0
  47. package/typings/parser.d.ts +9 -0
  48. package/typings/parser.js +2 -0
  49. package/typings/problem.d.ts +23 -0
  50. package/typings/problem.js +12 -0
  51. package/util/events.d.ts +16 -0
  52. package/util/events.js +29 -0
  53. package/util/getProblems.d.ts +5 -0
  54. package/util/getProblems.js +45 -0
  55. package/util/version.d.ts +3 -0
  56. package/util/version.js +20 -0
@@ -0,0 +1,147 @@
1
+ export declare const statusCodes: {
2
+ 400: {
3
+ status: number;
4
+ title: string;
5
+ type: string;
6
+ };
7
+ 401: {
8
+ status: number;
9
+ title: string;
10
+ type: string;
11
+ };
12
+ 402: {
13
+ status: number;
14
+ title: string;
15
+ type: string;
16
+ };
17
+ 403: {
18
+ status: number;
19
+ title: string;
20
+ type: string;
21
+ };
22
+ 404: {
23
+ status: number;
24
+ title: string;
25
+ type: string;
26
+ };
27
+ 406: {
28
+ status: number;
29
+ title: string;
30
+ type: string;
31
+ };
32
+ 405: {
33
+ status: number;
34
+ title: string;
35
+ type: string;
36
+ };
37
+ 407: {
38
+ status: number;
39
+ title: string;
40
+ type: string;
41
+ };
42
+ 408: {
43
+ status: number;
44
+ title: string;
45
+ type: string;
46
+ };
47
+ 409: {
48
+ status: number;
49
+ title: string;
50
+ type: string;
51
+ };
52
+ 410: {
53
+ status: number;
54
+ title: string;
55
+ type: string;
56
+ };
57
+ 411: {
58
+ status: number;
59
+ title: string;
60
+ type: string;
61
+ };
62
+ 412: {
63
+ status: number;
64
+ title: string;
65
+ type: string;
66
+ };
67
+ 413: {
68
+ status: number;
69
+ title: string;
70
+ type: string;
71
+ };
72
+ 414: {
73
+ status: number;
74
+ title: string;
75
+ type: string;
76
+ };
77
+ 415: {
78
+ status: number;
79
+ title: string;
80
+ type: string;
81
+ };
82
+ 416: {
83
+ status: number;
84
+ title: string;
85
+ type: string;
86
+ };
87
+ 417: {
88
+ status: number;
89
+ title: string;
90
+ type: string;
91
+ };
92
+ 418: {
93
+ status: number;
94
+ title: string;
95
+ type: string;
96
+ };
97
+ 421: {
98
+ status: number;
99
+ title: string;
100
+ type: string;
101
+ };
102
+ 422: {
103
+ status: number;
104
+ title: string;
105
+ type: string;
106
+ };
107
+ 423: {
108
+ status: number;
109
+ title: string;
110
+ type: string;
111
+ };
112
+ 424: {
113
+ status: number;
114
+ title: string;
115
+ type: string;
116
+ };
117
+ 425: {
118
+ status: number;
119
+ title: string;
120
+ type: string;
121
+ };
122
+ 426: {
123
+ status: number;
124
+ title: string;
125
+ type: string;
126
+ };
127
+ 428: {
128
+ status: number;
129
+ title: string;
130
+ type: string;
131
+ };
132
+ 429: {
133
+ status: number;
134
+ title: string;
135
+ type: string;
136
+ };
137
+ 431: {
138
+ status: number;
139
+ title: string;
140
+ type: string;
141
+ };
142
+ 451: {
143
+ status: number;
144
+ title: string;
145
+ type: string;
146
+ };
147
+ };
@@ -0,0 +1,151 @@
1
+ "use strict";
2
+ // Source: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.statusCodes = void 0;
5
+ exports.statusCodes = {
6
+ 400: {
7
+ status: 400,
8
+ title: 'Bad Request',
9
+ type: '/errors/defaults/4xx/badrequest',
10
+ },
11
+ 401: {
12
+ status: 401,
13
+ title: 'Unauthorized',
14
+ type: '/errors/defaults/4xx/unauthorized',
15
+ },
16
+ 402: {
17
+ status: 402,
18
+ title: 'Payment Required',
19
+ type: '/errors/defaults/4xx/paymentrequired',
20
+ },
21
+ 403: {
22
+ status: 403,
23
+ title: 'Forbidden',
24
+ type: '/errors/defaults/4xx/forbidden',
25
+ },
26
+ 404: {
27
+ status: 404,
28
+ title: 'Not Found',
29
+ type: '/errors/defaults/4xx/notfound',
30
+ },
31
+ 406: {
32
+ status: 406,
33
+ title: 'Not Acceptable',
34
+ type: 'errors/defaults/4xx/notacceptable'
35
+ },
36
+ 405: {
37
+ status: 405,
38
+ title: 'Method Not Allowed',
39
+ type: 'errors/defaults/4xx/methodnotallowed'
40
+ },
41
+ 407: {
42
+ status: 407,
43
+ title: 'Proxy Authentication Required (RFC 7235)',
44
+ type: 'errors/defaults/4xx/proxyauthenticationrequired'
45
+ },
46
+ 408: {
47
+ status: 408,
48
+ title: 'Request Timeout',
49
+ type: 'errors/defaults/4xx/requesttimeout'
50
+ },
51
+ 409: {
52
+ status: 409,
53
+ title: 'Conflict',
54
+ type: 'errors/defaults/4xx/conflict'
55
+ },
56
+ 410: {
57
+ status: 410,
58
+ title: 'Gone',
59
+ type: 'errors/defaults/4xx/gone'
60
+ },
61
+ 411: {
62
+ status: 411,
63
+ title: 'Length Required',
64
+ type: 'errors/defaults/4xx/lengthrequired'
65
+ },
66
+ 412: {
67
+ status: 412,
68
+ title: 'Precondition Failed (RFC 7232)',
69
+ type: 'errors/defaults/4xx/preconditionfailed'
70
+ },
71
+ 413: {
72
+ status: 413,
73
+ title: 'Payload Too Large (RFC 7231)',
74
+ type: 'errors/defaults/4xx/payloadtoolarge'
75
+ },
76
+ 414: {
77
+ status: 414,
78
+ title: 'URI Too Long (RFC 7231)',
79
+ type: 'errors/defaults/4xx/uritoolong'
80
+ },
81
+ 415: {
82
+ status: 415,
83
+ title: 'Unsupported Media Type (RFC 7231)',
84
+ type: 'errors/defaults/4xx/unsupportedmediatype'
85
+ },
86
+ 416: {
87
+ status: 416,
88
+ title: 'Range Not Satisfiable (RFC 7233)',
89
+ type: 'errors/defaults/4xx/rangenotsatisfiable'
90
+ },
91
+ 417: {
92
+ status: 417,
93
+ title: 'Expectation Failed',
94
+ type: 'errors/defaults/4xx/expectationfailed'
95
+ },
96
+ 418: {
97
+ status: 418,
98
+ title: 'I\'m a teapot (RFC 2324, RFC 7168)',
99
+ type: 'errors/defaults/4xx/i\'mateapot'
100
+ },
101
+ 421: {
102
+ status: 421,
103
+ title: 'Misdirected Request (RFC 7540)',
104
+ type: 'errors/defaults/4xx/misdirectedrequest'
105
+ },
106
+ 422: {
107
+ status: 422,
108
+ title: 'Unprocessable Entity (WebDAV; RFC 4918)',
109
+ type: 'errors/defaults/4xx/unprocessableentity'
110
+ },
111
+ 423: {
112
+ status: 423,
113
+ title: 'Locked (WebDAV; RFC 4918)',
114
+ type: 'errors/defaults/4xx/locked'
115
+ },
116
+ 424: {
117
+ status: 424,
118
+ title: 'Failed Dependency (WebDAV; RFC 4918)',
119
+ type: 'errors/defaults/4xx/faileddependency'
120
+ },
121
+ 425: {
122
+ status: 425,
123
+ title: 'Too Early (RFC 8470)',
124
+ type: 'errors/defaults/4xx/tooearly'
125
+ },
126
+ 426: {
127
+ status: 426,
128
+ title: 'Upgrade Required',
129
+ type: 'errors/defaults/4xx/upgraderequired'
130
+ },
131
+ 428: {
132
+ status: 428,
133
+ title: 'Precondition Required (RFC 6585)',
134
+ type: 'errors/defaults/4xx/preconditionrequired'
135
+ },
136
+ 429: {
137
+ status: 429,
138
+ title: 'Too Many Requests (RFC 6585)',
139
+ type: 'errors/defaults/4xx/toomanyrequests'
140
+ },
141
+ 431: {
142
+ status: 431,
143
+ title: 'Request Header Fields Too Large (RFC 6585)',
144
+ type: 'errors/defaults/4xx/requestheaderfieldstoolarge'
145
+ },
146
+ 451: {
147
+ status: 451,
148
+ title: 'Unavailable For Legal Reasons (RFC 7725)',
149
+ type: 'errors/defaults/4xx/unavailableforlegalreasons'
150
+ },
151
+ };
@@ -0,0 +1,57 @@
1
+ export declare const statusCodes: {
2
+ 500: {
3
+ status: number;
4
+ title: string;
5
+ type: string;
6
+ };
7
+ 501: {
8
+ status: number;
9
+ title: string;
10
+ type: string;
11
+ };
12
+ 502: {
13
+ status: number;
14
+ title: string;
15
+ type: string;
16
+ };
17
+ 503: {
18
+ status: number;
19
+ title: string;
20
+ type: string;
21
+ };
22
+ 504: {
23
+ status: number;
24
+ title: string;
25
+ type: string;
26
+ };
27
+ 505: {
28
+ status: number;
29
+ title: string;
30
+ type: string;
31
+ };
32
+ 506: {
33
+ status: number;
34
+ title: string;
35
+ type: string;
36
+ };
37
+ 507: {
38
+ status: number;
39
+ title: string;
40
+ type: string;
41
+ };
42
+ 508: {
43
+ status: number;
44
+ title: string;
45
+ type: string;
46
+ };
47
+ 511: {
48
+ status: number;
49
+ title: string;
50
+ type: string;
51
+ };
52
+ 510: {
53
+ status: number;
54
+ title: string;
55
+ type: string;
56
+ };
57
+ };
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ // Source: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.statusCodes = void 0;
5
+ exports.statusCodes = {
6
+ 500: {
7
+ status: 500,
8
+ title: 'Internal Server Error',
9
+ type: 'errors/defaults/5xx/internalservererror'
10
+ },
11
+ 501: {
12
+ status: 501,
13
+ title: 'Not Implemented',
14
+ type: 'errors/defaults/5xx/notimplemented'
15
+ },
16
+ 502: {
17
+ status: 502,
18
+ title: 'Bad Gateway',
19
+ type: 'errors/defaults/5xx/badgateway'
20
+ },
21
+ 503: {
22
+ status: 503,
23
+ title: 'Service Unavailable',
24
+ type: 'errors/defaults/5xx/serviceunavailable'
25
+ },
26
+ 504: {
27
+ status: 504,
28
+ title: 'Gateway Timeout',
29
+ type: 'errors/defaults/5xx/gatewaytimeout'
30
+ },
31
+ 505: {
32
+ status: 505,
33
+ title: 'HTTP Version Not Supported',
34
+ type: 'errors/defaults/5xx/httpversionnotsupported'
35
+ },
36
+ 506: {
37
+ status: 506,
38
+ title: 'Variant Also Negotiates (RFC 2295)',
39
+ type: 'errors/defaults/5xx/variantalsonegotiates'
40
+ },
41
+ 507: {
42
+ status: 507,
43
+ title: 'Insufficient Storage (WebDAV; RFC 4918)',
44
+ type: 'errors/defaults/5xx/insufficientstorage'
45
+ },
46
+ 508: {
47
+ status: 508,
48
+ title: 'Loop Detected (WebDAV; RFC 5842)',
49
+ type: 'errors/defaults/5xx/loopdetected'
50
+ },
51
+ 511: {
52
+ status: 511,
53
+ title: 'Network Authentication Required (RFC 6585)',
54
+ type: 'errors/defaults/5xx/networkauthenticationrequired'
55
+ },
56
+ 510: {
57
+ status: 510,
58
+ title: 'Not Extended (RFC 2774)',
59
+ type: 'errors/defaults/5xx/notextended'
60
+ },
61
+ };
@@ -0,0 +1,12 @@
1
+ export declare const statusCodes: {
2
+ 460: {
3
+ status: number;
4
+ title: string;
5
+ type: string;
6
+ };
7
+ 463: {
8
+ status: number;
9
+ title: string;
10
+ type: string;
11
+ };
12
+ };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ // Source: https://docs.aws.amazon.com/elasticloadbalancing/latest/application/load-balancer-troubleshooting.html
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.statusCodes = void 0;
5
+ exports.statusCodes = {
6
+ 460: {
7
+ status: 460,
8
+ title: 'Client closed connection before idle timeout period elapsed',
9
+ type: '/errors/defaults/aws/clientclosedbeforetimeout',
10
+ },
11
+ 463: {
12
+ status: 463,
13
+ title: 'X-Forwarded-For contains more than 30 ips',
14
+ type: '/errors/defaults/aws/toomanyips'
15
+ }
16
+ };
@@ -0,0 +1,47 @@
1
+ export declare const statusCodes: {
2
+ 520: {
3
+ status: number;
4
+ title: string;
5
+ type: string;
6
+ };
7
+ 521: {
8
+ status: number;
9
+ title: string;
10
+ type: string;
11
+ };
12
+ 522: {
13
+ status: number;
14
+ title: string;
15
+ type: string;
16
+ };
17
+ 523: {
18
+ status: number;
19
+ title: string;
20
+ type: string;
21
+ };
22
+ 524: {
23
+ status: number;
24
+ title: string;
25
+ type: string;
26
+ };
27
+ 525: {
28
+ status: number;
29
+ title: string;
30
+ type: string;
31
+ };
32
+ 526: {
33
+ status: number;
34
+ title: string;
35
+ type: string;
36
+ };
37
+ 527: {
38
+ status: number;
39
+ title: string;
40
+ type: string;
41
+ };
42
+ 530: {
43
+ status: number;
44
+ title: string;
45
+ type: string;
46
+ };
47
+ };
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ // Source: https://support.cloudflare.com/hc/en-us/articles/115003011431
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.statusCodes = void 0;
5
+ exports.statusCodes = {
6
+ 520: {
7
+ status: 520,
8
+ title: 'Web Server returned an unknown error',
9
+ type: '/errors/defaults/cloudflare/unknownerror',
10
+ },
11
+ 521: {
12
+ status: 521,
13
+ title: 'Web server is down',
14
+ type: '/errors/defaults/cloudflare/webserverdown',
15
+ },
16
+ 522: {
17
+ status: 522,
18
+ title: 'Connection timed out',
19
+ type: '/errors/defaults/cloudflare/connectiontimeout',
20
+ },
21
+ 523: {
22
+ status: 523,
23
+ title: 'Origin is unreachable',
24
+ type: '/errors/defaults/cloudflare/originunreachable'
25
+ },
26
+ 524: {
27
+ status: 524,
28
+ title: 'A timeout occurred',
29
+ type: '/errors/defaults/cloudflare/timeout'
30
+ },
31
+ 525: {
32
+ status: 525,
33
+ title: 'SSL handshake failed',
34
+ type: '/errors/defaults/cloudflare/sslhandshakefail'
35
+ },
36
+ 526: {
37
+ status: 526,
38
+ title: 'Invalid SSL certificate',
39
+ type: '/errors/defaults/cloudflare/invalidssl'
40
+ },
41
+ // A 527 error indicates an interrupted connection between Cloudflare and your origin's Railgun server (rg-listener)
42
+ 527: {
43
+ status: 527,
44
+ title: 'Railgun Listener to origin error',
45
+ type: '/errors/defaults/cloudflare/railgunoriginerr'
46
+ },
47
+ 530: {
48
+ status: 530,
49
+ title: 'Cloudflare returned 1xxx error',
50
+ type: '/errors/defaults/cloudflare/1xxx'
51
+ }
52
+ };
@@ -0,0 +1,17 @@
1
+ export declare const statusCodes: {
2
+ 440: {
3
+ status: number;
4
+ title: string;
5
+ type: string;
6
+ };
7
+ 449: {
8
+ status: number;
9
+ title: string;
10
+ type: string;
11
+ };
12
+ 451: {
13
+ status: number;
14
+ title: string;
15
+ type: string;
16
+ };
17
+ };
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ // Source: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.statusCodes = void 0;
5
+ exports.statusCodes = {
6
+ 440: {
7
+ status: 440,
8
+ title: 'Login Time-out',
9
+ type: '/errors/defaults/iis/logintimeout',
10
+ },
11
+ 449: {
12
+ status: 449,
13
+ title: 'Retry with required information',
14
+ type: '/errors/defaults/iis/retrywith'
15
+ },
16
+ 451: {
17
+ status: 451,
18
+ title: 'Redirect',
19
+ type: '/errors/defaults/iis/redirect'
20
+ }
21
+ };
@@ -0,0 +1,7 @@
1
+ export { statusCodes as codes4xx } from '../defaults/4xx';
2
+ export { statusCodes as codes5xx } from '../defaults/5xx';
3
+ export { statusCodes as codesAws } from '../defaults/aws';
4
+ export { statusCodes as codesCloudflare } from '../defaults/cloudflare';
5
+ export { statusCodes as codesIis } from '../defaults/iis';
6
+ export { statusCodes as codesNginx } from '../defaults/nginx';
7
+ export { otherErrors } from '../defaults/others';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.otherErrors = exports.codesNginx = exports.codesIis = exports.codesCloudflare = exports.codesAws = exports.codes5xx = exports.codes4xx = void 0;
4
+ var _4xx_1 = require("../defaults/4xx");
5
+ Object.defineProperty(exports, "codes4xx", { enumerable: true, get: function () { return _4xx_1.statusCodes; } });
6
+ var _5xx_1 = require("../defaults/5xx");
7
+ Object.defineProperty(exports, "codes5xx", { enumerable: true, get: function () { return _5xx_1.statusCodes; } });
8
+ var aws_1 = require("../defaults/aws");
9
+ Object.defineProperty(exports, "codesAws", { enumerable: true, get: function () { return aws_1.statusCodes; } });
10
+ var cloudflare_1 = require("../defaults/cloudflare");
11
+ Object.defineProperty(exports, "codesCloudflare", { enumerable: true, get: function () { return cloudflare_1.statusCodes; } });
12
+ var iis_1 = require("../defaults/iis");
13
+ Object.defineProperty(exports, "codesIis", { enumerable: true, get: function () { return iis_1.statusCodes; } });
14
+ var nginx_1 = require("../defaults/nginx");
15
+ Object.defineProperty(exports, "codesNginx", { enumerable: true, get: function () { return nginx_1.statusCodes; } });
16
+ var others_1 = require("../defaults/others");
17
+ Object.defineProperty(exports, "otherErrors", { enumerable: true, get: function () { return others_1.otherErrors; } });
@@ -0,0 +1,32 @@
1
+ export declare const statusCodes: {
2
+ 444: {
3
+ status: number;
4
+ title: string;
5
+ type: string;
6
+ };
7
+ 494: {
8
+ status: number;
9
+ title: string;
10
+ type: string;
11
+ };
12
+ 495: {
13
+ status: number;
14
+ title: string;
15
+ type: string;
16
+ };
17
+ 496: {
18
+ status: number;
19
+ title: string;
20
+ type: string;
21
+ };
22
+ 497: {
23
+ status: number;
24
+ title: string;
25
+ type: string;
26
+ };
27
+ 499: {
28
+ status: number;
29
+ title: string;
30
+ type: string;
31
+ };
32
+ };
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ // Source: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.statusCodes = void 0;
5
+ exports.statusCodes = {
6
+ 444: {
7
+ status: 494,
8
+ title: 'No Response',
9
+ type: '/errors/defaults/nginx/noresponse',
10
+ },
11
+ 494: {
12
+ status: 494,
13
+ title: 'Request header too large',
14
+ type: '/errors/defaults/nginx/headertoolarge',
15
+ },
16
+ 495: {
17
+ status: 495,
18
+ title: 'SSL Certificate Error',
19
+ type: '/errors/defaults/nginx/sslcerterr'
20
+ },
21
+ 496: {
22
+ status: 496,
23
+ title: 'SSL Certificate Required',
24
+ type: '/errors/defaults/nginx/sslcertrequired'
25
+ },
26
+ 497: {
27
+ status: 497,
28
+ title: 'HTTP Request Sent to HTTPS Port',
29
+ type: '/errors/defaults/nginx/httpreqtohttpsport'
30
+ },
31
+ 499: {
32
+ status: 499,
33
+ title: 'Client Closed Request',
34
+ type: '/errors/defaults/nginx/clientclosedreq'
35
+ }
36
+ };