@shware/http 2.11.4 → 2.12.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 (236) hide show
  1. package/dist/_virtual/_rolldown/runtime.cjs +13 -0
  2. package/dist/_virtual/_rolldown/runtime.mjs +13 -0
  3. package/dist/cache/index.cjs +5 -30
  4. package/dist/cache/index.cjs.map +1 -1
  5. package/dist/cache/index.d.cts +7 -5
  6. package/dist/cache/index.d.cts.map +1 -0
  7. package/dist/cache/index.d.mts +11 -0
  8. package/dist/cache/index.d.mts.map +1 -0
  9. package/dist/cache/index.mjs +5 -6
  10. package/dist/cache/index.mjs.map +1 -1
  11. package/dist/error/detail.cjs +100 -90
  12. package/dist/error/detail.cjs.map +1 -1
  13. package/dist/error/detail.d.cts +77 -78
  14. package/dist/error/detail.d.cts.map +1 -0
  15. package/dist/error/detail.d.mts +108 -0
  16. package/dist/error/detail.d.mts.map +1 -0
  17. package/dist/error/detail.mjs +99 -65
  18. package/dist/error/detail.mjs.map +1 -1
  19. package/dist/error/i18n/en-us.cjs +5 -29
  20. package/dist/error/i18n/en-us.cjs.map +1 -1
  21. package/dist/error/i18n/en-us.d.cts +3 -1
  22. package/dist/error/i18n/en-us.d.cts.map +1 -0
  23. package/dist/error/i18n/en-us.d.mts +5 -0
  24. package/dist/error/i18n/en-us.d.mts.map +1 -0
  25. package/dist/error/i18n/en-us.mjs +5 -5
  26. package/dist/error/i18n/en-us.mjs.map +1 -1
  27. package/dist/error/index.cjs +29 -56
  28. package/dist/error/index.cjs.map +1 -1
  29. package/dist/error/index.d.cts +12 -10
  30. package/dist/error/index.d.cts.map +1 -0
  31. package/dist/error/index.d.mts +21 -0
  32. package/dist/error/index.d.mts.map +1 -0
  33. package/dist/error/index.mjs +25 -28
  34. package/dist/error/index.mjs.map +1 -1
  35. package/dist/error/parse.cjs +63 -61
  36. package/dist/error/parse.cjs.map +1 -1
  37. package/dist/error/parse.d.cts +8 -7
  38. package/dist/error/parse.d.cts.map +1 -0
  39. package/dist/error/{parse.d.ts → parse.d.mts} +8 -7
  40. package/dist/error/parse.d.mts.map +1 -0
  41. package/dist/error/parse.mjs +59 -33
  42. package/dist/error/parse.mjs.map +1 -1
  43. package/dist/error/reason.cjs +0 -19
  44. package/dist/error/reason.d.cts +5 -4
  45. package/dist/error/reason.d.cts.map +1 -0
  46. package/dist/error/reason.d.mts +6 -0
  47. package/dist/error/reason.d.mts.map +1 -0
  48. package/dist/error/reason.mjs +1 -1
  49. package/dist/error/status.cjs +103 -256
  50. package/dist/error/status.cjs.map +1 -1
  51. package/dist/error/status.d.cts +58 -58
  52. package/dist/error/status.d.cts.map +1 -0
  53. package/dist/error/status.d.mts +69 -0
  54. package/dist/error/status.d.mts.map +1 -0
  55. package/dist/error/status.mjs +98 -227
  56. package/dist/error/status.mjs.map +1 -1
  57. package/dist/google-one-tap/index.cjs +135 -138
  58. package/dist/google-one-tap/index.cjs.map +1 -1
  59. package/dist/google-one-tap/index.d.cts +49 -48
  60. package/dist/google-one-tap/index.d.cts.map +1 -0
  61. package/dist/google-one-tap/index.d.mts +82 -0
  62. package/dist/google-one-tap/index.d.mts.map +1 -0
  63. package/dist/google-one-tap/index.mjs +133 -112
  64. package/dist/google-one-tap/index.mjs.map +1 -1
  65. package/dist/google-one-tap/types.cjs +0 -19
  66. package/dist/google-one-tap/types.d.cts +124 -122
  67. package/dist/google-one-tap/types.d.cts.map +1 -0
  68. package/dist/google-one-tap/types.d.mts +157 -0
  69. package/dist/google-one-tap/types.d.mts.map +1 -0
  70. package/dist/google-one-tap/types.mjs +1 -1
  71. package/dist/hono/authorizer.cjs +28 -65
  72. package/dist/hono/authorizer.cjs.map +1 -1
  73. package/dist/hono/authorizer.d.cts +12 -11
  74. package/dist/hono/authorizer.d.cts.map +1 -0
  75. package/dist/hono/authorizer.d.mts +19 -0
  76. package/dist/hono/authorizer.d.mts.map +1 -0
  77. package/dist/hono/authorizer.mjs +23 -36
  78. package/dist/hono/authorizer.mjs.map +1 -1
  79. package/dist/hono/csrf.cjs +81 -92
  80. package/dist/hono/csrf.cjs.map +1 -1
  81. package/dist/hono/csrf.d.cts +46 -45
  82. package/dist/hono/csrf.d.cts.map +1 -0
  83. package/dist/hono/csrf.d.mts +76 -0
  84. package/dist/hono/csrf.d.mts.map +1 -0
  85. package/dist/hono/csrf.mjs +76 -63
  86. package/dist/hono/csrf.mjs.map +1 -1
  87. package/dist/hono/geolocation.cjs +10 -34
  88. package/dist/hono/geolocation.cjs.map +1 -1
  89. package/dist/hono/geolocation.d.cts +5 -4
  90. package/dist/hono/geolocation.d.cts.map +1 -0
  91. package/dist/hono/geolocation.d.mts +7 -0
  92. package/dist/hono/geolocation.d.mts.map +1 -0
  93. package/dist/hono/geolocation.mjs +8 -12
  94. package/dist/hono/geolocation.mjs.map +1 -1
  95. package/dist/hono/handler.cjs +37 -61
  96. package/dist/hono/handler.cjs.map +1 -1
  97. package/dist/hono/handler.d.cts +26 -25
  98. package/dist/hono/handler.d.cts.map +1 -0
  99. package/dist/hono/handler.d.mts +32 -0
  100. package/dist/hono/handler.d.mts.map +1 -0
  101. package/dist/hono/handler.mjs +34 -34
  102. package/dist/hono/handler.mjs.map +1 -1
  103. package/dist/hono/index.cjs +14 -48
  104. package/dist/hono/index.d.cts +7 -15
  105. package/dist/hono/index.d.mts +7 -0
  106. package/dist/hono/index.mjs +4 -14
  107. package/dist/hono/rate-limit.cjs +65 -110
  108. package/dist/hono/rate-limit.cjs.map +1 -1
  109. package/dist/hono/rate-limit.d.cts +27 -26
  110. package/dist/hono/rate-limit.d.cts.map +1 -0
  111. package/dist/hono/rate-limit.d.mts +36 -0
  112. package/dist/hono/rate-limit.d.mts.map +1 -0
  113. package/dist/hono/rate-limit.mjs +60 -81
  114. package/dist/hono/rate-limit.mjs.map +1 -1
  115. package/dist/hono/validator.cjs +47 -66
  116. package/dist/hono/validator.cjs.map +1 -1
  117. package/dist/hono/validator.d.cts +25 -30
  118. package/dist/hono/validator.d.cts.map +1 -0
  119. package/dist/hono/validator.d.mts +26 -0
  120. package/dist/hono/validator.d.mts.map +1 -0
  121. package/dist/hono/validator.mjs +43 -43
  122. package/dist/hono/validator.mjs.map +1 -1
  123. package/dist/index.cjs +39 -95
  124. package/dist/index.d.cts +12 -14
  125. package/dist/index.d.mts +12 -0
  126. package/dist/index.mjs +5 -48
  127. package/dist/iso/iso_3601_1.cjs +1512 -290
  128. package/dist/iso/iso_3601_1.cjs.map +1 -1
  129. package/dist/iso/iso_3601_1.d.cts +8 -6
  130. package/dist/iso/iso_3601_1.d.cts.map +1 -0
  131. package/dist/iso/iso_3601_1.d.mts +11 -0
  132. package/dist/iso/iso_3601_1.d.mts.map +1 -0
  133. package/dist/iso/iso_3601_1.mjs +1511 -265
  134. package/dist/iso/iso_3601_1.mjs.map +1 -1
  135. package/dist/max-length/index.cjs +158 -91
  136. package/dist/max-length/index.cjs.map +1 -1
  137. package/dist/max-length/index.d.cts +110 -1
  138. package/dist/max-length/index.d.cts.map +1 -0
  139. package/dist/{index-BhgdyigB.d.ts → max-length/index.d.mts} +9 -28
  140. package/dist/max-length/index.d.mts.map +1 -0
  141. package/dist/max-length/index.mjs +133 -47
  142. package/dist/max-length/index.mjs.map +1 -1
  143. package/dist/message.cjs +5 -30
  144. package/dist/message.cjs.map +1 -1
  145. package/dist/message.d.cts +3 -1
  146. package/dist/message.d.cts.map +1 -0
  147. package/dist/{message.d.ts → message.d.mts} +3 -1
  148. package/dist/message.d.mts.map +1 -0
  149. package/dist/message.mjs +5 -6
  150. package/dist/message.mjs.map +1 -1
  151. package/dist/polyfills/index.cjs +4 -4
  152. package/dist/polyfills/index.cjs.map +1 -1
  153. package/dist/polyfills/index.d.cts +1 -2
  154. package/dist/polyfills/index.d.mts +1 -0
  155. package/dist/polyfills/index.mjs +5 -2
  156. package/dist/polyfills/index.mjs.map +1 -1
  157. package/dist/response.cjs +191 -208
  158. package/dist/response.cjs.map +1 -1
  159. package/dist/response.d.cts +53 -54
  160. package/dist/response.d.cts.map +1 -0
  161. package/dist/response.d.mts +82 -0
  162. package/dist/response.d.mts.map +1 -0
  163. package/dist/response.mjs +182 -175
  164. package/dist/response.mjs.map +1 -1
  165. package/dist/snowflake.cjs +48 -70
  166. package/dist/snowflake.cjs.map +1 -1
  167. package/dist/snowflake.d.cts +16 -14
  168. package/dist/snowflake.d.cts.map +1 -0
  169. package/dist/snowflake.d.mts +31 -0
  170. package/dist/snowflake.d.mts.map +1 -0
  171. package/dist/snowflake.mjs +46 -44
  172. package/dist/snowflake.mjs.map +1 -1
  173. package/dist/utils/geolocation.cjs +51 -75
  174. package/dist/utils/geolocation.cjs.map +1 -1
  175. package/dist/utils/geolocation.d.cts +14 -12
  176. package/dist/utils/geolocation.d.cts.map +1 -0
  177. package/dist/utils/{geolocation.d.ts → geolocation.d.mts} +14 -12
  178. package/dist/utils/geolocation.d.mts.map +1 -0
  179. package/dist/utils/geolocation.mjs +47 -47
  180. package/dist/utils/geolocation.mjs.map +1 -1
  181. package/dist/utils/google-tag-gateway.cjs +35 -56
  182. package/dist/utils/google-tag-gateway.cjs.map +1 -1
  183. package/dist/utils/google-tag-gateway.d.cts +3 -1
  184. package/dist/utils/google-tag-gateway.d.cts.map +1 -0
  185. package/dist/utils/{google-tag-gateway.d.ts → google-tag-gateway.d.mts} +3 -1
  186. package/dist/utils/google-tag-gateway.d.mts.map +1 -0
  187. package/dist/utils/google-tag-gateway.mjs +33 -30
  188. package/dist/utils/google-tag-gateway.mjs.map +1 -1
  189. package/dist/utils/timing.cjs +50 -71
  190. package/dist/utils/timing.cjs.map +1 -1
  191. package/dist/utils/timing.d.cts +11 -9
  192. package/dist/utils/timing.d.cts.map +1 -0
  193. package/dist/utils/timing.d.mts +15 -0
  194. package/dist/utils/timing.d.mts.map +1 -0
  195. package/dist/utils/timing.mjs +49 -46
  196. package/dist/utils/timing.mjs.map +1 -1
  197. package/dist/webhook/index.cjs +43 -72
  198. package/dist/webhook/index.cjs.map +1 -1
  199. package/dist/webhook/index.d.cts +3 -1
  200. package/dist/webhook/index.d.cts.map +1 -0
  201. package/dist/webhook/{index.d.ts → index.d.mts} +3 -1
  202. package/dist/webhook/index.d.mts.map +1 -0
  203. package/dist/webhook/index.mjs +41 -46
  204. package/dist/webhook/index.mjs.map +1 -1
  205. package/package.json +49 -24
  206. package/dist/cache/index.d.ts +0 -9
  207. package/dist/error/detail.d.ts +0 -109
  208. package/dist/error/i18n/en-us.d.ts +0 -3
  209. package/dist/error/index.d.ts +0 -19
  210. package/dist/error/reason.cjs.map +0 -1
  211. package/dist/error/reason.d.ts +0 -5
  212. package/dist/error/reason.mjs.map +0 -1
  213. package/dist/error/status.d.ts +0 -69
  214. package/dist/google-one-tap/index.d.ts +0 -81
  215. package/dist/google-one-tap/types.cjs.map +0 -1
  216. package/dist/google-one-tap/types.d.ts +0 -155
  217. package/dist/google-one-tap/types.mjs.map +0 -1
  218. package/dist/hono/authorizer.d.ts +0 -18
  219. package/dist/hono/csrf.d.ts +0 -75
  220. package/dist/hono/geolocation.d.ts +0 -6
  221. package/dist/hono/handler.d.ts +0 -31
  222. package/dist/hono/index.cjs.map +0 -1
  223. package/dist/hono/index.d.ts +0 -15
  224. package/dist/hono/index.mjs.map +0 -1
  225. package/dist/hono/rate-limit.d.ts +0 -35
  226. package/dist/hono/validator.d.ts +0 -31
  227. package/dist/index-BhgdyigB.d.cts +0 -129
  228. package/dist/index.cjs.map +0 -1
  229. package/dist/index.d.ts +0 -14
  230. package/dist/index.mjs.map +0 -1
  231. package/dist/iso/iso_3601_1.d.ts +0 -9
  232. package/dist/max-length/index.d.ts +0 -1
  233. package/dist/polyfills/index.d.ts +0 -2
  234. package/dist/response.d.ts +0 -83
  235. package/dist/snowflake.d.ts +0 -29
  236. package/dist/utils/timing.d.ts +0 -13
