@shware/http 3.4.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.
Files changed (97) hide show
  1. package/dist/cache/index.d.cts +1 -2
  2. package/dist/cache/index.d.cts.map +1 -1
  3. package/dist/cache/index.d.mts +1 -2
  4. package/dist/cache/index.d.mts.map +1 -1
  5. package/dist/error/detail.d.cts +14 -15
  6. package/dist/error/detail.d.cts.map +1 -1
  7. package/dist/error/detail.d.mts +14 -15
  8. package/dist/error/detail.d.mts.map +1 -1
  9. package/dist/error/i18n/en-us.d.cts +1 -2
  10. package/dist/error/i18n/en-us.d.cts.map +1 -1
  11. package/dist/error/i18n/en-us.d.mts +1 -2
  12. package/dist/error/i18n/en-us.d.mts.map +1 -1
  13. package/dist/error/index.d.cts +5 -6
  14. package/dist/error/index.d.cts.map +1 -1
  15. package/dist/error/index.d.mts +5 -6
  16. package/dist/error/index.d.mts.map +1 -1
  17. package/dist/error/parse.d.cts +4 -5
  18. package/dist/error/parse.d.cts.map +1 -1
  19. package/dist/error/parse.d.mts +4 -5
  20. package/dist/error/parse.d.mts.map +1 -1
  21. package/dist/error/reason.d.cts +2 -3
  22. package/dist/error/reason.d.cts.map +1 -1
  23. package/dist/error/reason.d.mts +2 -3
  24. package/dist/error/reason.d.mts.map +1 -1
  25. package/dist/error/status.d.cts +6 -7
  26. package/dist/error/status.d.cts.map +1 -1
  27. package/dist/error/status.d.mts +6 -7
  28. package/dist/error/status.d.mts.map +1 -1
  29. package/dist/google-one-tap/index.d.cts +8 -9
  30. package/dist/google-one-tap/index.d.cts.map +1 -1
  31. package/dist/google-one-tap/index.d.mts +8 -9
  32. package/dist/google-one-tap/index.d.mts.map +1 -1
  33. package/dist/google-one-tap/types.d.cts +6 -7
  34. package/dist/google-one-tap/types.d.cts.map +1 -1
  35. package/dist/google-one-tap/types.d.mts +6 -7
  36. package/dist/google-one-tap/types.d.mts.map +1 -1
  37. package/dist/hono/authorizer.d.cts +3 -4
  38. package/dist/hono/authorizer.d.cts.map +1 -1
  39. package/dist/hono/authorizer.d.mts +3 -4
  40. package/dist/hono/authorizer.d.mts.map +1 -1
  41. package/dist/hono/csrf.d.cts +3 -4
  42. package/dist/hono/csrf.d.cts.map +1 -1
  43. package/dist/hono/csrf.d.mts +3 -4
  44. package/dist/hono/csrf.d.mts.map +1 -1
  45. package/dist/hono/geolocation.d.cts +1 -2
  46. package/dist/hono/geolocation.d.cts.map +1 -1
  47. package/dist/hono/geolocation.d.mts +1 -2
  48. package/dist/hono/geolocation.d.mts.map +1 -1
  49. package/dist/hono/handler.d.cts +4 -5
  50. package/dist/hono/handler.d.cts.map +1 -1
  51. package/dist/hono/handler.d.mts +4 -5
  52. package/dist/hono/handler.d.mts.map +1 -1
  53. package/dist/hono/rate-limit.d.cts +5 -6
  54. package/dist/hono/rate-limit.d.cts.map +1 -1
  55. package/dist/hono/rate-limit.d.mts +5 -6
  56. package/dist/hono/rate-limit.d.mts.map +1 -1
  57. package/dist/hono/validator.d.cts +16 -17
  58. package/dist/hono/validator.d.cts.map +1 -1
  59. package/dist/hono/validator.d.mts +17 -18
  60. package/dist/hono/validator.d.mts.map +1 -1
  61. package/dist/iso/iso-3601-1.d.cts +2 -3
  62. package/dist/iso/iso-3601-1.d.cts.map +1 -1
  63. package/dist/iso/iso-3601-1.d.mts +2 -3
  64. package/dist/iso/iso-3601-1.d.mts.map +1 -1
  65. package/dist/max-length/index.d.cts +23 -23
  66. package/dist/max-length/index.d.cts.map +1 -1
  67. package/dist/max-length/index.d.mts +23 -23
  68. package/dist/max-length/index.d.mts.map +1 -1
  69. package/dist/message.d.cts +1 -2
  70. package/dist/message.d.cts.map +1 -1
  71. package/dist/message.d.mts +1 -2
  72. package/dist/message.d.mts.map +1 -1
  73. package/dist/response.d.cts +18 -19
  74. package/dist/response.d.cts.map +1 -1
  75. package/dist/response.d.mts +18 -19
  76. package/dist/response.d.mts.map +1 -1
  77. package/dist/snowflake.d.cts +2 -3
  78. package/dist/snowflake.d.cts.map +1 -1
  79. package/dist/snowflake.d.mts +2 -3
  80. package/dist/snowflake.d.mts.map +1 -1
  81. package/dist/utils/geolocation.d.cts +5 -6
  82. package/dist/utils/geolocation.d.cts.map +1 -1
  83. package/dist/utils/geolocation.d.mts +5 -6
  84. package/dist/utils/geolocation.d.mts.map +1 -1
  85. package/dist/utils/google-tag-gateway.d.cts +1 -2
  86. package/dist/utils/google-tag-gateway.d.cts.map +1 -1
  87. package/dist/utils/google-tag-gateway.d.mts +1 -2
  88. package/dist/utils/google-tag-gateway.d.mts.map +1 -1
  89. package/dist/utils/timing.d.cts +2 -3
  90. package/dist/utils/timing.d.cts.map +1 -1
  91. package/dist/utils/timing.d.mts +2 -3
  92. package/dist/utils/timing.d.mts.map +1 -1
  93. package/dist/webhook/index.d.cts +1 -2
  94. package/dist/webhook/index.d.cts.map +1 -1
  95. package/dist/webhook/index.d.mts +1 -2
  96. package/dist/webhook/index.d.mts.map +1 -1
  97. package/package.json +9 -9
