@utiliread/http 1.17.7 → 1.18.0
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/.vscode/settings.json +2 -2
- package/dist/cjs/event-aggregator.js +29 -29
- package/dist/cjs/event-aggregator.js.map +1 -1
- package/dist/cjs/events.js +18 -18
- package/dist/cjs/events.js.map +1 -1
- package/dist/cjs/helpers.js +15 -15
- package/dist/cjs/http-builder.js +191 -191
- package/dist/cjs/http-builder.js.map +1 -1
- package/dist/cjs/http-error.js +29 -29
- package/dist/cjs/http-error.js.map +1 -1
- package/dist/cjs/http-response.js +50 -50
- package/dist/cjs/http-response.js.map +1 -1
- package/dist/cjs/http.js +95 -95
- package/dist/cjs/http.js.map +1 -1
- package/dist/cjs/http.spec.js +68 -68
- package/dist/cjs/http.spec.js.map +1 -1
- package/dist/cjs/index.js +37 -37
- package/dist/cjs/json/index.js +73 -73
- package/dist/cjs/jsonpatch/index.js +14 -14
- package/dist/cjs/mapping.js +36 -36
- package/dist/cjs/mapping.js.map +1 -1
- package/dist/cjs/msgpack/index.js +34 -34
- package/dist/cjs/msgpack/index.js.map +1 -1
- package/dist/cjs/pagination.js +2 -2
- package/dist/cjs/problem-details.js +2 -2
- package/dist/cjs/query-string.js +67 -65
- package/dist/cjs/query-string.js.map +1 -1
- package/dist/cjs/query-string.spec.js +51 -51
- package/dist/cjs/status-codes.js +70 -70
- package/dist/cjs/timeout-error.js +13 -13
- package/dist/esm/event-aggregator.d.ts +11 -11
- package/dist/esm/event-aggregator.js +25 -25
- package/dist/esm/event-aggregator.js.map +1 -1
- package/dist/esm/events.d.ts +11 -11
- package/dist/esm/events.js +14 -14
- package/dist/esm/events.js.map +1 -1
- package/dist/esm/helpers.d.ts +5 -5
- package/dist/esm/helpers.js +9 -9
- package/dist/esm/http-builder.d.ts +60 -60
- package/dist/esm/http-builder.js +186 -186
- package/dist/esm/http-builder.js.map +1 -1
- package/dist/esm/http-error.d.ts +10 -10
- package/dist/esm/http-error.js +25 -25
- package/dist/esm/http-error.js.map +1 -1
- package/dist/esm/http-response.d.ts +18 -18
- package/dist/esm/http-response.js +45 -45
- package/dist/esm/http-response.js.map +1 -1
- package/dist/esm/http.d.ts +33 -33
- package/dist/esm/http.js +91 -91
- package/dist/esm/http.js.map +1 -1
- package/dist/esm/http.spec.d.ts +1 -1
- package/dist/esm/http.spec.js +66 -66
- package/dist/esm/http.spec.js.map +1 -1
- package/dist/esm/index.d.ts +15 -15
- package/dist/esm/index.js +10 -10
- package/dist/esm/json/index.d.ts +15 -15
- package/dist/esm/json/index.js +71 -71
- package/dist/esm/jsonpatch/index.d.ts +9 -9
- package/dist/esm/jsonpatch/index.js +12 -12
- package/dist/esm/mapping.d.ts +9 -9
- package/dist/esm/mapping.js +31 -31
- package/dist/esm/mapping.js.map +1 -1
- package/dist/esm/msgpack/index.d.ts +8 -8
- package/dist/esm/msgpack/index.js +32 -32
- package/dist/esm/msgpack/index.js.map +1 -1
- package/dist/esm/pagination.d.ts +23 -23
- package/dist/esm/pagination.js +1 -1
- package/dist/esm/problem-details.d.ts +7 -7
- package/dist/esm/problem-details.js +1 -1
- package/dist/esm/query-string.d.ts +6 -6
- package/dist/esm/query-string.js +63 -61
- package/dist/esm/query-string.js.map +1 -1
- package/dist/esm/query-string.spec.d.ts +1 -1
- package/dist/esm/query-string.spec.js +49 -49
- package/dist/esm/status-codes.d.ts +67 -67
- package/dist/esm/status-codes.js +67 -67
- package/dist/esm/timeout-error.d.ts +3 -3
- package/dist/esm/timeout-error.js +9 -9
- package/package.json +15 -17
- package/plugins/json/node_modules/@utiliread/http/package.json +4 -0
- package/plugins/json/src/index.ts +124 -122
- package/plugins/jsonpatch/node_modules/@utiliread/http/package.json +4 -0
- package/plugins/jsonpatch/src/index.ts +31 -31
- package/plugins/msgpack/node_modules/@utiliread/http/package.json +4 -0
- package/plugins/msgpack/src/index.ts +67 -60
- package/src/event-aggregator.ts +21 -21
- package/src/events.ts +39 -39
- package/src/helpers.ts +6 -6
- package/src/http-builder.ts +252 -218
- package/src/http-error.ts +30 -23
- package/src/http-response.ts +1 -1
- package/src/http.spec.ts +1 -1
- package/src/http.ts +8 -5
- package/src/index.ts +1 -1
- package/src/mapping.ts +40 -32
- package/src/pagination.ts +16 -16
- package/src/problem-details.ts +6 -6
- package/src/query-string.spec.ts +59 -43
- package/src/query-string.ts +56 -58
- package/src/status-codes.ts +67 -67
- package/src/timeout-error.ts +7 -7
- package/tsconfig.cjs.json +1 -0
- package/tsconfig.json +1 -1
- package/web-test-runner.config.mjs +7 -0
- package/karma.config.js +0 -29
- package/src/mapping.d.ts +0 -9
- package/src/mapping.js +0 -32
- package/src/mapping.js.map +0 -1
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import { DateTime } from 'luxon';
|
|
2
|
-
import { QueryString } from './query-string';
|
|
3
|
-
import { expect } from 'chai';
|
|
4
|
-
describe("query-string", () => {
|
|
5
|
-
it("should handle string", () => {
|
|
6
|
-
const qs = QueryString.serialize({
|
|
7
|
-
aString: "hello"
|
|
8
|
-
});
|
|
9
|
-
expect(qs).to.equal("?aString=hello");
|
|
10
|
-
});
|
|
11
|
-
it("should handle string array", () => {
|
|
12
|
-
const qs = QueryString.serialize({
|
|
13
|
-
aString: ["hello", "world"]
|
|
14
|
-
});
|
|
15
|
-
expect(qs).to.equal("?aString[0]=hello&aString[1]=world");
|
|
16
|
-
});
|
|
17
|
-
it("should handle object array", () => {
|
|
18
|
-
const qs = QueryString.serialize({
|
|
19
|
-
array: [{ a: "hello" }, { b: "world" }]
|
|
20
|
-
});
|
|
21
|
-
expect(qs).to.equal("?array[0].a=hello&array[1].b=world");
|
|
22
|
-
});
|
|
23
|
-
it("should handle luxon DateTime in local timezone", () => {
|
|
24
|
-
const datetime = DateTime.fromObject({ year: 2014, month: 11, day: 12, hour: 21, minute: 6 });
|
|
25
|
-
const qs = QueryString.serialize({
|
|
26
|
-
aDateTime: datetime
|
|
27
|
-
});
|
|
28
|
-
expect(qs).to.equal("?aDateTime=" + encodeURIComponent("2014-11-12T21:06:00.000+01:00"));
|
|
29
|
-
});
|
|
30
|
-
it("should handle luxon DateTime in utc", () => {
|
|
31
|
-
const datetime = DateTime.fromObject({ year: 2014, month: 11, day: 12, hour: 21, minute: 6 }).toUTC();
|
|
32
|
-
const qs = QueryString.serialize({
|
|
33
|
-
aDateTime: datetime
|
|
34
|
-
});
|
|
35
|
-
expect(qs).to.equal("?aDateTime=" + encodeURIComponent("2014-11-12T20:06:00.000Z"));
|
|
36
|
-
});
|
|
37
|
-
it("should handle null", () => {
|
|
38
|
-
const qs = QueryString.serialize({
|
|
39
|
-
null: null
|
|
40
|
-
});
|
|
41
|
-
expect(qs).to.equal("?null");
|
|
42
|
-
});
|
|
43
|
-
it("should not include undefined", () => {
|
|
44
|
-
const qs = QueryString.serialize({
|
|
45
|
-
null: undefined
|
|
46
|
-
});
|
|
47
|
-
expect(qs).to.equal("");
|
|
48
|
-
});
|
|
49
|
-
});
|
|
1
|
+
import { DateTime } from 'luxon';
|
|
2
|
+
import { QueryString } from './query-string';
|
|
3
|
+
import { expect } from 'chai';
|
|
4
|
+
describe("query-string", () => {
|
|
5
|
+
it("should handle string", () => {
|
|
6
|
+
const qs = QueryString.serialize({
|
|
7
|
+
aString: "hello"
|
|
8
|
+
});
|
|
9
|
+
expect(qs).to.equal("?aString=hello");
|
|
10
|
+
});
|
|
11
|
+
it("should handle string array", () => {
|
|
12
|
+
const qs = QueryString.serialize({
|
|
13
|
+
aString: ["hello", "world"]
|
|
14
|
+
});
|
|
15
|
+
expect(qs).to.equal("?aString[0]=hello&aString[1]=world");
|
|
16
|
+
});
|
|
17
|
+
it("should handle object array", () => {
|
|
18
|
+
const qs = QueryString.serialize({
|
|
19
|
+
array: [{ a: "hello" }, { b: "world" }]
|
|
20
|
+
});
|
|
21
|
+
expect(qs).to.equal("?array[0].a=hello&array[1].b=world");
|
|
22
|
+
});
|
|
23
|
+
it("should handle luxon DateTime in local timezone", () => {
|
|
24
|
+
const datetime = DateTime.fromObject({ year: 2014, month: 11, day: 12, hour: 21, minute: 6 });
|
|
25
|
+
const qs = QueryString.serialize({
|
|
26
|
+
aDateTime: datetime
|
|
27
|
+
});
|
|
28
|
+
expect(qs).to.equal("?aDateTime=" + encodeURIComponent("2014-11-12T21:06:00.000+01:00"));
|
|
29
|
+
});
|
|
30
|
+
it("should handle luxon DateTime in utc", () => {
|
|
31
|
+
const datetime = DateTime.fromObject({ year: 2014, month: 11, day: 12, hour: 21, minute: 6 }).toUTC();
|
|
32
|
+
const qs = QueryString.serialize({
|
|
33
|
+
aDateTime: datetime
|
|
34
|
+
});
|
|
35
|
+
expect(qs).to.equal("?aDateTime=" + encodeURIComponent("2014-11-12T20:06:00.000Z"));
|
|
36
|
+
});
|
|
37
|
+
it("should handle null", () => {
|
|
38
|
+
const qs = QueryString.serialize({
|
|
39
|
+
null: null
|
|
40
|
+
});
|
|
41
|
+
expect(qs).to.equal("?null");
|
|
42
|
+
});
|
|
43
|
+
it("should not include undefined", () => {
|
|
44
|
+
const qs = QueryString.serialize({
|
|
45
|
+
null: undefined
|
|
46
|
+
});
|
|
47
|
+
expect(qs).to.equal("");
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
50
|
//# sourceMappingURL=query-string.spec.js.map
|
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
export declare const statusCodes: Readonly<{
|
|
2
|
-
status100Continue:
|
|
3
|
-
status101SwitchingProtocols:
|
|
4
|
-
status102Processing:
|
|
5
|
-
status200OK:
|
|
6
|
-
status201Created:
|
|
7
|
-
status202Accepted:
|
|
8
|
-
status203NonAuthoritative:
|
|
9
|
-
status204NoContent:
|
|
10
|
-
status205ResetContent:
|
|
11
|
-
status206PartialContent:
|
|
12
|
-
status207MultiStatus:
|
|
13
|
-
status208AlreadyReported:
|
|
14
|
-
status226IMUsed:
|
|
15
|
-
status300MultipleChoices:
|
|
16
|
-
status301MovedPermanently:
|
|
17
|
-
status302Found:
|
|
18
|
-
status303SeeOther:
|
|
19
|
-
status304NotModified:
|
|
20
|
-
status305UseProxy:
|
|
21
|
-
status306SwitchProxy:
|
|
22
|
-
status307TemporaryRedirect:
|
|
23
|
-
status308PermanentRedirect:
|
|
24
|
-
status400BadRequest:
|
|
25
|
-
status401Unauthorized:
|
|
26
|
-
status402PaymentRequired:
|
|
27
|
-
status403Forbidden:
|
|
28
|
-
status404NotFound:
|
|
29
|
-
status405MethodNotAllowed:
|
|
30
|
-
status406NotAcceptable:
|
|
31
|
-
status407ProxyAuthenticationRequired:
|
|
32
|
-
status408RequestTimeout:
|
|
33
|
-
status409Conflict:
|
|
34
|
-
status410Gone:
|
|
35
|
-
status411LengthRequired:
|
|
36
|
-
status412PreconditionFailed:
|
|
37
|
-
status413RequestEntityTooLarge:
|
|
38
|
-
status413PayloadTooLarge:
|
|
39
|
-
status414RequestUriTooLong:
|
|
40
|
-
status414UriTooLong:
|
|
41
|
-
status415UnsupportedMediaType:
|
|
42
|
-
status416RequestedRangeNotSatisfiable:
|
|
43
|
-
status416RangeNotSatisfiable:
|
|
44
|
-
status417ExpectationFailed:
|
|
45
|
-
status418ImATeapot:
|
|
46
|
-
status419AuthenticationTimeout:
|
|
47
|
-
status421MisdirectedRequest:
|
|
48
|
-
status422UnprocessableEntity:
|
|
49
|
-
status423Locked:
|
|
50
|
-
status424FailedDependency:
|
|
51
|
-
status426UpgradeRequired:
|
|
52
|
-
status428PreconditionRequired:
|
|
53
|
-
status429TooManyRequests:
|
|
54
|
-
status431RequestHeaderFieldsTooLarge:
|
|
55
|
-
status451UnavailableForLegalReasons:
|
|
56
|
-
status500InternalServerError:
|
|
57
|
-
status501NotImplemented:
|
|
58
|
-
status502BadGateway:
|
|
59
|
-
status503ServiceUnavailable:
|
|
60
|
-
status504GatewayTimeout:
|
|
61
|
-
status505HttpVersionNotsupported:
|
|
62
|
-
status506VariantAlsoNegotiates:
|
|
63
|
-
status507InsufficientStorage:
|
|
64
|
-
status508LoopDetected:
|
|
65
|
-
status510NotExtended:
|
|
66
|
-
status511NetworkAuthenticationRequired:
|
|
67
|
-
}>;
|
|
1
|
+
export declare const statusCodes: Readonly<{
|
|
2
|
+
status100Continue: 100;
|
|
3
|
+
status101SwitchingProtocols: 101;
|
|
4
|
+
status102Processing: 102;
|
|
5
|
+
status200OK: 200;
|
|
6
|
+
status201Created: 201;
|
|
7
|
+
status202Accepted: 202;
|
|
8
|
+
status203NonAuthoritative: 203;
|
|
9
|
+
status204NoContent: 204;
|
|
10
|
+
status205ResetContent: 205;
|
|
11
|
+
status206PartialContent: 206;
|
|
12
|
+
status207MultiStatus: 207;
|
|
13
|
+
status208AlreadyReported: 208;
|
|
14
|
+
status226IMUsed: 226;
|
|
15
|
+
status300MultipleChoices: 300;
|
|
16
|
+
status301MovedPermanently: 301;
|
|
17
|
+
status302Found: 302;
|
|
18
|
+
status303SeeOther: 303;
|
|
19
|
+
status304NotModified: 304;
|
|
20
|
+
status305UseProxy: 305;
|
|
21
|
+
status306SwitchProxy: 306;
|
|
22
|
+
status307TemporaryRedirect: 307;
|
|
23
|
+
status308PermanentRedirect: 308;
|
|
24
|
+
status400BadRequest: 400;
|
|
25
|
+
status401Unauthorized: 401;
|
|
26
|
+
status402PaymentRequired: 402;
|
|
27
|
+
status403Forbidden: 403;
|
|
28
|
+
status404NotFound: 404;
|
|
29
|
+
status405MethodNotAllowed: 405;
|
|
30
|
+
status406NotAcceptable: 406;
|
|
31
|
+
status407ProxyAuthenticationRequired: 407;
|
|
32
|
+
status408RequestTimeout: 408;
|
|
33
|
+
status409Conflict: 409;
|
|
34
|
+
status410Gone: 410;
|
|
35
|
+
status411LengthRequired: 411;
|
|
36
|
+
status412PreconditionFailed: 412;
|
|
37
|
+
status413RequestEntityTooLarge: 413;
|
|
38
|
+
status413PayloadTooLarge: 413;
|
|
39
|
+
status414RequestUriTooLong: 414;
|
|
40
|
+
status414UriTooLong: 414;
|
|
41
|
+
status415UnsupportedMediaType: 415;
|
|
42
|
+
status416RequestedRangeNotSatisfiable: 416;
|
|
43
|
+
status416RangeNotSatisfiable: 416;
|
|
44
|
+
status417ExpectationFailed: 417;
|
|
45
|
+
status418ImATeapot: 418;
|
|
46
|
+
status419AuthenticationTimeout: 419;
|
|
47
|
+
status421MisdirectedRequest: 421;
|
|
48
|
+
status422UnprocessableEntity: 422;
|
|
49
|
+
status423Locked: 423;
|
|
50
|
+
status424FailedDependency: 424;
|
|
51
|
+
status426UpgradeRequired: 426;
|
|
52
|
+
status428PreconditionRequired: 428;
|
|
53
|
+
status429TooManyRequests: 429;
|
|
54
|
+
status431RequestHeaderFieldsTooLarge: 431;
|
|
55
|
+
status451UnavailableForLegalReasons: 451;
|
|
56
|
+
status500InternalServerError: 500;
|
|
57
|
+
status501NotImplemented: 501;
|
|
58
|
+
status502BadGateway: 502;
|
|
59
|
+
status503ServiceUnavailable: 503;
|
|
60
|
+
status504GatewayTimeout: 504;
|
|
61
|
+
status505HttpVersionNotsupported: 505;
|
|
62
|
+
status506VariantAlsoNegotiates: 506;
|
|
63
|
+
status507InsufficientStorage: 507;
|
|
64
|
+
status508LoopDetected: 508;
|
|
65
|
+
status510NotExtended: 510;
|
|
66
|
+
status511NetworkAuthenticationRequired: 511;
|
|
67
|
+
}>;
|
package/dist/esm/status-codes.js
CHANGED
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
export const statusCodes = Object.freeze({
|
|
2
|
-
status100Continue: 100,
|
|
3
|
-
status101SwitchingProtocols: 101,
|
|
4
|
-
status102Processing: 102,
|
|
5
|
-
status200OK: 200,
|
|
6
|
-
status201Created: 201,
|
|
7
|
-
status202Accepted: 202,
|
|
8
|
-
status203NonAuthoritative: 203,
|
|
9
|
-
status204NoContent: 204,
|
|
10
|
-
status205ResetContent: 205,
|
|
11
|
-
status206PartialContent: 206,
|
|
12
|
-
status207MultiStatus: 207,
|
|
13
|
-
status208AlreadyReported: 208,
|
|
14
|
-
status226IMUsed: 226,
|
|
15
|
-
status300MultipleChoices: 300,
|
|
16
|
-
status301MovedPermanently: 301,
|
|
17
|
-
status302Found: 302,
|
|
18
|
-
status303SeeOther: 303,
|
|
19
|
-
status304NotModified: 304,
|
|
20
|
-
status305UseProxy: 305,
|
|
21
|
-
status306SwitchProxy: 306,
|
|
22
|
-
status307TemporaryRedirect: 307,
|
|
23
|
-
status308PermanentRedirect: 308,
|
|
24
|
-
status400BadRequest: 400,
|
|
25
|
-
status401Unauthorized: 401,
|
|
26
|
-
status402PaymentRequired: 402,
|
|
27
|
-
status403Forbidden: 403,
|
|
28
|
-
status404NotFound: 404,
|
|
29
|
-
status405MethodNotAllowed: 405,
|
|
30
|
-
status406NotAcceptable: 406,
|
|
31
|
-
status407ProxyAuthenticationRequired: 407,
|
|
32
|
-
status408RequestTimeout: 408,
|
|
33
|
-
status409Conflict: 409,
|
|
34
|
-
status410Gone: 410,
|
|
35
|
-
status411LengthRequired: 411,
|
|
36
|
-
status412PreconditionFailed: 412,
|
|
37
|
-
status413RequestEntityTooLarge: 413,
|
|
38
|
-
status413PayloadTooLarge: 413,
|
|
39
|
-
status414RequestUriTooLong: 414,
|
|
40
|
-
status414UriTooLong: 414,
|
|
41
|
-
status415UnsupportedMediaType: 415,
|
|
42
|
-
status416RequestedRangeNotSatisfiable: 416,
|
|
43
|
-
status416RangeNotSatisfiable: 416,
|
|
44
|
-
status417ExpectationFailed: 417,
|
|
45
|
-
status418ImATeapot: 418,
|
|
46
|
-
status419AuthenticationTimeout: 419,
|
|
47
|
-
status421MisdirectedRequest: 421,
|
|
48
|
-
status422UnprocessableEntity: 422,
|
|
49
|
-
status423Locked: 423,
|
|
50
|
-
status424FailedDependency: 424,
|
|
51
|
-
status426UpgradeRequired: 426,
|
|
52
|
-
status428PreconditionRequired: 428,
|
|
53
|
-
status429TooManyRequests: 429,
|
|
54
|
-
status431RequestHeaderFieldsTooLarge: 431,
|
|
55
|
-
status451UnavailableForLegalReasons: 451,
|
|
56
|
-
status500InternalServerError: 500,
|
|
57
|
-
status501NotImplemented: 501,
|
|
58
|
-
status502BadGateway: 502,
|
|
59
|
-
status503ServiceUnavailable: 503,
|
|
60
|
-
status504GatewayTimeout: 504,
|
|
61
|
-
status505HttpVersionNotsupported: 505,
|
|
62
|
-
status506VariantAlsoNegotiates: 506,
|
|
63
|
-
status507InsufficientStorage: 507,
|
|
64
|
-
status508LoopDetected: 508,
|
|
65
|
-
status510NotExtended: 510,
|
|
66
|
-
status511NetworkAuthenticationRequired: 511,
|
|
67
|
-
});
|
|
1
|
+
export const statusCodes = Object.freeze({
|
|
2
|
+
status100Continue: 100,
|
|
3
|
+
status101SwitchingProtocols: 101,
|
|
4
|
+
status102Processing: 102,
|
|
5
|
+
status200OK: 200,
|
|
6
|
+
status201Created: 201,
|
|
7
|
+
status202Accepted: 202,
|
|
8
|
+
status203NonAuthoritative: 203,
|
|
9
|
+
status204NoContent: 204,
|
|
10
|
+
status205ResetContent: 205,
|
|
11
|
+
status206PartialContent: 206,
|
|
12
|
+
status207MultiStatus: 207,
|
|
13
|
+
status208AlreadyReported: 208,
|
|
14
|
+
status226IMUsed: 226,
|
|
15
|
+
status300MultipleChoices: 300,
|
|
16
|
+
status301MovedPermanently: 301,
|
|
17
|
+
status302Found: 302,
|
|
18
|
+
status303SeeOther: 303,
|
|
19
|
+
status304NotModified: 304,
|
|
20
|
+
status305UseProxy: 305,
|
|
21
|
+
status306SwitchProxy: 306,
|
|
22
|
+
status307TemporaryRedirect: 307,
|
|
23
|
+
status308PermanentRedirect: 308,
|
|
24
|
+
status400BadRequest: 400,
|
|
25
|
+
status401Unauthorized: 401,
|
|
26
|
+
status402PaymentRequired: 402,
|
|
27
|
+
status403Forbidden: 403,
|
|
28
|
+
status404NotFound: 404,
|
|
29
|
+
status405MethodNotAllowed: 405,
|
|
30
|
+
status406NotAcceptable: 406,
|
|
31
|
+
status407ProxyAuthenticationRequired: 407,
|
|
32
|
+
status408RequestTimeout: 408,
|
|
33
|
+
status409Conflict: 409,
|
|
34
|
+
status410Gone: 410,
|
|
35
|
+
status411LengthRequired: 411,
|
|
36
|
+
status412PreconditionFailed: 412,
|
|
37
|
+
status413RequestEntityTooLarge: 413,
|
|
38
|
+
status413PayloadTooLarge: 413,
|
|
39
|
+
status414RequestUriTooLong: 414,
|
|
40
|
+
status414UriTooLong: 414,
|
|
41
|
+
status415UnsupportedMediaType: 415,
|
|
42
|
+
status416RequestedRangeNotSatisfiable: 416,
|
|
43
|
+
status416RangeNotSatisfiable: 416,
|
|
44
|
+
status417ExpectationFailed: 417,
|
|
45
|
+
status418ImATeapot: 418,
|
|
46
|
+
status419AuthenticationTimeout: 419,
|
|
47
|
+
status421MisdirectedRequest: 421,
|
|
48
|
+
status422UnprocessableEntity: 422,
|
|
49
|
+
status423Locked: 423,
|
|
50
|
+
status424FailedDependency: 424,
|
|
51
|
+
status426UpgradeRequired: 426,
|
|
52
|
+
status428PreconditionRequired: 428,
|
|
53
|
+
status429TooManyRequests: 429,
|
|
54
|
+
status431RequestHeaderFieldsTooLarge: 431,
|
|
55
|
+
status451UnavailableForLegalReasons: 451,
|
|
56
|
+
status500InternalServerError: 500,
|
|
57
|
+
status501NotImplemented: 501,
|
|
58
|
+
status502BadGateway: 502,
|
|
59
|
+
status503ServiceUnavailable: 503,
|
|
60
|
+
status504GatewayTimeout: 504,
|
|
61
|
+
status505HttpVersionNotsupported: 505,
|
|
62
|
+
status506VariantAlsoNegotiates: 506,
|
|
63
|
+
status507InsufficientStorage: 507,
|
|
64
|
+
status508LoopDetected: 508,
|
|
65
|
+
status510NotExtended: 510,
|
|
66
|
+
status511NetworkAuthenticationRequired: 511,
|
|
67
|
+
});
|
|
68
68
|
//# sourceMappingURL=status-codes.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare class TimeoutError extends Error {
|
|
2
|
-
constructor();
|
|
3
|
-
}
|
|
1
|
+
export declare class TimeoutError extends Error {
|
|
2
|
+
constructor();
|
|
3
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export class TimeoutError extends Error {
|
|
2
|
-
constructor() {
|
|
3
|
-
super("Timeout: The request was not successful");
|
|
4
|
-
this.name = 'TimeoutError';
|
|
5
|
-
// Set the prototype explicitly to allow for "... instanceof TimeoutError",
|
|
6
|
-
// see https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work
|
|
7
|
-
Object.setPrototypeOf(this, TimeoutError.prototype);
|
|
8
|
-
}
|
|
9
|
-
}
|
|
1
|
+
export class TimeoutError extends Error {
|
|
2
|
+
constructor() {
|
|
3
|
+
super("Timeout: The request was not successful");
|
|
4
|
+
this.name = 'TimeoutError';
|
|
5
|
+
// Set the prototype explicitly to allow for "... instanceof TimeoutError",
|
|
6
|
+
// see https://github.com/Microsoft/TypeScript-wiki/blob/master/Breaking-Changes.md#extending-built-ins-like-error-array-and-map-may-no-longer-work
|
|
7
|
+
Object.setPrototypeOf(this, TimeoutError.prototype);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
10
|
//# sourceMappingURL=timeout-error.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utiliread/http",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.18.0",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/esm/index.d.ts",
|
|
@@ -33,36 +33,34 @@
|
|
|
33
33
|
"build:json": "cd ./plugins/json && tsc && tsc -p tsconfig.cjs.json",
|
|
34
34
|
"build:jsonpatch": "cd ./plugins/jsonpatch && tsc && tsc -p tsconfig.cjs.json",
|
|
35
35
|
"build:msgpack": "cd ./plugins/msgpack && tsc && tsc -p tsconfig.cjs.json",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
36
|
+
"prettier": "prettier --write src/**/*.ts plugins/**/*.ts",
|
|
37
|
+
"test": "web-test-runner",
|
|
38
38
|
"clean": "rimraf dist"
|
|
39
39
|
},
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@types/chai": "^4.
|
|
45
|
-
"@types/luxon": "^
|
|
46
|
-
"@types/mocha": "^
|
|
44
|
+
"@types/chai": "^4.3.11",
|
|
45
|
+
"@types/luxon": "^3.0.1",
|
|
46
|
+
"@types/mocha": "^10.0.0",
|
|
47
47
|
"@utiliread/json": "^1.0.2",
|
|
48
48
|
"@utiliread/jsonpatch": "^1.0.0",
|
|
49
49
|
"@utiliread/msgpack": "^1.0.1",
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"rimraf": "^3.0.2",
|
|
59
|
-
"typescript": "^4.2.4"
|
|
50
|
+
"@web/dev-server-esbuild": "^1.0.1",
|
|
51
|
+
"@web/test-runner": "^0.18.0",
|
|
52
|
+
"chai": "^5.0.0",
|
|
53
|
+
"luxon": "^3.0.4",
|
|
54
|
+
"mocha": "^10.0.0",
|
|
55
|
+
"prettier": "^3.2.4",
|
|
56
|
+
"rimraf": "^5.0.5",
|
|
57
|
+
"typescript": "^5.3.3"
|
|
60
58
|
},
|
|
61
59
|
"peerDependencies": {
|
|
62
60
|
"@utiliread/json": "^1.0.2",
|
|
63
61
|
"@utiliread/jsonpatch": "^1.0.0",
|
|
64
62
|
"@utiliread/msgpack": "^1.0.1",
|
|
65
|
-
"luxon": "^2.1.0"
|
|
63
|
+
"luxon": "^2.1.0 || ^3.0.0"
|
|
66
64
|
},
|
|
67
65
|
"peerDependenciesMeta": {
|
|
68
66
|
"@utiliread/json": {
|