@@ -1,48 +1,48 @@
1
- // src/hono/validator.ts
2
- import { validator } from "hono/validator";
3
- import {
4
- NEVER,
5
- pipe,
6
- string,
7
- transform
8
- } from "zod/mini";
9
1
  import { Details } from "../error/detail.mjs";
10
2
  import { Status } from "../error/status.mjs";
3
+ import { NEVER, pipe, string, transform } from "zod/mini";
4
+ import { validator } from "hono/validator";
5
+ //#region src/hono/validator.ts
11
6
  function zValidator(target, schema) {
12
- return validator(target, async (value) => {
13
- const result = await schema.safeParseAsync(value);
14
- if (result.success) return result.data;
15
- const fieldViolations = result.error.issues.map(
16
- ({ code, path, message }) => ({
17
- field: path.join("."),
18
- description: message,
19
- reason: code?.toUpperCase() ?? "INVALID_ARGUMENT",
20
- localizedMessage: { locale: "en-US", message }
21
- })
22
- );
23
- const details = Details.new().badRequest({ fieldViolations });
24
- throw Status.invalidArgument().error(details);
25
- });
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(({ code, path, message }) => ({
11
+ field: path.join("."),
12
+ description: message,
13
+ reason: code?.toUpperCase() ?? "INVALID_ARGUMENT",
14
+ localizedMessage: {
15
+ locale: "en-US",
16
+ message
17
+ }
18
+ }));
19
+ const details = Details.new().badRequest({ fieldViolations });
20
+ throw Status.invalidArgument().error(details);
21
+ });
26
22
  }