@@ -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
@@ -1 +1 @@
1
- {"version":3,"file":"snowflake.d.mts","names":[],"sources":["../src/snowflake.ts"],"mappings":";;;;;;;;;;;;cAoBa;WACK;mBACC;mBACA;mBACA;mBACA;mBACA;mBACA;mBACA;mBACA;UACT;UACA;EAER,YAAY;WAII;;cAwBL,KAAG"}
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":";KAAY;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;iBAQc,6BAA6B,GAAG,UAAU;;iBAgB1C,yBAAyB,GAAG,UAAU;;iBAoBtC,6BAA6B,GAAG,UAAU;iBAc1C,eAAe,GAAG,UAAU"}
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":";KAAY;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;;iBAQc,6BAA6B,GAAG,UAAU;;iBAgB1C,yBAAyB,GAAG,UAAU;;iBAoBtC,6BAA6B,GAAG,UAAU;iBAc1C,eAAe,GAAG,UAAU"}
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":";;;;;;iBAOsB,0BAA0B,SAAS,SAAS,eAAY,QAAA"}
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":";;;;;;iBAOsB,0BAA0B,SAAS,SAAS,eAAY,QAAA"}
1
+ {"version":3,"file":"google-tag-gateway.d.mts","names":[],"sources":["../../src/utils/google-tag-gateway.ts"],"mappings":";;;;;;wBAOsB,0BAA0B,SAAS,SAAS,eAAY,QAAA"}
@@ -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":";UAKiB;EACf;EACA;;iBAGc,OAAO,UAAS;EAO5B,YAAS,MAAS,mBAAiB;EAGnC,UAAO,MAAS,mBAAiB;EAcjC,OAAI,MAAS,mBAAiB,sBAAsB;EAQpD,YAAS,MACD,mBAAiB,oCACW,sBACd;EActB,YAAS,UAAa"}
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"}
@@ -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":";UAKiB;EACf;EACA;;iBAGc,OAAO,UAAS;EAO5B,YAAS,MAAS,mBAAiB;EAGnC,UAAO,MAAS,mBAAiB;EAcjC,OAAI,MAAS,mBAAiB,sBAAsB;EAQpD,YAAS,MACD,mBAAiB,oCACW,sBACd;EActB,YAAS,UAAa"}
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"}
@@ -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":";;;;;;;;iBA2BgB,sBAAsB,aACpC,SAAS,wBACT,iBACA,iBACC"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../../src/webhook/index.ts"],"mappings":";;;;;;;;wBA2BgB,sBAAsB,aACpC,SAAS,wBACT,iBACA,iBACC"}
@@ -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":";;;;;;;;iBA2BgB,sBAAsB,aACpC,SAAS,wBACT,iBACA,iBACC"}
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.4.0",
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.1",
70
- "vitest": "^4.1.11",
71
- "zod": "^4.4.3"
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.0",
76
- "@types/react": "^19.2.18",
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.5",
81
- "i18next": "^26.4.0",
82
- "react": "^19.2.8"
80
+ "hono": "^4.13.9",
81
+ "i18next": "^26.4.2",
82
+ "react": "^19.3.0"
83
83
  },
84
84
  "peerDependenciesMeta": {
85
85
  "hono": {