@shware/http 2.11.3 → 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 +50 -25
  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,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 { AAID as A, COUNTRY_CODE as C, DEVICE_ID as D, EMAIL as E, IDFA as I, LANGUAGE_CODE as L, PHONE_NUMBER as P, TIMEZONE as T, UDID as U, ADVERTISING_ID as a, ANDROID_ID as b, COUNTRY_CODE_ALPHA_2 as c, COUNTRY_CODE_ALPHA_3 as d, EMAIL_DOMAIN as e, EMAIL_LOCAL_PART as f, IDFV as g, IP as h, IPv4 as i, IPv4_MAPPED_IPv6 as j, IPv6 as k, TIMEZONE_LONGEST as l, UUID as m, index as n };
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @example\n * import { Details, Status } from '@repo/error';\n *\n * Status.adapter = () => new Error('Error');\n *\n * const details = Details.new()\n * .requestInfo({ requestId: '1234567890', servingData: '/v1/tests' })\n * .errorInfo({ reason: 'ACCOUNT_LOCKED' });\n *\n * throw Status.alreadyExists('xxx').error(details);\n */\n\nexport {\n LoginTimeoutError,\n LoginCanceledError,\n CheckoutCreateError,\n PurchaseError,\n} from './error/index';\nexport type { ErrorReason, ResolvedErrorReason } from './error/reason';\nexport {\n DetailType,\n Details,\n type ErrorInfo,\n type RetryInfo,\n type DebugInfo,\n type QuotaFailure,\n type PreconditionFailure,\n type BadRequest,\n type RequestInfo,\n type ResourceInfo,\n type Help,\n type LocalizedMessage,\n type Detail,\n} from './error/detail';\nexport { Status, StatusError, type ErrorBody } from './error/status';\nexport { getErrorInfo, getErrorMessage, getFieldViolations } from './error/parse';\nexport {\n Items,\n Pages,\n Cursor,\n pageParamsSchema,\n initialPageParam,\n getPreviousPageParam,\n getNextPageParam,\n} from './response';\nexport type {\n Empty,\n EntityId,\n Entity,\n Response,\n InitParams,\n NextParams,\n PrevParams,\n PageParams,\n ParentPageParams,\n Page,\n InfinitePageData,\n} from './response';\n\nexport { UidGenerator, uid } from './snowflake';\n\nexport * as MAX_LENGTH from './max-length/index';\nexport { timing } from './utils/timing';\nexport { forwardToGoogleTagGateway } from './utils/google-tag-gateway';\nexport { ISO_3601_1, type ISO3166CountryCode } from './iso/iso_3601_1';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaA,mBAKO;AAEP,oBAcO;AACP,oBAAoD;AACpD,mBAAkE;AAClE,sBAQO;AAeP,uBAAkC;AAElC,iBAA4B;AAC5B,oBAAuB;AACvB,gCAA0C;AAC1C,wBAAoD;","names":[]}
package/dist/index.d.ts DELETED
@@ -1,14 +0,0 @@
1
- export { CheckoutCreateError, LoginCanceledError, LoginTimeoutError, PurchaseError } from './error/index.js';
2
- export { ErrorReason, ResolvedErrorReason } from './error/reason.js';
3
- export { BadRequest, DebugInfo, Detail, DetailType, Details, ErrorInfo, Help, LocalizedMessage, PreconditionFailure, QuotaFailure, RequestInfo, ResourceInfo, RetryInfo } from './error/detail.js';
4
- export { ErrorBody, Status, StatusError } from './error/status.js';
5
- export { getErrorInfo, getErrorMessage, getFieldViolations } from './error/parse.js';
6
- export { Cursor, Empty, Entity, EntityId, InfinitePageData, InitParams, Items, NextParams, Page, PageParams, Pages, ParentPageParams, PrevParams, Response, getNextPageParam, getPreviousPageParam, initialPageParam, pageParamsSchema } from './response.js';
7
- export { UidGenerator, uid } from './snowflake.js';
8
- export { n as MAX_LENGTH } from './index-BhgdyigB.js';
9
- export { timing } from './utils/timing.js';
10
- export { forwardToGoogleTagGateway } from './utils/google-tag-gateway.js';
11
- export { ISO3166CountryCode, ISO_3601_1 } from './iso/iso_3601_1.js';
12
- import 'i18next';
13
- import 'zod/v4/core';
14
- import 'zod/mini';
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @example\n * import { Details, Status } from '@repo/error';\n *\n * Status.adapter = () => new Error('Error');\n *\n * const details = Details.new()\n * .requestInfo({ requestId: '1234567890', servingData: '/v1/tests' })\n * .errorInfo({ reason: 'ACCOUNT_LOCKED' });\n *\n * throw Status.alreadyExists('xxx').error(details);\n */\n\nexport {\n LoginTimeoutError,\n LoginCanceledError,\n CheckoutCreateError,\n PurchaseError,\n} from './error/index';\nexport type { ErrorReason, ResolvedErrorReason } from './error/reason';\nexport {\n DetailType,\n Details,\n type ErrorInfo,\n type RetryInfo,\n type DebugInfo,\n type QuotaFailure,\n type PreconditionFailure,\n type BadRequest,\n type RequestInfo,\n type ResourceInfo,\n type Help,\n type LocalizedMessage,\n type Detail,\n} from './error/detail';\nexport { Status, StatusError, type ErrorBody } from './error/status';\nexport { getErrorInfo, getErrorMessage, getFieldViolations } from './error/parse';\nexport {\n Items,\n Pages,\n Cursor,\n pageParamsSchema,\n initialPageParam,\n getPreviousPageParam,\n getNextPageParam,\n} from './response';\nexport type {\n Empty,\n EntityId,\n Entity,\n Response,\n InitParams,\n NextParams,\n PrevParams,\n PageParams,\n ParentPageParams,\n Page,\n InfinitePageData,\n} from './response';\n\nexport { UidGenerator, uid } from './snowflake';\n\nexport * as MAX_LENGTH from './max-length/index';\nexport { timing } from './utils/timing';\nexport { forwardToGoogleTagGateway } from './utils/google-tag-gateway';\nexport { ISO_3601_1, type ISO3166CountryCode } from './iso/iso_3601_1';\n"],"mappings":";AAaA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP;AAAA,EACE;AAAA,EACA;AAAA,OAYK;AACP,SAAS,QAAQ,mBAAmC;AACpD,SAAS,cAAc,iBAAiB,0BAA0B;AAClE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAeP,SAAS,cAAc,WAAW;AAElC,YAAY,gBAAgB;AAC5B,SAAS,cAAc;AACvB,SAAS,iCAAiC;AAC1C,SAAS,kBAA2C;","names":[]}
@@ -1,9 +0,0 @@
1
- type ISO3166CountryCode = {
2
- numeric: number;
3
- name: string;
4
- alpha2: string;
5
- alpha3: string;
6
- };
7
- declare const ISO_3601_1: ISO3166CountryCode[];
8
-
9
- export { type ISO3166CountryCode, ISO_3601_1 };
@@ -1 +0,0 @@
1
- export { A as AAID, a as ADVERTISING_ID, b as ANDROID_ID, C as COUNTRY_CODE, c as COUNTRY_CODE_ALPHA_2, d as COUNTRY_CODE_ALPHA_3, D as DEVICE_ID, E as EMAIL, e as EMAIL_DOMAIN, f as EMAIL_LOCAL_PART, I as IDFA, g as IDFV, h as IP, i as IPv4, j as IPv4_MAPPED_IPv6, k as IPv6, L as LANGUAGE_CODE, P as PHONE_NUMBER, T as TIMEZONE, l as TIMEZONE_LONGEST, U as UDID, m as UUID } from '../index-BhgdyigB.js';
@@ -1,2 +0,0 @@
1
-
2
- export { }
@@ -1,83 +0,0 @@
1
- import * as zod_v4_core from 'zod/v4/core';
2
- import * as zod_mini from 'zod/mini';
3
-
4
- type Empty = {};
5
- type EntityId = string | number;
6
- type Entity = {
7
- id: EntityId;
8
- };
9
- type Response<T = never> = {
10
- data: T;
11
- };
12
- type InitParams = {
13
- limit: number;
14
- parent?: string;
15
- };
16
- type NextParams = {
17
- limit: number;
18
- parent?: string;
19
- next: string;
20
- };
21
- type PrevParams = {
22
- limit: number;
23
- parent?: string;
24
- prev: string;
25
- };
26
- type PageParams = {
27
- limit: number;
28
- prev?: string;
29
- next?: string;
30
- };
31
- type ParentPageParams = {
32
- limit: number;
33
- parent: string;
34
- prev?: string;
35
- next?: string;
36
- };
37
- type Page<T = never> = {
38
- data: T[];
39
- paging: {
40
- next?: string;
41
- prev?: string;
42
- };
43
- };
44
- declare function pageParamsSchema(max?: number, defaultLimit?: number): zod_mini.ZodMiniObject<{
45
- limit: zod_mini.ZodMiniDefault<zod_mini.ZodMiniNumber<unknown>>;
46
- prev: zod_mini.ZodMiniOptional<zod_mini.ZodMiniString<string>>;
47
- next: zod_mini.ZodMiniOptional<zod_mini.ZodMiniString<string>>;
48
- }, zod_v4_core.$strip>;
49
- declare const Cursor: {
50
- of(prev: bigint | number | string | undefined, next: bigint | number | string | undefined): Page["paging"];
51
- empty(): Page["paging"];
52
- encode(id: bigint | number | string | undefined): string | undefined;
53
- decode<T extends "bigint" | "number" | "string" = "bigint">(token: string, type?: T): T extends "bigint" ? bigint : T extends "number" ? number : string;
54
- };
55
- declare const initialPageParam: Page['paging'];
56
- declare function getPreviousPageParam<T = never>(first: Page<T>): Page['paging'] | null;
57
- declare function getNextPageParam<T = never>(last: Page<T>): Page['paging'] | null;
58
- type InfinitePageData<T> = {
59
- pages: Array<Page<T>>;
60
- pageParams: Array<Page['paging']>;
61
- };
62
- declare const Pages: {
63
- flatten<T>(data: InfinitePageData<T>): T[];
64
- dedupe<T extends Entity>(data: InfinitePageData<T>): T[];
65
- prepend<T>(item: T): (data: InfinitePageData<T> | undefined) => InfinitePageData<T> | undefined;
66
- append<T>(item: T): (data: InfinitePageData<T> | undefined) => InfinitePageData<T> | undefined;
67
- update<T>(updater: T, predicate: (item: T) => boolean): (data: InfinitePageData<T> | undefined) => InfinitePageData<T> | undefined;
68
- updateById<T extends Entity>(updated: T): (data: InfinitePageData<T> | undefined) => InfinitePageData<T> | undefined;
69
- remove<T>(predicate: (item: T) => boolean): (data: InfinitePageData<T> | undefined) => InfinitePageData<T> | undefined;
70
- removeById<T extends Entity>(id: EntityId): (data: InfinitePageData<T> | undefined) => InfinitePageData<T> | undefined;
71
- };
72
- declare const Items: {
73
- push<T>(newItems: T[]): (data: T[] | undefined) => T[] | undefined;
74
- unshift<T>(newItems: T[]): (data: T[] | undefined) => T[] | undefined;
75
- pushAndDedupe<T extends Entity>(newItems: T[]): (data: T[] | undefined) => T[] | undefined;
76
- unshiftAndDedupe<T extends Entity>(newItems: T[]): (data: T[] | undefined) => T[] | undefined;
77
- update<T>(updater: T, predicate: (item: T) => boolean): (data: T[] | undefined) => T[] | undefined;
78
- updateById<T extends Entity>(updated: T): (data: T[] | undefined) => T[] | undefined;
79
- remove<T>(predicate: (item: T) => boolean): (data: T[] | undefined) => T[] | undefined;
80
- removeById<T extends Entity>(id: EntityId): (data: T[] | undefined) => T[] | undefined;
81
- };
82
-
83
- export { Cursor, type Empty, type Entity, type EntityId, type InfinitePageData, type InitParams, Items, type NextParams, type Page, type PageParams, Pages, type ParentPageParams, type PrevParams, type Response, getNextPageParam, getPreviousPageParam, initialPageParam, pageParamsSchema };
@@ -1,29 +0,0 @@
1
- /**
2
- * A distributed unique ID generator inspired by Twitter's Snowflake.
3
- *
4
- * ID data bits:
5
- * +----------------------+----------------+-----------+
6
- * | delta millisecond | machine id | sequence |
7
- * +----------------------+----------------+-----------+
8
- * | 41bits | 10bits | 12bits |
9
- * +----------------------+----------------+-----------+
10
- *
11
- */
12
- declare class UidGenerator {
13
- readonly MAX: bigint;
14
- private readonly machineBits;
15
- private readonly sequenceBits;
16
- private readonly epochMillisecond;
17
- private readonly sequenceMask;
18
- private readonly maxMachineId;
19
- private readonly machineIdShift;
20
- private readonly timeStampShift;
21
- private readonly machineId;
22
- private sequence;
23
- private lastTimestamp;
24
- constructor(mackineId: number);
25
- readonly next: () => bigint;
26
- }
27
- declare const uid: UidGenerator;
28
-
29
- export { UidGenerator, uid };
@@ -1,13 +0,0 @@
1
- interface Options {
2
- enabled: boolean;
3
- crossOrigin?: string;
4
- }
5
- declare function timing(options?: Options): {
6
- startTime: (name: Lowercase<string>, description?: string) => void;
7
- endTime: (name: Lowercase<string>, precision?: number) => void;
8
- mark: (name: Lowercase<string>, description?: string, precision?: number) => void;
9
- setMetric: (name: Lowercase<string>, value: number | string | undefined, description?: string, precision?: number) => void;
10
- setTiming: (response: Response) => void;
11
- };
12
-
13
- export { type Options, timing };