sleepy-socket 0.7.0 → 0.9.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/dist/utils.d.ts +65 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +64 -0
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/src/utils.ts +71 -0
package/dist/utils.d.ts
CHANGED
|
@@ -1,3 +1,68 @@
|
|
|
1
|
+
export declare const StatusCode: {
|
|
2
|
+
readonly Continue: 100;
|
|
3
|
+
readonly SwitchingProtocols: 101;
|
|
4
|
+
readonly Processing: 102;
|
|
5
|
+
readonly EarlyHints: 103;
|
|
6
|
+
readonly Ok: 200;
|
|
7
|
+
readonly Created: 201;
|
|
8
|
+
readonly Accepted: 202;
|
|
9
|
+
readonly NonAuthoritativeInformation: 203;
|
|
10
|
+
readonly NoContent: 204;
|
|
11
|
+
readonly ResetContent: 205;
|
|
12
|
+
readonly PartialContent: 206;
|
|
13
|
+
readonly MultiStatus: 207;
|
|
14
|
+
readonly AlreadyReported: 208;
|
|
15
|
+
readonly ImUsed: 226;
|
|
16
|
+
readonly MultipleChoices: 300;
|
|
17
|
+
readonly MovedPermanently: 301;
|
|
18
|
+
readonly Found: 302;
|
|
19
|
+
readonly SeeOther: 303;
|
|
20
|
+
readonly NotModified: 304;
|
|
21
|
+
readonly UseProxy: 305;
|
|
22
|
+
readonly TemporaryRedirect: 307;
|
|
23
|
+
readonly PermanentRedirect: 308;
|
|
24
|
+
readonly BadRequest: 400;
|
|
25
|
+
readonly Unauthorized: 401;
|
|
26
|
+
readonly PaymentRequired: 402;
|
|
27
|
+
readonly Forbidden: 403;
|
|
28
|
+
readonly NotFound: 404;
|
|
29
|
+
readonly MethodNotAllowed: 405;
|
|
30
|
+
readonly NotAcceptable: 406;
|
|
31
|
+
readonly ProxyAuthenticationRequired: 407;
|
|
32
|
+
readonly RequestTimeout: 408;
|
|
33
|
+
readonly Conflict: 409;
|
|
34
|
+
readonly Gone: 410;
|
|
35
|
+
readonly LengthRequired: 411;
|
|
36
|
+
readonly PreconditionFailed: 412;
|
|
37
|
+
readonly PayloadTooLarge: 413;
|
|
38
|
+
readonly UriTooLong: 414;
|
|
39
|
+
readonly UnsupportedMediaType: 415;
|
|
40
|
+
readonly RangeNotSatisfiable: 416;
|
|
41
|
+
readonly ExpectationFailed: 417;
|
|
42
|
+
readonly ImATeapot: 418;
|
|
43
|
+
readonly MisdirectedRequest: 421;
|
|
44
|
+
readonly UnprocessableContent: 422;
|
|
45
|
+
readonly Locked: 423;
|
|
46
|
+
readonly FailedDependency: 424;
|
|
47
|
+
readonly TooEarly: 425;
|
|
48
|
+
readonly UpgradeRequired: 426;
|
|
49
|
+
readonly PreconditionRequired: 428;
|
|
50
|
+
readonly TooManyRequests: 429;
|
|
51
|
+
readonly RequestHeaderFieldsTooLarge: 431;
|
|
52
|
+
readonly UnavailableForLegalReasons: 451;
|
|
53
|
+
readonly InternalServerError: 500;
|
|
54
|
+
readonly NotImplemented: 501;
|
|
55
|
+
readonly BadGateway: 502;
|
|
56
|
+
readonly ServiceUnavailable: 503;
|
|
57
|
+
readonly GatewayTimeout: 504;
|
|
58
|
+
readonly HTTPVersionNotSupported: 505;
|
|
59
|
+
readonly VariantAlsoNegotiates: 506;
|
|
60
|
+
readonly InsufficientStorage: 507;
|
|
61
|
+
readonly LoopDetected: 508;
|
|
62
|
+
readonly NotExtended: 510;
|
|
63
|
+
readonly NetworkAuthenticationRequired: 511;
|
|
64
|
+
};
|
|
65
|
+
export type StatusCode = typeof StatusCode[keyof typeof StatusCode];
|
|
1
66
|
export type IdGenerator = () => string;
|
|
2
67
|
export declare const defaultIdGenerator: IdGenerator;
|
|
3
68
|
export declare function joinRoute(...segments: string[]): string;
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,MAAM,MAAM,CAAA;AAEtC,eAAO,MAAM,kBAAkB,EAAE,WAAuC,CAAA;AAIxE,wBAAgB,SAAS,CAAE,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAOxD;AAED,wBAAgB,EAAE,IAAK,MAAM,CAE5B;AAED,wBAAgB,cAAc,CAAE,EAAE,EAAE,WAAW,GAAG,IAAI,CAErD"}
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmEb,CAAA;AAEV,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,MAAM,OAAO,UAAU,CAAC,CAAA;AAEnE,MAAM,MAAM,WAAW,GAAG,MAAM,MAAM,CAAA;AAEtC,eAAO,MAAM,kBAAkB,EAAE,WAAuC,CAAA;AAIxE,wBAAgB,SAAS,CAAE,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAOxD;AAED,wBAAgB,EAAE,IAAK,MAAM,CAE5B;AAED,wBAAgB,cAAc,CAAE,EAAE,EAAE,WAAW,GAAG,IAAI,CAErD"}
|
package/dist/utils.js
CHANGED
|
@@ -1,3 +1,67 @@
|
|
|
1
|
+
export const StatusCode = {
|
|
2
|
+
Continue: 100,
|
|
3
|
+
SwitchingProtocols: 101,
|
|
4
|
+
Processing: 102,
|
|
5
|
+
EarlyHints: 103,
|
|
6
|
+
Ok: 200,
|
|
7
|
+
Created: 201,
|
|
8
|
+
Accepted: 202,
|
|
9
|
+
NonAuthoritativeInformation: 203,
|
|
10
|
+
NoContent: 204,
|
|
11
|
+
ResetContent: 205,
|
|
12
|
+
PartialContent: 206,
|
|
13
|
+
MultiStatus: 207,
|
|
14
|
+
AlreadyReported: 208,
|
|
15
|
+
ImUsed: 226,
|
|
16
|
+
MultipleChoices: 300,
|
|
17
|
+
MovedPermanently: 301,
|
|
18
|
+
Found: 302,
|
|
19
|
+
SeeOther: 303,
|
|
20
|
+
NotModified: 304,
|
|
21
|
+
UseProxy: 305,
|
|
22
|
+
TemporaryRedirect: 307,
|
|
23
|
+
PermanentRedirect: 308,
|
|
24
|
+
BadRequest: 400,
|
|
25
|
+
Unauthorized: 401,
|
|
26
|
+
PaymentRequired: 402,
|
|
27
|
+
Forbidden: 403,
|
|
28
|
+
NotFound: 404,
|
|
29
|
+
MethodNotAllowed: 405,
|
|
30
|
+
NotAcceptable: 406,
|
|
31
|
+
ProxyAuthenticationRequired: 407,
|
|
32
|
+
RequestTimeout: 408,
|
|
33
|
+
Conflict: 409,
|
|
34
|
+
Gone: 410,
|
|
35
|
+
LengthRequired: 411,
|
|
36
|
+
PreconditionFailed: 412,
|
|
37
|
+
PayloadTooLarge: 413,
|
|
38
|
+
UriTooLong: 414,
|
|
39
|
+
UnsupportedMediaType: 415,
|
|
40
|
+
RangeNotSatisfiable: 416,
|
|
41
|
+
ExpectationFailed: 417,
|
|
42
|
+
ImATeapot: 418,
|
|
43
|
+
MisdirectedRequest: 421,
|
|
44
|
+
UnprocessableContent: 422,
|
|
45
|
+
Locked: 423,
|
|
46
|
+
FailedDependency: 424,
|
|
47
|
+
TooEarly: 425,
|
|
48
|
+
UpgradeRequired: 426,
|
|
49
|
+
PreconditionRequired: 428,
|
|
50
|
+
TooManyRequests: 429,
|
|
51
|
+
RequestHeaderFieldsTooLarge: 431,
|
|
52
|
+
UnavailableForLegalReasons: 451,
|
|
53
|
+
InternalServerError: 500,
|
|
54
|
+
NotImplemented: 501,
|
|
55
|
+
BadGateway: 502,
|
|
56
|
+
ServiceUnavailable: 503,
|
|
57
|
+
GatewayTimeout: 504,
|
|
58
|
+
HTTPVersionNotSupported: 505,
|
|
59
|
+
VariantAlsoNegotiates: 506,
|
|
60
|
+
InsufficientStorage: 507,
|
|
61
|
+
LoopDetected: 508,
|
|
62
|
+
NotExtended: 510,
|
|
63
|
+
NetworkAuthenticationRequired: 511,
|
|
64
|
+
};
|
|
1
65
|
export const defaultIdGenerator = () => crypto.randomUUID();
|
|
2
66
|
let _uuidFn = defaultIdGenerator;
|
|
3
67
|
export function joinRoute(...segments) {
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,QAAQ,EAAE,GAAG;IACb,kBAAkB,EAAE,GAAG;IACvB,UAAU,EAAE,GAAG;IACf,UAAU,EAAE,GAAG;IAEf,EAAE,EAAE,GAAG;IACP,OAAO,EAAE,GAAG;IACZ,QAAQ,EAAE,GAAG;IACb,2BAA2B,EAAE,GAAG;IAChC,SAAS,EAAE,GAAG;IACd,YAAY,EAAE,GAAG;IACjB,cAAc,EAAE,GAAG;IACnB,WAAW,EAAE,GAAG;IAChB,eAAe,EAAE,GAAG;IACpB,MAAM,EAAE,GAAG;IAEX,eAAe,EAAE,GAAG;IACpB,gBAAgB,EAAE,GAAG;IACrB,KAAK,EAAE,GAAG;IACV,QAAQ,EAAE,GAAG;IACb,WAAW,EAAE,GAAG;IAChB,QAAQ,EAAE,GAAG;IACb,iBAAiB,EAAE,GAAG;IACtB,iBAAiB,EAAE,GAAG;IAEtB,UAAU,EAAE,GAAG;IACf,YAAY,EAAE,GAAG;IACjB,eAAe,EAAE,GAAG;IACpB,SAAS,EAAE,GAAG;IACd,QAAQ,EAAE,GAAG;IACb,gBAAgB,EAAE,GAAG;IACrB,aAAa,EAAE,GAAG;IAClB,2BAA2B,EAAE,GAAG;IAChC,cAAc,EAAE,GAAG;IACnB,QAAQ,EAAE,GAAG;IACb,IAAI,EAAE,GAAG;IACT,cAAc,EAAE,GAAG;IACnB,kBAAkB,EAAE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AAE,EAAe;IAC7C,OAAO,GAAG,EAAE,CAAA;AACd,CAAC"}
|
package/package.json
CHANGED
package/src/utils.ts
CHANGED
|
@@ -1,3 +1,74 @@
|
|
|
1
|
+
export const StatusCode = {
|
|
2
|
+
Continue: 100,
|
|
3
|
+
SwitchingProtocols: 101,
|
|
4
|
+
Processing: 102,
|
|
5
|
+
EarlyHints: 103,
|
|
6
|
+
|
|
7
|
+
Ok: 200,
|
|
8
|
+
Created: 201,
|
|
9
|
+
Accepted: 202,
|
|
10
|
+
NonAuthoritativeInformation: 203,
|
|
11
|
+
NoContent: 204,
|
|
12
|
+
ResetContent: 205,
|
|
13
|
+
PartialContent: 206,
|
|
14
|
+
MultiStatus: 207,
|
|
15
|
+
AlreadyReported: 208,
|
|
16
|
+
ImUsed: 226,
|
|
17
|
+
|
|
18
|
+
MultipleChoices: 300,
|
|
19
|
+
MovedPermanently: 301,
|
|
20
|
+
Found: 302,
|
|
21
|
+
SeeOther: 303,
|
|
22
|
+
NotModified: 304,
|
|
23
|
+
UseProxy: 305,
|
|
24
|
+
TemporaryRedirect: 307,
|
|
25
|
+
PermanentRedirect: 308,
|
|
26
|
+
|
|
27
|
+
BadRequest: 400,
|
|
28
|
+
Unauthorized: 401,
|
|
29
|
+
PaymentRequired: 402,
|
|
30
|
+
Forbidden: 403,
|
|
31
|
+
NotFound: 404,
|
|
32
|
+
MethodNotAllowed: 405,
|
|
33
|
+
NotAcceptable: 406,
|
|
34
|
+
ProxyAuthenticationRequired: 407,
|
|
35
|
+
RequestTimeout: 408,
|
|
36
|
+
Conflict: 409,
|
|
37
|
+
Gone: 410,
|
|
38
|
+
LengthRequired: 411,
|
|
39
|
+
PreconditionFailed: 412,
|
|
40
|
+
PayloadTooLarge: 413,
|
|
41
|
+
UriTooLong: 414,
|
|
42
|
+
UnsupportedMediaType: 415,
|
|
43
|
+
RangeNotSatisfiable: 416,
|
|
44
|
+
ExpectationFailed: 417,
|
|
45
|
+
ImATeapot: 418,
|
|
46
|
+
MisdirectedRequest: 421,
|
|
47
|
+
UnprocessableContent: 422,
|
|
48
|
+
Locked: 423,
|
|
49
|
+
FailedDependency: 424,
|
|
50
|
+
TooEarly: 425,
|
|
51
|
+
UpgradeRequired: 426,
|
|
52
|
+
PreconditionRequired: 428,
|
|
53
|
+
TooManyRequests: 429,
|
|
54
|
+
RequestHeaderFieldsTooLarge: 431,
|
|
55
|
+
UnavailableForLegalReasons: 451,
|
|
56
|
+
|
|
57
|
+
InternalServerError: 500,
|
|
58
|
+
NotImplemented: 501,
|
|
59
|
+
BadGateway: 502,
|
|
60
|
+
ServiceUnavailable: 503,
|
|
61
|
+
GatewayTimeout: 504,
|
|
62
|
+
HTTPVersionNotSupported: 505,
|
|
63
|
+
VariantAlsoNegotiates: 506,
|
|
64
|
+
InsufficientStorage: 507,
|
|
65
|
+
LoopDetected: 508,
|
|
66
|
+
NotExtended: 510,
|
|
67
|
+
NetworkAuthenticationRequired: 511,
|
|
68
|
+
} as const
|
|
69
|
+
|
|
70
|
+
export type StatusCode = typeof StatusCode[keyof typeof StatusCode]
|
|
71
|
+
|
|
1
72
|
export type IdGenerator = () => string
|
|
2
73
|
|
|
3
74
|
export const defaultIdGenerator: IdGenerator = () => crypto.randomUUID()
|