@shware/http 3.3.0 → 3.4.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/dist/cache/index.d.cts +1 -2
- package/dist/cache/index.d.cts.map +1 -1
- package/dist/cache/index.d.mts +1 -2
- package/dist/cache/index.d.mts.map +1 -1
- package/dist/error/detail.d.cts +14 -15
- package/dist/error/detail.d.cts.map +1 -1
- package/dist/error/detail.d.mts +14 -15
- package/dist/error/detail.d.mts.map +1 -1
- package/dist/error/i18n/en-us.d.cts +1 -2
- package/dist/error/i18n/en-us.d.cts.map +1 -1
- package/dist/error/i18n/en-us.d.mts +1 -2
- package/dist/error/i18n/en-us.d.mts.map +1 -1
- package/dist/error/index.d.cts +5 -6
- package/dist/error/index.d.cts.map +1 -1
- package/dist/error/index.d.mts +5 -6
- package/dist/error/index.d.mts.map +1 -1
- package/dist/error/parse.d.cts +4 -5
- package/dist/error/parse.d.cts.map +1 -1
- package/dist/error/parse.d.mts +4 -5
- package/dist/error/parse.d.mts.map +1 -1
- package/dist/error/reason.d.cts +2 -3
- package/dist/error/reason.d.cts.map +1 -1
- package/dist/error/reason.d.mts +2 -3
- package/dist/error/reason.d.mts.map +1 -1
- package/dist/error/status.d.cts +6 -7
- package/dist/error/status.d.cts.map +1 -1
- package/dist/error/status.d.mts +6 -7
- package/dist/error/status.d.mts.map +1 -1
- package/dist/google-one-tap/index.d.cts +8 -9
- package/dist/google-one-tap/index.d.cts.map +1 -1
- package/dist/google-one-tap/index.d.mts +8 -9
- package/dist/google-one-tap/index.d.mts.map +1 -1
- package/dist/google-one-tap/types.d.cts +6 -7
- package/dist/google-one-tap/types.d.cts.map +1 -1
- package/dist/google-one-tap/types.d.mts +6 -7
- package/dist/google-one-tap/types.d.mts.map +1 -1
- package/dist/hono/authorizer.d.cts +3 -4
- package/dist/hono/authorizer.d.cts.map +1 -1
- package/dist/hono/authorizer.d.mts +3 -4
- package/dist/hono/authorizer.d.mts.map +1 -1
- package/dist/hono/csrf.d.cts +3 -4
- package/dist/hono/csrf.d.cts.map +1 -1
- package/dist/hono/csrf.d.mts +3 -4
- package/dist/hono/csrf.d.mts.map +1 -1
- package/dist/hono/geolocation.d.cts +1 -2
- package/dist/hono/geolocation.d.cts.map +1 -1
- package/dist/hono/geolocation.d.mts +1 -2
- package/dist/hono/geolocation.d.mts.map +1 -1
- package/dist/hono/handler.d.cts +4 -5
- package/dist/hono/handler.d.cts.map +1 -1
- package/dist/hono/handler.d.mts +4 -5
- package/dist/hono/handler.d.mts.map +1 -1
- package/dist/hono/rate-limit.d.cts +5 -6
- package/dist/hono/rate-limit.d.cts.map +1 -1
- package/dist/hono/rate-limit.d.mts +5 -6
- package/dist/hono/rate-limit.d.mts.map +1 -1
- package/dist/hono/validator.d.cts +16 -17
- package/dist/hono/validator.d.cts.map +1 -1
- package/dist/hono/validator.d.mts +17 -18
- package/dist/hono/validator.d.mts.map +1 -1
- package/dist/iso/iso-3601-1.d.cts +2 -3
- package/dist/iso/iso-3601-1.d.cts.map +1 -1
- package/dist/iso/iso-3601-1.d.mts +2 -3
- package/dist/iso/iso-3601-1.d.mts.map +1 -1
- package/dist/max-length/index.d.cts +23 -23
- package/dist/max-length/index.d.cts.map +1 -1
- package/dist/max-length/index.d.mts +23 -23
- package/dist/max-length/index.d.mts.map +1 -1
- package/dist/message.d.cts +1 -2
- package/dist/message.d.cts.map +1 -1
- package/dist/message.d.mts +1 -2
- package/dist/message.d.mts.map +1 -1
- package/dist/response.d.cts +18 -19
- package/dist/response.d.cts.map +1 -1
- package/dist/response.d.mts +18 -19
- package/dist/response.d.mts.map +1 -1
- package/dist/snowflake.d.cts +2 -3
- package/dist/snowflake.d.cts.map +1 -1
- package/dist/snowflake.d.mts +2 -3
- package/dist/snowflake.d.mts.map +1 -1
- package/dist/utils/geolocation.d.cts +5 -6
- package/dist/utils/geolocation.d.cts.map +1 -1
- package/dist/utils/geolocation.d.mts +5 -6
- package/dist/utils/geolocation.d.mts.map +1 -1
- package/dist/utils/google-tag-gateway.d.cts +1 -2
- package/dist/utils/google-tag-gateway.d.cts.map +1 -1
- package/dist/utils/google-tag-gateway.d.mts +1 -2
- package/dist/utils/google-tag-gateway.d.mts.map +1 -1
- package/dist/utils/timing.d.cts +2 -3
- package/dist/utils/timing.d.cts.map +1 -1
- package/dist/utils/timing.d.mts +2 -3
- package/dist/utils/timing.d.mts.map +1 -1
- package/dist/webhook/index.d.cts +1 -2
- package/dist/webhook/index.d.cts.map +1 -1
- package/dist/webhook/index.d.mts +1 -2
- package/dist/webhook/index.d.mts.map +1 -1
- package/package.json +9 -9
package/dist/snowflake.d.mts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* +----------------------+----------------+-----------+
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
|
-
declare class UidGenerator {
|
|
13
|
+
export declare class UidGenerator {
|
|
14
14
|
readonly MAX: bigint;
|
|
15
15
|
private readonly machineBits;
|
|
16
16
|
private readonly sequenceBits;
|
|
@@ -25,7 +25,6 @@ declare class UidGenerator {
|
|
|
25
25
|
constructor(mackineId: number);
|
|
26
26
|
readonly next: () => bigint;
|
|
27
27
|
}
|
|
28
|
-
declare const uid: UidGenerator;
|
|
28
|
+
export declare const uid: UidGenerator;
|
|
29
29
|
//#endregion
|
|
30
|
-
export { UidGenerator, uid };
|
|
31
30
|
//# sourceMappingURL=snowflake.d.mts.map
|
package/dist/snowflake.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snowflake.d.mts","names":[],"sources":["../src/snowflake.ts"],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"snowflake.d.mts","names":[],"sources":["../src/snowflake.ts"],"mappings":";;;;;;;;;;;;qBAoBa;WACK;mBACC;mBACA;mBACA;mBACA;mBACA;mBACA;mBACA;mBACA;UACT;UACA;EAER,YAAY;WAII;;qBAwBL,KAAG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/utils/geolocation.d.ts
|
|
2
|
-
type Geolocation = {
|
|
2
|
+
export type Geolocation = {
|
|
3
3
|
ip_address?: string;
|
|
4
4
|
city?: string;
|
|
5
5
|
country?: string;
|
|
@@ -12,12 +12,11 @@ type Geolocation = {
|
|
|
12
12
|
time_zone?: string;
|
|
13
13
|
};
|
|
14
14
|
/** reference: https://developers.cloudflare.com/rules/transform/managed-transforms/reference/#add-visitor-location-headers */
|
|
15
|
-
declare function getGeolocationFromCloudflare(r: Request): Geolocation;
|
|
15
|
+
export declare function getGeolocationFromCloudflare(r: Request): Geolocation;
|
|
16
16
|
/** reference: https://github.com/vercel/vercel/blob/main/packages/functions/src/headers.ts */
|
|
17
|
-
declare function getGeolocationFromVercel(r: Request): Geolocation;
|
|
17
|
+
export declare function getGeolocationFromVercel(r: Request): Geolocation;
|
|
18
18
|
/** reference: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/adding-cloudfront-headers.html#cloudfront-headers-viewer-location */
|
|
19
|
-
declare function getGeolocationFromCloudfront(r: Request): Geolocation;
|
|
20
|
-
declare function getGeolocation(r: Request): Geolocation;
|
|
19
|
+
export declare function getGeolocationFromCloudfront(r: Request): Geolocation;
|
|
20
|
+
export declare function getGeolocation(r: Request): Geolocation;
|
|
21
21
|
//#endregion
|
|
22
|
-
export { Geolocation, getGeolocation, getGeolocationFromCloudflare, getGeolocationFromCloudfront, getGeolocationFromVercel };
|
|
23
22
|
//# sourceMappingURL=geolocation.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geolocation.d.cts","names":[],"sources":["../../src/utils/geolocation.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"geolocation.d.cts","names":[],"sources":["../../src/utils/geolocation.ts"],"mappings":";YAAY;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;wBAQc,6BAA6B,GAAG,UAAU;;wBAgB1C,yBAAyB,GAAG,UAAU;;wBAoBtC,6BAA6B,GAAG,UAAU;wBAc1C,eAAe,GAAG,UAAU"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region src/utils/geolocation.d.ts
|
|
2
|
-
type Geolocation = {
|
|
2
|
+
export type Geolocation = {
|
|
3
3
|
ip_address?: string;
|
|
4
4
|
city?: string;
|
|
5
5
|
country?: string;
|
|
@@ -12,12 +12,11 @@ type Geolocation = {
|
|
|
12
12
|
time_zone?: string;
|
|
13
13
|
};
|
|
14
14
|
/** reference: https://developers.cloudflare.com/rules/transform/managed-transforms/reference/#add-visitor-location-headers */
|
|
15
|
-
declare function getGeolocationFromCloudflare(r: Request): Geolocation;
|
|
15
|
+
export declare function getGeolocationFromCloudflare(r: Request): Geolocation;
|
|
16
16
|
/** reference: https://github.com/vercel/vercel/blob/main/packages/functions/src/headers.ts */
|
|
17
|
-
declare function getGeolocationFromVercel(r: Request): Geolocation;
|
|
17
|
+
export declare function getGeolocationFromVercel(r: Request): Geolocation;
|
|
18
18
|
/** reference: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/adding-cloudfront-headers.html#cloudfront-headers-viewer-location */
|
|
19
|
-
declare function getGeolocationFromCloudfront(r: Request): Geolocation;
|
|
20
|
-
declare function getGeolocation(r: Request): Geolocation;
|
|
19
|
+
export declare function getGeolocationFromCloudfront(r: Request): Geolocation;
|
|
20
|
+
export declare function getGeolocation(r: Request): Geolocation;
|
|
21
21
|
//#endregion
|
|
22
|
-
export { Geolocation, getGeolocation, getGeolocationFromCloudflare, getGeolocationFromCloudfront, getGeolocationFromVercel };
|
|
23
22
|
//# sourceMappingURL=geolocation.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geolocation.d.mts","names":[],"sources":["../../src/utils/geolocation.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"geolocation.d.mts","names":[],"sources":["../../src/utils/geolocation.ts"],"mappings":";YAAY;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;wBAQc,6BAA6B,GAAG,UAAU;;wBAgB1C,yBAAyB,GAAG,UAAU;;wBAoBtC,6BAA6B,GAAG,UAAU;wBAc1C,eAAe,GAAG,UAAU"}
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* should read ok. Verify that geographical information is being included by navigating to:
|
|
5
5
|
* https://example.com/metrics/?validate_geo=healthy. The page should read ok.
|
|
6
6
|
*/
|
|
7
|
-
declare function forwardToGoogleTagGateway(request: Request, gaId: string): Promise<Response>;
|
|
7
|
+
export declare function forwardToGoogleTagGateway(request: Request, gaId: string): Promise<Response>;
|
|
8
8
|
//#endregion
|
|
9
|
-
export { forwardToGoogleTagGateway };
|
|
10
9
|
//# sourceMappingURL=google-tag-gateway.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"google-tag-gateway.d.cts","names":[],"sources":["../../src/utils/google-tag-gateway.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"google-tag-gateway.d.cts","names":[],"sources":["../../src/utils/google-tag-gateway.ts"],"mappings":";;;;;;wBAOsB,0BAA0B,SAAS,SAAS,eAAY,QAAA"}
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
* should read ok. Verify that geographical information is being included by navigating to:
|
|
5
5
|
* https://example.com/metrics/?validate_geo=healthy. The page should read ok.
|
|
6
6
|
*/
|
|
7
|
-
declare function forwardToGoogleTagGateway(request: Request, gaId: string): Promise<Response>;
|
|
7
|
+
export declare function forwardToGoogleTagGateway(request: Request, gaId: string): Promise<Response>;
|
|
8
8
|
//#endregion
|
|
9
|
-
export { forwardToGoogleTagGateway };
|
|
10
9
|
//# sourceMappingURL=google-tag-gateway.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"google-tag-gateway.d.mts","names":[],"sources":["../../src/utils/google-tag-gateway.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"google-tag-gateway.d.mts","names":[],"sources":["../../src/utils/google-tag-gateway.ts"],"mappings":";;;;;;wBAOsB,0BAA0B,SAAS,SAAS,eAAY,QAAA"}
|
package/dist/utils/timing.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
//#region src/utils/timing.d.ts
|
|
2
|
-
interface Options {
|
|
2
|
+
export interface Options {
|
|
3
3
|
enabled: boolean;
|
|
4
4
|
crossOrigin?: string;
|
|
5
5
|
}
|
|
6
|
-
declare function timing(options?: Options): {
|
|
6
|
+
export declare function timing(options?: Options): {
|
|
7
7
|
startTime: (name: Lowercase<string>, description?: string) => void;
|
|
8
8
|
endTime: (name: Lowercase<string>, precision?: number) => void;
|
|
9
9
|
mark: (name: Lowercase<string>, description?: string, precision?: number) => void;
|
|
@@ -11,5 +11,4 @@ declare function timing(options?: Options): {
|
|
|
11
11
|
setTiming: (response: Response) => void;
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
14
|
-
export { Options, timing };
|
|
15
14
|
//# sourceMappingURL=timing.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timing.d.cts","names":[],"sources":["../../src/utils/timing.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"timing.d.cts","names":[],"sources":["../../src/utils/timing.ts"],"mappings":";iBAKiB;EACf;EACA;;wBAGc,OAAO,UAAS;EAO5B,YAAS,MAAS,mBAAiB;EAGnC,UAAO,MAAS,mBAAiB;EAcjC,OAAI,MAAS,mBAAiB,sBAAsB;EAQpD,YAAS,MACD,mBAAiB,oCACW,sBACd;EActB,YAAS,UAAa"}
|
package/dist/utils/timing.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
//#region src/utils/timing.d.ts
|
|
2
|
-
interface Options {
|
|
2
|
+
export interface Options {
|
|
3
3
|
enabled: boolean;
|
|
4
4
|
crossOrigin?: string;
|
|
5
5
|
}
|
|
6
|
-
declare function timing(options?: Options): {
|
|
6
|
+
export declare function timing(options?: Options): {
|
|
7
7
|
startTime: (name: Lowercase<string>, description?: string) => void;
|
|
8
8
|
endTime: (name: Lowercase<string>, precision?: number) => void;
|
|
9
9
|
mark: (name: Lowercase<string>, description?: string, precision?: number) => void;
|
|
@@ -11,5 +11,4 @@ declare function timing(options?: Options): {
|
|
|
11
11
|
setTiming: (response: Response) => void;
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
14
|
-
export { Options, timing };
|
|
15
14
|
//# sourceMappingURL=timing.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timing.d.mts","names":[],"sources":["../../src/utils/timing.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"timing.d.mts","names":[],"sources":["../../src/utils/timing.ts"],"mappings":";iBAKiB;EACf;EACA;;wBAGc,OAAO,UAAS;EAO5B,YAAS,MAAS,mBAAiB;EAGnC,UAAO,MAAS,mBAAiB;EAcjC,OAAI,MAAS,mBAAiB,sBAAsB;EAQpD,YAAS,MACD,mBAAiB,oCACW,sBACd;EActB,YAAS,UAAa"}
|
package/dist/webhook/index.d.cts
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
* const webhook = verifyStandardWebhook(c.req.header(), await c.req.text(), 'secret');
|
|
7
7
|
* ```
|
|
8
8
|
*/
|
|
9
|
-
declare function verifyStandardWebhook<T = unknown>(headers: Record<string, string>, payload: string, secret: string): T;
|
|
9
|
+
export declare function verifyStandardWebhook<T = unknown>(headers: Record<string, string>, payload: string, secret: string): T;
|
|
10
10
|
//#endregion
|
|
11
|
-
export { verifyStandardWebhook };
|
|
12
11
|
//# sourceMappingURL=index.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/webhook/index.ts"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/webhook/index.ts"],"mappings":";;;;;;;;wBA2BgB,sBAAsB,aACpC,SAAS,wBACT,iBACA,iBACC"}
|
package/dist/webhook/index.d.mts
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
* const webhook = verifyStandardWebhook(c.req.header(), await c.req.text(), 'secret');
|
|
7
7
|
* ```
|
|
8
8
|
*/
|
|
9
|
-
declare function verifyStandardWebhook<T = unknown>(headers: Record<string, string>, payload: string, secret: string): T;
|
|
9
|
+
export declare function verifyStandardWebhook<T = unknown>(headers: Record<string, string>, payload: string, secret: string): T;
|
|
10
10
|
//#endregion
|
|
11
|
-
export { verifyStandardWebhook };
|
|
12
11
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/webhook/index.ts"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/webhook/index.ts"],"mappings":";;;;;;;;wBA2BgB,sBAAsB,aACpC,SAAS,wBACT,iBACA,iBACC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shware/http",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -66,20 +66,20 @@
|
|
|
66
66
|
"access": "public"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@shware/utils": "^1.6.
|
|
70
|
-
"vitest": "^
|
|
71
|
-
"zod": "^4.
|
|
69
|
+
"@shware/utils": "^1.6.2",
|
|
70
|
+
"vitest": "^5.0.2",
|
|
71
|
+
"zod": "^4.6.5"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@repo/typescript-config": "0.0.0",
|
|
75
|
-
"@types/node": "^26.3
|
|
76
|
-
"@types/react": "^19.
|
|
75
|
+
"@types/node": "^26.6.3",
|
|
76
|
+
"@types/react": "^19.3.0",
|
|
77
77
|
"typescript": "^7.0.2"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
|
-
"hono": "^4.13.
|
|
81
|
-
"i18next": "^26.4.
|
|
82
|
-
"react": "^19.
|
|
80
|
+
"hono": "^4.13.9",
|
|
81
|
+
"i18next": "^26.4.2",
|
|
82
|
+
"react": "^19.3.0"
|
|
83
83
|
},
|
|
84
84
|
"peerDependenciesMeta": {
|
|
85
85
|
"hono": {
|