@utiliread/http 1.17.7 → 1.17.8
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/esm/status-codes.d.ts +65 -65
- package/karma.config.js +1 -1
- package/package.json +6 -6
- package/src/mapping.d.ts +0 -9
- package/src/mapping.js +0 -32
- package/src/mapping.js.map +0 -1
|
@@ -1,67 +1,67 @@
|
|
|
1
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:
|
|
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
67
|
}>;
|
package/karma.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utiliread/http",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.8",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/esm/index.d.ts",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/chai": "^4.2.16",
|
|
45
|
-
"@types/luxon": "^
|
|
46
|
-
"@types/mocha": "^
|
|
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",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"karma-chrome-launcher": "^3.1.0",
|
|
54
54
|
"karma-mocha": "^2.0.1",
|
|
55
55
|
"karma-typescript": "^5.5.1",
|
|
56
|
-
"luxon": "^
|
|
57
|
-
"mocha": "^
|
|
56
|
+
"luxon": "^3.0.4",
|
|
57
|
+
"mocha": "^10.0.0",
|
|
58
58
|
"rimraf": "^3.0.2",
|
|
59
59
|
"typescript": "^4.2.4"
|
|
60
60
|
},
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@utiliread/json": "^1.0.2",
|
|
63
63
|
"@utiliread/jsonpatch": "^1.0.0",
|
|
64
64
|
"@utiliread/msgpack": "^1.0.1",
|
|
65
|
-
"luxon": "^2.1.0"
|
|
65
|
+
"luxon": "^2.1.0 || ^3.0.0"
|
|
66
66
|
},
|
|
67
67
|
"peerDependenciesMeta": {
|
|
68
68
|
"@utiliread/json": {
|
package/src/mapping.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
declare type DeserializeFn<T> = (source: any, type: Type<T>) => T | null | undefined;
|
|
2
|
-
export declare type Type<T> = {
|
|
3
|
-
new (): T;
|
|
4
|
-
};
|
|
5
|
-
export declare type Mapper<T> = ((source: any) => T);
|
|
6
|
-
export declare type TypeOrMapper<T> = Type<T> | Mapper<T>;
|
|
7
|
-
export declare function getNullableMapper<T>(deserialize: DeserializeFn<T>, typeOrMap: Type<T> | Mapper<T> | undefined): Mapper<T | null>;
|
|
8
|
-
export declare function getMapper<T>(deserialize: DeserializeFn<T>, typeOrMap: Type<T> | Mapper<T> | undefined): Mapper<T>;
|
|
9
|
-
export {};
|
package/src/mapping.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export function getNullableMapper(deserialize, typeOrMap) {
|
|
2
|
-
if (!typeOrMap) {
|
|
3
|
-
return (x) => x;
|
|
4
|
-
}
|
|
5
|
-
if (isZeroArgumentFunction(typeOrMap)) {
|
|
6
|
-
// It cannot be a factory function if it takes no arguments,
|
|
7
|
-
// so it must be a (zero argument) type (constructor)
|
|
8
|
-
return (x) => {
|
|
9
|
-
const bound = deserialize(x, typeOrMap);
|
|
10
|
-
// The server cannot produce the undefined result
|
|
11
|
-
if (bound === undefined) {
|
|
12
|
-
throw Error("The model factory created a undefined result");
|
|
13
|
-
}
|
|
14
|
-
return bound;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
return typeOrMap;
|
|
18
|
-
}
|
|
19
|
-
export function getMapper(deserialize, typeOrMap) {
|
|
20
|
-
const nullableFactory = getNullableMapper(deserialize, typeOrMap);
|
|
21
|
-
return (x) => {
|
|
22
|
-
const result = nullableFactory(x);
|
|
23
|
-
if (result === null) {
|
|
24
|
-
throw Error("The model factory created a null result");
|
|
25
|
-
}
|
|
26
|
-
return result;
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
function isZeroArgumentFunction(typeCtor) {
|
|
30
|
-
return typeCtor.length === 0;
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=mapping.js.map
|
package/src/mapping.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mapping.js","sourceRoot":"","sources":["mapping.ts"],"names":[],"mappings":"AAKA,MAAM,UAAU,iBAAiB,CAAI,WAA6B,EAAE,SAA0C;IAC1G,IAAI,CAAC,SAAS,EAAE;QACZ,OAAO,CAAC,CAAM,EAAE,EAAE,CAAI,CAAC,CAAC;KAC3B;IAED,IAAI,sBAAsB,CAAC,SAAS,CAAC,EAAE;QACnC,4DAA4D;QAC5D,qDAAqD;QACrD,OAAO,CAAC,CAAM,EAAE,EAAE;YACd,MAAM,KAAK,GAAG,WAAW,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;YAExC,iDAAiD;YACjD,IAAI,KAAK,KAAK,SAAS,EAAE;gBACrB,MAAM,KAAK,CAAC,8CAA8C,CAAC,CAAC;aAC/D;YAED,OAAO,KAAK,CAAC;QACjB,CAAC,CAAA;KACJ;IAED,OAAO,SAAS,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,SAAS,CAAI,WAA6B,EAAE,SAA0C;IAClG,MAAM,eAAe,GAAG,iBAAiB,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;IAClE,OAAO,CAAC,CAAM,EAAE,EAAE;QACd,MAAM,MAAM,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;QAElC,IAAI,MAAM,KAAK,IAAI,EAAE;YACjB,MAAM,KAAK,CAAC,yCAAyC,CAAC,CAAC;SAC1D;QAED,OAAO,MAAM,CAAC;IAClB,CAAC,CAAC;AACN,CAAC;AAED,SAAS,sBAAsB,CAAI,QAAkB;IACjD,OAAO,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC;AACjC,CAAC"}
|