27
- var bigintId = pipe(
28
- string(),
29
- transform((input, ctx) => {
30
- if (!/^(0|[1-9]\d{0,19})$/.test(input)) {
31
- const message = `Invalid bigint id: ${input}`;
32
- ctx.issues.push({ code: "custom", input, message });
33
- return NEVER;
34
- }
35
- try {
36
- return BigInt(input);
37
- } catch {
38
- const message = `Parse bigint id: ${input} failed`;
39
- ctx.issues.push({ code: "custom", input, message });
40
- return NEVER;
41
- }
42
- })
43
- );
44
- export {
45
- bigintId,
46
- zValidator
47
- };
23
+ const bigintId = pipe(string(), transform((input, ctx) => {
24
+ if (!/^(0|[1-9]\d{0,19})$/.test(input)) {
25
+ const message = `Invalid bigint id: ${input}`;
26
+ ctx.issues.push({
27
+ code: "custom",
28
+ input,
29
+ message
30
+ });
31
+ return NEVER;
32
+ }
33
+ try {
34
+ return BigInt(input);
35
+ } catch {
36
+ const message = `Parse bigint id: ${input} failed`;
37
+ ctx.issues.push({
38
+ code: "custom",
39
+ input,
40
+ message
41
+ });
42
+ return NEVER;
43
+ }
44
+ }));
45
+ //#endregion
46
+ export { bigintId, zValidator };
47
+
48
48
  //# sourceMappingURL=validator.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/hono/validator.ts"],"sourcesContent":["import type { ValidationTargets } from 'hono';\nimport { validator } from 'hono/validator';\nimport type { ZodType, output as outputV4 } from 'zod';\nimport {\n NEVER,\n type ZodMiniType,\n type output as outputMini,\n pipe,\n string,\n transform,\n} from 'zod/mini';\nimport { type BadRequest, Details } from '../error/detail';\nimport { Status } from '../error/status';\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 ({ code, path, message }) => ({\n field: path.join('.'),\n description: message,\n reason: code?.toUpperCase() ?? 'INVALID_ARGUMENT',\n localizedMessage: { locale: 'en-US', message: message },\n })\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":";AACA,SAAS,iBAAiB;AAE1B;AAAA,EACE;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAA0B,eAAe;AACzC,SAAS,cAAc;AAEhB,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,MAAM,QAAQ,OAAO;AAAA,QAC5B,OAAO,KAAK,KAAK,GAAG;AAAA,QACpB,aAAa;AAAA,QACb,QAAQ,MAAM,YAAY,KAAK;AAAA,QAC/B,kBAAkB,EAAE,QAAQ,SAAS,QAAiB;AAAA,MACxD;AAAA,IACF;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
