@zudojs/constants 0.0.1
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/LICENSE +21 -0
- package/README.md +34 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/cache/cacheControl.type.d.ts +44 -0
- package/dist/cache/cacheControl.type.d.ts.map +1 -0
- package/dist/cache/cacheControl.type.js +44 -0
- package/dist/cache/cacheControl.type.js.map +1 -0
- package/dist/cache/cacheStrategy.type.d.ts +25 -0
- package/dist/cache/cacheStrategy.type.d.ts.map +1 -0
- package/dist/cache/cacheStrategy.type.js +23 -0
- package/dist/cache/cacheStrategy.type.js.map +1 -0
- package/dist/cache/index.d.ts +8 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +8 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/common/common.constant.d.ts +96 -0
- package/dist/common/common.constant.d.ts.map +1 -0
- package/dist/common/common.constant.js +106 -0
- package/dist/common/common.constant.js.map +1 -0
- package/dist/common/common.lifecycle.d.ts +45 -0
- package/dist/common/common.lifecycle.d.ts.map +1 -0
- package/dist/common/common.lifecycle.js +84 -0
- package/dist/common/common.lifecycle.js.map +1 -0
- package/dist/common/common.schema.d.ts +54 -0
- package/dist/common/common.schema.d.ts.map +1 -0
- package/dist/common/common.schema.js +55 -0
- package/dist/common/common.schema.js.map +1 -0
- package/dist/common/common.serialization.d.ts +42 -0
- package/dist/common/common.serialization.d.ts.map +1 -0
- package/dist/common/common.serialization.js +42 -0
- package/dist/common/common.serialization.js.map +1 -0
- package/dist/common/common.type.d.ts +47 -0
- package/dist/common/common.type.d.ts.map +1 -0
- package/dist/common/common.type.js +7 -0
- package/dist/common/common.type.js.map +1 -0
- package/dist/common/index.d.ts +11 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/index.js +11 -0
- package/dist/common/index.js.map +1 -0
- package/dist/constantsErrors/constantsError.base.d.ts +24 -0
- package/dist/constantsErrors/constantsError.base.d.ts.map +1 -0
- package/dist/constantsErrors/constantsError.base.js +33 -0
- package/dist/constantsErrors/constantsError.base.js.map +1 -0
- package/dist/constantsErrors/index.d.ts +7 -0
- package/dist/constantsErrors/index.d.ts.map +1 -0
- package/dist/constantsErrors/index.js +7 -0
- package/dist/constantsErrors/index.js.map +1 -0
- package/dist/environment/environment.constant.d.ts +30 -0
- package/dist/environment/environment.constant.d.ts.map +1 -0
- package/dist/environment/environment.constant.js +50 -0
- package/dist/environment/environment.constant.js.map +1 -0
- package/dist/environment/environment.type.d.ts +23 -0
- package/dist/environment/environment.type.d.ts.map +1 -0
- package/dist/environment/environment.type.js +23 -0
- package/dist/environment/environment.type.js.map +1 -0
- package/dist/environment/index.d.ts +8 -0
- package/dist/environment/index.d.ts.map +1 -0
- package/dist/environment/index.js +8 -0
- package/dist/environment/index.js.map +1 -0
- package/dist/http/httpContentType.type.d.ts +51 -0
- package/dist/http/httpContentType.type.d.ts.map +1 -0
- package/dist/http/httpContentType.type.js +51 -0
- package/dist/http/httpContentType.type.js.map +1 -0
- package/dist/http/httpHeader.type.d.ts +42 -0
- package/dist/http/httpHeader.type.d.ts.map +1 -0
- package/dist/http/httpHeader.type.js +40 -0
- package/dist/http/httpHeader.type.js.map +1 -0
- package/dist/http/httpMethod.type.d.ts +28 -0
- package/dist/http/httpMethod.type.d.ts.map +1 -0
- package/dist/http/httpMethod.type.js +37 -0
- package/dist/http/httpMethod.type.js.map +1 -0
- package/dist/http/httpStatus.type.d.ts +59 -0
- package/dist/http/httpStatus.type.d.ts.map +1 -0
- package/dist/http/httpStatus.type.js +71 -0
- package/dist/http/httpStatus.type.js.map +1 -0
- package/dist/http/index.d.ts +10 -0
- package/dist/http/index.d.ts.map +1 -0
- package/dist/http/index.js +10 -0
- package/dist/http/index.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/priority/index.d.ts +7 -0
- package/dist/priority/index.d.ts.map +1 -0
- package/dist/priority/index.js +7 -0
- package/dist/priority/index.js.map +1 -0
- package/dist/priority/priority.type.d.ts +34 -0
- package/dist/priority/priority.type.d.ts.map +1 -0
- package/dist/priority/priority.type.js +34 -0
- package/dist/priority/priority.type.js.map +1 -0
- package/dist/runtime/clock.d.ts +27 -0
- package/dist/runtime/clock.d.ts.map +1 -0
- package/dist/runtime/clock.js +23 -0
- package/dist/runtime/clock.js.map +1 -0
- package/dist/runtime/index.d.ts +10 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/runtime/index.js +8 -0
- package/dist/runtime/index.js.map +1 -0
- package/dist/runtime/random.d.ts +35 -0
- package/dist/runtime/random.d.ts.map +1 -0
- package/dist/runtime/random.js +57 -0
- package/dist/runtime/random.js.map +1 -0
- package/dist/time/index.d.ts +8 -0
- package/dist/time/index.d.ts.map +1 -0
- package/dist/time/index.js +8 -0
- package/dist/time/index.js.map +1 -0
- package/dist/time/time.constant.d.ts +74 -0
- package/dist/time/time.constant.d.ts.map +1 -0
- package/dist/time/time.constant.js +105 -0
- package/dist/time/time.constant.js.map +1 -0
- package/dist/time/time.unit.type.d.ts +18 -0
- package/dist/time/time.unit.type.d.ts.map +1 -0
- package/dist/time/time.unit.type.js +16 -0
- package/dist/time/time.unit.type.js.map +1 -0
- package/dist/validation/index.d.ts +8 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/index.js +8 -0
- package/dist/validation/index.js.map +1 -0
- package/dist/validation/validation.constant.d.ts +54 -0
- package/dist/validation/validation.constant.d.ts.map +1 -0
- package/dist/validation/validation.constant.js +54 -0
- package/dist/validation/validation.constant.js.map +1 -0
- package/dist/validation/validation.pattern.type.d.ts +39 -0
- package/dist/validation/validation.pattern.type.d.ts.map +1 -0
- package/dist/validation/validation.pattern.type.js +39 -0
- package/dist/validation/validation.pattern.type.js.map +1 -0
- package/package.json +51 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP method constants and type-safe method type.
|
|
3
|
+
*
|
|
4
|
+
* @module http/httpMethod
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* All supported HTTP methods as an object map for runtime use.
|
|
8
|
+
*/
|
|
9
|
+
export const HttpMethods = Object.freeze({
|
|
10
|
+
GET: "GET",
|
|
11
|
+
POST: "POST",
|
|
12
|
+
PUT: "PUT",
|
|
13
|
+
PATCH: "PATCH",
|
|
14
|
+
DELETE: "DELETE",
|
|
15
|
+
HEAD: "HEAD",
|
|
16
|
+
OPTIONS: "OPTIONS",
|
|
17
|
+
TRACE: "TRACE",
|
|
18
|
+
CONNECT: "CONNECT",
|
|
19
|
+
});
|
|
20
|
+
/** Set of all HTTP methods for quick membership checks. */
|
|
21
|
+
export const HTTP_METHODS = new Set(Object.values(HttpMethods));
|
|
22
|
+
/** HTTP methods that are safe (no side effects). */
|
|
23
|
+
export const SAFE_HTTP_METHODS = new Set([
|
|
24
|
+
HttpMethods.GET,
|
|
25
|
+
HttpMethods.HEAD,
|
|
26
|
+
HttpMethods.OPTIONS,
|
|
27
|
+
]);
|
|
28
|
+
/** HTTP methods that are idempotent. */
|
|
29
|
+
export const IDEMPOTENT_HTTP_METHODS = new Set([
|
|
30
|
+
HttpMethods.GET,
|
|
31
|
+
HttpMethods.HEAD,
|
|
32
|
+
HttpMethods.PUT,
|
|
33
|
+
HttpMethods.DELETE,
|
|
34
|
+
HttpMethods.OPTIONS,
|
|
35
|
+
HttpMethods.TRACE,
|
|
36
|
+
]);
|
|
37
|
+
//# sourceMappingURL=httpMethod.type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpMethod.type.js","sourceRoot":"","sources":["../../src/http/httpMethod.type.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAcH;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC;IACvC,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;CACV,CAAC,CAAC;AAEZ,2DAA2D;AAC3D,MAAM,CAAC,MAAM,YAAY,GAA4B,IAAI,GAAG,CAC1D,MAAM,CAAC,MAAM,CAAC,WAAW,CAAiB,CAC3C,CAAC;AAEF,oDAAoD;AACpD,MAAM,CAAC,MAAM,iBAAiB,GAA4B,IAAI,GAAG,CAAa;IAC5E,WAAW,CAAC,GAAiB;IAC7B,WAAW,CAAC,IAAkB;IAC9B,WAAW,CAAC,OAAqB;CAClC,CAAC,CAAC;AAEH,wCAAwC;AACxC,MAAM,CAAC,MAAM,uBAAuB,GAClC,IAAI,GAAG,CAAa;IAClB,WAAW,CAAC,GAAiB;IAC7B,WAAW,CAAC,IAAkB;IAC9B,WAAW,CAAC,GAAiB;IAC7B,WAAW,CAAC,MAAoB;IAChC,WAAW,CAAC,OAAqB;IACjC,WAAW,CAAC,KAAmB;CAChC,CAAC,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP status code constants and category helpers.
|
|
3
|
+
*
|
|
4
|
+
* @module http/httpStatus
|
|
5
|
+
*/
|
|
6
|
+
/** Type-safe HTTP status code number. */
|
|
7
|
+
export type HttpStatusCode = number;
|
|
8
|
+
/**
|
|
9
|
+
* Standard HTTP status codes organized by category.
|
|
10
|
+
*/
|
|
11
|
+
export declare const HttpStatus: Readonly<{
|
|
12
|
+
readonly OK: 200;
|
|
13
|
+
readonly CREATED: 201;
|
|
14
|
+
readonly ACCEPTED: 202;
|
|
15
|
+
readonly NO_CONTENT: 204;
|
|
16
|
+
readonly RESET_CONTENT: 205;
|
|
17
|
+
readonly PARTIAL_CONTENT: 206;
|
|
18
|
+
readonly MOVED_PERMANENTLY: 301;
|
|
19
|
+
readonly FOUND: 302;
|
|
20
|
+
readonly NOT_MODIFIED: 304;
|
|
21
|
+
readonly TEMPORARY_REDIRECT: 307;
|
|
22
|
+
readonly PERMANENT_REDIRECT: 308;
|
|
23
|
+
readonly BAD_REQUEST: 400;
|
|
24
|
+
readonly UNAUTHORIZED: 401;
|
|
25
|
+
readonly FORBIDDEN: 403;
|
|
26
|
+
readonly NOT_FOUND: 404;
|
|
27
|
+
readonly METHOD_NOT_ALLOWED: 405;
|
|
28
|
+
readonly NOT_ACCEPTABLE: 406;
|
|
29
|
+
readonly CONFLICT: 409;
|
|
30
|
+
readonly GONE: 410;
|
|
31
|
+
readonly UNPROCESSABLE_ENTITY: 422;
|
|
32
|
+
readonly TOO_MANY_REQUESTS: 429;
|
|
33
|
+
readonly INTERNAL_SERVER_ERROR: 500;
|
|
34
|
+
readonly NOT_IMPLEMENTED: 501;
|
|
35
|
+
readonly BAD_GATEWAY: 502;
|
|
36
|
+
readonly SERVICE_UNAVAILABLE: 503;
|
|
37
|
+
readonly GATEWAY_TIMEOUT: 504;
|
|
38
|
+
}>;
|
|
39
|
+
/**
|
|
40
|
+
* Check whether a status code is in the 2xx success range.
|
|
41
|
+
*/
|
|
42
|
+
export declare function isSuccessStatus(code: number): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Check whether a status code is in the 3xx redirection range.
|
|
45
|
+
*/
|
|
46
|
+
export declare function isRedirectStatus(code: number): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Check whether a status code is in the 4xx client error range.
|
|
49
|
+
*/
|
|
50
|
+
export declare function isClientError(code: number): boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Check whether a status code is in the 5xx server error range.
|
|
53
|
+
*/
|
|
54
|
+
export declare function isServerError(code: number): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Check whether a status code represents any error (4xx or 5xx).
|
|
57
|
+
*/
|
|
58
|
+
export declare function isErrorStatus(code: number): boolean;
|
|
59
|
+
//# sourceMappingURL=httpStatus.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpStatus.type.d.ts","sourceRoot":"","sources":["../../src/http/httpStatus.type.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,yCAAyC;AACzC,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC;AAEpC;;GAEG;AACH,eAAO,MAAM,UAAU;iBAEjB,GAAG;sBACE,GAAG;uBACF,GAAG;yBACD,GAAG;4BACA,GAAG;8BACD,GAAG;gCAGD,GAAG;oBACf,GAAG;2BACI,GAAG;iCACG,GAAG;iCACH,GAAG;0BAGV,GAAG;2BACF,GAAG;wBACN,GAAG;wBACH,GAAG;iCACM,GAAG;6BACP,GAAG;uBACT,GAAG;mBACP,GAAG;mCACa,GAAG;gCACN,GAAG;oCAGC,GAAG;8BACT,GAAG;0BACP,GAAG;kCACK,GAAG;8BACP,GAAG;EACX,CAAC;AAEZ;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEnD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEnD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEnD"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP status code constants and category helpers.
|
|
3
|
+
*
|
|
4
|
+
* @module http/httpStatus
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Standard HTTP status codes organized by category.
|
|
8
|
+
*/
|
|
9
|
+
export const HttpStatus = Object.freeze({
|
|
10
|
+
// 2xx Success
|
|
11
|
+
OK: 200,
|
|
12
|
+
CREATED: 201,
|
|
13
|
+
ACCEPTED: 202,
|
|
14
|
+
NO_CONTENT: 204,
|
|
15
|
+
RESET_CONTENT: 205,
|
|
16
|
+
PARTIAL_CONTENT: 206,
|
|
17
|
+
// 3xx Redirection
|
|
18
|
+
MOVED_PERMANENTLY: 301,
|
|
19
|
+
FOUND: 302,
|
|
20
|
+
NOT_MODIFIED: 304,
|
|
21
|
+
TEMPORARY_REDIRECT: 307,
|
|
22
|
+
PERMANENT_REDIRECT: 308,
|
|
23
|
+
// 4xx Client Error
|
|
24
|
+
BAD_REQUEST: 400,
|
|
25
|
+
UNAUTHORIZED: 401,
|
|
26
|
+
FORBIDDEN: 403,
|
|
27
|
+
NOT_FOUND: 404,
|
|
28
|
+
METHOD_NOT_ALLOWED: 405,
|
|
29
|
+
NOT_ACCEPTABLE: 406,
|
|
30
|
+
CONFLICT: 409,
|
|
31
|
+
GONE: 410,
|
|
32
|
+
UNPROCESSABLE_ENTITY: 422,
|
|
33
|
+
TOO_MANY_REQUESTS: 429,
|
|
34
|
+
// 5xx Server Error
|
|
35
|
+
INTERNAL_SERVER_ERROR: 500,
|
|
36
|
+
NOT_IMPLEMENTED: 501,
|
|
37
|
+
BAD_GATEWAY: 502,
|
|
38
|
+
SERVICE_UNAVAILABLE: 503,
|
|
39
|
+
GATEWAY_TIMEOUT: 504,
|
|
40
|
+
});
|
|
41
|
+
/**
|
|
42
|
+
* Check whether a status code is in the 2xx success range.
|
|
43
|
+
*/
|
|
44
|
+
export function isSuccessStatus(code) {
|
|
45
|
+
return code >= 200 && code < 300;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Check whether a status code is in the 3xx redirection range.
|
|
49
|
+
*/
|
|
50
|
+
export function isRedirectStatus(code) {
|
|
51
|
+
return code >= 300 && code < 400;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Check whether a status code is in the 4xx client error range.
|
|
55
|
+
*/
|
|
56
|
+
export function isClientError(code) {
|
|
57
|
+
return code >= 400 && code < 500;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Check whether a status code is in the 5xx server error range.
|
|
61
|
+
*/
|
|
62
|
+
export function isServerError(code) {
|
|
63
|
+
return code >= 500 && code < 600;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Check whether a status code represents any error (4xx or 5xx).
|
|
67
|
+
*/
|
|
68
|
+
export function isErrorStatus(code) {
|
|
69
|
+
return isClientError(code) || isServerError(code);
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=httpStatus.type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpStatus.type.js","sourceRoot":"","sources":["../../src/http/httpStatus.type.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC;IACtC,cAAc;IACd,EAAE,EAAE,GAAG;IACP,OAAO,EAAE,GAAG;IACZ,QAAQ,EAAE,GAAG;IACb,UAAU,EAAE,GAAG;IACf,aAAa,EAAE,GAAG;IAClB,eAAe,EAAE,GAAG;IAEpB,kBAAkB;IAClB,iBAAiB,EAAE,GAAG;IACtB,KAAK,EAAE,GAAG;IACV,YAAY,EAAE,GAAG;IACjB,kBAAkB,EAAE,GAAG;IACvB,kBAAkB,EAAE,GAAG;IAEvB,mBAAmB;IACnB,WAAW,EAAE,GAAG;IAChB,YAAY,EAAE,GAAG;IACjB,SAAS,EAAE,GAAG;IACd,SAAS,EAAE,GAAG;IACd,kBAAkB,EAAE,GAAG;IACvB,cAAc,EAAE,GAAG;IACnB,QAAQ,EAAE,GAAG;IACb,IAAI,EAAE,GAAG;IACT,oBAAoB,EAAE,GAAG;IACzB,iBAAiB,EAAE,GAAG;IAEtB,mBAAmB;IACnB,qBAAqB,EAAE,GAAG;IAC1B,eAAe,EAAE,GAAG;IACpB,WAAW,EAAE,GAAG;IAChB,mBAAmB,EAAE,GAAG;IACxB,eAAe,EAAE,GAAG;CACZ,CAAC,CAAC;AAEZ;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,OAAO,IAAI,IAAI,GAAG,IAAI,IAAI,GAAG,GAAG,CAAC;AACnC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,OAAO,IAAI,IAAI,GAAG,IAAI,IAAI,GAAG,GAAG,CAAC;AACnC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,IAAI,IAAI,GAAG,IAAI,IAAI,GAAG,GAAG,CAAC;AACnC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,IAAI,IAAI,GAAG,IAAI,IAAI,GAAG,GAAG,CAAC;AACnC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,aAAa,CAAC,IAAI,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP-related constants: methods, status codes, headers, and content types.
|
|
3
|
+
*
|
|
4
|
+
* @module http
|
|
5
|
+
*/
|
|
6
|
+
export { type HttpMethod, HttpMethods, HTTP_METHODS, SAFE_HTTP_METHODS, IDEMPOTENT_HTTP_METHODS, } from "./httpMethod.type.js";
|
|
7
|
+
export { type HttpStatusCode, HttpStatus, isSuccessStatus, isRedirectStatus, isClientError, isServerError, isErrorStatus, } from "./httpStatus.type.js";
|
|
8
|
+
export { type HttpHeaderName, HttpHeader } from "./httpHeader.type.js";
|
|
9
|
+
export { type ContentType, ContentTypes, Charset, buildContentType, } from "./httpContentType.type.js";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/http/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,UAAU,EACf,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,KAAK,cAAc,EACnB,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,aAAa,GACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,cAAc,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EACL,KAAK,WAAW,EAChB,YAAY,EACZ,OAAO,EACP,gBAAgB,GACjB,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP-related constants: methods, status codes, headers, and content types.
|
|
3
|
+
*
|
|
4
|
+
* @module http
|
|
5
|
+
*/
|
|
6
|
+
export { HttpMethods, HTTP_METHODS, SAFE_HTTP_METHODS, IDEMPOTENT_HTTP_METHODS, } from "./httpMethod.type.js";
|
|
7
|
+
export { HttpStatus, isSuccessStatus, isRedirectStatus, isClientError, isServerError, isErrorStatus, } from "./httpStatus.type.js";
|
|
8
|
+
export { HttpHeader } from "./httpHeader.type.js";
|
|
9
|
+
export { ContentTypes, Charset, buildContentType, } from "./httpContentType.type.js";
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/http/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,aAAa,GACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAuB,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvE,OAAO,EAEL,YAAY,EACZ,OAAO,EACP,gBAAgB,GACjB,MAAM,2BAA2B,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @zudojs/constants
|
|
3
|
+
*
|
|
4
|
+
* Shared constants, enums, and type-safe literals for the Zudojs framework.
|
|
5
|
+
*
|
|
6
|
+
* Provides HTTP methods/status/headers/content types, environment detection,
|
|
7
|
+
* time durations and timeouts, branded domain identifiers, validation patterns
|
|
8
|
+
* and limits, cache strategies, and priority levels.
|
|
9
|
+
*
|
|
10
|
+
* @module @zudojs/constants
|
|
11
|
+
*/
|
|
12
|
+
export * from "./http/index.js";
|
|
13
|
+
export * from "./environment/index.js";
|
|
14
|
+
export * from "./time/index.js";
|
|
15
|
+
export * from "./common/index.js";
|
|
16
|
+
export * from "./validation/index.js";
|
|
17
|
+
export * from "./cache/index.js";
|
|
18
|
+
export * from "./priority/index.js";
|
|
19
|
+
export * from "./constantsErrors/index.js";
|
|
20
|
+
export * from "./runtime/index.js";
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @zudojs/constants
|
|
3
|
+
*
|
|
4
|
+
* Shared constants, enums, and type-safe literals for the Zudojs framework.
|
|
5
|
+
*
|
|
6
|
+
* Provides HTTP methods/status/headers/content types, environment detection,
|
|
7
|
+
* time durations and timeouts, branded domain identifiers, validation patterns
|
|
8
|
+
* and limits, cache strategies, and priority levels.
|
|
9
|
+
*
|
|
10
|
+
* @module @zudojs/constants
|
|
11
|
+
*/
|
|
12
|
+
export * from "./http/index.js";
|
|
13
|
+
export * from "./environment/index.js";
|
|
14
|
+
export * from "./time/index.js";
|
|
15
|
+
export * from "./common/index.js";
|
|
16
|
+
export * from "./validation/index.js";
|
|
17
|
+
export * from "./cache/index.js";
|
|
18
|
+
export * from "./priority/index.js";
|
|
19
|
+
export * from "./constantsErrors/index.js";
|
|
20
|
+
export * from "./runtime/index.js";
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/priority/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,QAAQ,EACb,UAAU,EACV,cAAc,EACd,eAAe,GAChB,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/priority/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,UAAU,EACV,cAAc,EACd,eAAe,GAChB,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Priority type and enums for events, tasks, and queues.
|
|
3
|
+
*
|
|
4
|
+
* @module priority/priority
|
|
5
|
+
*/
|
|
6
|
+
/** Type-safe priority level string. */
|
|
7
|
+
export type Priority = "critical" | "high" | "normal" | "low" | "background";
|
|
8
|
+
/**
|
|
9
|
+
* All supported priority levels as an object map.
|
|
10
|
+
*/
|
|
11
|
+
export declare const Priorities: Readonly<{
|
|
12
|
+
readonly CRITICAL: "critical";
|
|
13
|
+
readonly HIGH: "high";
|
|
14
|
+
readonly NORMAL: "normal";
|
|
15
|
+
readonly LOW: "low";
|
|
16
|
+
readonly BACKGROUND: "background";
|
|
17
|
+
}>;
|
|
18
|
+
/** Numeric priority weights for sorting (higher = more urgent). */
|
|
19
|
+
export declare const PriorityWeight: Readonly<{
|
|
20
|
+
readonly critical: 100;
|
|
21
|
+
readonly high: 75;
|
|
22
|
+
readonly normal: 50;
|
|
23
|
+
readonly low: 25;
|
|
24
|
+
readonly background: 10;
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* Compare two priorities by weight.
|
|
28
|
+
*
|
|
29
|
+
* @param a - First priority
|
|
30
|
+
* @param b - Second priority
|
|
31
|
+
* @returns Negative if a is more urgent, positive if b is more urgent, 0 if equal
|
|
32
|
+
*/
|
|
33
|
+
export declare function comparePriority(a: Priority, b: Priority): number;
|
|
34
|
+
//# sourceMappingURL=priority.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"priority.type.d.ts","sourceRoot":"","sources":["../../src/priority/priority.type.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,uCAAuC;AACvC,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,YAAY,CAAC;AAE7E;;GAEG;AACH,eAAO,MAAM,UAAU;uBACX,UAAU;mBACd,MAAM;qBACJ,QAAQ;kBACX,KAAK;yBACE,YAAY;EACf,CAAC;AAEZ,mEAAmE;AACnE,eAAO,MAAM,cAAc;uBACf,GAAG;mBACP,EAAE;qBACA,EAAE;kBACL,EAAE;yBACK,EAAE;EACL,CAAC;AAEZ;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,GAAG,MAAM,CAEhE"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Priority type and enums for events, tasks, and queues.
|
|
3
|
+
*
|
|
4
|
+
* @module priority/priority
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* All supported priority levels as an object map.
|
|
8
|
+
*/
|
|
9
|
+
export const Priorities = Object.freeze({
|
|
10
|
+
CRITICAL: "critical",
|
|
11
|
+
HIGH: "high",
|
|
12
|
+
NORMAL: "normal",
|
|
13
|
+
LOW: "low",
|
|
14
|
+
BACKGROUND: "background",
|
|
15
|
+
});
|
|
16
|
+
/** Numeric priority weights for sorting (higher = more urgent). */
|
|
17
|
+
export const PriorityWeight = Object.freeze({
|
|
18
|
+
critical: 100,
|
|
19
|
+
high: 75,
|
|
20
|
+
normal: 50,
|
|
21
|
+
low: 25,
|
|
22
|
+
background: 10,
|
|
23
|
+
});
|
|
24
|
+
/**
|
|
25
|
+
* Compare two priorities by weight.
|
|
26
|
+
*
|
|
27
|
+
* @param a - First priority
|
|
28
|
+
* @param b - Second priority
|
|
29
|
+
* @returns Negative if a is more urgent, positive if b is more urgent, 0 if equal
|
|
30
|
+
*/
|
|
31
|
+
export function comparePriority(a, b) {
|
|
32
|
+
return PriorityWeight[b] - PriorityWeight[a];
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=priority.type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"priority.type.js","sourceRoot":"","sources":["../../src/priority/priority.type.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC;IACtC,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,KAAK;IACV,UAAU,EAAE,YAAY;CAChB,CAAC,CAAC;AAEZ,mEAAmE;AACnE,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC;IAC1C,QAAQ,EAAE,GAAG;IACb,IAAI,EAAE,EAAE;IACR,MAAM,EAAE,EAAE;IACV,GAAG,EAAE,EAAE;IACP,UAAU,EAAE,EAAE;CACN,CAAC,CAAC;AAEZ;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,CAAW,EAAE,CAAW;IACtD,OAAO,cAAc,CAAC,CAAC,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Injectable Clock interface for deterministic time in tests.
|
|
3
|
+
*
|
|
4
|
+
* @module runtime/clock
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Provides deterministic time for testing.
|
|
8
|
+
*/
|
|
9
|
+
export interface Clock {
|
|
10
|
+
/**
|
|
11
|
+
* Returns current timestamp in milliseconds.
|
|
12
|
+
*/
|
|
13
|
+
now(): number;
|
|
14
|
+
/**
|
|
15
|
+
* Returns current Date.
|
|
16
|
+
*/
|
|
17
|
+
Date(): Date;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Default clock using real system time.
|
|
21
|
+
*/
|
|
22
|
+
export declare const systemClock: Clock;
|
|
23
|
+
/**
|
|
24
|
+
* Creates a mock clock with a fixed time.
|
|
25
|
+
*/
|
|
26
|
+
export declare function createMockClock(fixedTime?: number): Clock;
|
|
27
|
+
//# sourceMappingURL=clock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clock.d.ts","sourceRoot":"","sources":["../../src/runtime/clock.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB;;OAEG;IACH,GAAG,IAAI,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,IAAI,IAAI,CAAC;CACd;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,KAGzB,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,CAAC,SAAS,GAAE,MAAU,GAAG,KAAK,CAO5D"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Injectable Clock interface for deterministic time in tests.
|
|
3
|
+
*
|
|
4
|
+
* @module runtime/clock
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Default clock using real system time.
|
|
8
|
+
*/
|
|
9
|
+
export const systemClock = {
|
|
10
|
+
now: () => Date.now(),
|
|
11
|
+
Date: () => new Date(),
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Creates a mock clock with a fixed time.
|
|
15
|
+
*/
|
|
16
|
+
export function createMockClock(fixedTime = 0) {
|
|
17
|
+
let time = fixedTime;
|
|
18
|
+
return {
|
|
19
|
+
now: () => time,
|
|
20
|
+
Date: () => new Date(time),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=clock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clock.js","sourceRoot":"","sources":["../../src/runtime/clock.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAiBH;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAU;IAChC,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;IACrB,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;CACvB,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,SAAS,GAAW,CAAC;IACnD,IAAI,IAAI,GAAG,SAAS,CAAC;IAErB,OAAO;QACL,GAAG,EAAE,GAAG,EAAE,CAAC,IAAI;QACf,IAAI,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC;KAC3B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Injectable Clock and Random interfaces for deterministic testing.
|
|
3
|
+
*
|
|
4
|
+
* @module runtime
|
|
5
|
+
*/
|
|
6
|
+
export { systemClock, createMockClock } from "./clock.js";
|
|
7
|
+
export type { Clock } from "./clock.js";
|
|
8
|
+
export { systemRandom, createMockRandom } from "./random.js";
|
|
9
|
+
export type { Random } from "./random.js";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC1D,YAAY,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAExC,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC7D,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAG1D,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Injectable Random interface for deterministic randomness in tests.
|
|
3
|
+
*
|
|
4
|
+
* @module runtime/random
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Provides deterministic randomness for testing.
|
|
8
|
+
*/
|
|
9
|
+
export interface Random {
|
|
10
|
+
/**
|
|
11
|
+
* Returns a random float between 0 (inclusive) and 1 (exclusive).
|
|
12
|
+
*/
|
|
13
|
+
random(): number;
|
|
14
|
+
/**
|
|
15
|
+
* Returns a random integer between min (inclusive) and max (inclusive).
|
|
16
|
+
*/
|
|
17
|
+
randomInt(min: number, max: number): number;
|
|
18
|
+
/**
|
|
19
|
+
* Generates a random string of the specified length using alphanumeric characters.
|
|
20
|
+
*/
|
|
21
|
+
randomString(length: number): string;
|
|
22
|
+
/**
|
|
23
|
+
* Generates random bytes.
|
|
24
|
+
*/
|
|
25
|
+
randomBytes(length: number): Uint8Array;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Default random using real system randomness.
|
|
29
|
+
*/
|
|
30
|
+
export declare const systemRandom: Random;
|
|
31
|
+
/**
|
|
32
|
+
* Creates a mock random with a seeded sequence for deterministic testing.
|
|
33
|
+
*/
|
|
34
|
+
export declare function createMockRandom(seed?: number): Random;
|
|
35
|
+
//# sourceMappingURL=random.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"random.d.ts","sourceRoot":"","sources":["../../src/runtime/random.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,MAAM,IAAI,MAAM,CAAC;IAEjB;;OAEG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IAE5C;;OAEG;IACH,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IAErC;;OAEG;IACH,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC;CACzC;AAED;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,MAkB1B,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,GAAE,MAAU,GAAG,MAAM,CA2BzD"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Injectable Random interface for deterministic randomness in tests.
|
|
3
|
+
*
|
|
4
|
+
* @module runtime/random
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Default random using real system randomness.
|
|
8
|
+
*/
|
|
9
|
+
export const systemRandom = {
|
|
10
|
+
random: () => Math.random(),
|
|
11
|
+
randomInt: (min, max) => Math.floor(Math.random() * (max - min + 1)) + min,
|
|
12
|
+
randomString: (length) => {
|
|
13
|
+
const chars = "abcdefghijklmnopqrstuvwxyz0123456789";
|
|
14
|
+
let result = "";
|
|
15
|
+
for (let i = 0; i < length; i++) {
|
|
16
|
+
result += chars[Math.floor(Math.random() * chars.length)];
|
|
17
|
+
}
|
|
18
|
+
return result;
|
|
19
|
+
},
|
|
20
|
+
randomBytes: (length) => {
|
|
21
|
+
const bytes = new Uint8Array(length);
|
|
22
|
+
for (let i = 0; i < length; i++) {
|
|
23
|
+
bytes[i] = Math.floor(Math.random() * 256);
|
|
24
|
+
}
|
|
25
|
+
return bytes;
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Creates a mock random with a seeded sequence for deterministic testing.
|
|
30
|
+
*/
|
|
31
|
+
export function createMockRandom(seed = 1) {
|
|
32
|
+
let state = seed;
|
|
33
|
+
function next() {
|
|
34
|
+
state = (state * 1664525 + 1013904223) & 0xffffffff;
|
|
35
|
+
return (state >>> 0) / 0xffffffff;
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
random: next,
|
|
39
|
+
randomInt: (min, max) => Math.floor(next() * (max - min + 1)) + min,
|
|
40
|
+
randomString: (length) => {
|
|
41
|
+
const chars = "abcdefghijklmnopqrstuvwxyz0123456789";
|
|
42
|
+
let result = "";
|
|
43
|
+
for (let i = 0; i < length; i++) {
|
|
44
|
+
result += chars[Math.floor(next() * chars.length)];
|
|
45
|
+
}
|
|
46
|
+
return result;
|
|
47
|
+
},
|
|
48
|
+
randomBytes: (length) => {
|
|
49
|
+
const bytes = new Uint8Array(length);
|
|
50
|
+
for (let i = 0; i < length; i++) {
|
|
51
|
+
bytes[i] = Math.floor(next() * 256);
|
|
52
|
+
}
|
|
53
|
+
return bytes;
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=random.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"random.js","sourceRoot":"","sources":["../../src/runtime/random.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA2BH;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAW;IAClC,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE;IAC3B,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG;IAC1E,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE;QACvB,MAAM,KAAK,GAAG,sCAAsC,CAAC;QACrD,IAAI,MAAM,GAAG,EAAE,CAAC;QAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;QAC5D,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,WAAW,EAAE,CAAC,MAAM,EAAE,EAAE;QACtB,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;QACrC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAChC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC;QAC7C,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAI,GAAW,CAAC;IAC/C,IAAI,KAAK,GAAG,IAAI,CAAC;IAEjB,SAAS,IAAI;QACX,KAAK,GAAG,CAAC,KAAK,GAAG,OAAO,GAAG,UAAU,CAAC,GAAG,UAAU,CAAC;QACpD,OAAO,CAAC,KAAK,KAAK,CAAC,CAAC,GAAG,UAAU,CAAC;IACpC,CAAC;IAED,OAAO;QACL,MAAM,EAAE,IAAI;QACZ,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG;QACnE,YAAY,EAAE,CAAC,MAAM,EAAE,EAAE;YACvB,MAAM,KAAK,GAAG,sCAAsC,CAAC;YACrD,IAAI,MAAM,GAAG,EAAE,CAAC;YAChB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAChC,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;YACrD,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,WAAW,EAAE,CAAC,MAAM,EAAE,EAAE;YACtB,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;YACrC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBAChC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,GAAG,CAAC,CAAC;YACtC,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Time-related constants: durations, timeouts, and retry defaults.
|
|
3
|
+
*
|
|
4
|
+
* @module time
|
|
5
|
+
*/
|
|
6
|
+
export { type TimeUnit, TimeUnits } from "./time.unit.type.js";
|
|
7
|
+
export { TimeMs, DefaultTimeout, DefaultRetry, toMilliseconds, formatDuration, } from "./time.constant.js";
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/time/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,KAAK,QAAQ,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EACL,MAAM,EACN,cAAc,EACd,YAAY,EACZ,cAAc,EACd,cAAc,GACf,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Time-related constants: durations, timeouts, and retry defaults.
|
|
3
|
+
*
|
|
4
|
+
* @module time
|
|
5
|
+
*/
|
|
6
|
+
export { TimeUnits } from "./time.unit.type.js";
|
|
7
|
+
export { TimeMs, DefaultTimeout, DefaultRetry, toMilliseconds, formatDuration, } from "./time.constant.js";
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/time/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAiB,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EACL,MAAM,EACN,cAAc,EACd,YAAY,EACZ,cAAc,EACd,cAAc,GACf,MAAM,oBAAoB,CAAC"}
|