@shware/http 1.1.13 → 1.2.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.
Files changed (207) hide show
  1. package/package.json +1 -1
  2. package/dist/__tests__/index.test.cjs +0 -27
  3. package/dist/__tests__/index.test.cjs.map +0 -1
  4. package/dist/__tests__/index.test.d.cts +0 -2
  5. package/dist/__tests__/index.test.d.ts +0 -2
  6. package/dist/__tests__/index.test.mjs +0 -25
  7. package/dist/__tests__/index.test.mjs.map +0 -1
  8. package/dist/cache/index.cjs +0 -32
  9. package/dist/cache/index.cjs.map +0 -1
  10. package/dist/cache/index.d.cts +0 -9
  11. package/dist/cache/index.d.ts +0 -9
  12. package/dist/cache/index.mjs +0 -7
  13. package/dist/cache/index.mjs.map +0 -1
  14. package/dist/error/detail.cjs +0 -93
  15. package/dist/error/detail.cjs.map +0 -1
  16. package/dist/error/detail.d.cts +0 -99
  17. package/dist/error/detail.d.ts +0 -99
  18. package/dist/error/detail.mjs +0 -67
  19. package/dist/error/detail.mjs.map +0 -1
  20. package/dist/error/i18n/en-us.cjs +0 -31
  21. package/dist/error/i18n/en-us.cjs.map +0 -1
  22. package/dist/error/i18n/en-us.d.cts +0 -3
  23. package/dist/error/i18n/en-us.d.ts +0 -3
  24. package/dist/error/i18n/en-us.mjs +0 -6
  25. package/dist/error/i18n/en-us.mjs.map +0 -1
  26. package/dist/error/index.cjs +0 -63
  27. package/dist/error/index.cjs.map +0 -1
  28. package/dist/error/index.d.cts +0 -19
  29. package/dist/error/index.d.ts +0 -19
  30. package/dist/error/index.mjs +0 -35
  31. package/dist/error/index.mjs.map +0 -1
  32. package/dist/error/parse.cjs +0 -52
  33. package/dist/error/parse.cjs.map +0 -1
  34. package/dist/error/parse.d.cts +0 -16
  35. package/dist/error/parse.d.ts +0 -16
  36. package/dist/error/parse.mjs +0 -27
  37. package/dist/error/parse.mjs.map +0 -1
  38. package/dist/error/reason.cjs +0 -19
  39. package/dist/error/reason.cjs.map +0 -1
  40. package/dist/error/reason.d.cts +0 -66
  41. package/dist/error/reason.d.ts +0 -66
  42. package/dist/error/reason.mjs +0 -1
  43. package/dist/error/reason.mjs.map +0 -1
  44. package/dist/error/status.cjs +0 -266
  45. package/dist/error/status.cjs.map +0 -1
  46. package/dist/error/status.d.cts +0 -69
  47. package/dist/error/status.d.ts +0 -69
  48. package/dist/error/status.mjs +0 -237
  49. package/dist/error/status.mjs.map +0 -1
  50. package/dist/google-one-tap/index.cjs +0 -51
  51. package/dist/google-one-tap/index.cjs.map +0 -1
  52. package/dist/google-one-tap/index.d.cts +0 -17
  53. package/dist/google-one-tap/index.d.ts +0 -17
  54. package/dist/google-one-tap/index.mjs +0 -26
  55. package/dist/google-one-tap/index.mjs.map +0 -1
  56. package/dist/google-one-tap/types.cjs +0 -19
  57. package/dist/google-one-tap/types.cjs.map +0 -1
  58. package/dist/google-one-tap/types.d.cts +0 -155
  59. package/dist/google-one-tap/types.d.ts +0 -155
  60. package/dist/google-one-tap/types.mjs +0 -1
  61. package/dist/google-one-tap/types.mjs.map +0 -1
  62. package/dist/hono/__tests__/authorizer.test.cjs +0 -483
  63. package/dist/hono/__tests__/authorizer.test.cjs.map +0 -1
  64. package/dist/hono/__tests__/authorizer.test.d.cts +0 -2
  65. package/dist/hono/__tests__/authorizer.test.d.ts +0 -2
  66. package/dist/hono/__tests__/authorizer.test.mjs +0 -481
  67. package/dist/hono/__tests__/authorizer.test.mjs.map +0 -1
  68. package/dist/hono/__tests__/csrf.test.cjs +0 -162
  69. package/dist/hono/__tests__/csrf.test.cjs.map +0 -1
  70. package/dist/hono/__tests__/csrf.test.d.cts +0 -2
  71. package/dist/hono/__tests__/csrf.test.d.ts +0 -2
  72. package/dist/hono/__tests__/csrf.test.mjs +0 -160
  73. package/dist/hono/__tests__/csrf.test.mjs.map +0 -1
  74. package/dist/hono/authorizer.cjs +0 -99
  75. package/dist/hono/authorizer.cjs.map +0 -1
  76. package/dist/hono/authorizer.d.cts +0 -25
  77. package/dist/hono/authorizer.d.ts +0 -25
  78. package/dist/hono/authorizer.mjs +0 -73
  79. package/dist/hono/authorizer.mjs.map +0 -1
  80. package/dist/hono/csrf.cjs +0 -93
  81. package/dist/hono/csrf.cjs.map +0 -1
  82. package/dist/hono/csrf.d.cts +0 -65
  83. package/dist/hono/csrf.d.ts +0 -65
  84. package/dist/hono/csrf.mjs +0 -68
  85. package/dist/hono/csrf.mjs.map +0 -1
  86. package/dist/hono/geolocation.cjs +0 -75
  87. package/dist/hono/geolocation.cjs.map +0 -1
  88. package/dist/hono/geolocation.d.cts +0 -17
  89. package/dist/hono/geolocation.d.ts +0 -17
  90. package/dist/hono/geolocation.mjs +0 -50
  91. package/dist/hono/geolocation.mjs.map +0 -1
  92. package/dist/hono/handler.cjs +0 -68
  93. package/dist/hono/handler.cjs.map +0 -1
  94. package/dist/hono/handler.d.cts +0 -13
  95. package/dist/hono/handler.d.ts +0 -13
  96. package/dist/hono/handler.mjs +0 -42
  97. package/dist/hono/handler.mjs.map +0 -1
  98. package/dist/hono/index.cjs +0 -47
  99. package/dist/hono/index.cjs.map +0 -1
  100. package/dist/hono/index.d.cts +0 -12
  101. package/dist/hono/index.d.ts +0 -12
  102. package/dist/hono/index.mjs +0 -16
  103. package/dist/hono/index.mjs.map +0 -1
  104. package/dist/hono/validator.cjs +0 -64
  105. package/dist/hono/validator.cjs.map +0 -1
  106. package/dist/hono/validator.d.cts +0 -28
  107. package/dist/hono/validator.d.ts +0 -28
  108. package/dist/hono/validator.mjs +0 -38
  109. package/dist/hono/validator.mjs.map +0 -1
  110. package/dist/index-BnPgRQDl.d.cts +0 -129
  111. package/dist/index-BnPgRQDl.d.ts +0 -129
  112. package/dist/index.cjs +0 -91
  113. package/dist/index.cjs.map +0 -1
  114. package/dist/index.d.cts +0 -18
  115. package/dist/index.d.ts +0 -18
  116. package/dist/index.mjs +0 -46
  117. package/dist/index.mjs.map +0 -1
  118. package/dist/iso/iso_3601_1.cjs +0 -292
  119. package/dist/iso/iso_3601_1.cjs.map +0 -1
  120. package/dist/iso/iso_3601_1.d.cts +0 -9
  121. package/dist/iso/iso_3601_1.d.ts +0 -9
  122. package/dist/iso/iso_3601_1.mjs +0 -267
  123. package/dist/iso/iso_3601_1.mjs.map +0 -1
  124. package/dist/max-length/index.cjs +0 -94
  125. package/dist/max-length/index.cjs.map +0 -1
  126. package/dist/max-length/index.d.cts +0 -1
  127. package/dist/max-length/index.d.ts +0 -1
  128. package/dist/max-length/index.mjs +0 -48
  129. package/dist/max-length/index.mjs.map +0 -1
  130. package/dist/message.cjs +0 -32
  131. package/dist/message.cjs.map +0 -1
  132. package/dist/message.d.cts +0 -3
  133. package/dist/message.d.ts +0 -3
  134. package/dist/message.mjs +0 -7
  135. package/dist/message.mjs.map +0 -1
  136. package/dist/polyfills/index.cjs +0 -7
  137. package/dist/polyfills/index.cjs.map +0 -1
  138. package/dist/polyfills/index.d.cts +0 -2
  139. package/dist/polyfills/index.d.ts +0 -2
  140. package/dist/polyfills/index.mjs +0 -5
  141. package/dist/polyfills/index.mjs.map +0 -1
  142. package/dist/response.cjs +0 -73
  143. package/dist/response.cjs.map +0 -1
  144. package/dist/response.d.cts +0 -65
  145. package/dist/response.d.ts +0 -65
  146. package/dist/response.mjs +0 -44
  147. package/dist/response.mjs.map +0 -1
  148. package/dist/snowflake.cjs +0 -75
  149. package/dist/snowflake.cjs.map +0 -1
  150. package/dist/snowflake.d.cts +0 -29
  151. package/dist/snowflake.d.ts +0 -29
  152. package/dist/snowflake.mjs +0 -49
  153. package/dist/snowflake.mjs.map +0 -1
  154. package/dist/utils/__tests__/ip.test.cjs +0 -38
  155. package/dist/utils/__tests__/ip.test.cjs.map +0 -1
  156. package/dist/utils/__tests__/ip.test.d.cts +0 -2
  157. package/dist/utils/__tests__/ip.test.d.ts +0 -2
  158. package/dist/utils/__tests__/ip.test.mjs +0 -36
  159. package/dist/utils/__tests__/ip.test.mjs.map +0 -1
  160. package/dist/utils/invariant.cjs +0 -37
  161. package/dist/utils/invariant.cjs.map +0 -1
  162. package/dist/utils/invariant.d.cts +0 -3
  163. package/dist/utils/invariant.d.ts +0 -3
  164. package/dist/utils/invariant.mjs +0 -12
  165. package/dist/utils/invariant.mjs.map +0 -1
  166. package/dist/utils/ip.cjs +0 -53
  167. package/dist/utils/ip.cjs.map +0 -1
  168. package/dist/utils/ip.d.cts +0 -3
  169. package/dist/utils/ip.d.ts +0 -3
  170. package/dist/utils/ip.mjs +0 -28
  171. package/dist/utils/ip.mjs.map +0 -1
  172. package/dist/utils/promise.cjs +0 -47
  173. package/dist/utils/promise.cjs.map +0 -1
  174. package/dist/utils/promise.d.cts +0 -3
  175. package/dist/utils/promise.d.ts +0 -3
  176. package/dist/utils/promise.mjs +0 -22
  177. package/dist/utils/promise.mjs.map +0 -1
  178. package/dist/utils/string.cjs +0 -33
  179. package/dist/utils/string.cjs.map +0 -1
  180. package/dist/utils/string.d.cts +0 -6
  181. package/dist/utils/string.d.ts +0 -6
  182. package/dist/utils/string.mjs +0 -8
  183. package/dist/utils/string.mjs.map +0 -1
  184. package/dist/utils/timing.cjs +0 -74
  185. package/dist/utils/timing.cjs.map +0 -1
  186. package/dist/utils/timing.d.cts +0 -13
  187. package/dist/utils/timing.d.ts +0 -13
  188. package/dist/utils/timing.mjs +0 -49
  189. package/dist/utils/timing.mjs.map +0 -1
  190. package/dist/utils/token-bucket.cjs +0 -73
  191. package/dist/utils/token-bucket.cjs.map +0 -1
  192. package/dist/utils/token-bucket.d.cts +0 -20
  193. package/dist/utils/token-bucket.d.ts +0 -20
  194. package/dist/utils/token-bucket.mjs +0 -48
  195. package/dist/utils/token-bucket.mjs.map +0 -1
  196. package/dist/vaild.cjs +0 -51
  197. package/dist/vaild.cjs.map +0 -1
  198. package/dist/vaild.d.cts +0 -13
  199. package/dist/vaild.d.ts +0 -13
  200. package/dist/vaild.mjs +0 -26
  201. package/dist/vaild.mjs.map +0 -1
  202. package/dist/webhook/index.cjs +0 -77
  203. package/dist/webhook/index.cjs.map +0 -1
  204. package/dist/webhook/index.d.cts +0 -10
  205. package/dist/webhook/index.d.ts +0 -10
  206. package/dist/webhook/index.mjs +0 -52
  207. package/dist/webhook/index.mjs.map +0 -1