+ {"version":3,"file":"validator.mjs","names":[],"sources":["../../src/hono/validator.ts"],"sourcesContent":["import type { ValidationTargets } from 'hono';\nimport { validator } from 'hono/validator';\nimport type { ZodType, output as outputV4 } from 'zod';\nimport {\n NEVER,\n type ZodMiniType,\n type output as outputMini,\n pipe,\n string,\n transform,\n} from 'zod/mini';\nimport { type BadRequest, Details } from '../error/detail';\nimport { Status } from '../error/status';\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 ({ code, path, message }) => ({\n field: path.join('.'),\n description: message,\n reason: code?.toUpperCase() ?? 'INVALID_ARGUMENT',\n localizedMessage: { locale: 'en-US', message: message },\n })\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":";;;;;AAcA,SAAgB,WACd,QACA,QACA;CACA,OAAO,UAAU,QAAQ,OAAO,UAAU;EACxC,MAAM,SAAS,MAAM,OAAO,eAAe,KAAK;EAChD,IAAI,OAAO,SAAS,OAAO,OAAO;EAElC,MAAM,kBAAiD,OAAO,MAAM,OAAO,KACxE,EAAE,MAAM,MAAM,eAAe;GAC5B,OAAO,KAAK,KAAK,GAAG;GACpB,aAAa;GACb,QAAQ,MAAM,YAAY,KAAK;GAC/B,kBAAkB;IAAE,QAAQ;IAAkB;GAAQ;EACxD,EACF;EACA,MAAM,UAAU,QAAQ,IAAI,CAAC,CAAC,WAAW,EAAE,gBAAgB,CAAC;EAC5D,MAAM,OAAO,gBAAgB,CAAC,CAAC,MAAM,OAAO;CAC9C,CAAC;AACH;AAEA,MAAa,WAAW,KACtB,OAAO,GACP,WAAW,OAAO,QAAQ;CACxB,IAAI,CAAC,sBAAsB,KAAK,KAAK,GAAG;EACtC,MAAM,UAAU,sBAAsB;EACtC,IAAI,OAAO,KAAK;GAAE,MAAM;GAAU;GAAO;EAAQ,CAAC;EAClD,OAAO;CACT;CACA,IAAI;EACF,OAAO,OAAO,KAAK;CACrB,QAAQ;EACN,MAAM,UAAU,oBAAoB,MAAM;EAC1C,IAAI,OAAO,KAAK;GAAE,MAAM;GAAU;GAAO;EAAQ,CAAC;EAClD,OAAO;CACT;AACF,CAAC,CACH"}
package/dist/index.cjs CHANGED
@@ -1,96 +1,40 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/index.ts
31
- var index_exports = {};
32
- __export(index_exports, {
33
- CheckoutCreateError: () => import_error.CheckoutCreateError,
34
- Cursor: () => import_response.Cursor,
35
- DetailType: () => import_detail.DetailType,
36
- Details: () => import_detail.Details,
37
- ISO_3601_1: () => import_iso_3601_1.ISO_3601_1,
38
- Items: () => import_response.Items,
39
- LoginCanceledError: () => import_error.LoginCanceledError,
40
- LoginTimeoutError: () => import_error.LoginTimeoutError,
41
- MAX_LENGTH: () => MAX_LENGTH,
42
- Pages: () => import_response.Pages,
43
- PurchaseError: () => import_error.PurchaseError,
44
- Status: () => import_status.Status,
45
- StatusError: () => import_status.StatusError,
46
- UidGenerator: () => import_snowflake.UidGenerator,
47
- forwardToGoogleTagGateway: () => import_google_tag_gateway.forwardToGoogleTagGateway,
48
- getErrorInfo: () => import_parse.getErrorInfo,
49
- getErrorMessage: () => import_parse.getErrorMessage,
50
- getFieldViolations: () => import_parse.getFieldViolations,
51
- getNextPageParam: () => import_response.getNextPageParam,
52
- getPreviousPageParam: () => import_response.getPreviousPageParam,
53
- initialPageParam: () => import_response.initialPageParam,
54
- pageParamsSchema: () => import_response.pageParamsSchema,
55
- timing: () => import_timing.timing,
56
- uid: () => import_snowflake.uid
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_error_index = require("./error/index.cjs");
3
+ const require_error_detail = require("./error/detail.cjs");
4
+ const require_error_status = require("./error/status.cjs");
5
+ const require_error_parse = require("./error/parse.cjs");
6
+ const require_response = require("./response.cjs");
7
+ const require_snowflake = require("./snowflake.cjs");
8
+ const require_max_length_index = require("./max-length/index.cjs");
9
+ const require_utils_timing = require("./utils/timing.cjs");
10
+ const require_utils_google_tag_gateway = require("./utils/google-tag-gateway.cjs");
11
+ const require_iso_iso_3601_1 = require("./iso/iso_3601_1.cjs");
12
+ exports.CheckoutCreateError = require_error_index.CheckoutCreateError;
13
+ exports.Cursor = require_response.Cursor;
14
+ exports.DetailType = require_error_detail.DetailType;
15
+ exports.Details = require_error_detail.Details;
16
+ exports.ISO_3601_1 = require_iso_iso_3601_1.ISO_3601_1;
17
+ exports.Items = require_response.Items;
18
+ exports.LoginCanceledError = require_error_index.LoginCanceledError;
19
+ exports.LoginTimeoutError = require_error_index.LoginTimeoutError;
20
+ Object.defineProperty(exports, "MAX_LENGTH", {
21
+ enumerable: true,
22
+ get: function() {
23
+ return require_max_length_index.max_length_exports;
24
+ }
57
25
  });
58
- module.exports = __toCommonJS(index_exports);
59
- var import_error = require("./error/index.cjs");
60
- var import_detail = require("./error/detail.cjs");
61
- var import_status = require("./error/status.cjs");
62
- var import_parse = require("./error/parse.cjs");
63
- var import_response = require("./response.cjs");
64
- var import_snowflake = require("./snowflake.cjs");
65
- var MAX_LENGTH = __toESM(require("./max-length/index.cjs"), 1);
66
- var import_timing = require("./utils/timing.cjs");
67
- var import_google_tag_gateway = require("./utils/google-tag-gateway.cjs");
68
- var import_iso_3601_1 = require("./iso/iso_3601_1.cjs");
69
- // Annotate the CommonJS export names for ESM import in node:
70
- 0 && (module.exports = {
71
- CheckoutCreateError,
72
- Cursor,
73
- DetailType,
74
- Details,
75
- ISO_3601_1,
76
- Items,
77
- LoginCanceledError,
78
- LoginTimeoutError,
79
- MAX_LENGTH,
80
- Pages,
81
- PurchaseError,
82
- Status,
83
- StatusError,
84
- UidGenerator,
85
- forwardToGoogleTagGateway,
86
- getErrorInfo,
87
- getErrorMessage,
88
- getFieldViolations,
89
- getNextPageParam,
90
- getPreviousPageParam,
91
- initialPageParam,
92
- pageParamsSchema,
93
- timing,
94
- uid
95
- });
96
- //# sourceMappingURL=index.cjs.map
26
+ exports.Pages = require_response.Pages;
27
+ exports.PurchaseError = require_error_index.PurchaseError;
28
+ exports.Status = require_error_status.Status;
29
+ exports.StatusError = require_error_status.StatusError;
30
+ exports.UidGenerator = require_snowflake.UidGenerator;
31
+ exports.forwardToGoogleTagGateway = require_utils_google_tag_gateway.forwardToGoogleTagGateway;
32
+ exports.getErrorInfo = require_error_parse.getErrorInfo;
33
+ exports.getErrorMessage = require_error_parse.getErrorMessage;
34
+ exports.getFieldViolations = require_error_parse.getFieldViolations;
35
+ exports.getNextPageParam = require_response.getNextPageParam;
36
+ exports.getPreviousPageParam = require_response.getPreviousPageParam;
37
+ exports.initialPageParam = require_response.initialPageParam;
38
+ exports.pageParamsSchema = require_response.pageParamsSchema;
39
+ exports.timing = require_utils_timing.timing;
40
+ exports.uid = require_snowflake.uid;
package/dist/index.d.cts CHANGED
@@ -1,14 +1,12 @@
1
- export { CheckoutCreateError, LoginCanceledError, LoginTimeoutError, PurchaseError } from './error/index.cjs';
2
- export { ErrorReason, ResolvedErrorReason } from './error/reason.cjs';
3
- export { BadRequest, DebugInfo, Detail, DetailType, Details, ErrorInfo, Help, LocalizedMessage, PreconditionFailure, QuotaFailure, RequestInfo, ResourceInfo, RetryInfo } from './error/detail.cjs';
4
- export { ErrorBody, Status, StatusError } from './error/status.cjs';
5
- export { getErrorInfo, getErrorMessage, getFieldViolations } from './error/parse.cjs';
6
- export { Cursor, Empty, Entity, EntityId, InfinitePageData, InitParams, Items, NextParams, Page, PageParams, Pages, ParentPageParams, PrevParams, Response, getNextPageParam, getPreviousPageParam, initialPageParam, pageParamsSchema } from './response.cjs';
7
- export { UidGenerator, uid } from './snowflake.cjs';
8
- export { n as MAX_LENGTH } from './index-BhgdyigB.cjs';
9
- export { timing } from './utils/timing.cjs';
10
- export { forwardToGoogleTagGateway } from './utils/google-tag-gateway.cjs';
11
- export { ISO3166CountryCode, ISO_3601_1 } from './iso/iso_3601_1.cjs';
12
- import 'i18next';
13
- import 'zod/v4/core';
14
- import 'zod/mini';
1
+ import { ErrorReason, ResolvedErrorReason } from "./error/reason.cjs";
2
+ import { BadRequest, DebugInfo, Detail, DetailType, Details, ErrorInfo, Help, LocalizedMessage, PreconditionFailure, QuotaFailure, RequestInfo, ResourceInfo, RetryInfo } from "./error/detail.cjs";
3
+ import { CheckoutCreateError, LoginCanceledError, LoginTimeoutError, PurchaseError } from "./error/index.cjs";
4
+ import { getErrorInfo, getErrorMessage, getFieldViolations } from "./error/parse.cjs";
5
+ import { ErrorBody, Status, StatusError } from "./error/status.cjs";
6
+ import { Cursor, Empty, Entity, EntityId, InfinitePageData, InitParams, Items, NextParams, Page, PageParams, Pages, ParentPageParams, PrevParams, Response, getNextPageParam, getPreviousPageParam, initialPageParam, pageParamsSchema } from "./response.cjs";
7
+ import { UidGenerator, uid } from "./snowflake.cjs";
8
+ import { index_d_exports } from "./max-length/index.cjs";
9
+ import { timing } from "./utils/timing.cjs";
10
+ import { forwardToGoogleTagGateway } from "./utils/google-tag-gateway.cjs";
11
+ import { ISO3166CountryCode, ISO_3601_1 } from "./iso/iso_3601_1.cjs";
12
+ export { type BadRequest, CheckoutCreateError, Cursor, type DebugInfo, type Detail, DetailType, Details, type Empty, type Entity, type EntityId, type ErrorBody, type ErrorInfo, type ErrorReason, type Help, type ISO3166CountryCode, ISO_3601_1, type InfinitePageData, type InitParams, Items, type LocalizedMessage, LoginCanceledError, LoginTimeoutError, index_d_exports as MAX_LENGTH, type NextParams, type Page, type PageParams, Pages, type ParentPageParams, type PreconditionFailure, type PrevParams, PurchaseError, type QuotaFailure, type RequestInfo, type ResolvedErrorReason, type ResourceInfo, type Response, type RetryInfo, Status, StatusError, UidGenerator, forwardToGoogleTagGateway, getErrorInfo, getErrorMessage, getFieldViolations, getNextPageParam, getPreviousPageParam, initialPageParam, pageParamsSchema, timing, uid };
@@ -0,0 +1,12 @@
1
+ import { ErrorReason, ResolvedErrorReason } from "./error/reason.mjs";
2
+ import { BadRequest, DebugInfo, Detail, DetailType, Details, ErrorInfo, Help, LocalizedMessage, PreconditionFailure, QuotaFailure, RequestInfo, ResourceInfo, RetryInfo } from "./error/detail.mjs";
3
+ import { CheckoutCreateError, LoginCanceledError, LoginTimeoutError, PurchaseError } from "./error/index.mjs";
4
+ import { getErrorInfo, getErrorMessage, getFieldViolations } from "./error/parse.mjs";
5
+ import { ErrorBody, Status, StatusError } from "./error/status.mjs";
6
+ import { Cursor, Empty, Entity, EntityId, InfinitePageData, InitParams, Items, NextParams, Page, PageParams, Pages, ParentPageParams, PrevParams, Response, getNextPageParam, getPreviousPageParam, initialPageParam, pageParamsSchema } from "./response.mjs";
7
+ import { UidGenerator, uid } from "./snowflake.mjs";
8
+ import { index_d_exports } from "./max-length/index.mjs";
9
+ import { timing } from "./utils/timing.mjs";
10
+ import { forwardToGoogleTagGateway } from "./utils/google-tag-gateway.mjs";
11
+ import { ISO3166CountryCode, ISO_3601_1 } from "./iso/iso_3601_1.mjs";
12
+ export { type BadRequest, CheckoutCreateError, Cursor, type DebugInfo, type Detail, DetailType, Details, type Empty, type Entity, type EntityId, type ErrorBody, type ErrorInfo, type ErrorReason, type Help, type ISO3166CountryCode, ISO_3601_1, type InfinitePageData, type InitParams, Items, type LocalizedMessage, LoginCanceledError, LoginTimeoutError, index_d_exports as MAX_LENGTH, type NextParams, type Page, type PageParams, Pages, type ParentPageParams, type PreconditionFailure, type PrevParams, PurchaseError, type QuotaFailure, type RequestInfo, type ResolvedErrorReason, type ResourceInfo, type Response, type RetryInfo, Status, StatusError, UidGenerator, forwardToGoogleTagGateway, getErrorInfo, getErrorMessage, getFieldViolations, getNextPageParam, getPreviousPageParam, initialPageParam, pageParamsSchema, timing, uid };
package/dist/index.mjs CHANGED
@@ -1,54 +1,11 @@
1
- // src/index.ts
2
- import {
3
- LoginTimeoutError,
4
- LoginCanceledError,
5
- CheckoutCreateError,
6
- PurchaseError
7
- } from "./error/index.mjs";
8
- import {
9
- DetailType,
10
- Details
11
- } from "./error/detail.mjs";
1
+ import { CheckoutCreateError, LoginCanceledError, LoginTimeoutError, PurchaseError } from "./error/index.mjs";
2
+ import { DetailType, Details } from "./error/detail.mjs";
12
3
  import { Status, StatusError } from "./error/status.mjs";
13
4
  import { getErrorInfo, getErrorMessage, getFieldViolations } from "./error/parse.mjs";
14
- import {
15
- Items,
16
- Pages,
17
- Cursor,
18
- pageParamsSchema,
19
- initialPageParam,
20
- getPreviousPageParam,
21
- getNextPageParam
22
- } from "./response.mjs";
5
+ import { Cursor, Items, Pages, getNextPageParam, getPreviousPageParam, initialPageParam, pageParamsSchema } from "./response.mjs";
23
6
  import { UidGenerator, uid } from "./snowflake.mjs";
24
- import * as MAX_LENGTH from "./max-length/index.mjs";
7
+ import { max_length_exports } from "./max-length/index.mjs";
25
8
  import { timing } from "./utils/timing.mjs";
26
9
  import { forwardToGoogleTagGateway } from "./utils/google-tag-gateway.mjs";
27
10
  import { ISO_3601_1 } from "./iso/iso_3601_1.mjs";
28
- export {
29
- CheckoutCreateError,
30
- Cursor,
31
- DetailType,
32
- Details,
33
- ISO_3601_1,
34
- Items,
35
- LoginCanceledError,
36
- LoginTimeoutError,
37
- MAX_LENGTH,
38
- Pages,
39
- PurchaseError,
40
- Status,
41
- StatusError,
42
- UidGenerator,
43
- forwardToGoogleTagGateway,
44
- getErrorInfo,
45
- getErrorMessage,
46
- getFieldViolations,
47
- getNextPageParam,
48
- getPreviousPageParam,
49
- initialPageParam,
50
- pageParamsSchema,
51
- timing,
52
- uid
53
- };
54
- //# sourceMappingURL=index.mjs.map
11
+ export { CheckoutCreateError, Cursor, DetailType, Details, ISO_3601_1, Items, LoginCanceledError, LoginTimeoutError, max_length_exports as MAX_LENGTH, Pages, PurchaseError, Status, StatusError, UidGenerator, forwardToGoogleTagGateway, getErrorInfo, getErrorMessage, getFieldViolations, getNextPageParam, getPreviousPageParam, initialPageParam, pageParamsSchema, timing, uid };