@@ -1,42 +0,0 @@
1
- // src/hono/handler.ts
2
- import { Details, DetailType } from "../error/detail.mjs";
3
- import { Status, StatusError } from "../error/status.mjs";
4
- function isAxiosError(payload) {
5
- return payload !== null && typeof payload === "object" && "isAxiosError" in payload && payload.isAxiosError === true;
6
- }
7
- function errorHandler(error, c) {
8
- const requestId = c.get("requestId");
9
- const servingData = `${c.req.method}: ${c.req.path}`;
10
- const details = Details.new().requestInfo({ requestId, servingData });
11
- if (error instanceof StatusError) {
12
- error.body?.error?.details?.push(...details.list);
13
- const badRequest = error.body?.error?.details.find((d) => d.type === DetailType.BAD_REQUEST);
14
- if (badRequest) console.warn(servingData, badRequest);
15
- return c.json(error.body, error.status);
16
- }
17
- if (error instanceof SyntaxError) {
18
- if (/^Cannot convert .* to a BigInt$/.test(error.message)) {
19
- return Status.invalidArgument(`Invalid number. ${error.message}`).response(details);
20
- }
21
- }
22
- if (isAxiosError(error)) {
23
- console.error({
24
- status: error.status,
25
- message: error.message,
26
- request: {
27
- method: error.config?.method,
28
- url: error.config?.url,
29
- data: error.config?.data
30
- },
31
- response: { data: error.response?.data }
32
- });
33
- return Status.internal("Axios error").response(details);
34
- }
35
- console.error(`Unknown error: ${servingData}`, error);
36
- return Status.internal("Unknown error").response(details);
37
- }
38
- export {
39
- errorHandler,
40
- isAxiosError
41
- };
42
- //# sourceMappingURL=handler.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/hono/handler.ts"],"sourcesContent":["import { Details, DetailType } from '../error/detail';\nimport { Status, StatusError } from '../error/status';\nimport type { AxiosError } from 'axios';\nimport type { Context } from 'hono';\nimport type { RequestIdVariables } from 'hono/request-id';\nimport type { HTTPResponseError, Bindings } from 'hono/types';\nimport type { ContentfulStatusCode } from 'hono/utils/http-status';\n\nexport type Env = {\n Variables: RequestIdVariables;\n Bindings?: Bindings;\n};\n\nexport function isAxiosError(payload: unknown): payload is AxiosError {\n return (\n payload !== null &&\n typeof payload === 'object' &&\n 'isAxiosError' in payload &&\n payload.isAxiosError === true\n );\n}\n\nexport function errorHandler<E extends Env = never>(\n error: Error | HTTPResponseError,\n c: Context<E>\n): Response | Promise<Response> {\n const requestId = c.get('requestId');\n const servingData = `${c.req.method}: ${c.req.path}`;\n const details = Details.new().requestInfo({ requestId, servingData });\n\n if (error instanceof StatusError) {\n error.body?.error?.details?.push(...details.list);\n const badRequest = error.body?.error?.details.find((d) => d.type === DetailType.BAD_REQUEST);\n if (badRequest) console.warn(servingData, badRequest);\n return c.json(error.body, error.status as ContentfulStatusCode);\n }\n\n if (error instanceof SyntaxError) {\n if (/^Cannot convert .* to a BigInt$/.test(error.message)) {\n return Status.invalidArgument(`Invalid number. ${error.message}`).response(details);\n }\n }\n\n if (isAxiosError(error)) {\n console.error({\n status: error.status,\n message: error.message,\n request: {\n method: error.config?.method,\n url: error.config?.url,\n data: error.config?.data,\n },\n response: { data: error.response?.data },\n });\n return Status.internal('Axios error').response(details);\n }\n\n console.error(`Unknown error: ${servingData}`, error);\n return Status.internal('Unknown error').response(details);\n}\n"],"mappings":";AAAA,SAAS,SAAS,kBAAkB;AACpC,SAAS,QAAQ,mBAAmB;AAY7B,SAAS,aAAa,SAAyC;AACpE,SACE,YAAY,QACZ,OAAO,YAAY,YACnB,kBAAkB,WAClB,QAAQ,iBAAiB;AAE7B;AAEO,SAAS,aACd,OACA,GAC8B;AAC9B,QAAM,YAAY,EAAE,IAAI,WAAW;AACnC,QAAM,cAAc,GAAG,EAAE,IAAI,MAAM,KAAK,EAAE,IAAI,IAAI;AAClD,QAAM,UAAU,QAAQ,IAAI,EAAE,YAAY,EAAE,WAAW,YAAY,CAAC;AAEpE,MAAI,iBAAiB,aAAa;AAChC,UAAM,MAAM,OAAO,SAAS,KAAK,GAAG,QAAQ,IAAI;AAChD,UAAM,aAAa,MAAM,MAAM,OAAO,QAAQ,KAAK,CAAC,MAAM,EAAE,SAAS,WAAW,WAAW;AAC3F,QAAI,WAAY,SAAQ,KAAK,aAAa,UAAU;AACpD,WAAO,EAAE,KAAK,MAAM,MAAM,MAAM,MAA8B;AAAA,EAChE;AAEA,MAAI,iBAAiB,aAAa;AAChC,QAAI,kCAAkC,KAAK,MAAM,OAAO,GAAG;AACzD,aAAO,OAAO,gBAAgB,mBAAmB,MAAM,OAAO,EAAE,EAAE,SAAS,OAAO;AAAA,IACpF;AAAA,EACF;AAEA,MAAI,aAAa,KAAK,GAAG;AACvB,YAAQ,MAAM;AAAA,MACZ,QAAQ,MAAM;AAAA,MACd,SAAS,MAAM;AAAA,MACf,SAAS;AAAA,QACP,QAAQ,MAAM,QAAQ;AAAA,QACtB,KAAK,MAAM,QAAQ;AAAA,QACnB,MAAM,MAAM,QAAQ;AAAA,MACtB;AAAA,MACA,UAAU,EAAE,MAAM,MAAM,UAAU,KAAK;AAAA,IACzC,CAAC;AACD,WAAO,OAAO,SAAS,aAAa,EAAE,SAAS,OAAO;AAAA,EACxD;AAEA,UAAQ,MAAM,kBAAkB,WAAW,IAAI,KAAK;AACpD,SAAO,OAAO,SAAS,eAAe,EAAE,SAAS,OAAO;AAC1D;","names":[]}
@@ -1,47 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/hono/index.ts
21
- var hono_exports = {};
22
- __export(hono_exports, {
23
- Authorizer: () => import_authorizer.Authorizer,
24
- authorizer: () => import_authorizer.authorizer,
25
- bigintId: () => import_validator.bigintId,
26
- csrf: () => import_csrf.csrf,
27
- errorHandler: () => import_handler.errorHandler,
28
- geolocation: () => import_geolocation.geolocation,
29
- zValidator: () => import_validator.zValidator
30
- });
31
- module.exports = __toCommonJS(hono_exports);
32
- var import_validator = require("./validator.cjs");
33
- var import_handler = require("./handler.cjs");
34
- var import_geolocation = require("./geolocation.cjs");
35
- var import_authorizer = require("./authorizer.cjs");
36
- var import_csrf = require("./csrf.cjs");
37
- // Annotate the CommonJS export names for ESM import in node:
38
- 0 && (module.exports = {
39
- Authorizer,
40
- authorizer,
41
- bigintId,
42
- csrf,
43
- errorHandler,
44
- geolocation,
45
- zValidator
46
- });
47
- //# sourceMappingURL=index.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/hono/index.ts"],"sourcesContent":["export { zValidator, bigintId } from './validator';\nexport { errorHandler } from './handler';\nexport { geolocation } from './geolocation';\nexport { Authorizer, authorizer, type AuthorizerConfig } from './authorizer';\nexport { csrf, type CSRFConfig, type CSRFIgnoreRule } from './csrf';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAAqC;AACrC,qBAA6B;AAC7B,yBAA4B;AAC5B,wBAA8D;AAC9D,kBAA2D;","names":[]}
@@ -1,12 +0,0 @@
1
- export { bigintId, zValidator } from './validator.cjs';
2
- export { errorHandler } from './handler.cjs';
3
- export { geolocation } from './geolocation.cjs';
4
- export { Authorizer, AuthorizerConfig, authorizer } from './authorizer.cjs';
5
- export { CSRFConfig, CSRFIgnoreRule, csrf } from './csrf.cjs';
6
- import 'zod/mini';
7
- import 'hono';
8
- import 'zod/v4/core';
9
- import 'zod';
10
- import 'axios';
11
- import 'hono/request-id';
12
- import 'hono/types';
@@ -1,12 +0,0 @@
1
- export { bigintId, zValidator } from './validator.js';
2
- export { errorHandler } from './handler.js';
3
- export { geolocation } from './geolocation.js';
4
- export { Authorizer, AuthorizerConfig, authorizer } from './authorizer.js';
5
- export { CSRFConfig, CSRFIgnoreRule, csrf } from './csrf.js';
6
- import 'zod/mini';
7
- import 'hono';
8
- import 'zod/v4/core';
9
- import 'zod';
10
- import 'axios';
11
- import 'hono/request-id';
12
- import 'hono/types';
@@ -1,16 +0,0 @@
1
- // src/hono/index.ts
2
- import { zValidator, bigintId } from "./validator.mjs";
3
- import { errorHandler } from "./handler.mjs";
4
- import { geolocation } from "./geolocation.mjs";
5
- import { Authorizer, authorizer } from "./authorizer.mjs";
6
- import { csrf } from "./csrf.mjs";
7
- export {
8
- Authorizer,
9
- authorizer,
10
- bigintId,
11
- csrf,
12
- errorHandler,
13
- geolocation,
14
- zValidator
15
- };
16
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/hono/index.ts"],"sourcesContent":["export { zValidator, bigintId } from './validator';\nexport { errorHandler } from './handler';\nexport { geolocation } from './geolocation';\nexport { Authorizer, authorizer, type AuthorizerConfig } from './authorizer';\nexport { csrf, type CSRFConfig, type CSRFIgnoreRule } from './csrf';\n"],"mappings":";AAAA,SAAS,YAAY,gBAAgB;AACrC,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAC5B,SAAS,YAAY,kBAAyC;AAC9D,SAAS,YAAkD;","names":[]}
@@ -1,64 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/hono/validator.ts
21
- var validator_exports = {};
22
- __export(validator_exports, {
23
- bigintId: () => bigintId,
24
- zValidator: () => zValidator
25
- });
26
- module.exports = __toCommonJS(validator_exports);
27
- var import_validator = require("hono/validator");
28
- var import_mini = require("zod/mini");
29
- var import_detail = require("../error/detail.cjs");
30
- var import_status = require("../error/status.cjs");
31
- function zValidator(target, schema) {
32
- return (0, import_validator.validator)(target, async (value) => {
33
- const result = await schema.safeParseAsync(value);
34
- if (result.success) return result.data;
35
- const fieldViolations = result.error.issues.map(
36
- ({ path, message }) => ({ field: path.join("."), description: message })
37
- );
38
- const details = import_detail.Details.new().badRequest({ fieldViolations });
39
- throw import_status.Status.invalidArgument().error(details);
40
- });
41
- }
42
- var bigintId = (0, import_mini.pipe)(
43
- (0, import_mini.string)(),
44
- (0, import_mini.transform)((input, ctx) => {
45
- if (!/^(0|[1-9]\d{0,19})$/.test(input)) {
46
- const message = `Invalid bigint id: ${input}`;
47
- ctx.issues.push({ code: "custom", input, message });
48
- return import_mini.NEVER;
49
- }
50
- try {
51
- return BigInt(input);
52
- } catch {
53
- const message = `Parse bigint id: ${input} failed`;
54
- ctx.issues.push({ code: "custom", input, message });
55
- return import_mini.NEVER;
56
- }
57
- })
58
- );
59
- // Annotate the CommonJS export names for ESM import in node:
60
- 0 && (module.exports = {
61
- bigintId,
62
- zValidator
63
- });
64
- //# sourceMappingURL=validator.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/hono/validator.ts"],"sourcesContent":["import { validator } from 'hono/validator';\nimport { transform, pipe, string, NEVER } from 'zod/mini';\nimport { Details } from '../error/detail';\nimport { Status } from '../error/status';\nimport type { BadRequest } from '../error/detail';\nimport type { ValidationTargets } from 'hono';\nimport type { output as outputV4, ZodType } from 'zod';\nimport type { output as outputMini, ZodMiniType } from 'zod/mini';\n\nexport function zValidator<S extends ZodType | ZodMiniType>(\n target: keyof ValidationTargets,\n schema: S\n) {\n return validator(target, async (value) => {\n const result = await schema.safeParseAsync(value);\n if (result.success) return result.data as S extends ZodType ? outputV4<S> : outputMini<S>;\n\n const fieldViolations: BadRequest['fieldViolations'] = result.error.issues.map(\n ({ path, message }) => ({ field: path.join('.'), description: message })\n );\n const details = Details.new().badRequest({ fieldViolations });\n throw Status.invalidArgument().error(details);\n });\n}\n\nexport const bigintId = pipe(\n string(),\n transform((input, ctx) => {\n if (!/^(0|[1-9]\\d{0,19})$/.test(input)) {\n const message = `Invalid bigint id: ${input}`;\n ctx.issues.push({ code: 'custom', input, message });\n return NEVER;\n }\n try {\n return BigInt(input);\n } catch {\n const message = `Parse bigint id: ${input} failed`;\n ctx.issues.push({ code: 'custom', input, message });\n return NEVER;\n }\n })\n);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAA0B;AAC1B,kBAA+C;AAC/C,oBAAwB;AACxB,oBAAuB;AAMhB,SAAS,WACd,QACA,QACA;AACA,aAAO,4BAAU,QAAQ,OAAO,UAAU;AACxC,UAAM,SAAS,MAAM,OAAO,eAAe,KAAK;AAChD,QAAI,OAAO,QAAS,QAAO,OAAO;AAElC,UAAM,kBAAiD,OAAO,MAAM,OAAO;AAAA,MACzE,CAAC,EAAE,MAAM,QAAQ,OAAO,EAAE,OAAO,KAAK,KAAK,GAAG,GAAG,aAAa,QAAQ;AAAA,IACxE;AACA,UAAM,UAAU,sBAAQ,IAAI,EAAE,WAAW,EAAE,gBAAgB,CAAC;AAC5D,UAAM,qBAAO,gBAAgB,EAAE,MAAM,OAAO;AAAA,EAC9C,CAAC;AACH;AAEO,IAAM,eAAW;AAAA,MACtB,oBAAO;AAAA,MACP,uBAAU,CAAC,OAAO,QAAQ;AACxB,QAAI,CAAC,sBAAsB,KAAK,KAAK,GAAG;AACtC,YAAM,UAAU,sBAAsB,KAAK;AAC3C,UAAI,OAAO,KAAK,EAAE,MAAM,UAAU,OAAO,QAAQ,CAAC;AAClD,aAAO;AAAA,IACT;AACA,QAAI;AACF,aAAO,OAAO,KAAK;AAAA,IACrB,QAAQ;AACN,YAAM,UAAU,oBAAoB,KAAK;AACzC,UAAI,OAAO,KAAK,EAAE,MAAM,UAAU,OAAO,QAAQ,CAAC;AAClD,aAAO;AAAA,IACT;AAAA,EACF,CAAC;AACH;","names":[]}
@@ -1,28 +0,0 @@
1
- import * as zod_mini from 'zod/mini';
2
- import { ZodMiniType } from 'zod/mini';
3
- import * as hono from 'hono';
4
- import { ValidationTargets } from 'hono';
5
- import * as zod_v4_core from 'zod/v4/core';
6
- import { ZodType, output } from 'zod';
7
-
8
- declare function zValidator<S extends ZodType | ZodMiniType>(target: keyof ValidationTargets, schema: S): hono.MiddlewareHandler<any, string, {
9
- in: {
10
- json: (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T ? T extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T extends Response & hono.TypedResponse<any> ? never : T : never : never;
11
- form: ((S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_2 ? T_2 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_2 extends Response & hono.TypedResponse<any> ? never : T_2 : never : never) extends infer T_1 ? { [K2 in keyof T_1]: ValidationTargets[K][K2]; } : never;
12
- query: ((S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_4 ? T_4 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_4 extends Response & hono.TypedResponse<any> ? never : T_4 : never : never) extends infer T_3 ? { [K2_1 in keyof T_3]: ValidationTargets[K][K2_1]; } : never;
13
- param: ((S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_6 ? T_6 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_6 extends Response & hono.TypedResponse<any> ? never : T_6 : never : never) extends infer T_5 ? { [K2_2 in keyof T_5]: ValidationTargets[K][K2_2]; } : never;
14
- header: ((S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_8 ? T_8 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_8 extends Response & hono.TypedResponse<any> ? never : T_8 : never : never) extends infer T_7 ? { [K2_3 in keyof T_7]: ValidationTargets[K][K2_3]; } : never;
15
- cookie: ((S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_10 ? T_10 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_10 extends Response & hono.TypedResponse<any> ? never : T_10 : never : never) extends infer T_9 ? { [K2_4 in keyof T_9]: ValidationTargets[K][K2_4]; } : never;
16
- };
17
- out: {
18
- json: (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_11 ? T_11 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_11 extends Response & hono.TypedResponse<any> ? never : T_11 : never : never;
19
- form: (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_12 ? T_12 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_12 extends Response & hono.TypedResponse<any> ? never : T_12 : never : never;
20
- query: (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_13 ? T_13 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_13 extends Response & hono.TypedResponse<any> ? never : T_13 : never : never;
21
- param: (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_14 ? T_14 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_14 extends Response & hono.TypedResponse<any> ? never : T_14 : never : never;
22
- header: (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_15 ? T_15 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_15 extends Response & hono.TypedResponse<any> ? never : T_15 : never : never;
23
- cookie: (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_16 ? T_16 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_16 extends Response & hono.TypedResponse<any> ? never : T_16 : never : never;
24
- };
25
- }>;
26
- declare const bigintId: zod_mini.ZodMiniPipe<zod_mini.ZodMiniString<string>, zod_mini.ZodMiniTransform<bigint, string>>;
27
-
28
- export { bigintId, zValidator };
@@ -1,28 +0,0 @@
1
- import * as zod_mini from 'zod/mini';
2
- import { ZodMiniType } from 'zod/mini';
3
- import * as hono from 'hono';
4
- import { ValidationTargets } from 'hono';
5
- import * as zod_v4_core from 'zod/v4/core';
6
- import { ZodType, output } from 'zod';
7
-
8
- declare function zValidator<S extends ZodType | ZodMiniType>(target: keyof ValidationTargets, schema: S): hono.MiddlewareHandler<any, string, {
9
- in: {
10
- json: (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T ? T extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T extends Response & hono.TypedResponse<any> ? never : T : never : never;
11
- form: ((S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_2 ? T_2 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_2 extends Response & hono.TypedResponse<any> ? never : T_2 : never : never) extends infer T_1 ? { [K2 in keyof T_1]: ValidationTargets[K][K2]; } : never;
12
- query: ((S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_4 ? T_4 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_4 extends Response & hono.TypedResponse<any> ? never : T_4 : never : never) extends infer T_3 ? { [K2_1 in keyof T_3]: ValidationTargets[K][K2_1]; } : never;
13
- param: ((S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_6 ? T_6 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_6 extends Response & hono.TypedResponse<any> ? never : T_6 : never : never) extends infer T_5 ? { [K2_2 in keyof T_5]: ValidationTargets[K][K2_2]; } : never;
14
- header: ((S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_8 ? T_8 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_8 extends Response & hono.TypedResponse<any> ? never : T_8 : never : never) extends infer T_7 ? { [K2_3 in keyof T_7]: ValidationTargets[K][K2_3]; } : never;
15
- cookie: ((S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_10 ? T_10 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_10 extends Response & hono.TypedResponse<any> ? never : T_10 : never : never) extends infer T_9 ? { [K2_4 in keyof T_9]: ValidationTargets[K][K2_4]; } : never;
16
- };
17
- out: {
18
- json: (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_11 ? T_11 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_11 extends Response & hono.TypedResponse<any> ? never : T_11 : never : never;
19
- form: (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_12 ? T_12 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_12 extends Response & hono.TypedResponse<any> ? never : T_12 : never : never;
20
- query: (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_13 ? T_13 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_13 extends Response & hono.TypedResponse<any> ? never : T_13 : never : never;
21
- param: (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_14 ? T_14 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_14 extends Response & hono.TypedResponse<any> ? never : T_14 : never : never;
22
- header: (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_15 ? T_15 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_15 extends Response & hono.TypedResponse<any> ? never : T_15 : never : never;
23
- cookie: (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) extends infer T_16 ? T_16 extends (S extends ZodType<unknown, unknown, zod_v4_core.$ZodTypeInternals<unknown, unknown>> ? output<S> : output<S>) ? T_16 extends Response & hono.TypedResponse<any> ? never : T_16 : never : never;
24
- };
25
- }>;
26
- declare const bigintId: zod_mini.ZodMiniPipe<zod_mini.ZodMiniString<string>, zod_mini.ZodMiniTransform<bigint, string>>;
27
-
28
- export { bigintId, zValidator };
@@ -1,38 +0,0 @@
1
- // src/hono/validator.ts
2
- import { validator } from "hono/validator";
3
- import { transform, pipe, string, NEVER } from "zod/mini";
4
- import { Details } from "../error/detail.mjs";
5
- import { Status } from "../error/status.mjs";
6
- function zValidator(target, schema) {
7
- return validator(target, async (value) => {
8
- const result = await schema.safeParseAsync(value);
9
- if (result.success) return result.data;
10
- const fieldViolations = result.error.issues.map(
11
- ({ path, message }) => ({ field: path.join("."), description: message })
12
- );
13
- const details = Details.new().badRequest({ fieldViolations });
14
- throw Status.invalidArgument().error(details);
15
- });
16
- }
17
- var bigintId = pipe(
18
- string(),
19
- transform((input, ctx) => {
20
- if (!/^(0|[1-9]\d{0,19})$/.test(input)) {
21
- const message = `Invalid bigint id: ${input}`;
22
- ctx.issues.push({ code: "custom", input, message });
23
- return NEVER;
24
- }
25
- try {
26
- return BigInt(input);
27
- } catch {
28
- const message = `Parse bigint id: ${input} failed`;
29
- ctx.issues.push({ code: "custom", input, message });
30
- return NEVER;
31
- }
32
- })
33
- );
34
- export {
35
- bigintId,
36
- zValidator
37
- };
38
- //# sourceMappingURL=validator.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/hono/validator.ts"],"sourcesContent":["import { validator } from 'hono/validator';\nimport { transform, pipe, string, NEVER } from 'zod/mini';\nimport { Details } from '../error/detail';\nimport { Status } from '../error/status';\nimport type { BadRequest } from '../error/detail';\nimport type { ValidationTargets } from 'hono';\nimport type { output as outputV4, ZodType } from 'zod';\nimport type { output as outputMini, ZodMiniType } from 'zod/mini';\n\nexport function zValidator<S extends ZodType | ZodMiniType>(\n target: keyof ValidationTargets,\n schema: S\n) {\n return validator(target, async (value) => {\n const result = await schema.safeParseAsync(value);\n if (result.success) return result.data as S extends ZodType ? outputV4<S> : outputMini<S>;\n\n const fieldViolations: BadRequest['fieldViolations'] = result.error.issues.map(\n ({ path, message }) => ({ field: path.join('.'), description: message })\n );\n const details = Details.new().badRequest({ fieldViolations });\n throw Status.invalidArgument().error(details);\n });\n}\n\nexport const bigintId = pipe(\n string(),\n transform((input, ctx) => {\n if (!/^(0|[1-9]\\d{0,19})$/.test(input)) {\n const message = `Invalid bigint id: ${input}`;\n ctx.issues.push({ code: 'custom', input, message });\n return NEVER;\n }\n try {\n return BigInt(input);\n } catch {\n const message = `Parse bigint id: ${input} failed`;\n ctx.issues.push({ code: 'custom', input, message });\n return NEVER;\n }\n })\n);\n"],"mappings":";AAAA,SAAS,iBAAiB;AAC1B,SAAS,WAAW,MAAM,QAAQ,aAAa;AAC/C,SAAS,eAAe;AACxB,SAAS,cAAc;AAMhB,SAAS,WACd,QACA,QACA;AACA,SAAO,UAAU,QAAQ,OAAO,UAAU;AACxC,UAAM,SAAS,MAAM,OAAO,eAAe,KAAK;AAChD,QAAI,OAAO,QAAS,QAAO,OAAO;AAElC,UAAM,kBAAiD,OAAO,MAAM,OAAO;AAAA,MACzE,CAAC,EAAE,MAAM,QAAQ,OAAO,EAAE,OAAO,KAAK,KAAK,GAAG,GAAG,aAAa,QAAQ;AAAA,IACxE;AACA,UAAM,UAAU,QAAQ,IAAI,EAAE,WAAW,EAAE,gBAAgB,CAAC;AAC5D,UAAM,OAAO,gBAAgB,EAAE,MAAM,OAAO;AAAA,EAC9C,CAAC;AACH;AAEO,IAAM,WAAW;AAAA,EACtB,OAAO;AAAA,EACP,UAAU,CAAC,OAAO,QAAQ;AACxB,QAAI,CAAC,sBAAsB,KAAK,KAAK,GAAG;AACtC,YAAM,UAAU,sBAAsB,KAAK;AAC3C,UAAI,OAAO,KAAK,EAAE,MAAM,UAAU,OAAO,QAAQ,CAAC;AAClD,aAAO;AAAA,IACT;AACA,QAAI;AACF,aAAO,OAAO,KAAK;AAAA,IACrB,QAAQ;AACN,YAAM,UAAU,oBAAoB,KAAK;AACzC,UAAI,OAAO,KAAK,EAAE,MAAM,UAAU,OAAO,QAAQ,CAAC;AAClD,aAAO;AAAA,IACT;AAAA,EACF,CAAC;AACH;","names":[]}
@@ -1,129 +0,0 @@
1
- /**
2
- * A Universally Unique Identifier (UUID) is a 36-character alphanumeric string that's typically represented in the following format:
3
- * - Format: 8-4-4-4-12
4
- * */
5
- declare const UUID = 36;
6
- /**
7
- * The length of an Apple device's unique device identifier (UDID) depends on the model of the device:
8
- * - iPhone X and earlier: The UDID is a 40-character alphanumeric string
9
- * - iPhone XS and later: The UDID is a 24-character string with a dash after the 8th digit
10
- * */
11
- declare const UDID = 40;
12
- /**
13
- * Apple's Identifier for Vendors (IDFV).
14
- * - `var identifierForVendor: UUID? { get }` An alphanumeric string that uniquely identifies a device to the app’s vendor.
15
- * - Reference: [identifierForVendor](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor)
16
- * */
17
- declare const IDFV = 36;
18
- /**
19
- * Apple's Identifier for Advertisers (IDFA).
20
- * - `var advertisingIdentifier: UUID { get }` The UUID that is specific to a device.
21
- * - Reference: [advertisingIdentifier](https://developer.apple.com/documentation/adsupport/asidentifiermanager/advertisingidentifier)
22
- * */
23
- declare const IDFA = 36;
24
- /**
25
- * Android Device ID
26
- * - 64-bit number (expressed as a hexadecimal string)
27
- * - Reference: [ANDROID_ID](https://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID)
28
- * */
29
- declare const ANDROID_ID = 16;
30
- /**
31
- * - Web Device ID: UUID v4
32
- * - iOS Device ID: IDFV
33
- * - Android Device ID: ANDROID_ID
34
- * */
35
- declare const DEVICE_ID: number;
36
- /**
37
- * - The advertising ID is represented using version 3 of the universally unique identifier (UUID) format or an equivalent 128-bit format.
38
- * - If this permission is not declared, the returned value will be 00000000-0000-0000-0000-000000000000 starting early 2022.
39
- * - Reference: [AD_ID](https://developers.google.com/android/reference/com/google/android/gms/ads/identifier/AdvertisingIdClient.Info#public-string-getid)
40
- * */
41
- declare const AAID = 36;
42
- /**
43
- * - Web: UUID
44
- * - iOS: IDFA
45
- * - Android: AAID
46
- * */
47
- declare const ADVERTISING_ID: number;
48
- /**
49
- * - An IPv4 address is at most 4 sets of 3 numbers (12 characters), each set separated by a dot (.). That makes 15 characters.
50
- * - An IPv6 address, at its longest, would be 8 sets of 4 characters (32 total), each set separated by a colon. That makes 39 characters.
51
- * */
52
- declare const IPv4 = 15;
53
- declare const IPv6 = 39;
54
- declare const IPv4_MAPPED_IPv6 = 45;
55
- declare const IP: number;
56
- /**
57
- * - The longest string in the database is America/Argentina/ComodRivadavia. It's 32 characters long.
58
- * - The mysql.time_zone_name table has a Name column defined with 64 characters.
59
- * - It makes sense to use VARCHAR(64) for storing this information.
60
- * - Reference: [List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
61
- * */
62
- declare const TIMEZONE_LONGEST: number;
63
- declare const TIMEZONE: number;
64
- /**
65
- * Reference: [List of ISO 3166 country codes](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes)
66
- * */
67
- declare const COUNTRY_CODE_ALPHA_2 = 2;
68
- declare const COUNTRY_CODE_ALPHA_3 = 3;
69
- declare const COUNTRY_CODE: number;
70
- /**
71
- * Reference: [RFC5646 Tags for Identifying Languages](https://www.rfc-editor.org/rfc/rfc5646#section-4.4.1)
72
- * The following illustration shows how the 35-character recommendation was derived:
73
- * ```
74
- * language = 8 ; longest allowed registered value
75
- * ; longer than primary+extlang
76
- * ; which requires 7 characters
77
- * script = 5 ; if not suppressed: see Section 4.1
78
- * region = 4 ; UN M.49 numeric region code
79
- * ; ISO 3166-1 codes require 3
80
- * variant1 = 9 ; needs 'language' as a prefix
81
- * variant2 = 9 ; very rare, as it needs
82
- * ; 'language-variant1' as a prefix
83
- *
84
- * total = 35 characters
85
- * ```
86
- * */
87
- declare const LANGUAGE_CODE = 35;
88
- /**
89
- * Mailbox = Local-part "@" ( Domain / address-literal )
90
- * - Local-part: The maximum total length of a user name or other local-part is 64 octets.
91
- * - Domain: The maximum total length of a domain name or number is 255 octets.
92
- * - Maximum length of an email address: 64 + 1 + 255 = 320
93
- * - Reference: [Simple Mail Transfer Protocol - Size Limits and Minimums](https://datatracker.ietf.org/doc/html/rfc5321#section-4.5.3.1)
94
- * */
95
- declare const EMAIL_LOCAL_PART = 64;
96
- declare const EMAIL_DOMAIN = 255;
97
- declare const EMAIL: number;
98
- /**
99
- * Reference: [E.164](https://en.wikipedia.org/wiki/E.164)
100
- * */
101
- declare const PHONE_NUMBER = 15;
102
-
103
- declare const index_AAID: typeof AAID;
104
- declare const index_ADVERTISING_ID: typeof ADVERTISING_ID;
105
- declare const index_ANDROID_ID: typeof ANDROID_ID;
106
- declare const index_COUNTRY_CODE: typeof COUNTRY_CODE;
107
- declare const index_COUNTRY_CODE_ALPHA_2: typeof COUNTRY_CODE_ALPHA_2;
108
- declare const index_COUNTRY_CODE_ALPHA_3: typeof COUNTRY_CODE_ALPHA_3;
109
- declare const index_DEVICE_ID: typeof DEVICE_ID;
110
- declare const index_EMAIL: typeof EMAIL;
111
- declare const index_EMAIL_DOMAIN: typeof EMAIL_DOMAIN;
112
- declare const index_EMAIL_LOCAL_PART: typeof EMAIL_LOCAL_PART;
113
- declare const index_IDFA: typeof IDFA;
114
- declare const index_IDFV: typeof IDFV;
115
- declare const index_IP: typeof IP;
116
- declare const index_IPv4: typeof IPv4;
117
- declare const index_IPv4_MAPPED_IPv6: typeof IPv4_MAPPED_IPv6;
118
- declare const index_IPv6: typeof IPv6;
119
- declare const index_LANGUAGE_CODE: typeof LANGUAGE_CODE;
120
- declare const index_PHONE_NUMBER: typeof PHONE_NUMBER;
121
- declare const index_TIMEZONE: typeof TIMEZONE;
122
- declare const index_TIMEZONE_LONGEST: typeof TIMEZONE_LONGEST;
123
- declare const index_UDID: typeof UDID;
124
- declare const index_UUID: typeof UUID;
125
- declare namespace index {
126
- export { index_AAID as AAID, index_ADVERTISING_ID as ADVERTISING_ID, index_ANDROID_ID as ANDROID_ID, index_COUNTRY_CODE as COUNTRY_CODE, index_COUNTRY_CODE_ALPHA_2 as COUNTRY_CODE_ALPHA_2, index_COUNTRY_CODE_ALPHA_3 as COUNTRY_CODE_ALPHA_3, index_DEVICE_ID as DEVICE_ID, index_EMAIL as EMAIL, index_EMAIL_DOMAIN as EMAIL_DOMAIN, index_EMAIL_LOCAL_PART as EMAIL_LOCAL_PART, index_IDFA as IDFA, index_IDFV as IDFV, index_IP as IP, index_IPv4 as IPv4, index_IPv4_MAPPED_IPv6 as IPv4_MAPPED_IPv6, index_IPv6 as IPv6, index_LANGUAGE_CODE as LANGUAGE_CODE, index_PHONE_NUMBER as PHONE_NUMBER, index_TIMEZONE as TIMEZONE, index_TIMEZONE_LONGEST as TIMEZONE_LONGEST, index_UDID as UDID, index_UUID as UUID };
127
- }
128
-
129
- export { ANDROID_ID as A, COUNTRY_CODE_ALPHA_2 as C, DEVICE_ID as D, EMAIL_LOCAL_PART as E, IDFV as I, LANGUAGE_CODE as L, PHONE_NUMBER as P, TIMEZONE_LONGEST as T, UUID as U, UDID as a, IDFA as b, AAID as c, ADVERTISING_ID as d, IPv4 as e, IPv6 as f, IPv4_MAPPED_IPv6 as g, IP as h, index as i, TIMEZONE as j, COUNTRY_CODE_ALPHA_3 as k, COUNTRY_CODE as l, EMAIL_DOMAIN as m, EMAIL as n };
@@ -1,129 +0,0 @@
1
- /**
2
- * A Universally Unique Identifier (UUID) is a 36-character alphanumeric string that's typically represented in the following format:
3
- * - Format: 8-4-4-4-12
4
- * */
5
- declare const UUID = 36;
6
- /**
7
- * The length of an Apple device's unique device identifier (UDID) depends on the model of the device:
8
- * - iPhone X and earlier: The UDID is a 40-character alphanumeric string
9
- * - iPhone XS and later: The UDID is a 24-character string with a dash after the 8th digit
10
- * */
11
- declare const UDID = 40;
12
- /**
13
- * Apple's Identifier for Vendors (IDFV).
14
- * - `var identifierForVendor: UUID? { get }` An alphanumeric string that uniquely identifies a device to the app’s vendor.
15
- * - Reference: [identifierForVendor](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor)
16
- * */
17
- declare const IDFV = 36;
18
- /**
19
- * Apple's Identifier for Advertisers (IDFA).
20
- * - `var advertisingIdentifier: UUID { get }` The UUID that is specific to a device.
21
- * - Reference: [advertisingIdentifier](https://developer.apple.com/documentation/adsupport/asidentifiermanager/advertisingidentifier)
22
- * */
23
- declare const IDFA = 36;
24
- /**
25
- * Android Device ID
26
- * - 64-bit number (expressed as a hexadecimal string)
27
- * - Reference: [ANDROID_ID](https://developer.android.com/reference/android/provider/Settings.Secure.html#ANDROID_ID)
28
- * */
29
- declare const ANDROID_ID = 16;
30
- /**
31
- * - Web Device ID: UUID v4
32
- * - iOS Device ID: IDFV
33
- * - Android Device ID: ANDROID_ID
34
- * */
35
- declare const DEVICE_ID: number;
36
- /**
37
- * - The advertising ID is represented using version 3 of the universally unique identifier (UUID) format or an equivalent 128-bit format.
38
- * - If this permission is not declared, the returned value will be 00000000-0000-0000-0000-000000000000 starting early 2022.
39
- * - Reference: [AD_ID](https://developers.google.com/android/reference/com/google/android/gms/ads/identifier/AdvertisingIdClient.Info#public-string-getid)
40
- * */
41
- declare const AAID = 36;
42
- /**
43
- * - Web: UUID
44
- * - iOS: IDFA
45
- * - Android: AAID
46
- * */
47
- declare const ADVERTISING_ID: number;
48
- /**
49
- * - An IPv4 address is at most 4 sets of 3 numbers (12 characters), each set separated by a dot (.). That makes 15 characters.
50
- * - An IPv6 address, at its longest, would be 8 sets of 4 characters (32 total), each set separated by a colon. That makes 39 characters.
51
- * */
52
- declare const IPv4 = 15;
53
- declare const IPv6 = 39;
54
- declare const IPv4_MAPPED_IPv6 = 45;
55
- declare const IP: number;
56
- /**
57
- * - The longest string in the database is America/Argentina/ComodRivadavia. It's 32 characters long.
58
- * - The mysql.time_zone_name table has a Name column defined with 64 characters.
59
- * - It makes sense to use VARCHAR(64) for storing this information.
60
- * - Reference: [List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
61
- * */
62
- declare const TIMEZONE_LONGEST: number;
63
- declare const TIMEZONE: number;
64
- /**
65
- * Reference: [List of ISO 3166 country codes](https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes)
66
- * */
67
- declare const COUNTRY_CODE_ALPHA_2 = 2;
68
- declare const COUNTRY_CODE_ALPHA_3 = 3;
69
- declare const COUNTRY_CODE: number;
70
- /**
71
- * Reference: [RFC5646 Tags for Identifying Languages](https://www.rfc-editor.org/rfc/rfc5646#section-4.4.1)
72
- * The following illustration shows how the 35-character recommendation was derived:
73
- * ```
74
- * language = 8 ; longest allowed registered value
75
- * ; longer than primary+extlang
76
- * ; which requires 7 characters
77
- * script = 5 ; if not suppressed: see Section 4.1
78
- * region = 4 ; UN M.49 numeric region code
79
- * ; ISO 3166-1 codes require 3
80
- * variant1 = 9 ; needs 'language' as a prefix
81
- * variant2 = 9 ; very rare, as it needs
82
- * ; 'language-variant1' as a prefix
83
- *
84
- * total = 35 characters
85
- * ```
86
- * */
87
- declare const LANGUAGE_CODE = 35;
88
- /**
89
- * Mailbox = Local-part "@" ( Domain / address-literal )
90
- * - Local-part: The maximum total length of a user name or other local-part is 64 octets.
91
- * - Domain: The maximum total length of a domain name or number is 255 octets.
92
- * - Maximum length of an email address: 64 + 1 + 255 = 320
93
- * - Reference: [Simple Mail Transfer Protocol - Size Limits and Minimums](https://datatracker.ietf.org/doc/html/rfc5321#section-4.5.3.1)
94
- * */
95
- declare const EMAIL_LOCAL_PART = 64;
96
- declare const EMAIL_DOMAIN = 255;
97
- declare const EMAIL: number;
98
- /**
99
- * Reference: [E.164](https://en.wikipedia.org/wiki/E.164)
100
- * */
101
- declare const PHONE_NUMBER = 15;
102
-
103
- declare const index_AAID: typeof AAID;
104
- declare const index_ADVERTISING_ID: typeof ADVERTISING_ID;
105
- declare const index_ANDROID_ID: typeof ANDROID_ID;
106
- declare const index_COUNTRY_CODE: typeof COUNTRY_CODE;
107
- declare const index_COUNTRY_CODE_ALPHA_2: typeof COUNTRY_CODE_ALPHA_2;
108
- declare const index_COUNTRY_CODE_ALPHA_3: typeof COUNTRY_CODE_ALPHA_3;
109
- declare const index_DEVICE_ID: typeof DEVICE_ID;
110
- declare const index_EMAIL: typeof EMAIL;
111
- declare const index_EMAIL_DOMAIN: typeof EMAIL_DOMAIN;
112
- declare const index_EMAIL_LOCAL_PART: typeof EMAIL_LOCAL_PART;
113
- declare const index_IDFA: typeof IDFA;
114
- declare const index_IDFV: typeof IDFV;
115
- declare const index_IP: typeof IP;
116
- declare const index_IPv4: typeof IPv4;
117
- declare const index_IPv4_MAPPED_IPv6: typeof IPv4_MAPPED_IPv6;
118
- declare const index_IPv6: typeof IPv6;
119
- declare const index_LANGUAGE_CODE: typeof LANGUAGE_CODE;
120
- declare const index_PHONE_NUMBER: typeof PHONE_NUMBER;
121
- declare const index_TIMEZONE: typeof TIMEZONE;
122
- declare const index_TIMEZONE_LONGEST: typeof TIMEZONE_LONGEST;
123
- declare const index_UDID: typeof UDID;
124
- declare const index_UUID: typeof UUID;
125
- declare namespace index {
126
- export { index_AAID as AAID, index_ADVERTISING_ID as ADVERTISING_ID, index_ANDROID_ID as ANDROID_ID, index_COUNTRY_CODE as COUNTRY_CODE, index_COUNTRY_CODE_ALPHA_2 as COUNTRY_CODE_ALPHA_2, index_COUNTRY_CODE_ALPHA_3 as COUNTRY_CODE_ALPHA_3, index_DEVICE_ID as DEVICE_ID, index_EMAIL as EMAIL, index_EMAIL_DOMAIN as EMAIL_DOMAIN, index_EMAIL_LOCAL_PART as EMAIL_LOCAL_PART, index_IDFA as IDFA, index_IDFV as IDFV, index_IP as IP, index_IPv4 as IPv4, index_IPv4_MAPPED_IPv6 as IPv4_MAPPED_IPv6, index_IPv6 as IPv6, index_LANGUAGE_CODE as LANGUAGE_CODE, index_PHONE_NUMBER as PHONE_NUMBER, index_TIMEZONE as TIMEZONE, index_TIMEZONE_LONGEST as TIMEZONE_LONGEST, index_UDID as UDID, index_UUID as UUID };
127
- }
128
-
129
- export { ANDROID_ID as A, COUNTRY_CODE_ALPHA_2 as C, DEVICE_ID as D, EMAIL_LOCAL_PART as E, IDFV as I, LANGUAGE_CODE as L, PHONE_NUMBER as P, TIMEZONE_LONGEST as T, UUID as U, UDID as a, IDFA as b, AAID as c, ADVERTISING_ID as d, IPv4 as e, IPv6 as f, IPv4_MAPPED_IPv6 as g, IP as h, index as i, TIMEZONE as j, COUNTRY_CODE_ALPHA_3 as k, COUNTRY_CODE as l, EMAIL_DOMAIN as m, EMAIL as n };